<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Gonzalo,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Is lookup(“location”) being
called before the uri matching or after? <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;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.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>You may want to add “xlog”
messages in your config to see how the call is processed. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hope this helps.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>-- <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Zahid<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;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><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0>
<tr>
<td valign=top style='padding:0in 0in 0in 0in'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>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. <o:p></o:p></span></font></p>
<p class=MsoNormal><u3:p><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> <br>
<br>
<o:p></o:p></span></font></p>
</u3:p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>#from an internal domain -> inbound<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> #Native SIP destinations
are handled using the location table<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> #Gateway destinations are
handled by regular expressions<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> append_hf("P-hint:
inbound->inbound \r\n");<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'><u3:p> </u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> if
(uri=~"^sip:[2-9][0-9]{9}@") {<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
if (is_user_in("credentials","local")) {<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
route(4);<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
exit;<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
};<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> };<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'><u3:p> </u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> if
(uri=~"^sip:1[2-9][0-9]{9}@") {<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
if (is_user_in("credentials","ld")) {<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
route(4);<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
exit;<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> };<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> };<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'><u3:p> </u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> if
(uri=~"^sip:011[0-9]*@") {<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
if (is_user_in("credentials","int")) {<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
route(4);<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
exit;<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
};<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> };<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> <u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> <u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'><u3:p> </u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> if
(!lookup("location")) {<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
if (does_uri_exist()) {<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
## User not registered at this time.<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
## Use the IP Address of your e-mail server<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
revert_uri();<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
prefix("u");<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
rewritehostport("192.168.1.104"); #Use the voicemail IP<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
route(1);<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> }
else {<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
sl_send_reply("404", "Not Found");<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
exit;<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
} <u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
sl_send_reply("404", "Not Found");<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>
exit;<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> };<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'> route(1);<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:
9.0pt;font-family:"Courier New"'>}<u3:p></u3:p></span></font><o:p></o:p></p>
<p class=MsoNormal><u3:p><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> <o:p></o:p></span></font></u3:p></p>
<p class=MsoNormal><u3:p><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> <o:p></o:p></span></font></u3:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>Any idea or suggestion how to accomplish this?<o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>