]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_refer: Handle compact Refer-To header. 84/4684/1
authorGeorge Joseph <gjoseph@digium.com>
Fri, 30 Dec 2016 15:10:09 +0000 (08:10 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Fri, 30 Dec 2016 15:10:09 +0000 (08:10 -0700)
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

res/res_pjsip_refer.c

index 99295d5f3b07e2e5737db1c95d4bc7c4f0cbe883..3101c361c8e07bb43ab1b7dbae80083d58bae0d4 100644 (file)
@@ -1006,6 +1006,7 @@ static int refer_incoming_refer_request(struct ast_sip_session *session, struct
        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 @@ static int refer_incoming_refer_request(struct ast_sip_session *session, struct
        }
 
        /* 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",