[Asterisk-code-review] res/res pjsip refer: call xfer w/o extension (asterisk[13])

Anonymous Coward asteriskteam at digium.com
Wed Mar 15 18:54:27 CDT 2017


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5182 )

Change subject: res/res_pjsip_refer: call xfer w/o extension
......................................................................


res/res_pjsip_refer: call xfer w/o extension

When transfering to a URI without an extension, ensure that the
s extension of the dialplan is entered

ASTERISK-26869 #close

Change-Id: I07403df66cf93f09e00a40ab5b41bfc6f72b1525
---
M res/res_pjsip_refer.c
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c
index d52a922..db50612 100644
--- a/res/res_pjsip_refer.c
+++ b/res/res_pjsip_refer.c
@@ -822,6 +822,13 @@
 	 */
 	AST_SIP_USER_OPTIONS_TRUNCATE_CHECK(exten);
 
+	/* Uri without exten */
+	if (ast_strlen_zero(exten)) {
+		ast_copy_string(exten, "s", sizeof(exten));
+		ast_debug(3, "Channel '%s' from endpoint '%s' attempted blind transfer to a target without extension. Target was set to 's@%s'\n",
+			ast_channel_name(session->channel), ast_sorcery_object_get_id(session->endpoint), context);
+	}
+
 	if (!ast_exists_extension(NULL, context, exten, 1, NULL)) {
 		ast_log(LOG_ERROR, "Channel '%s' from endpoint '%s' attempted blind transfer to '%s@%s' but target does not exist\n",
 			ast_channel_name(session->channel), ast_sorcery_object_get_id(session->endpoint), exten, context);

-- 
To view, visit https://gerrit.asterisk.org/5182
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I07403df66cf93f09e00a40ab5b41bfc6f72b1525
Gerrit-PatchSet: 6
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Torrey Searle <tsearle at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>



More information about the asterisk-code-review mailing list