<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>you can put the group of actions inside a route block and then
execute that route block from failure_route and other locations in
your config.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 05.05.22 19:50, David Villasmil
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFGRPVo+PddGVz519LUQ-9nTOhdhXj1Ec5=_um6xip78BHfYWw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hello guys,
<div><br>
</div>
<div>Is it possible to call a failure_route like a normal route?</div>
<div><br>
</div>
<div>i.e.:</div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">{</font></div>
<div><font face="monospace"> t_on_failure("myroute");</font></div>
<div><font face="monospace">}</font></div>
<div><font face="monospace">...</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">route("myroute");</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">failure_route[myroute] {</font></div>
<div><font face="monospace">...</font></div>
<div><font face="monospace">}</font></div>
<div><br>
</div>
<div>Let me explain:</div>
<div><br>
</div>
<div>I have this scenario where a DNS name may get deleted and a
dns resolution will fail. There's no pinging to that gateway
so i need to:</div>
<div><br>
</div>
<div>- skip that gateway when dispatching to the setid</div>
<div>- detect whether the domain is up and available<br>
</div>
<div><br>
</div>
<div>And failover to the next gateway.</div>
<div><br>
</div>
<div>I don't know of any other way so on the DISPATCH route, I'm
doing:</div>
<div><br>
</div>
<div><font face="monospace">route[DISPATCH] {<br>
# round robin dispatching on gateways group '1'<br>
if(!ds_select_dst("1", "4")) {<br>
send_reply("404", "No destination");<br>
exit;<br>
}<br>
xlog("L_DBG", "--- SCRIPT: going to <$ru> via
<$du>\n");<br>
if(dns_query("$du", "xyz")) {<br>
t_on_failure("RTF_DISPATCH");<br>
route(RELAY);<br>
} else {</font></div>
<div><font face="monospace"> </font><span
style="font-family:monospace">route(</span><span
style="font-family:monospace">RTF_DISPATCH</span><span
style="font-family:monospace">);</span></div>
<div><font face="monospace"> }<br>
exit;<br>
}<br>
</font></div>
<div><br>
</div>
<div>to try to resolve and if it fails, it will just go to the
failover route.</div>
<div><br>
</div>
<div><br>
</div>
<div>makes sense?</div>
<div><br>
</div>
<div><br clear="all">
<div>
<div dir="ltr" data-smartmail="gmail_signature">
<div dir="ltr">
<div>Regards,</div>
<div><br>
</div>
David Villasmil
<div>email: <a
href="mailto:david.villasmil.work@gmail.com"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">david.villasmil.work@gmail.com</a></div>
<div>phone: +34669448337</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
* <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
* <a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
* <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
</body>
</html>