Review Board 1.7.16

Yet Another Whack at the SIP user options issue.

Review Request #1223 - Created May 19, 2011 and submitted

Jonathan Rose
dvossel, lmadsen, russell
A quick recap:
As of Asterisk 1.8, semicolons in user fields are accepted as just part of the user field in compliance with RFC 3261.  This makes devices that employ those options unable to register and also unable to match intended extensions without dialplan workarounds.

This approach involves a global sip option (if it were done per channel, we couldn't match on registers unfortunately) to strip the semicolons in the same general way as it was done in 1.6.2.  For that reason I chose to call it legacyuseroptionparsing
Made sure matches while the option were on would happen with the following using sipp:

        REGISTER sip:localhost SIP/2.0
        Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
		To: "Jonathan" <sip:evilhost;garbage@[local_ip]:[local_port]>
        From: "Jonathan" <sip:evilhost;garbage@[local_ip]:[local_port]>;tag=[call_number]

        Call-ID: [call_id]
        CSeq: 1 REGISTER
        Contact: sip:evilhost@[local_ip]:[local_port];expires=3600
		User-Agent: Sipp
        Content-Length: [len]


        INVITE sip:2005;5002;phone-context=+1;npdi=yes@[remote_ip]:[remote_port] SIP/2.0
        Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
        From: "Lrrrr Schmrrr" <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
        To: Asterisk <sip:2005;5002;phone-context=+1;npdi=yes@[remote_ip]:[remote_port]>
        Call-ID: [call_id]
        CSeq: 1 OPTIONS
        Contact: sip:sipp@[local_ip]:[local_port]
        Max-Forwards: 70
        Subject: Asterisk Testsuite
        Content-Length: [len]

Also that they also acted the same as the way they acted before with the option off.
Posted (May 19, 2011, 9:12 a.m.)
lmadsen: jrose: what are the chances you could make the option name something like:  legacy_useroption_parsing={yes,no} or something like that?
  1. That's fine by me.
Ship it!
Posted (May 19, 2011, 12:07 p.m.)
Great work! I don't like that this involves another wrapper around the sip_parsing function, but with that said I can't even convince myself that this belongs in the parse_uri either.  What you have here works. If it needs to do something different in the future we'll do it then.  No sense and making this any more complicated.
/branches/1.8/configs/sip.conf.sample (Diff revision 1)
Use spaces on these lines instead of tabs.
  1. Yeah, and underscores in the option name like leif requested as well. runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to