Hi All,<br><br>I&#39;ve been playing a little bit with the source code of 
&#39;closeddial&#39; module (v1.6.2), and I&#39;m having an issue with the 
&#39;parse_from_uri&#39; function:<br><br>1. First, there is call to parse_from_uri:<br>
<br>        if ( (from_uri = parse_from_uri(_msg ))==NULL ) {<br>                LM_ERR(&quot;Failed to parse FROM header\n&quot;);<br>                return -1;<br>        }<br><br><br>2. Then, it is used to extract the username and build the query (which works well):<br>

<br>        /* username=? */<br>        valsToMatch[0].type=DB_STR;<br>        valsToMatch[0].nul=0;<br>        valsToMatch[0].val.str_val.s=<div id=":15s">from_uri-&gt;user.s;<br>        valsToMatch[0].val.str_val.len=from_uri-&gt;user.len;<br>

<br><br>3. Then, I&#39;m trying to use the &#39;host&#39; part:<br><br>        if(use_domain &gt; 0) {<br>                /* ... and domain= ... */<br>                colsToCompare[1]=&amp;domain_column;<br><br>                /* domain as taken from host in from_uri */<br>

                valsToMatch[1].type=DB_STR;<br>                valsToMatch[1].nul=0;<br>                valsToMatch[1].val.str_val.s=from_uri-&gt;host.s;<br>                valsToMatch[1].val.str_val.len=from_uri-&gt;host.len;<br>

                LM_DBG(&quot;Comparing domain %s\n&quot;, from_uri-&gt;host.s);<br>        }<br><br><br>4. But when running using debug, I&#39;m getting not only the host part, but everything else in the rest of the message:<br>

<br>Comparing domain  <a href="http://8.14.80.37:5061/" target="_blank">8.14.80.37:5061</a>&gt;;tag=as2e46cb60^M To: &lt;<a href="http://sip:56000@8.14.80.16:5061/" target="_blank">sip:56000@8.14.80.16:5061</a>&gt;^M Contact: &lt;<a href="http://sip:55000@8.14.80.37:5061/" target="_blank">sip:55000@8.14.80.37:5061</a>&gt;^M Call-ID: <a href="mailto:6fca172e2507a3e8720d95ae06e9a398@8.14.80.37" target="_blank">6fca172e2507a3e8720d95ae06e9a398@8.14.80.37</a>^M
 CSeq: 102 INVITE^M User-Agent: Livevox SBC 1.6.1^M Date: Wed, 13 Apr 
2011 21:36:35 GMT^M Session-Expires: 1800^M Min-SE: 90^M Allow: INVITE, 
ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO^M Supported: 
replaces, timer^M Content-Type: application/sdp^M Content-Length: 254^M 
^M v=0^M o=root 131658240 131658240 IN IP4 8.14.80.37^M s=Livevox SBC 
1.6.1^M c=IN IP4 8.14.80.37^M t=0 0^M m=audio 15762 RTP/AVP 0 101^M 
a=rtpmap:0 PCMU/8000^M a=rtpmap:101 telephone-event/8000^M a=fmtp:101 
0-16^M a=silenceSupp:off - - - -^M a=ptime:20^M a=sendrecv<br>
<br><br>So, Is &#39;from_uri-&gt;host.s&#39; wrong, or how can I reference only the from domain of the request?<br><br>Thanks in advance,<br><font color="#888888"><br clear="all">Alejandro Rios</font></div><br><font size="1"><br>
DISCLAIMER: The opinions expressed are my own, and not necessarily those of my employer.</font><br><a href="http://www.avatar.com.co" target="_blank"><br></a><br>