<div>I am trying to set up some logic that will allow me to failover to a secondary SIP Provider's IP address and I found this subject on how you can implement it</div>
<div> </div>
<div><a href="http://opensips-open-sip-server.1449251.n2.nabble.com/Timer-Based-Failover-Question-td5758903.html">http://opensips-open-sip-server.1449251.n2.nabble.com/Timer-Based-Failover-Question-td5758903.html</a></div>
<div> </div>
<div> </div>
<div>In order to test I send my first call to 4.2.2.X (which is not my SIP providers Gateway). So this call fails as planned. Then a second call is sent to the correct backup SIP Providers IP address. This call starts to go through but then my Timer times out and the call is canceled. I am not sure why the call is canceled because I get a 183 from the SIP provider and in my OnReply_Route I set the timeout to be 300 seconds. It seems like when I set fr_inv_timer_avp it doesn't take affect. Not sure what I am doing wrong. Here is what I do</div>
<div> </div>
<div>route[4] {<br> # routing to the public network</div>
<div> $du = "sip:" + $rU + "@173.X.X.88:5060"; # IP Address of my OpenSIPS B2BUA server<br> $ru = "sip:" + $rU + "@<a href="http://4.2.2.2:5060">4.2.2.2:5060</a>";<br>
append_rpid_hf(); # Append Remote-Party-ID header field</div>
<div> <br> t_on_reply("2");<br> t_on_failure("2");</div>
<div> $avp(s:fr_inv_timer) = 6; </div>
<div> if (!t_relay()) { <br> sl_reply_error(); <br> };<br> exit;<br>}</div>
<div> </div>
<div>onreply_route[2] {<br> #<br> #-- On-reply block routing --<br> #</div>
<div> append_hf("P-hint: Onreply-route 2 - fixcontact \r\n");<br> fix_contact();<br> if ( $rs =~ "18." ) {<br> $avp(s:fr_inv_timer) = 300;<br> }<br> exit;<br>
}</div>
<div> </div>
<div> </div>
<div>failure_route[2] {<br>xlog("L_INFO", "Failure Route 2: Call [$rm] rU[$rU] ru[$ru] rd[$rd] fu[$fu] tu[$tu] si[$si] ct[$ct]\n");</div>
<div> ##--<br> ##-- If cancelled, exit.<br> ##--<br> if (t_was_cancelled()) {<br> exit;<br> };</div>
<div><br> # -- The last call failed to the Primary SIP Trunk Gateway<br> # -- So we need to try the Backup SIP Trunk Gateway</div>
<div> $du = "sip:" + $rU + "@173.X.X.X:5060";<br> $ru = "sip:" + $rU + "@<a href="http://216.82.225.202:5060">216.82.225.202:5060</a>"; #Bandwidth.com's Secondary SIP Gateway</div>
<div> append_rpid_hf(); # Append Remote-Party-ID header field</div>
<div> </div>
<div> $avp(s:fr_inv_timer) = 6;<br> t_on_reply("2");<br> t_on_failure("3");</div>
<div> t_relay();<br> exit;<br>}</div>
<div> </div>
<div>failure_route[3] {<br> ##--<br> ##-- If cancelled, exit.<br> ##--<br> if (t_was_cancelled()) {<br> exit;<br> };</div>
<div> ##--<br> ##-- If the Backup SIP Trunk Gateway didn't answer then we need to tell user "Server Unavailable"<br> t_reply("503","Service not available, no more gateways");<br>
exit;<br>}</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>It seems like I have everything configured correctly so I am not sure why the second call is being canceled. Sometimes a phone on the PSTN side will get the call and I answer the phone but I can't hear anything and then the call hangs up right away.</div>
<div> </div>
<div>I did a ngrep capture on both my OpenSIPS Proxy server and my OpenSIPS B2BUA server that sits in between my SIP Trunk Provider and my OpenSIPS Proxy</div>
<div> </div>
<div>OpenSIPSB2BUA Ngrep <a href="http://pastebin.com/BGEF7YxT">http://pastebin.com/BGEF7YxT</a></div>
<div>OpenSIPSProxy Ngrep <a href="http://pastebin.com/hfhezZMp">http://pastebin.com/hfhezZMp</a></div>
<div> </div>
<div>It looks like the OpenSIPS B2BUA sends the OpenSIPS proxy a 183 message and then 4 200 OK's but the OpenSIPS Proxy never replies back with an ACK.</div>
<div> </div>
<div>In the Ngreps my OpenSIPS Proxy is (<span lang="EN">173.XX.X.107) and my OpenSIPS B2BUA is (<span lang="EN">173.XX.X.88).</span></span></div>