<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>carrierroute question.</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hello.</FONT>
<BR> <FONT SIZE=2 FACE="Arial">I'm facing a problem with the carrierroute module (openser version 1.3.2). i hope that someone could help me.</FONT>
<BR> <FONT SIZE=2 FACE="Arial">I have two gateways for a particular destination. GW1and GW2 : </FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">+----+---------+-------------+--------+------+-------+---------------+----------------+----------------+--------------+</FONT>
<BR><FONT SIZE=2 FACE="Courier New">| id | carrier | scan_prefix | domain | prob | strip | rewrite_host | rewrite_prefix | rewrite_suffix | comment |</FONT>
<BR><FONT SIZE=2 FACE="Courier New">+----+---------+-------------+--------+------+-------+---------------+----------------+----------------+--------------+</FONT>
<BR><FONT SIZE=2 FACE="Courier New">| 1 | 0 | 200 | 0 | 0.3 | 0 | GW1.IP | | | op 1 | </FONT>
<BR><FONT SIZE=2 FACE="Courier New">| 2 | 0 | 200 | 0 | 0.3 | 0 | GW2.IP | | | op 2 | </FONT>
<BR><FONT SIZE=2 FACE="Courier New">| 3 | 1 | 200 | 1 | 1 | 0 | GW3.IP | | | op 3 |</FONT>
<BR><FONT SIZE=2 FACE="Courier New">+----+---------+-------------+--------+------+-------+---------------+----------------+----------------+--------------+</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> Let's say, for example, that GW1 is down (offline). Is possible via the carrierroute module try with the other gateway (GW2) before sending the call to the failure_route?.</FONT></P>
<P> <FONT SIZE=2 FACE="Arial">My configuration file is very similar to the example in the docs.</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">route[2] {</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> # send it out now; use stateful forwarding as it works reliably</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> # even for UDP2TCP</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> if (!t_relay()) {</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> sl_reply_error();</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> };</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> exit;</FONT>
<BR><FONT SIZE=2 FACE="Courier New">} </FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">route[5] {</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> # CARRIER ROUTE MODULE HANDLING.</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New"> # route calls based on hash over callid</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> # choose route domain 0 of the default carrier</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New"> if(!cr_rewrite_uri("0", "call_id")){</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> sl_send_reply("403", "Not allowed - CR");</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> } else {</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> # In case of failure, re-route the request</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> t_on_failure("2");</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> # Relay the request to the gateway</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> route(2);</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> }</FONT>
<BR><FONT SIZE=2 FACE="Courier New">}</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">failure_route[2] {</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> # In case of failure, send it to an alternative route:</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> if (t_check_status("408|5[0-9][0-9]")) {</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> #choose route domain 1 of the default carrier</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> if(!cr_rewrite_uri("1", "call_id")){</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> t_reply("403", "Not allowed");</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> } else {</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> route(2);</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> }</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> }</FONT>
<BR><FONT SIZE=2 FACE="Courier New">}</FONT>
</P>
<P> <FONT SIZE=2 FACE="Courier New">How can i address this issue?</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">Thanks,</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">Regards,</FONT>
<BR><FONT SIZE=2 FACE="Courier New">Ricardo Martinez.-</FONT>
</P>
</BODY>
</HTML>