<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 />









<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/1188/diff/4/?file=16214#file16214line69" style="color: black; font-weight: bold; text-decoration: underline;">/branches/1.8/channels/sip/dialplan_functions.c</a>
    <span style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int sip_acf_channel_read(struct ast_channel *chan, const char *funcname, char *preparse, char *buf, size_t buflen)</pre></td>

  </tr>
 </tbody>






 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">69</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="p">}</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">69</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="p">}</span></pre></td>
  </tr>

 </tbody>


 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">70</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">70</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">strcasecmp</span><span class="p">(</span><span class="n">args</span><span class="p">.</span><span class="n">param</span><span class="p">,</span> <span class="s">&quot;uri_user_options&quot;</span><span class="p">))</span> <span class="p">{</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">71</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">strcasecmp</span><span class="p">(</span><span class="n">args</span><span class="p">.</span><span class="n">param</span><span class="p">,</span> <span class="s">&quot;peerip&quot;</span><span class="p">))</span> <span class="p">{</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">71</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">ast_copy_string</span><span class="p">(</span><span class="n">buf</span><span class="p">,</span> <span class="n">p</span><span class="o">-&gt;</span><span class="n">uri_user_options</span><span class="p">,</span> <span class="n">buflen</span><span class="p">);</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Adding this white space back in.</pre>
</div>
<br />



<p>- jrose</p>


<br />
<p>On April 19th, 2011, 12:59 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-19 12:59:25</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:
--------------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;
&lt;!DOCTYPE scenario SYSTEM &quot;sipp.dtd&quot;&gt;

&lt;scenario name=&quot;UAC OPTIONS&quot;&gt;
    &lt;send retrans=&quot;500&quot;&gt; &lt;![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: &quot;Lrrrr Schmrrr&quot; &lt;sip:sipp@[local_ip]:[local_port]&gt;;tag=[call_number]
        To: Asterisk &lt;sip:2005;phone-context=+1;npdi=yes@[remote_ip]:[remote_port]&gt;
        Call-ID: [call_id]
        CSeq: 1 OPTIONS
        Contact: sip:sipp@[local_ip]:[local_port]
        Max-Forwards: 70
        Subject: Asterisk Testsuite
        Content-Length: [len]

        ]]&gt;
    &lt;/send&gt;
    &lt;recv response=&quot;200&quot;/&gt;
&lt;/scenario&gt;
--------------------------------------

Tested those calls against dialplan as follows:
--------------------------------------
[sipp]
exten =&gt; 2005,1,Answer()
exten =&gt; 2005,2,Background(tt-weasels)
exten =&gt; 2005,3,NoOp(callerid =&gt; ${CALLERID(all)})
exten =&gt; 2005,n,NoOp(exten =&gt; ${EXTEN})
exten =&gt; 2005,n,Wait(5)
exten =&gt; 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 &#39;sipp&#39; to extension &#39;2005&#39; rejected because extension not found in context &#39;sipp&#39;.

because the extension actually contains the entire URI and can&#39;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">(314156)</span></li>

 <li>/branches/1.8/channels/sip/dialplan_functions.c <span style="color: grey">(314156)</span></li>

 <li>/branches/1.8/channels/sip/include/sip.h <span style="color: grey">(314156)</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>