[Asterisk-code-review] res pjsip refer: Handle compact Refer-To header. (asterisk[14])

George Joseph asteriskteam at digium.com
Wed Jan 4 16:26:57 CST 2017


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/4685 )

Change subject: res_pjsip_refer:  Handle compact Refer-To header.
......................................................................


res_pjsip_refer:  Handle compact Refer-To header.

refer_incoming_refer_request needed to look for the "r" header as well
as the "Refer-To" header.

ASTERISK-26655 #close
patches:
	refer_compact_fix.diff	submitted by JoshE (license 6075)

Change-Id: I610410a99b02427ea5db887aeb454d5f12c2259f
---
M res/res_pjsip_refer.c
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c
index c1dee82..c3e9ba5 100644
--- a/res/res_pjsip_refer.c
+++ b/res/res_pjsip_refer.c
@@ -1006,6 +1006,7 @@
 	int response;
 
 	static const pj_str_t str_refer_to = { "Refer-To", 8 };
+	static const pj_str_t str_refer_to_s = { "r", 1 };
 	static const pj_str_t str_replaces = { "Replaces", 8 };
 
 	if (!session->channel) {
@@ -1024,7 +1025,7 @@
 	}
 
 	/* A Refer-To header is required */
-	refer_to = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_refer_to, NULL);
+	refer_to = pjsip_msg_find_hdr_by_names(rdata->msg_info.msg, &str_refer_to, &str_refer_to_s, NULL);
 	if (!refer_to) {
 		pjsip_dlg_respond(session->inv_session->dlg, rdata, 400, NULL, NULL, NULL);
 		ast_debug(3, "Received a REFER without Refer-To on channel '%s' from endpoint '%s'\n",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I610410a99b02427ea5db887aeb454d5f12c2259f
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Martin Tomec <tomec.martin at gmail.com>



More information about the asterisk-code-review mailing list