[Home]

Summary:ASTERISK-28648: chan_sip/chan_pjsip copy_via_headers() function not RFC 3261 compliant
Reporter:Bill Mandra (wmandra)Labels:
Date Opened:2019-12-04 09:15:51.000-0600Date Closed:
Priority:MinorRegression?No
Status:Open/NewComponents:Channels/chan_pjsip Channels/chan_sip/General
Versions:16.6.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:Per RFC 3261 8.2.6.2 Headers and Tags:
The Via header field values in the response MUST equal the Via header field values in the request and MUST maintain the same ordering.

However, the copy_via_headers function inserts "received=" or "received=;rport=" potentially into the middle of the header which does not maintain ordering of the field values.

To be RFC 3261 compliant, received and rport should always be appended to the end of the via header.
Comments:By: Asterisk Team (asteriskteam) 2019-12-04 09:15:52.828-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].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: George Joseph (gjoseph) 2019-12-04 11:17:43.838-0600

The chan_sip channel driver is in 'extended' support status and is supported only by community members.  Your issue is in the queue. Your patience is appreciated as a community developer may work the issue when time and resources become available.

Asterisk is an open source project and community members work the issues on a voluntary basis. You are welcome to develop your own patches and submit them to the project.[1]

If you are not a programmer and you are in a hurry to see a patch provided then you might try rallying support on the Asterisk users mailing list or forums.[2] Another alternative is offering a bug bounty on the asterisk-dev mailing list.[3] Often a little incentive can go a long way.

[1]: https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process
[2]: http://www.asterisk.org/community/discuss
[3]: https://wiki.asterisk.org/wiki/display/AST/Asterisk+Bug+Bounties



By: Bill Mandra (wmandra) 2019-12-09 09:29:25.465-0600

Note, this issue also applies to the pjsip implementation.

By: George Joseph (gjoseph) 2019-12-09 09:56:28.381-0600

[~wmandra] Is this currently causing problems for you in real life?
If so, can you share an example?


By: Bill Mandra (wmandra) 2019-12-09 10:29:12.635-0600

George, surprisingly yes. When trunking with Colt, they use the OPTIONS function to check if host on other end is alive and blacklist the IP (preventing all calls) if they don't receive a response. In this case, they do not recognize the response since the Via header is invalid.

Here's what they send:
> OPTIONS sip:10.232.232.38:5060 SIP/2.0
> Via: SIP/2.0/UDP 10.232.232.33:5060;branch=z9hG4bK0aBc7c920a6936de302

Here's what they receive:
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 10.232.232.33:5060;rport=5060;received=10.232.232.33;branch=z9hG4bK0a

Here's what Colt expects:
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 10.232.232.33:5060;branch=z9hG4bK0a;rport=5060;received=10.232.232.33

While I personally think  whatever implementation they are using is too strict, it's technically correct and the Asterisk response is not RFC compliant.