Hello. I'm facing a problem with the carrierroute module (openser version 1.3.2). i hope that someone could help me. I have two gateways for a particular destination. GW1and GW2 :
+----+---------+-------------+--------+------+-------+---------------+----------------+----------------+--------------+ | id | carrier | scan_prefix | domain | prob | strip | rewrite_host | rewrite_prefix | rewrite_suffix | comment | +----+---------+-------------+--------+------+-------+---------------+----------------+----------------+--------------+ | 1 | 0 | 200 | 0 | 0.3 | 0 | GW1.IP | | | op 1 | | 2 | 0 | 200 | 0 | 0.3 | 0 | GW2.IP | | | op 2 | | 3 | 1 | 200 | 1 | 1 | 0 | GW3.IP | | | op 3 | +----+---------+-------------+--------+------+-------+---------------+----------------+----------------+--------------+
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?. My configuration file is very similar to the example in the docs.
route[2] { # send it out now; use stateful forwarding as it works reliably # even for UDP2TCP if (!t_relay()) { sl_reply_error(); }; exit; }
route[5] { # CARRIER ROUTE MODULE HANDLING.
# route calls based on hash over callid # choose route domain 0 of the default carrier
if(!cr_rewrite_uri("0", "call_id")){ sl_send_reply("403", "Not allowed - CR"); } else { # In case of failure, re-route the request t_on_failure("2"); # Relay the request to the gateway route(2); } }
failure_route[2] { # In case of failure, send it to an alternative route: if (t_check_status("408|5[0-9][0-9]")) { #choose route domain 1 of the default carrier if(!cr_rewrite_uri("1", "call_id")){ t_reply("403", "Not allowed"); } else { route(2); } } }
How can i address this issue?
Thanks,
Regards, Ricardo Martinez.-
On Tuesday 24 June 2008, Ricardo Martinez wrote:
I'm facing a problem with the carrierroute module (openser version 1.3.2). i hope that someone could help me. I have two gateways for a particular destination. GW1and GW2 :
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?. [..]
Hi Ricardo,
this is not possible with the 1.3 carrierroute. You need to implement the failover logic manually in the script. In the 1.4.0 release the carrierroute module were heavily reworked. With this version it will be possible to have only one failure_route, and lookup the appropriate next GW from the routing trees. Take a look at the development docs (example 1.4.4) for this module.
Cheers,
Henning