[asterisk-bugs] [JIRA] (ASTERISK-26779) No Call transfer Possible using PJSIP and Compact SIP Headers
Asterisk Team (JIRA)
noreply at issues.asterisk.org
Thu Feb 9 09:37:10 CST 2017
[ https://issues.asterisk.org/jira/browse/ASTERISK-26779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235120#comment-235120 ]
Asterisk Team commented on ASTERISK-26779:
------------------------------------------
Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.
A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.
Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].
> No Call transfer Possible using PJSIP and Compact SIP Headers
> -------------------------------------------------------------
>
> Key: ASTERISK-26779
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-26779
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Channels/chan_pjsip
> Affects Versions: 14.2.1
> Reporter: Peter Sokolov
>
> When an endpoint using compact SIP headers tries to transfer a call using REFER, Asterisk/PJSIP rejects the request with 400 and shows the following DEBUG info although the "r:" header is present in the REFER request:
>
> [Feb 9 13:15:44] DEBUG[2212]: res_pjsip_refer.c:1031 refer_incoming_refer_request: Received a REFER without Refer-To on channel 'PJSIP/132-00000003' from endpoint '132'
>
> The same request works perfectly using chan_SIP. It turns out that Asterisk uses pjsip_msg_find_hdr_by_name function from sip_msg.c on many places to read SIP headers. However this function does not find headers which use compact names. In the case of call transfer using REFER, both "r:" and "b:" headers (Refer-To and Referred-By) are not found, causing the rejection of REFER. Call transfer fails.
>
> The problem with REFER can be resolved easily by modifying the file /res/res_pjsip_refer.c in the following way (add lines with ++, remove those with --):
>
> static const pj_str_t str_referred_by = { "Referred-By", 11 };
> ++ static const pj_str_t str_referred_by_short = { "b", 1 };
>
> -- referred_by = pjsip_msg_find_hdr_by_name(refer->rdata->msg_info.msg, &str_referred_by, NULL);
> ++ referred_by = pjsip_msg_find_hdr_by_names(refer->rdata->msg_info.msg, &str_referred_by, &str_referred_by_short, NULL);
>
> static const pj_str_t str_refer_to = { "Refer-To", 8 };
> ++ static const pj_str_t str_refer_to_short = { "r", 1 };
> static const pj_str_t str_replaces = { "Replaces", 8 };
>
> -- 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_short, NULL);
>
> Even though the call transfer problem is solved this way, the question remains, whether there are other places in Asterisk that need to be corrected in order to handle correctly SIP compact names, for example:
>
> - Will reading a SIP header from dialplan return correct result when using long/compact name in the query while the received headers use the other type or even mixed long/compact types of the same header? For example reading the second Via: header in the case one of the proxies inserted a compact v: header.
>
> - Will adding a header to a request overwrite an existing header with the same name in the case such one is present, but uses the opposite long/compact form?
>
> - Are there other places using pjsip_msg_find_hdr_by_name thet read headers which can use compact form?
>
> The list of IANA registered compact headers is available here:
> http://www.iana.org/assignments/sip-parameters/sip-parameters.xhtml
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list