Forgot to add, 
<div>&nbsp;</div>
<div>you may need to rewritehost (or even contact information) to point at the Asterisk server&nbsp;before you do the forwarding to Asterisk.<br><br>&nbsp;</div><br><br>
<div><span class="gmail_quote">On 20/12/06, <b class="gmail_sendername">Max Gregorian</b> &lt;<a href="mailto:gregorian442@googlemail.com">gregorian442@googlemail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>I think I may have spotted the problem in the signalling.</div>
<div>&nbsp;</div>
<div>In this reply to the INVITE, the&nbsp;<u>first stage</u> is fine:</div>
<div>&nbsp;</div>
<div>Asterisk -&gt; OpenSER (The signalling here is fine from Asterisk)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>In the <u>second stage</u>, the reply from OpenSER to UAC</div>
<div><br>OpenSER -&gt; Client</div>
<div>&nbsp;</div>
<div>this part</div>
<div>&nbsp;</div>
<div><span class="q">Session Description Protocol<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Session Description Protocol Version (v): 0<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Owner/Creator, Session Id (o): root 20137 20138 IN IP4<br><strong>OOO.OOO.OOO.OOO</strong><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Session Name (s): session 
<br></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Connection Information (c): IN IP4 Session Description Protocol<span class="q"><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Session Description Protocol Version (v): 0<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Owner/Creator, Session Id (o): root 20137 20138 IN IP4
<br>OOO.OOO.OOO.OOO <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Session Name (s): session<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Connection Information (c): IN IP4 OOO.OOO.OOO.OOO<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Time Description, active time (t): 0 0<br></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Media Description, name and address (m): audio 58508&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Time Description, active time (t): 0 0 
<span class="q"><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Media Description, name and address (m): audio 58508</span></div>
<div><br>&nbsp;</div>
<div>you see where it says IN IP4, this should <u>still</u> have the IP of Asterisk if you want the RTP to go to the Asterisk server, but instead it has the IP of OpenSER so RTP is sent to OpenSER.</div>
<div>&nbsp;</div>
<div>This information is taken from somewhere (I forget - i think it&#39;s the <u>contact</u> of the REGISTER message), but it can be fixed.</div>
<div>&nbsp;</div>
<div>You will need to look at the entire call flow starting from when the UAC first registers with OpenSER. Then, in your NAT handling routine use I think <strong>fix_nated_register</strong> and <strong>fix_nated_contact 
</strong>.</div>
<div>&nbsp;</div>
<div>Hope this helps.</div>
<div><span class="e" id="q_10f9ffa179a0c52b_7">
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><span class="gmail_quote">On 12/19/06, <b class="gmail_sendername">Edoardo Serra</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:osdevel@webrainstorm.it" target="_blank">osdevel@webrainstorm.it
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">At 13.51 19/12/2006, Klaus Darilion wrote:<br>&gt;You said that the 200 contains openser&#39;s IP in the SDP? Is it put in 
<br>&gt;there by openser or already by Asterisk?<br><br>Tnx very much for help<br><br>It&#39;s put in there by OpenSER.<br><br>I&#39;m attaching the 2 SIP/SDP packets (1 from asterisk to openser and 1<br>from openser to client) 
<br><br>AAA.AAA.AAA.AAA stands for IP of Asterisk<br>OOO.OOO.OOO.OOO stands for IP of OpenSER<br>CCC.CCC.CCC.CCC stands for IP of client<br>3333333333 is the called number<br><br><br>No.&nbsp;&nbsp;&nbsp;&nbsp; Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Source&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Destination&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Protocol Info 
<br>&nbsp;&nbsp;&nbsp;&nbsp;20 12.646925&nbsp;&nbsp; AAA.AAA.AAA.AAA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OOO.OOO.OOO.OOO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIP/SDP<br>Status: 200 OK, with session description<br><br>Session Initiation Protocol<br>&nbsp;&nbsp; Status-Line: SIP/2.0 200 OK<br>&nbsp;&nbsp; Message Header<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Via: SIP/2.0/UDP 
<br>OOO.OOO.OOO.OOO;branch=z9hG4bK5bbd.eaf4f093.0;received=OOO.OOO.OOO.OOO<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Via: SIP/2.0/UDP<br>CCC.CCC.CCC.CCC:8952;branch=z9hG4bK-d87543-e15656230434101e-1--d87543-;rport=8952<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Record-Route: &lt;sip:OOO.OOO.OOO.OOO
 ;lr=on;ftag=9043ec70&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; From: &quot;test&quot;&lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sip:test@OOO.OOO.OOO.OOO" target="_blank">sip:test@OOO.OOO.OOO.OOO</a>&gt;;tag=9043ec70<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; To: &quot;3333333333&quot;&lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sip:3333333333@OOO.OOO.OOO.OOO" target="_blank"> sip:3333333333@OOO.OOO.OOO.OOO</a>&gt;;tag=as30a7528b<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Call-ID: 98684a222a2eeb7aYmVlZTUzZDRhNjMzN2Y0MTZhYmNmOTc5MzQ4OGI3ZGU.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CSeq: 3 INVITE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User-Agent: Asterisk<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Contact: &lt;sip:3333333333@AAA.AAA.AAA.AAA:5060&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Content-Type: application/sdp
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Content-Length: 291<br>&nbsp;&nbsp; Message body<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Session Description Protocol<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Session Description Protocol Version (v): 0 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Owner/Creator, Session Id (o): root 20137 20138 IN IP4<br>AAA.AAA.AAA.AAA
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Session Name (s): session<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connection Information (c): IN IP4 AAA.AAA.AAA.AAA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Time Description, active time (t): 0 0 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Description, name and address (m): audio 58508
<br>RTP/AVP 98 3 8 0 101<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): rtpmap:98 iLBC/8000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): rtpmap:3 GSM/8000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): rtpmap:8 PCMA/8000 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): rtpmap:0 PCMU/8000
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): rtpmap:101 telephone-event/8000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): fmtp:101 0-16<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): silenceSupp:off - - - - <br><br>No.&nbsp;&nbsp;&nbsp;&nbsp; Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Source&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Destination&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Protocol Info
<br>&nbsp;&nbsp;&nbsp;&nbsp;21 12.647437&nbsp;&nbsp; OOO.OOO.OOO.OOO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CCC.CCC.CCC.CCC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIP/SDP<br>Status: 200 OK, with session description<br><br>Session Initiation Protocol <br>&nbsp;&nbsp; Status-Line: SIP/2.0 200 OK<br>&nbsp;&nbsp; Message Header<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Via: SIP/2.0/UDP
<br>OOO.OOO.OOO.OOO:5060;branch=z9hG4bK-d87543-e15656230434101e-1--d87543-;rport=8952<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Record-Route: &lt;sip:OOO.OOO.OOO.OOO;lr=on;ftag=9043ec70&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; From: &quot;test&quot;&lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sip:test@OOO.OOO.OOO.OOO" target="_blank">
sip:test@OOO.OOO.OOO.OOO</a>&gt;;tag=9043ec70<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; To: &quot;3333333333&quot;&lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sip:3333333333@OOO.OOO.OOO.OOO" target="_blank">sip:3333333333@OOO.OOO.OOO.OOO 
</a>&gt;;tag=as30a7528b<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Call-ID: 98684a222a2eeb7aYmVlZTUzZDRhNjMzN2Y0MTZhYmNmOTc5MzQ4OGI3ZGU.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CSeq: 3 INVITE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User-Agent: Asterisk<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Contact: &lt;sip:3333333333@AAA.AAA.AAA.AAA:5060&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Content-Type: application/sdp<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Content-Length: 291<br>&nbsp;&nbsp; Message body<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Session Description Protocol<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Session Description Protocol Version (v): 0 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Owner/Creator, Session Id (o): root 20137 20138 IN IP4<br>OOO.OOO.OOO.OOO<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Session Name (s): session<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connection Information (c): IN IP4 OOO.OOO.OOO.OOO<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Time Description, active time (t): 0 0 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Description, name and address (m): audio 58508<br>RTP/AVP 98 3 8 0 101<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): rtpmap:98 iLBC/8000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): rtpmap:3 GSM/8000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): rtpmap:8 PCMA/8000 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): rtpmap:0 PCMU/8000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): rtpmap:101 telephone-event/8000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): fmtp:101 0-16<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Media Attribute (a): silenceSupp:off - - - - 
<br><br>Tnx very much for help again<br><br>Regards<br><br>Edoardo<br><br><br>&gt;regards<br>&gt;klaus<br>&gt;<br>&gt;<br>&gt;regards<br>&gt;klaus<br>&gt;<br>&gt;Edoardo Serra wrote:<br>&gt;&gt;Hi guys,<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; I&#39;m having a problem with an OpenSER acting as registrar 
<br>&gt;&gt; server and load balancer for many Asterisk servers.<br>&gt;&gt;In a few words: &quot;users are registering on openser and, when they<br>&gt;&gt;want to make a call, OpenSER proxies the request to an Asterisk<br>
&gt;&gt;server with the dispatcher module&quot;<br>&gt;&gt;Here is the intended data flow (SIP goes through OpenSER and media<br>&gt;&gt;goes directly to Asterisk)<br>&gt;&gt;User &lt;-- SIP --&gt; OpenSER &lt;-- SIP --&gt; Asterisk 
<br>&gt;&gt;User &lt;-- RTP --&gt; Asterisk<br>&gt;&gt;Both, OpenSER and Asterisks have public IPs<br>&gt;&gt;I already have a working setup of that and everything seems working<br>&gt;&gt;correctly.<br>&gt;&gt;I&#39;m trying to replicate that setup on another site, same 
<br>&gt;&gt;configurations of the boxes, same versions of OpenSER and Asterisk,<br>&gt;&gt;etc... but I&#39;m having monodirectional Audio.<br>&gt;&gt;Having a look with tethereal I see that OpenSER, when the<br>&gt;&gt;communication is answered, sends a SIP packet (200 OK) to the user 
<br>&gt;&gt;indicating itself as media endpoint instead of the Asterisks.<br>&gt;&gt;&nbsp;&nbsp;From that moment I see RTP packets flowing from the client to OpenSER<br>&gt;&gt;This seems really strange to me because I just copied the same 
<br>&gt;&gt;configurations file from a working setup to the new installation.<br>&gt;&gt;Tnx in advance for help.<br>&gt;&gt;Regards<br>&gt;&gt;P.S.: Here is my openser.cfg<br>&gt;&gt;## $Id: ser.cfg,v <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://1.21.4.1/" target="_blank">
1.21.4.1</a> 2003/11/10 15:35:15 andrei Exp $<br>&gt;&gt;## simple quick-start config script<br>&gt;&gt;#<br>&gt;&gt;# ----------- global configuration parameters ------------------------<br>&gt;&gt;#debug=3 # debug level (cmd line: -dddddddddd) 
<br>&gt;&gt;fork=yes<br>&gt;&gt;#log_stderror=no # (cmd line: -E)<br>&gt;&gt;check_via=no # (cmd. line: -v)<br>&gt;&gt;dns=no # (cmd. line: -r)<br>&gt;&gt;rev_dns=no # (cmd. line: -R)<br>&gt;&gt;#children=4<br>&gt;&gt;#port=5060 
<br>&gt;&gt;fifo=&quot;/tmp/ser_fifo&quot;<br>&gt;&gt;#uid=nobody<br>&gt;&gt;#gid=nobody<br>&gt;&gt;# ------------------ module loading ----------------------------------<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/sl.so&quot; 
<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/tm.so&quot;<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/rr.so&quot;<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/maxfwd.so&quot;<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/usrloc.so&quot; 
<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/registrar.so&quot;<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/nathelper.so&quot;<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/textops.so&quot;<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/exec.so&quot; 
<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/uri.so&quot;<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/uri_db.so&quot;<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/dispatcher.so&quot;<br>&gt;&gt;# Uncomment this if you want digest authentication 
<br>&gt;&gt;# mysql.so must be loaded !<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/mysql.so&quot;<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/auth.so&quot;<br>&gt;&gt;loadmodule &quot;/usr/lib/openser/modules/auth_db.so&quot; 
<br>&gt;&gt;modparam(&quot;usrloc&quot;, &quot;db_mode&quot;, 2)<br>&gt;&gt;modparam(&quot;usrloc&quot;, &quot;db_url&quot;, &quot;mysql://xxx:xxx@xxx.xxx.xxx.xxx/openser&quot;)<br>&gt;&gt;modparam(&quot;usrloc&quot;, &quot;timer_interval&quot;, 120) 
<br>&gt;&gt;modparam(&quot;auth_db&quot;, &quot;calculate_ha1&quot;, 0)<br>&gt;&gt;modparam(&quot;auth_db&quot;, &quot;db_url&quot;, &quot;mysql://xxx:xxx@xxx.xxx.xxx.xxx/voip&quot;)<br>&gt;&gt;modparam(&quot;uri_db&quot;, &quot;db_url&quot;, &quot; 
mysql://xxx:xxx@xxx.xxx.xxx.xxx/openser&quot;)<br>&gt;&gt;modparam(&quot;rr&quot;, &quot;enable_full_lr&quot;, 1)<br>&gt;&gt;modparam(&quot;registrar&quot;, &quot;nat_flag&quot;, 6)<br>&gt;&gt;modparam(&quot;registrar&quot;, &quot;max_expires&quot;, 3600) 
<br>&gt;&gt;modparam(&quot;registrar&quot;, &quot;min_expires&quot;, 60)<br>&gt;&gt;modparam(&quot;registrar&quot;, &quot;append_branches&quot;, 0)<br>&gt;&gt;modparam(&quot;registrar&quot;, &quot;desc_time_order&quot;, 1) 
<br>&gt;&gt;modparam(&quot;nathelper&quot;, &quot;natping_interval&quot;, 20) # Ping interval 20 s<br>&gt;&gt;modparam(&quot;nathelper&quot;, &quot;ping_nated_only&quot;, 1) # Ping only clients behind NAT<br>&gt;&gt;modparam(&quot;dispatcher&quot;, &quot;force_dst&quot;, 1) 
<br>&gt;&gt;# ------------------------- request routing logic -------------------<br>&gt;&gt;# main routing logic<br>&gt;&gt;route{<br>&gt;&gt;# initial sanity checks -- messages with<br>&gt;&gt;# max_forwards==0, or excessively long requests 
<br>&gt;&gt;if (!mf_process_maxfwd_header(&quot;10&quot;)) {<br>&gt;&gt;sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);<br>&gt;&gt;exit;<br>&gt;&gt;};<br>&gt;&gt;if ( msg:len &gt; max_len ) {<br>&gt;&gt;sl_send_reply(&quot;513&quot;, &quot;Message too big&quot;); 
<br>&gt;&gt;exit;<br>&gt;&gt;};<br>&gt;&gt;if ( (method==&quot;OPTIONS&quot;) || (method==&quot;SUBSCRIBE&quot;) || (method==&quot;NOTIFY&quot;) ) {<br>&gt;&gt;sl_send_reply(&quot;405&quot;, &quot;Method Not Allowed&quot;); 
<br>&gt;&gt;exit;<br>&gt;&gt;}<br>&gt;&gt;if (!method==&quot;REGISTER&quot;) {<br>&gt;&gt;record_route();<br>&gt;&gt;};<br>&gt;&gt;if ((src_ip==xxx.xxx.xxx.xxx) || (src_ip==xxx.xxx.xxx.xxx)) { # IP<br>&gt;&gt;of Asterisks 
<br>&gt;&gt;if (!lookup(&quot;location&quot;)) {<br>&gt;&gt;sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>&gt;&gt;exit;<br>&gt;&gt;};<br>&gt;&gt;# forward to current uri now; use stateful forwarding; that<br>&gt;&gt;# works reliably even if we forward from TCP to UDP 
<br>&gt;&gt;if (!t_relay()) {<br>&gt;&gt;sl_reply_error();<br>&gt;&gt;};<br>&gt;&gt;exit;<br>&gt;&gt;};<br>&gt;&gt;if (nat_uac_test(&quot;3&quot;)) {<br>&gt;&gt;if ((method==&quot;REGISTER&quot;) || (method==&quot;INVITE&quot;) || (method==&quot;OPTIONS&quot;)) { 
<br>&gt;&gt;fix_nated_contact();<br>&gt;&gt;force_rport();<br>&gt;&gt;setflag(6); # Mark as NATed<br>&gt;&gt;}<br>&gt;&gt;}<br>&gt;&gt;# if the request is for other domain use UsrLoc<br>&gt;&gt;# (in case, it does not work, use the following command 
<br>&gt;&gt;# with proper names and addresses in it)<br>&gt;&gt;if (method==&quot;REGISTER&quot;) {<br>&gt;&gt;if (!proxy_authorize(&quot;domain&quot;, &quot;openser_view&quot;)) {<br>&gt;&gt;proxy_challenge(&quot;domain&quot;, &quot;0&quot;); 
<br>&gt;&gt;exit;<br>&gt;&gt;}<br>&gt;&gt;if (!check_to()) {<br>&gt;&gt;sl_send_reply(&quot;403&quot;, &quot;Digest username and URI username do NOT<br>&gt;&gt;match! Stay away!&quot;);<br>&gt;&gt;exit;<br>&gt;&gt;}<br>&gt;&gt;save(&quot;location&quot;); 
<br>&gt;&gt;exit;<br>&gt;&gt;};<br>&gt;&gt;<br>&gt;&gt;if (method==&quot;INVITE&quot;) {<br>&gt;&gt;if (!proxy_authorize(&quot;domain&quot;, &quot;openser_view&quot;)) {<br>&gt;&gt;proxy_challenge(&quot;domain&quot;, &quot;0&quot;); 
<br>&gt;&gt;exit;<br>&gt;&gt;}<br>&gt;&gt;if (!check_from()) {<br>&gt;&gt;sl_send_reply(&quot;403&quot;, &quot;Digest username and URI username do NOT<br>&gt;&gt;match! Stay away!&quot;);<br>&gt;&gt;exit;<br>&gt;&gt;}<br>
&gt;&gt;}<br>&gt;&gt;# loose-route processing<br>&gt;&gt;if (loose_route()) {<br>&gt;&gt;# mark routing logic in request<br>&gt;&gt;append_hf(&quot;P-hint: rr-enforced\r\n&quot;);<br>&gt;&gt;route(1);<br>&gt;&gt;exit;<br>
&gt;&gt;};<br>&gt;&gt;if (!uri==myself) {<br>&gt;&gt;# mark routing logic in request<br>&gt;&gt;append_hf(&quot;P-hint: outbound\r\n&quot;);<br>&gt;&gt;route(1);<br>&gt;&gt;exit;<br>&gt;&gt;};<br>&gt;&gt;append_hf(&quot;P-hint: usrloc applied\r\n&quot;); 
<br>&gt;&gt;route(1);<br>&gt;&gt;}<br>&gt;&gt;route[1]<br>&gt;&gt;{<br>&gt;&gt;# ! Nathelper<br>&gt;&gt;if (uri=~&quot;[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)&quot; &amp;&amp;<br>&gt;&gt;!search(&quot;^Route:&quot;)){ 
<br>&gt;&gt;sl_send_reply(&quot;479&quot;, &quot;We don&#39;t forward to private IP addresses&quot;);<br>&gt;&gt;exit;<br>&gt;&gt;};<br>&gt;&gt;# NAT processing of replies; apply to all transactions (for example,<br>&gt;&gt;# re-INVITEs from public to private UA are hard to identify as 
<br>&gt;&gt;# NATed at the moment of request processing); look at replies<br>&gt;&gt;t_on_reply(&quot;1&quot;);<br>&gt;&gt;# send it out now; use stateful forwarding as it works reliably<br>&gt;&gt;# even for UDP2TCP<br>&gt;&gt;if ((src_ip!= 
xxx.xxx.xxx.xxx) &amp;&amp; (src_ip!=xxx.xxx.xxx.xxx)) { # IP<br>&gt;&gt;of Asterisks<br>&gt;&gt;ds_select_dst(&quot;2&quot;, &quot;0&quot;);<br>&gt;&gt;}<br>&gt;&gt;if (!t_relay()) {<br>&gt;&gt;sl_reply_error();<br>&gt;&gt;}; 
<br>&gt;&gt;}<br>&gt;&gt;# ! Nathelper<br>&gt;&gt;onreply_route[1] {<br>&gt;&gt;# NATed transaction ?<br>&gt;&gt;if (isflagset(6) &amp;&amp; status =~ &quot;(183)|2[0-9][0-9]&quot;) {<br>&gt;&gt;fix_nated_contact();<br>&gt;&gt;# otherwise, is it a transaction behind a NAT and we did not 
<br>&gt;&gt;# know at time of request processing ? (RFC1918 contacts)<br>&gt;&gt;} else if (nat_uac_test(&quot;1&quot;)) {<br>&gt;&gt;fix_nated_contact();<br>&gt;&gt;};<br>&gt;&gt;}<br>&gt;&gt;<br>&gt;&gt;_______________________________________________ 
<br>&gt;&gt;Users mailing list<br>&gt;&gt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Users@openser.org" target="_blank">Users@openser.org</a><br>&gt;&gt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://openser.org/cgi-bin/mailman/listinfo/users" target="_blank">
http://openser.org/cgi-bin/mailman/listinfo/users</a> <br>&gt;<br>&gt;<br>&gt;--<br>&gt;Klaus Darilion<br>&gt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://nic.at/" target="_blank">nic.at</a><br>&gt;
<br><br><br>_______________________________________________<br>Users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Users@openser.org" target="_blank">Users@openser.org </a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://openser.org/cgi-bin/mailman/listinfo/users" target="_blank">
http://openser.org/cgi-bin/mailman/listinfo/users</a><br></blockquote></div><br></span></div></blockquote></div><br>