<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/1188/">https://reviewboard.asterisk.org/r/1188/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On April 18th, 2011, 3:16 p.m., <b>Terry Wilson</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Would it make sense to make this something more configurable? The ABNF for a SIP-URI is:
SIP-URI = "sip:" [ userinfo ] hostport
uri-parameters [ headers ]
userinfo = ( user / telephone-subscriber ) [ ":" password ] "@"
user = 1*( unreserved / escaped / user-unreserved )
user-unreserved = "&" / "=" / "+" / "$" / "," / ";" / "?" / "/"
So down the road, it is entirely possible that someone does something weird like INVITE sip:user?foo=bar&bar=baz and we would need another workaround option. We could make the option something like uri_exten_terminator=?;&/ or something since you are matching with strpbrk anyway. Of course, then someone might say that we need to have an option to do regex matches on URIs. Then someone else will point out the limitations of regexes. :-p But, it seems like a cheap and easy change that doesn't make things any more confusing. Others may disagree.</pre>
</blockquote>
<p>On April 18th, 2011, 3:40 p.m., <b>jrose</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I suppose it wouldn't be hard at all to have an option like...
uri_break_characters=;:/
instead. Especially since the method this uses for terminating is strpbrk against ";" on the uri string. I wouldn't have to do a whole lot to change it.
I really don't know for certain though what the best option for this is. I'm still pretty green when it comes to SIP and the various scenarios we might encounter with it.</pre>
</blockquote>
<p>On April 18th, 2011, 3:41 p.m., <b>jrose</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">And rereading what you just wrote, that's pretty much exactly what you said. Oi, I'm a little tired.</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I think this is a bug. The URI username options - which this seems to be about - should be removed from the actual extension. Maybe be put in a variable for later processing, like SIPFULLUSERNAME (username AND options) or SIPUSERNAMEOPTIONS - just the options. That way, I could restore them on the outbound call leg if needed.
Please test with 1.4 to compare behaviours.
Terry - the Username options is not part of your ABNF because it was added in a later RFC.
</pre>
<br />
<p>- Olle E</p>
<br />
<p>On April 18th, 2011, 2:53 p.m., jrose wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.orgrb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By jrose.</div>
<p style="color: grey;"><i>Updated 2011-04-18 14:53:48</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Adds a new option to SIP peers in order to truncate the semicolon delimited values in the URI so that devices which generate semicolon delimited values (like the Sonus mentioned in the bug report) can connect to an extension properly without forcing pattern matching and employing weird workarounds with the extension value every time it is used in the dialplan.
In order to add it to a peer, place the following in sip.conf:
ignore_uri_sem=yes
By default it is off, naturally.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Used sipp to make a phone call using the following xml:
--------------------------------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="UAC OPTIONS">
<send retrans="500"> <![CDATA[
INVITE sip:2005;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;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]
]]>
</send>
<recv response="200"/>
</scenario>
--------------------------------------
Tested those calls against dialplan as follows:
--------------------------------------
[sipp]
exten => 2005,1,Answer()
exten => 2005,2,Background(tt-weasels)
exten => 2005,3,NoOp(callerid => ${CALLERID(all)})
exten => 2005,n,NoOp(exten => ${EXTEN})
exten => 2005,n,Wait(5)
exten => 2005,n,HangUp()
--------------------------------------
and used the following definitions of sipp in sip.conf:
--------------------------------------
[sipp]
type=friend
context=sipp
host=dynamic
port=6000
user=sipp
canreinvite=no
diallow=all
allow=ulaw
ignore_uri_sem=on
--------------------------------------
as well as ignore_uri_sem=off
and with no ignore_uri_sem statement in the config file.
Results:
With the option on, the call gets completed as normal if the extension were just 2005.
With the option off, the call gets interrupted with the following error message:
[Apr 18 14:40:58] NOTICE[16316]: chan_sip.c:21496 handle_request_invite: Call from 'sipp' to extension '2005' rejected because extension not found in context 'sipp'.
because the extension actually contains the entire URI and can't be matched in spite of it showing just 2005 above.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/view.php?id=18344">18344</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/branches/1.8/channels/chan_sip.c <span style="color: grey">(313867)</span></li>
<li>/branches/1.8/channels/sip/include/sip.h <span style="color: grey">(313867)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1188/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>