Summary: | ASTERISK-26655: [patch]pjsip: Transfers Broken with Compact Headers Enabled | ||||
Reporter: | JoshE (n8ideas) | Labels: | |||
Date Opened: | 2016-12-09 16:59:20.000-0600 | Date Closed: | 2017-01-03 06:36:57.000-0600 | ||
Priority: | Minor | Regression? | |||
Status: | Closed/Complete | Components: | pjproject/pjsip | ||
Versions: | 14.2.1 | Frequency of Occurrence | |||
Related Issues: |
| ||||
Environment: | Attachments: | ( 0) refer_compact_fix.diff | |||
Description: | With compact headers enabled on all Asterisk 14 versions, a SIP REFER is broken - returns a 400 error. Turning compact headers off causes transfers to happen normally.
Here are the relevant messages: {noformat} REFER sip:159.203.108.176:5060;transport=tcp SIP/2.0. v: SIP/2.0/TCP 192.168.0.64;branch=z9hG4bK5c296a0557CAF956. f: "252" <sip:252-Cloud@phone-3.cloud.com>;tag=75623ABC-C7F21941. t: <sip:303520xxxx@phone-3.cloud.com;user=phone>;tag=806b0979-0f15-46cd-b250-1a446b35edce. CSeq: 7 REFER. i: 9ed9e530905a067fc0b8ffec45cbdb1e. m: <sip:252-Cloud@192.168.0.64;transport=tcp>. User-Agent: PolycomVVX-VVX_300-UA/5.5.1.11526. Accept-Language: en. r: <sip:720xxxyyyy@phone-3.cloud.com;user=phone>. b: <sip:252-Cloud@phone-3.cloud.com>. Authorization: Digest username="252-Cloud", realm="cloud.com", nonce="1481323971/5550ba48137b7abed94842e3905e03ca", qop=auth, cnonce="ZfcLvhcY3rAO9O6", nc=00000006, opaque="205162c83c168447", uri="sip:303520xxxx@phone-3.cloud.com;user=phone;transport=tcp", response="aab629046d78dd3aad50c060ad9a80d9", algorithm=MD5. Max-Forwards: 70. l: 0. . T 2016/12/09 15:53:24.350136 159.203.108.176:5060 -> 73.34.214.163:59149 [AP] SIP/2.0 400 Bad Request. Via: SIP/2.0/TCP 192.168.0.64;rport=59149;received=73.34.214.163;branch=z9hG4bK5c296a0557CAF956. Call-ID: 9ed9e530905a067fc0b8ffec45cbdb1e. From: "252" <sip:252-Cloud@phone-3.cloud.com>;tag=75623ABC-C7F21941. To: <sip:303520xxxx@phone-3.cloud.com;user=phone>;tag=806b0979-0f15-46cd-b250-1a446b35edce. CSeq: 7 REFER. Server: Media v4. Content-Length: 0. {noformat} | ||||
Comments: | By: Asterisk Team (asteriskteam) 2016-12-09 16:59:21.183-0600 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]. By: Rusty Newton (rnewton) 2016-12-13 14:39:02.757-0600 We require additional debug to continue with triage of your issue. Please follow the instructions on the wiki [1] for how to collect debugging information from Asterisk. For expediency, where possible, attach the debug with a '.txt' file extension so that the debug will be usable for further analysis. Thanks! [1] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information By: Rusty Newton (rnewton) 2016-12-13 14:39:48.259-0600 Can you provide a debug log with the SIP trace included with both a working and non working scenario? If you can provide the pjsip.conf for each as well.. thanks! By: JoshE (n8ideas) 2016-12-15 10:35:57.812-0600 Let me see if I can pull some more here, but the issue is 100% reproducible with any device that uses compact headers. Enable compact headers on an endpoint and attempt a REFER and you'll get a SIP/400 response. Disable it and you'll get a SIP/200 response. By: George Joseph (gjoseph) 2016-12-17 17:00:24.637-0600 I was not able to reproduce this using a softphone with compact headers turned on. I always get a "202 Accepted" with or without Asterisk turning on compact headers. We're going to see if we can hunt a Polycom. Do you have another phone type that can send compact headers as a test? By: JoshE (n8ideas) 2016-12-21 14:51:06.707-0600 So not sure on the repro via softphone, but the fix was simple. We found this issue with both Yealink and Polycom being the referring device with compact headers turned on. Patch to resolve is attached. Also, as a note, there are a number of places where pjsip's method pjsip_msg_find_hdr_by_name is called where compact headers are legal. In those cases, the proper method appears to be pjsip_msg_find_hdr_by_names, and we need to be defining the compact header value in addition to the long form value, where legal. We'll be trying to patch these in a handful of other places and submit additional issues as needed. By: JoshE (n8ideas) 2016-12-21 14:51:27.486-0600 Fix for refer to using compact headers. By: Rusty Newton (rnewton) 2016-12-22 09:56:49.721-0600 Thanks for the patch. Feel free to go ahead and push it up to Gerrit: https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage By: George Joseph (gjoseph) 2016-12-30 09:19:22.903-0600 I've submitted it in [~n8ideas]'s behalf By: Friendly Automation (friendly-automation) 2017-01-03 06:37:02.059-0600 Change 4684 merged by Joshua Colp: res_pjsip_refer: Handle compact Refer-To header. [https://gerrit.asterisk.org/4684|https://gerrit.asterisk.org/4684] By: Friendly Automation (friendly-automation) 2017-01-03 06:37:10.659-0600 Change 4686 merged by Joshua Colp: res_pjsip_refer: Handle compact Refer-To header. [https://gerrit.asterisk.org/4686|https://gerrit.asterisk.org/4686] By: Friendly Automation (friendly-automation) 2017-01-04 16:27:43.302-0600 Change 4685 merged by George Joseph: res_pjsip_refer: Handle compact Refer-To header. [https://gerrit.asterisk.org/4685|https://gerrit.asterisk.org/4685] |