<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi there,</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm trying to forward some destinations, but
there are accounts/users starting the same way connected to the server.
<BR>Example</FONT></DIV>
<DIV><FONT face=Arial size=2>account: 123456</FONT></DIV>
<DIV><FONT face=Arial size=2>When ser see that it forwards the call to other ser
located at 12.34.56.79. I want my users to use prefix for local calls.
</FONT></DIV>
<DIV><FONT face=Arial size=2>Example:</FONT></DIV>
<DIV><FONT face=Arial size=2>calling 699123456 goes to local server user 123456
not to 12.34.56.79. Please check my code and tell me what's </FONT></DIV>
<DIV><FONT face=Arial size=2>wrong:</FONT></DIV>
<DIV><FONT face=Arial size=2>...</FONT></DIV>
<DIV><FONT face=Arial size=2>if (uri=~"^sip:1234")
{<BR> log(0,
"\n\n************ Office 1
***********\n");<BR>
strip(0);<BR>
rewritehostport("12.34.56.79:5060");<BR>
append_branch("12.34.56.79");<BR>
t_relay_to_udp("12.34.56.79",
"5060");<BR> append_hf("P-hint:
VoipSwitch GATEWAY\r\n");<BR> log(0,
"********************************************\n\n\n");<BR>
break;<BR> };</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> if (uri=~"^sip:051")
{<BR> log(0,
"\n\n************ Office 2
***********\n");<BR>
strip(0);<BR>
rewritehostport("12.34.56.78:5060");<BR>
append_branch("12.34.56.78");<BR>
t_relay_to_udp("12.34.56.78",
"5060");<BR> append_hf("P-hint:
VoipSwitch GATEWAY\r\n");<BR> log(0,
"********************************************\n\n\n");<BR>
break;<BR> };</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> if (uri=~"^sip:699")
{<BR>
strip(3);<BR>
route(1);<BR> break;<BR>
};</FONT></DIV>
<DIV><FONT face=Arial
size=2>}<BR>
else
{<BR>
sl_send_reply("399", "Your account balance is
low!");<BR>
};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>
if (!lookup("location"))
{<BR>
sl_send_reply("404", "Not
Found");<BR>
break;<BR>
};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
append_hf("P-hint: usrloc
applied\r\n");<BR>
route(1);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><BR>}</DIV>
<DIV> </DIV>
<DIV>route[1] {</DIV>
<DIV> </DIV>
<DIV> if (isflagset(6))
{<BR>
force_rtp_proxy();<BR> };</DIV>
<DIV> </DIV>
<DIV> t_on_reply("1");</DIV>
<DIV> </DIV>
<DIV> if (!t_relay())
{<BR>
sl_reply_error();<BR> };<BR>}</DIV>
<DIV> </DIV>
<DIV>onreply_route[1] {<BR> if (isflagset(6) && status
=~ "(183)|2[0-9][0-9]") {<BR>
fix_nated_contact();<BR>
force_rtp_proxy();<BR> } else if (nat_uac_test("1"))
{<BR>
fix_nated_contact();<BR> };<BR>}<BR></DIV>
<DIV> </DIV>
<DIV>Thanks in advance :)!</DIV>
<DIV> </DIV>
<DIV>Pavel Siderov</DIV></FONT></BODY></HTML>