<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Zahid,<br><br><br>Thank you for your reply. <br><br>I tried if (!lookup("location")) before the uri matching, but no change. Unfortunately don't know how to setup xlog.<br><br><br> #from an internal domain -> inbound<br> #Native SIP destinations are handled using the location table<br> #Gateway destinations are handled by regular expressions<br> append_hf("P-hint: inbound->inbound \r\n");<br><br> if (!lookup("location")) {<br> route(1);<br><br> }<br><br> <br> if (uri=~"^sip:[2-9][0-9]{9}@") {<br> if (is_user_in("credentials","local")) {<br>
#prefix("+1");<br> route(4);<br> exit;<br> } else {<br> sl_send_reply("403", "No permissions for local calls");<br> exit;<br> };<br> };<br><br><br><br>Thanks,<br><br>Gonzalo<br><br><br>--- On <b>Thu, 2/12/09, Zahid Mehmood <i><zm23@columbia.edu></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Zahid Mehmood <zm23@columbia.edu><br>Subject: RE: [OpenSIPS-Users] Call between registered users<br>To: gonzovoip@yahoo.com, "Opensips" <users@lists.opensips.org><br>Date: Thursday, February 12, 2009, 6:45
PM<br><br><div id="yiv1265392549">
<style>
<!--
#yiv1265392549
_filtered #yiv1265392549 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
#yiv1265392549
#yiv1265392549 p.MsoNormal, #yiv1265392549 li.MsoNormal, #yiv1265392549 div.MsoNormal
        {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}
#yiv1265392549 a:link, #yiv1265392549 span.MsoHyperlink
        {color:blue;text-decoration:underline;}
#yiv1265392549 a:visited, #yiv1265392549 span.MsoHyperlinkFollowed
        {color:purple;text-decoration:underline;}
#yiv1265392549 span.EmailStyle17
        {font-family:Arial;color:navy;}
_filtered #yiv1265392549 {margin:1.0in 1.25in 1.0in 1.25in;}
#yiv1265392549 div.Section1
        {}
-->
</style>
<div class="Section1">
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hi Gonzalo,</span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Is lookup(“location”) being
called before the uri matching or after? </span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Looking at the code snippet, If local
callers are dialing a pattern that matches one of the “if (uri=….”
Then it is sent to route(4) and lookup part of the code is not touched.</span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">You may want to add “xlog”
messages in your config to see how the call is processed. </span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hope this helps.</span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">-- </span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Zahid</span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<div>
<div class="MsoNormal" style="text-align: center;" align="center"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">
<hr tabindex="-1" size="2" width="100%" align="center">
</span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma;">
users-bounces@lists.opensips.org [mailto:users-bounces@lists.opensips.org] <b><span style="font-weight: bold;">On Behalf Of </span></b>Gonzalo Gonzalez<br>
<b><span style="font-weight: bold;">Sent:</span></b> Thursday, February 12, 2009
1:35 PM<br>
<b><span style="font-weight: bold;">To:</span></b> Opensips<br>
<b><span style="font-weight: bold;">Subject:</span></b> [OpenSIPS-Users] Call
between registered users</span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>
<table class="MsoNormalTable" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td style="padding: 0in;" valign="top">
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">Each user has a DID number and the user name match
the DID umber, so on incoming calls to a DID if the user is online it ring
that ext. and if is offline it go to voice mail. Mt issue is when a user call
another user that is online it doesnt go to that user directly even though
shows in the location table. </span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> <br>
<br>
</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">#from an internal domain -> inbound</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> #Native SIP destinations
are handled using the location table</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> #Gateway destinations are
handled by regular expressions</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> append_hf("P-hint:
inbound->inbound \r\n");</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> </span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> if
(uri=~"^sip:[2-9][0-9]{9}@") {</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
if (is_user_in("credentials","local")) {</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
route(4);</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
exit;</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
};</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> };</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> </span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> if
(uri=~"^sip:1[2-9][0-9]{9}@") {</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
if (is_user_in("credentials","ld")) {</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
route(4);</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
exit;</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> };</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> };</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> </span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> if
(uri=~"^sip:011[0-9]*@") {</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
if (is_user_in("credentials","int")) {</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
route(4);</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
exit;</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
};</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> };</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> </span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> </span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> </span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> if
(!lookup("location")) {</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
if (does_uri_exist()) {</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
## User not registered at this time.</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
## Use the IP Address of your e-mail server</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
revert_uri();</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
prefix("u");</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
rewritehostport("192.168.1.104"); #Use the voicemail IP</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
route(1);</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> }
else {</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
sl_send_reply("404", "Not Found");</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
exit;</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
} </span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
sl_send_reply("404", "Not Found");</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">
exit;</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> };</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";"> route(1);</span></font></p>
<p class="MsoNormal"><font size="1" face="Courier New"><span style="font-size: 9pt; font-family: "Courier New";">}</span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">Any idea or suggestion how to accomplish this?</span></font></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>
</div>
</div></blockquote></td></tr></table><br>