<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div>Hi community,</div><div><br></div><div>I have following setup:</div><div><br></div><div>Public IP (eth0) < OpenSIPS > Private IP (eth1) <------> Private IP (eth0) Asterisk.</div>
<div><br></div><div>I'm trying to relay all the initial packets received by OpenSIPS to Asterisk, so I record-route initial packets and process all responses using loose routing. OpenSIPS is restricted to use only two UDP IP addresses - private & public ones. It all works fine on SIP layer, I do understand that I also need RTP proxy, but at this stage I've got strange problem - with mhomed=1 in configuration file OpenSIPS still sends packets using public IP address, while Contact, To and Via fields are set correctly, to private IP address of OpenSIPS. I have tried to use force_send_socket but without any luck. Could you please help me with this configuration? At least - why does OpenSIPS uses public IP? Thanks!</div>
<div><br></div><div>Here's my configuration:</div><div><br></div><div><div>####### Global Parameters #########</div><div>log_facility=LOG_LOCAL4</div><div>fork=yes</div><div>children=4</div><div>debug=9</div><div>disable_tcp=yes</div>
<div>auto_aliases=no</div><div>mhomed=1</div><div>port=5066</div><div>listen=udp:XXX.XXX.XXX.XXX:5066</div><div>listen=udp:<a href="http://10.22.10.254:5068/" target="_blank" style="color: rgb(0, 0, 204); ">10.22.10.254:5068</a></div>
<div><br></div><div>####### Modules Section ########</div><div><br></div><div>#set module path</div><div>mpath="/opt/opensips/lib64/opensips/modules/"</div><div><br></div><div>loadmodule "signaling.so"</div>
<div>loadmodule "sl.so"</div><div>loadmodule "tm.so"</div><div>loadmodule "rr.so"</div><div>loadmodule "maxfwd.so"</div><div>loadmodule "textops.so"</div><div>loadmodule "mi_fifo.so"</div>
<div>loadmodule "uri.so"</div><div><br></div><div># ----------------- setting module-specific parameters ---------------</div><div><br></div><div># ----- mi_fifo params -----</div><div>modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")</div>
<div><br></div><div># ----- rr params -----</div></div><div><div># add value to ;lr param to cope with most of the UAs</div><div>modparam("rr", "enable_full_lr", 1)</div><div>modparam("rr", "append_fromtag", 1)</div>
<div><br></div><div># ----- uri params -----</div><div>modparam("uri", "use_uri_table", 0)</div><div><br></div><div>####### Routing Logic ########</div><div><br></div><div># main request routing logic</div>
<div><br></div><div>route{</div><div><br></div><div> if (!mf_process_maxfwd_header("10")) {</div><div> sl_send_reply("483","Too Many Hops");</div><div> exit;</div>
<div> }</div><div><br></div><div> if (has_totag()) {</div><div> # sequential request withing a dialog should</div><div> # take the path determined by record-routing</div><div> if (loose_route()) {</div>
<div> if (is_method("BYE")) {</div><div> setflag(1); # do accounting ...</div><div> setflag(3); # ... even if the transaction fails</div>
<div> } else if (is_method("INVITE")) {</div><div> # even if in most of the cases is useless, do RR for</div><div> # re-INVITEs alos, as some buggy clients do change route set</div>
<div> # during the dialog.</div><div> record_route();</div><div> }</div><div> # route it out to whatever destination was set by loose_route()</div>
<div> # in $du (destination URI).</div><div> route(1);</div><div> } else {</div><div> if ( is_method("ACK") ) {</div><div> if ( t_check_trans() ) {</div>
<div> # non loose-route, but stateful ACK; must be an ACK after</div><div> # a 487 or e.g. 404 from upstream server</div><div> t_relay();</div>
<div> exit;</div><div> } else {</div><div> # ACK without matching transaction -></div><div> # ignore and discard</div>
<div> exit;</div><div> }</div><div> }</div><div> sl_send_reply("404","Not here");</div>
<div> }</div><div> exit;</div><div> }</div><div><br></div><div> #initial requests</div><div><br></div><div> # CANCEL processing</div><div> if (is_method("CANCEL"))</div>
</div><div><div> {</div><div> if (t_check_trans())</div><div> t_relay();</div><div> exit;</div><div> }</div><div><br></div><div> t_check_trans();</div>
<div><br></div><div> # preloaded route checking</div><div> if (loose_route()) {</div><div> xlog("L_ERR",</div><div> "Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");</div>
<div> if (!is_method("ACK"))</div><div> sl_send_reply("403","Preload Route denied");</div><div> exit;</div><div> }</div><div><br></div>
<div> record_route();</div><div> route(1);</div><div>}</div><div><br></div><div><br></div><div>route[1] {</div><div> rewritehostport("<a href="http://10.22.10.1:6000/" target="_blank" style="color: rgb(0, 0, 204); ">10.22.10.1:6000</a>");</div>
<div> force_send_socket(10.22.10.254);</div><div> if (!t_relay()) {</div><div> sl_reply_error();</div><div> };</div><div> exit;</div><div>}</div></div></span>