Hi All,<br><br>I've been playing a little bit with the source code of
'closeddial' module (v1.6.2), and I'm having an issue with the
'parse_from_uri' 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("Failed to parse FROM header\n");<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->user.s;<br> valsToMatch[0].val.str_val.len=from_uri->user.len;<br>
<br><br>3. Then, I'm trying to use the 'host' part:<br><br> if(use_domain > 0) {<br> /* ... and domain= ... */<br> colsToCompare[1]=&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->host.s;<br> valsToMatch[1].val.str_val.len=from_uri->host.len;<br>
LM_DBG("Comparing domain %s\n", from_uri->host.s);<br> }<br><br><br>4. But when running using debug, I'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>>;tag=as2e46cb60^M To: <<a href="http://sip:56000@8.14.80.16:5061/" target="_blank">sip:56000@8.14.80.16:5061</a>>^M Contact: <<a href="http://sip:55000@8.14.80.37:5061/" target="_blank">sip:55000@8.14.80.37:5061</a>>^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 'from_uri->host.s' 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>