8000 Attended transfer missing to and from tags · Issue #3367 · baresip/baresip · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Attended transfer missing to and from tags #3367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gordongrech opened this issue Apr 25, 2025 · 2 comments
Open

Attended transfer missing to and from tags #3367

gordongrech opened this issue Apr 25, 2025 · 2 comments

Comments

@gordongrech
Copy link

Hello,

I've have been working on attended transfers using the call_replace_transfer. While the Replaces portion of the header is added with the correct call id, the to-tag and from tag are not being included. This seems to be incompatible with RFC 3891, also on phone systems such as Asterisk, the transfer request is detected as non-local and fails as the respective dialogs are not found.

I've managed to address this by exposing rtag and ltag in re/src/sip/dialog.c and adding these to the Replaces portion of the header.

const char *sip_dialog_ltag(const struct sip_dialog *dlg)
{
	return dlg ? dlg->ltag : NULL;
}

const char *sip_dialog_rtag(const struct sip_dialog *dlg)
{
	return dlg ? dlg->rtag : NULL;
}

and

int call_replace_transfer(struct call *call, struct call *source_call)
{
	int err;

	call->sub = mem_deref(call->sub);

	err = sipevent_drefer(&call->sub, uag_sipevent_sock(),
			      sipsess_dialog(call->sess), ua_cuser(call->ua),
			      auth_handler, call->acc, true,
			      sipsub_notify_handler, sipsub_close_handler,
                              call,
	                      "Refer-To: <%s?Replaces=%s%%3Bto-tag%%3D%s%%3Bfrom-tag%%3D%s>\r\n"
	                      "Referred-By: %s\r\n",
	                      source_call->peer_uri,
	                      source_call->id,
	                      sip_dialog_rtag(sipsess_dialog(source_call->sess)),
                              sip_dialog_ltag(sipsess_dialog(source_call->sess)),
	                      account_aor(ua_account(call->ua)));

	if (err) {
		warning("call: sipevent_drefer: %m\n", err);
	}

	return err;
}

If you believe that the above approach is correct I will happily create a pull request.

Thanks,
Gordon

@cspiel1
Copy link
Collaborator
cspiel1 commented Apr 28, 2025

Related commit: e02d727
We will have a look on this.

@cspiel1 cspiel1 added this to the v3.23.0 milestone Apr 30, 2025
@alfredh alfredh removed this from the v3.23.0 milestone May 8, 2025
@alfredh
Copy link
Collaborator
alfredh commented May 10, 2025

Could you please also include the relevant SIP traffic, enable with baresip -s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0