New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unquoted IPv6 Contact header alias parameter causes issues with Asterisk (PJSIP) & TOPOH module #120
Comments
Parameter values for SIP URI must not be enclosed in quotes (as per sip rfc). However, given that the IP ofen appear as value of a uri parameter, I would expect '[' and ']' to be allowed as chars in uri parameters. The SIP grammar has to be checked. |
Ok @miconda. Thanks. I'll check in with the Asterisk/PJSIP folks. There still is something strange about the TOPOH processing, however. I'll need to look more into that. |
Check also/first the grammar for uri parameters in rfc3261. |
Thank you for the advice, @miconda. I believe this may be a bug in PJSIP's header parsing (https://trac.pjsip.org/repos/browser/pjproject/trunk/pjsip/src/pjsip/sip_parser.c#L1128). I'm not a C coder, but I've learned to troll through the code until I find something reasonable. Perhaps you can spot something in there. I have requested to join the PJSIP mailing list to ask about this issue. I asked originally about the quoting because I noticed Kamailio does quote the "received" parameter in the Contact header when it's sent back to a UAC:
|
I have asked for assistance on the PJSIP mailing list to see if any further information can be provided there: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2015-April/018313.html Thanks for pointing me in the right direction, @miconda. |
For reference, from sip grammar (rfc3261, section25):
Therefore '[' and ']' are allowed in uri parameter, being part of 'param-unreserved' group of chars. |
When using Kamailio from the master branch, I'm encountering an issue where IPv6 contact address aliases that are added via
set_contact_alias()
for WebSocket connections (for example) are unquoted and create problems for Asterisk:and TOPOH garbles the Request-URI when processing the ACK:
I have tested this with CSipSimple nightly branch (PJSIP) Asterisk 13.2.0 (PJSIP), Google Chrome 41.0.2272.118, and Firefox 37 and all fail to handle the Contact alias parameter properly.
An example of an invite that shows this issue follows (this INVITE is without TOPOH on).
I believe that the Contact header alias parameter might need quotes in order to properly handle the bracketed IPv6 alias address, something like the following, but unfortunately I haven't been able to find evidence to be certain that this is the fix, though I do notice that parameters in headers with special characters like brackets are often quoted.
The text was updated successfully, but these errors were encountered: