<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.5">
<TITLE>Why if (uri==myself) is always true? (about openser call number pstn)</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hello everybody,</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">I want that openser can call a PSTN number for example: 0296487631. But in the request of INVITE, I see that the callee is always </FONT></P>

<P><FONT SIZE=2 FACE="Arial">0296487631@opensersip.test.machine ( and opensersip.test.machine is my sip server), that means the (uri==myself) is always ture. So this request of INVITE can not reache the gateway of PSTN.&nbsp; Anybody can give me some advices? This is my openser.cfg and I use openser+radius+mysql. </FONT></P>

<P><FONT SIZE=2 FACE="Arial">Thank you very much!!!</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Yin</FONT><SPAN LANG="pl"></SPAN>
</P>
<BR>
<BR>

<P><SPAN LANG="pl"><FONT SIZE=2 FACE="&#23435;&#20307;">#</FONT></SPAN>

<BR><SPAN LANG="pl"><FONT SIZE=2 FACE="&#23435;&#20307;"># $Id: openser.cfg 1827 2007-03-12 15:22:53Z bogdan_iancu $</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># simple quick-start config script</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># Please refer to the Core CookBook at </FONT></SPAN><A HREF="http://www.openser.org/dokuwiki/doku.php"><SPAN LANG="en-gb"><U><FONT COLOR="#0000FF" SIZE=2 FACE="&#23435;&#20307;">http://www.openser.org/dokuwiki/doku.php</FONT></U></SPAN></A><SPAN LANG="en-gb"></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># for a explanation of possible statements, functions and parameters.</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># ----------- global configuration parameters ------------------------</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">debug=3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # debug level (cmd line: -dddddddddd)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">fork=yes</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">log_stderror=no&nbsp;&nbsp;&nbsp; # (cmd line: -E)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">children=4</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># Uncomment these lines to enter debugging mode </FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#fork=no</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#log_stderror=yes</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">port=5060</FONT></SPAN>
</P>
<BR>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># uncomment the following lines for TLS support</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#disable_tls = 0</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#listen = tls:your_IP:5061</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#tls_verify_server = 1</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#tls_verify_client = 1</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#tls_require_client_certificate = 0</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#tls_method = TLSv1</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#tls_certificate = &quot;/usr/local/etc/openser/tls/user/user-cert.pem&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#tls_private_key = &quot;/usr/local/etc/openser/tls/user/user-privkey.pem&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#tls_ca_list = &quot;/usr/local/etc/openser/tls/user/user-calist.pem&quot;</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># ------------------ module loading ----------------------------------</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#set module path</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">mpath=&quot;/usr/local/lib/openser/modules/&quot;</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># Uncomment this if you want to use SQL database</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;mysql.so&quot;</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;sl.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;tm.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;rr.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;maxfwd.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;usrloc.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;registrar.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;textops.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;mi_fifo.so&quot;</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># Uncomment this if you want digest authentication</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># mysql.so must be loaded !</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;auth.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#loadmodule &quot;auth_db.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;auth_radius.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;group_radius.so&quot;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">loadmodule &quot;acc.so&quot;</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># ----------------- setting module-specific parameters ---------------</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># -- mi_fifo params --</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/openser_fifo&quot;)</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># -- usrloc params --</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;usrloc&quot;, &quot;db_mode&quot;,&nbsp;&nbsp; 0)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;auth_radius|group_radius|acc&quot;, &quot;radius_config&quot;, &quot;/usr/local/etc/radiusclient-ng/radiusclient.conf&quot;)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;group_radius&quot;,&quot;use_domain&quot;, 0)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;auth_radius&quot;, &quot;service_type&quot;, 15)</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;auth&quot;, &quot;secret&quot;, &quot;testing123&quot;)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;acc&quot;, &quot;radius_flag&quot;, 1)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;acc&quot;, &quot;radius_missed_flag&quot;, 2)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;acc&quot;, &quot;service_type&quot;, 15)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;acc&quot;, &quot;radius_extra&quot;, &quot;User-Name=$fU;Sip-Src-IP=$si;Sip-Src-Port=$sp&quot;)</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># Uncomment this if you want to use SQL database </FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># for persistent storage and comment the previous line</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#modparam(&quot;usrloc&quot;, &quot;db_mode&quot;, 2)</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># -- auth params --</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># Uncomment if you are using auth module</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#modparam(&quot;auth_db&quot;, &quot;calculate_ha1&quot;, yes)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># If you set &quot;calculate_ha1&quot; parameter to yes (which true in this config), </FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># uncomment also the following parameter)</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#modparam(&quot;auth_db&quot;, &quot;password_column&quot;, &quot;password&quot;)</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># -- rr params --</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># add value to ;lr param to make some broken UAs happy</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">modparam(&quot;rr&quot;, &quot;enable_full_lr&quot;, 1)</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># -------------------------&nbsp; request routing logic -------------------</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;"># main routing logic</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">route{</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># initial sanity checks -- messages with</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># max_forwards==0, or excessively long requests</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (!mf_process_maxfwd_header(&quot;10&quot;)) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (msg:len &gt;=&nbsp; 2048 ) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">sl_send_reply(&quot;513&quot;, &quot;Message too big&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#-------set flag for Radius Accounting</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#if (!method==&quot;OPTIONS&quot;) setflag(3);</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#if (method==&quot;INVITE&quot;){</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log (1, &quot;INVITE MESSAGE RECEIVED - START ACC\n&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setflag(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setflag(2);</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#};</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">if (method==&quot;BYE&quot;){</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">log (1, &quot;BYE - STOP ACCOUNTING\n&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">setflag(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">if (method==&quot;CANCEL&quot;){</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">log (1, &quot;CANCEL -STOP ACCOUNTING\n&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">setflag(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># we record-route all messages -- to make sure that</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># subsequent messages will go through our proxy; that's</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># particularly good if upstream and downstream entities</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># use different transport protocol</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (!method==&quot;REGISTER&quot;)</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">record_route();</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># subsequent messages withing a dialog should take the</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># path determined by record-routing</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (loose_route()) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># mark routing logic in request</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">append_hf(&quot;P-hint: rr-enforced\r\n&quot;); </FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">route(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">if (!uri==myself) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># mark routing logic in request</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append_hf(&quot;P-hint: outbound\r\n&quot;); </FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># if you have some interdomain connections via TLS</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">#if(uri=~&quot;@tls_domain1.net&quot;) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN LANG="fr"> <FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_relay(&quot;tls:domain1.net&quot;);</FONT></SPAN>

<BR><SPAN LANG="fr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">#} else if(uri=~&quot;@tls_domain2.net&quot;) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN LANG="fr"> <FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_relay(&quot;tls:domain2.net&quot;);</FONT></SPAN>

<BR><SPAN LANG="fr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">#}</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (method==&quot;ACK&quot;) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">route(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">}else </FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (method==&quot;CANCEL&quot;){</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">route(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">}else</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (method==&quot;INVITE&quot;)</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">{</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT SIZE=2 FACE="&#23435;&#20307;"> route(3);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT SIZE=2 FACE="&#23435;&#20307;"> exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">}else</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">&nbsp;&nbsp;&nbsp;&nbsp; if (method==&quot;REGISTER&quot;)</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(2);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">lookup(&quot;aliases&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (uri!=myself)</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">{</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT SIZE=2 FACE="&#23435;&#20307;"> route(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT SIZE=2 FACE="&#23435;&#20307;"> exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (!lookup(&quot;location&quot;))</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">{</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT SIZE=2 FACE="&#23435;&#20307;"> sl_send_reply(&quot;404&quot;,&quot;Not User PSTN Found&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT SIZE=2 FACE="&#23435;&#20307;"> exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">route(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">}</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># if the request is for other domain use UsrLoc</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># (in case, it does not work, use the following command</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># with proper names and addresses in it)</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (uri==myself) {</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (method==&quot;REGISTER&quot;) {</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># Uncomment this if you want to use digest authentication</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (!radius_www_authorize(&quot;opensersip.test.machine&quot;)) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">www_challenge(&quot;opensersip.test.machine&quot;, &quot;0&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">save(&quot;location&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (method==&quot;INVITE&quot;) {</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (!radius_proxy_authorize(&quot;opensersip.test.machine&quot;)){</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">proxy_challenge(&quot;opensersip.test.machine&quot;,&quot;0&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">lookup(&quot;aliases&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (!uri==myself) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">append_hf(&quot;P-hint: outbound alias\r\n&quot;); </FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">route(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># native SIP destinations are handled using our USRLOC DB</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (!lookup(&quot;location&quot;)) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">sl_send_reply(&quot;404&quot;, &quot;Not SIP User Found&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">append_hf(&quot;P-hint: usrloc applied\r\n&quot;); </FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">route(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">}</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">route[1] {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># send it out now; use stateful forwarding as it works reliably</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># even for UDP2TCP</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (!t_relay()) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">sl_reply_error();</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">}</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">route[2] {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># Register Message Handler</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">sl_send_reply(&quot;100&quot;,&quot;Trying&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (!radius_www_authorize(&quot;opensersip.test.machine&quot;)) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">www_challenge(&quot;opensersip.test.machine&quot;, &quot;0&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">if (!save(&quot;location&quot;))</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">{</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">sl_reply_error();</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">}</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">route[3] {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;"># Invite Message Handler</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!radius_proxy_authorize(&quot;opensersip.test.machine&quot;)){</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_challenge(&quot;opensersip.test.machine&quot;,&quot;0&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup(&quot;aliases&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!uri==myself) {</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append_hf(&quot;P-hint: outbound alias\r\n&quot;); </FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);</FONT></SPAN>

<BR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="&#23435;&#20307;">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (uri=~&quot;^sip:[0-9]{10}@&quot;) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">route(4);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>
</P>

<P><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (!lookup(&quot;location&quot;)) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">if (uri=~&quot;^sip:[0-9]{10}@&quot;) {</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">route(4);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">sl_send_reply(&quot;404&quot;,&quot;User not Found&quot;);</FONT></SPAN>

<BR><SPAN LANG="en-gb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN LANG="fr"> <FONT SIZE=2 FACE="&#23435;&#20307;">exit;</FONT></SPAN>

<BR><SPAN LANG="fr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">};</FONT></SPAN>

<BR><SPAN LANG="fr"><FONT SIZE=2 FACE="&#23435;&#20307;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);</FONT></SPAN>

<BR><SPAN LANG="fr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">}</FONT></SPAN>
</P>

<P><SPAN LANG="fr"><FONT SIZE=2 FACE="&#23435;&#20307;">route[4] {</FONT></SPAN>

<BR><SPAN LANG="fr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">rewritehost(&quot;172.20.14.32&quot;);</FONT></SPAN>

<BR><SPAN LANG="fr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">route(1);</FONT></SPAN>

<BR><SPAN LANG="fr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="&#23435;&#20307;">}</FONT></SPAN>
</P>
<BR>
<BR>

</BODY>
</HTML>