<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>Hi Everyone,<br></div><div><br></div><div>Is it possible to failover to next carrier (instead next gateway) while using drouting? <br></div><div><br></div><div><br></div><div>I got the below to work; however currently, use_next_gw gets the next gateway in the list, so <br></div><div>if gwlist= #0,#3 <br></div><div><br></div><div>and one of the carriers has multiple gateway IPs, the retry happens many times to the same carrier: <br></div><div><br></div><div><br></div><div><div>route[droute] {<br></div><div><br></div><div> xlog("DRoute GATEWAY: source:$si - $fU -> $rU\n");<br></div><div> if (!do_routing(0,"F")) {<br></div><div> xlog("DRoute GATEWAY: Failed. source:$si -$fU -> $rU\n");<br></div><div> send_reply(500, "No Gateway to Route found");<br></div><div> exit;<br></div><div> }<br></div><div> route(relay);<br></div><div> exit;<br></div><div><br></div><div> }<br></div><div><br></div></div><div>route[relay] {<br></div><div><br></div><div> if (is_method("INVITE")) {<br></div><div> t_on_failure("missed_call");<br></div><div> }<br></div><div><br></div><div> if (!t_relay()) {<br></div><div> if (use_next_gw()) {<br></div><div> xlog("L_INFO","Next Gateway: From=$fu, To=$tu,RU=$ru, CI=$ci IP=$si\n");<br></div><div> t_on_failure("missed_call");<br></div><div> route(relay);<br></div><div> exit;<br></div><div> }<br></div><div> else {<br></div><div> send_reply(503, "Service not available, no more gws");<br></div><div> exit;<br></div><div> }<br></div><div> };<br></div><div> exit;<br></div><div>}<br></div><div><br></div><div><br></div><div>failure_route[missed_call] {<br></div><div><br></div><div> #if (use_next_gw(, , $var(carrier_attrs))) {<br></div><div> if (use_next_gw(, $avp(gw_id),$avp(carrier_id))) {<br></div><div> xlog("MissedCall--Next Gateway: From=$fu, To=$tu,RU=$ru, CI=$ci IP=$si\n");<br></div><div> xlog("Carrier attributes of current gateway: $avp(gw_id). carrier: $avp(carrier_id)\n");<br></div><div><br></div><div> t_on_failure("missed_call");<br></div><div> route(relay);<br></div><div> exit;<br></div><div> }<br></div><div> else {<br></div><div> send_reply(503, "Service not available, no more gws");<br></div><div> exit;<br></div><div> }<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>Thank you.<br></div><div><br></div><div><br></div><div><br></div></div><br></body></html>