<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>HI,</div><div>I have a opensips servers in a private network, IP address: 10.34.14.24, now I&#39;m going to this private network address 1: 1 NAT to public networks, and modify the opensips.cfg profile. Register now through the public network clients can conduct video and audio communications, and work very well.</div><div><br></div><div>Now I need to add a network card (IP: 192.168.100.100) on opensips server, and directly connected to a sip client (IP: 192.168.100.200) through this card.</div><div><br></div><div>How should I modify opensips.cfg, make public sip client the private network sip client to communicate it?</div><div><br></div><div>Attach opensips.cfg I now use:</div><div><br></div><div><br></div><div><br></div><div><div>#</div><div># $Id$</div><div>#</div><div># OpenSIPS residential configuration script</div><div>#     by OpenSIPS Solutions &lt;<a href="mailto:team@opensips-solutions.com" target="_blank">team@opensips-solutions.com</a>&gt;</div><div>#</div><div># This script was generated via &quot;make menuconfig&quot;, from</div><div>#   the &quot;Residential&quot; scenario.</div><div># You can enable / disable more features / functionalities by</div><div>#   re-generating the scenario with different options.#</div><div>#</div><div># Please refer to the Core CookBook at:</div><div>#      <a href="http://www.opensips.org/Resources/DocsCookbooks" target="_blank">http://www.opensips.org/Resources/DocsCookbooks</a></div><div># for a explanation of possible statements, functions and parameters.</div><div>#</div><div><br></div><div><br></div><div>####### Global Parameters #########</div><div><br></div><div>debug=3</div><div>log_stderror=no</div><div>log_facility=LOG_LOCAL0</div><div><br></div><div>fork=yes</div><div>children=4</div><div><br></div><div>/* uncomment the following lines to enable debugging */</div><div>#debug=6</div><div>#fork=no</div><div>#log_stderror=yes</div><div><br></div><div>/* uncomment the next line to enable the auto temporary blacklisting of </div><div>   not available destinations (default disabled) */</div><div>#disable_dns_blacklist=no</div><div><br></div><div>/* uncomment the next line to enable IPv6 lookup after IPv4 dns </div><div>   lookup failures (default disabled) */</div><div>#dns_try_ipv6=yes</div><div><br></div><div>/* comment the next line to enable the auto discovery of local aliases</div><div>   based on revers DNS on IPs */</div><div>auto_aliases=no</div><div><br></div><div>advertised_address=61.132.137.100</div><div>alias=61.132.137.100</div><div><br></div><div>listen=udp:<a href="http://10.34.14.24:5060" target="_blank">10.34.14.24:5060</a>  # CUSTOMIZE ME</div><div>#listen=udp:<a href="http://10.34.240.150:5060" target="_blank">10.34.240.150:5060</a></div><div><br></div><div>disable_tcp=yes</div><div><br></div><div>disable_tls=yes</div><div><br></div><div><br></div><div>####### Modules Section ########</div><div><br></div><div>#set module path</div><div>mpath=&quot;/usr/local/opensips/lib64/opensips/modules&quot;</div><div><br></div><div>#### SIGNALING module</div><div>loadmodule &quot;signaling.so&quot;</div><div><br></div><div>#### StateLess module</div><div>loadmodule &quot;sl.so&quot;</div><div><br></div><div>#### Transaction Module</div><div>loadmodule &quot;tm.so&quot;</div><div>modparam(&quot;tm&quot;, &quot;fr_timer&quot;, 5)</div><div>modparam(&quot;tm&quot;, &quot;fr_inv_timer&quot;, 30)</div><div>modparam(&quot;tm&quot;, &quot;restart_fr_on_each_reply&quot;, 0)</div><div>modparam(&quot;tm&quot;, &quot;onreply_avp_mode&quot;, 1)</div><div><br></div><div>#### Record Route Module</div><div>loadmodule &quot;rr.so&quot;</div><div>/* do not append from tag to the RR (no need for this script) */</div><div>modparam(&quot;rr&quot;, &quot;append_fromtag&quot;, 0)</div><div><br></div><div>#### MAX ForWarD module</div><div>loadmodule &quot;maxfwd.so&quot;</div><div><br></div><div>#### SIP MSG OPerationS module</div><div>loadmodule &quot;sipmsgops.so&quot;</div><div><br></div><div>#### FIFO Management Interface</div><div>loadmodule &quot;mi_fifo.so&quot;</div><div>modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/opensips_fifo&quot;)</div><div><br></div><div><br></div><div>#### URI module</div><div>loadmodule &quot;uri.so&quot;</div><div>modparam(&quot;uri&quot;, &quot;use_uri_table&quot;, 0)</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>#### USeR LOCation module</div><div>loadmodule &quot;usrloc.so&quot;</div><div>modparam(&quot;usrloc&quot;, &quot;nat_bflag&quot;, 10)</div><div>modparam(&quot;usrloc&quot;, &quot;db_mode&quot;,   0)</div><div><br></div><div>#### REGISTRAR module</div><div>loadmodule &quot;registrar.so&quot;</div><div>modparam(&quot;registrar&quot;, &quot;tcp_persistent_flag&quot;, 7)</div><div><br></div><div>/* uncomment the next line not to allow more than 10 contacts per AOR */</div><div>#modparam(&quot;registrar&quot;, &quot;max_contacts&quot;, 10)</div><div><br></div><div>#### ACCounting module</div><div>loadmodule &quot;acc.so&quot;</div><div>/* what special events should be accounted ? */</div><div>modparam(&quot;acc&quot;, &quot;early_media&quot;, 0)</div><div>modparam(&quot;acc&quot;, &quot;report_cancels&quot;, 0)</div><div>/* by default we do not adjust the direct of the sequential requests.</div><div>   if you enable this parameter, be sure the enable &quot;append_fromtag&quot;</div><div>   in &quot;rr&quot; module */</div><div>modparam(&quot;acc&quot;, &quot;detect_direction&quot;, 0)</div><div>modparam(&quot;acc&quot;, &quot;failed_transaction_flag&quot;, 3)</div><div>/* account triggers (flags) */</div><div>modparam(&quot;acc&quot;, &quot;log_flag&quot;, 1)</div><div>modparam(&quot;acc&quot;, &quot;log_missed_flag&quot;, 2)</div><div><br></div><div>### Authenticated by MySQL ###</div><div>loadmodule &quot;db_mysql.so&quot;</div><div>loadmodule &quot;auth.so&quot;</div><div>loadmodule &quot;auth_db.so&quot;</div><div><br></div><div>modparam(&quot;usrloc&quot;, &quot;db_mode&quot;, 2)</div><div>modparam(&quot;usrloc&quot;, &quot;db_url&quot;, &quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div>modparam(&quot;auth_db&quot;, &quot;calculate_ha1&quot;, yes)</div><div>modparam(&quot;auth_db&quot;, &quot;password_column&quot;, &quot;password&quot;)</div><div>modparam(&quot;auth_db&quot;, &quot;db_url&quot;, &quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div>modparam(&quot;auth_db&quot;, &quot;load_credentials&quot;, &quot;&quot;)</div><div>### End Authentivated by MySQL ###</div><div><br></div><div>loadmodule &quot;domain.so&quot;</div><div>modparam(&quot;domain&quot;, &quot;db_url&quot;,&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div>modparam(&quot;domain&quot;, &quot;db_mode&quot;, 1)   # Use caching</div><div><br></div><div>loadmodule &quot;nat_traversal.so&quot;</div><div>modparam(&quot;nat_traversal&quot;, &quot;keepalive_interval&quot;, 90)</div><div><br></div><div>#### nathelper module</div><div>loadmodule &quot;nathelper.so&quot;</div><div>modparam(&quot;nathelper&quot;, &quot;natping_interval&quot;, 30)</div><div>modparam(&quot;nathelper&quot;, &quot;sipping_from&quot;, &quot;<a href="mailto:sip%3Apinger@opensips.org" target="_blank">sip:pinger@opensips.org</a>&quot;)</div><div>modparam(&quot;nathelper|registrar&quot;, &quot;received_avp&quot;, &quot;$avp(RECEIVED)&quot;)</div><div><br></div><div>#### Modulo rtpproxy (forcar o audio atraves do opensips)</div><div>loadmodule &quot;rtpproxy.so&quot;</div><div>modparam(&quot;rtpproxy&quot;, &quot;rtpproxy_sock&quot;, &quot;udp:<a href="http://127.0.0.1:7890" target="_blank">127.0.0.1:7890</a>&quot;)</div><div>modparam(&quot;nathelper&quot;, &quot;force_socket&quot;, &quot;udp:<a href="http://127.0.0.1:7890" target="_blank">127.0.0.1:7890</a>&quot;)</div><div>modparam(&quot;rtpproxy&quot;, &quot;rtpproxy_autobridge&quot;, 1)</div><div><br></div><div><br></div><div>####### Routing Logic ########</div><div><br></div><div># main request routing logic</div><div><br></div><div>route{</div><div><span style="white-space:pre-wrap">        </span></div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (!mf_process_maxfwd_header(&quot;10&quot;)) {</div><div><span style="white-space:pre-wrap">                </span>sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);</div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (has_totag()) {</div><div><span style="white-space:pre-wrap">                </span># sequential requests within a dialog should</div><div><span style="white-space:pre-wrap">                </span># take the path determined by record-routing</div><div><span style="white-space:pre-wrap">                </span>if (loose_route()) {</div><div><span style="white-space:pre-wrap">                        </span></div><div><span style="white-space:pre-wrap">                        </span>if (is_method(&quot;BYE&quot;)) {</div><div><span style="white-space:pre-wrap">                                </span>setflag(1); # do accounting ...</div><div><span style="white-space:pre-wrap">                                </span>setflag(3); # ... even if the transaction fails</div><div><span style="white-space:pre-wrap">                        </span>} else if (is_method(&quot;INVITE&quot;)) {</div><div><span style="white-space:pre-wrap">                                </span># even if in most of the cases is useless, do RR for</div><div><span style="white-space:pre-wrap">                                </span># re-INVITEs alos, as some buggy clients do change route set</div><div><span style="white-space:pre-wrap">                                </span># during the dialog.</div><div><span style="white-space:pre-wrap">                                </span>record_route();</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">                        </span></div><div><br></div><div><span style="white-space:pre-wrap">                        </span># route it out to whatever destination was set by loose_route()</div><div><span style="white-space:pre-wrap">                        </span># in $du (destination URI).</div><div><span style="white-space:pre-wrap">                        </span>route(1);</div><div><span style="white-space:pre-wrap">                </span>} else {</div><div><span style="white-space:pre-wrap">                        </span></div><div><span style="white-space:pre-wrap">                        </span>if ( is_method(&quot;ACK&quot;) ) {</div><div><span style="white-space:pre-wrap">                                </span>if ( t_check_trans() ) {</div><div><span style="white-space:pre-wrap">                                        </span># non loose-route, but stateful ACK; must be an ACK after </div><div><span style="white-space:pre-wrap">                                        </span># a 487 or e.g. 404 from upstream server</div><div><span style="white-space:pre-wrap">                                        </span>t_relay();</div><div><span style="white-space:pre-wrap">                                        </span>exit;</div><div><span style="white-space:pre-wrap">                                </span>} else {</div><div><span style="white-space:pre-wrap">                                        </span># ACK without matching transaction -&gt;</div><div><span style="white-space:pre-wrap">                                        </span># ignore and discard</div><div><span style="white-space:pre-wrap">                                        </span>exit;</div><div><span style="white-space:pre-wrap">                                </span>}</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                </span>        #t_on_failure(&quot;1&quot;);</div><div><span style="white-space:pre-wrap">                        </span>sl_send_reply(&quot;404&quot;,&quot;Not here&quot;);</div><div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span># CANCEL processing</div><div><span style="white-space:pre-wrap">        </span>if (is_method(&quot;CANCEL&quot;))</div><div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">                </span>if (t_check_trans())</div><div><span style="white-space:pre-wrap">                        </span>t_relay();</div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span>t_check_trans();</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if ( !(is_method(&quot;REGISTER&quot;)  ) ) {</div><div><span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">                </span>if (from_uri==myself)</div><div><span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">                </span>{</div><div><br></div><div><span style="white-space:pre-wrap">                </span>          ### Authenticated by MySQL ###</div><div>                      if(!proxy_authorize(&quot;&quot;, &quot;subscriber&quot;)) {</div><div>                      <span style="white-space:pre-wrap">        </span>   if (!registered(&quot;location&quot;,&quot;$fu&quot;)) {</div><div><span style="white-space:pre-wrap">                        </span>         xlog(&quot;L_NOTICE&quot;,&quot;Auth_error for $fU@$fd from $si cause proxy authentication required&quot;);</div><div><span style="white-space:pre-wrap">                        </span>   }                 </div><div><span style="white-space:pre-wrap">        </span>               <span style="white-space:pre-wrap">        </span>   proxy_challenge(&quot;&quot;, &quot;0&quot;);</div><div>        <span style="white-space:pre-wrap">        </span>           exit;</div><div>            <span style="white-space:pre-wrap">        </span>        }</div><div><span style="white-space:pre-wrap">        </span>                    if(!db_check_from()) {</div><div><span style="white-space:pre-wrap">                        </span>         xlog(&quot;L_NOTICE&quot;,&quot;Auth_error for $fU@$fd from $si cause Forbidden auth ID&quot;);</div><div>          <span style="white-space:pre-wrap">                </span>         sl_send_reply(&quot;403&quot;, &quot;Forbidden auth ID&quot;);</div><div><span style="white-space:pre-wrap">        </span>                         exit;</div><div>          <span style="white-space:pre-wrap">        </span>          }</div><div>            </div><div><span style="white-space:pre-wrap">        </span>                consume_credentials();</div><div>                      # caller authenticated</div><div><br></div><div>        <span style="white-space:pre-wrap">        </span>     ### End Autheticated by MySQL ###    </div><div><span style="white-space:pre-wrap">                        </span></div><div><span style="white-space:pre-wrap">                </span>} else {</div><div><span style="white-space:pre-wrap">                        </span># if caller is not local, then called number must be local</div><div><span style="white-space:pre-wrap">                        </span></div><div><span style="white-space:pre-wrap">                        </span>if (!uri==myself) {</div><div><span style="white-space:pre-wrap">                                </span>xlog(&quot;L_NOTICE&quot;,&quot;Auth_error for $fU@$fd from $si cause Rely forbidden&quot;);</div><div><span style="white-space:pre-wrap">                                </span>send_reply(&quot;403&quot;,&quot;Rely forbidden&quot;);</div><div><span style="white-space:pre-wrap">                                </span>exit;</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span># preloaded route checking</div><div><span style="white-space:pre-wrap">        </span>if (loose_route()) {</div><div><span style="white-space:pre-wrap">                </span>xlog(&quot;L_ERR&quot;,</div><div><span style="white-space:pre-wrap">                </span>&quot;Attempt to route with preloaded Route&#39;s [$fu/$tu/$ru/$ci]&quot;);</div><div><span style="white-space:pre-wrap">                </span>if (!is_method(&quot;ACK&quot;))</div><div><span style="white-space:pre-wrap">                        </span>sl_send_reply(&quot;403&quot;,&quot;Preload Route denied&quot;);</div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span># record routing</div><div><span style="white-space:pre-wrap">        </span>if (!is_method(&quot;REGISTER|MESSAGE&quot;))</div><div><span style="white-space:pre-wrap">                </span>record_route();</div><div><br></div><div><span style="white-space:pre-wrap">        </span># account only INVITEs</div><div><span style="white-space:pre-wrap">        </span>if (is_method(&quot;INVITE&quot;)) {</div><div><span style="white-space:pre-wrap">                </span>  sl_send_reply(&quot;180&quot;,&quot;ringing&quot;);<span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">                </span>  </div><div><span style="white-space:pre-wrap">                </span>  #SIP trunk to PSTN</div><div>      # if(((uri=~&quot;^sip:[055199999]@*&quot;) || (uri=~&quot;^sip:[1]@*&quot;)) &amp;&amp; !lookup(&quot;location&quot;,&quot;m&quot;)) {</div><div> <span style="white-space:pre-wrap">                                </span>if(((uri=~&quot;^sip:[055199999]@*&quot;) ) ) {</div><div>             xlog(&quot;sip trunk&quot;);</div><div><span style="white-space:pre-wrap">        </span>     rewritehostport(&quot;<a href="http://10.34.240.131:5060" target="_blank">10.34.240.131:5060</a>&quot;); # outbound </div><div>             route(1);</div><div>       }</div><div><br></div><div><span style="white-space:pre-wrap">        </span>setflag(1); # do accounting</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>if (!uri==myself) {</div><div><span style="white-space:pre-wrap">                </span>append_hf(&quot;P-hint: outbound\r\n&quot;); </div><div><span style="white-space:pre-wrap">                </span>route(1);</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span># requests for my domain</div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>if (is_method(&quot;PUBLISH|SUBSCRIBE&quot;))</div><div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">                </span>sl_send_reply(&quot;503&quot;, &quot;Service Unavailable&quot;);</div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (is_method(&quot;REGISTER&quot;))</div><div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">        </span>  ### Authenticated by MySQL ###</div><div>    if (!www_authorize(&quot;&quot;, &quot;subscriber&quot;)) {</div><div>        www_challenge(&quot;&quot;, &quot;0&quot;);</div><div>        exit;</div><div>    }</div><div>    if (!db_check_to()) {</div><div>        sl_send_reply(&quot;403&quot;, &quot;Forbidden auth ID&quot;);</div><div>        exit;</div><div>    }    </div><div>    ### End Authenticate by MySQL ###</div><div><br></div><div>    # we receive a register request</div><div>    # we will execute fix_nated_register nad fix_nated_contact</div><div>    fix_nated_register();</div><div>    fix_nated_contact();</div><div><br></div><div><span style="white-space:pre-wrap">                </span>if (   0 ) setflag(7);</div><div><br></div><div><span style="white-space:pre-wrap">                </span>if (!save(&quot;location&quot;))</div><div><span style="white-space:pre-wrap">                </span>    sl_reply_error();</div><div><span style="white-space:pre-wrap">                        </span>              </div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if ($rU==NULL) {</div><div><span style="white-space:pre-wrap">                </span># request with no Username in RURI</div><div><span style="white-space:pre-wrap">                </span>sl_send_reply(&quot;484&quot;,&quot;Address Incomplete&quot;);</div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span># do lookup with method filtering</div><div><span style="white-space:pre-wrap">        </span>if (!lookup(&quot;location&quot;,&quot;m&quot;)) {</div><div><span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">                </span># voicemail</div><div><span style="white-space:pre-wrap">        </span>#<span style="white-space:pre-wrap">        </span>xlog(&quot;voicemail service\n&quot;);</div><div><span style="white-space:pre-wrap">        </span>#<span style="white-space:pre-wrap">        </span>rewritehostport(&quot;<a href="http://10.34.240.129:5080" target="_blank">10.34.240.129:5080</a>&quot;);</div><div><br></div><div><span style="white-space:pre-wrap">        </span>} </div><div><br></div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span># when routing via usrloc, log the missed calls also</div><div><span style="white-space:pre-wrap">        </span>setflag(2);</div><div><span style="white-space:pre-wrap">        </span>route(1);</div><div>}</div><div><br></div><div><br></div><div>route[1] {</div><div><span style="white-space:pre-wrap">        </span># for INVITEs enable some additional helper routes</div><div><span style="white-space:pre-wrap">        </span>if (is_method(&quot;INVITE&quot;)) {</div><div><br></div><div><span style="white-space:pre-wrap">                </span>t_on_branch(&quot;2&quot;);</div><div><span style="white-space:pre-wrap">                </span>t_on_reply(&quot;2&quot;);</div><div><span style="white-space:pre-wrap">                </span>t_on_failure(&quot;1&quot;);</div><div><br></div><div>    if(nat_uac_test(&quot;127&quot;)){</div><div>      # user identified as behing a nat</div><div>      xlog(&quot;we are on route relay, user behind nat&quot;);</div><div>      fix_nated_contact();</div><div>    }</div><div><br></div><div>    # if we have an application/sdp on our body, so we execute</div><div>    # the rtpproxy_offer</div><div>    if(has_body(&quot;application/sdp&quot;)){</div><div>       xlog(&quot;we have sdp on this $rm&quot;);</div><div>       rtpproxy_offer(&quot;c&quot;,&quot;61.132.137.100&quot;);</div><div>    }</div><div><br></div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div>  # removing the rtpproxy session</div><div>  if(is_method(&quot;CANCEL|BYE&quot;)){</div><div>      unforce_rtp_proxy();</div><div>  }</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (!t_relay()) {</div><div><span style="white-space:pre-wrap">                </span>send_reply(&quot;500&quot;,&quot;Internal Error&quot;);</div><div><span style="white-space:pre-wrap">        </span>};</div><div><span style="white-space:pre-wrap">        </span>exit;</div><div>}</div><div><br></div><div><br></div><div>branch_route[2] {</div><div><span style="white-space:pre-wrap">        </span>xlog(&quot;new branch at $ru\n&quot;);</div><div>}</div><div><br></div><div><br></div><div>onreply_route[2] {</div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>xlog(&quot;incoming reply\n&quot;);</div><div><br></div><div>        # we receive a reply, we need to check about application/sdp</div><div>        # on our body, if we have, we answer that</div><div>        if(is_method(&quot;ACK&quot;) &amp;&amp; has_body(&quot;application/sdp&quot;)){</div><div>                rtpproxy_answer();</div><div>        }else if(has_body(&quot;application/sdp&quot;)){</div><div>                # offering rtpproxy on a non ack message</div><div>                rtpproxy_offer(&quot;c&quot;,&quot;61.132.137.100&quot;);</div><div>        }</div><div><br></div><div><br></div><div>        # here we try to identify if the user is behind a nat again</div><div>        # but now is the second user (the called user)</div><div>        if(nat_uac_test(&quot;127&quot;)){</div><div>        </div><div>               xlog(&quot;we are on nat handle , user behind nat, fixing contact&quot;);</div><div>               fix_nated_contact();</div><div>        }</div><div><br></div><div>}</div><div><br></div><div><br></div><div>failure_route[1] {</div><div><br></div><div>        if(is_method(&quot;INVITE&quot;)) {</div><div>             # call failed - relay to voice mail</div><div><span style="white-space:pre-wrap">        </span>     #append_branch();</div><div><span style="white-space:pre-wrap">        </span>     #t_relay(&quot;udp:<a href="http://10.34.240.131:5080" target="_blank">10.34.240.131:5080</a>&quot;);</div><div>        }</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (t_was_cancelled()) {</div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div>}</div></div><div><br></div></div>
</div><br></div>