[Serusers] LCR failure syntax

Matt Schulte mschulte at netlogic.net
Wed Apr 13 05:51:56 CEST 2005


Ok, I've checked over my config and am going bananas. I cannot get a
"failover" scenario working. The first LCR load_gw is fine however
whenever a call fails (in this instance I am generating a 404) it never
sees the second priority. Thoughts?

I Dial 636561XXXX
I checked my logs, everything goes through just fine, get the 404 (per
failover test), it gets caught by the failure if statement and spits out
no more gateways..

lcr table (accounting for e164 and non)
+------------+----------+--------+----------+
| prefix     | from_uri | grp_id | priority |
+------------+----------+--------+----------+
| +1636      | %        |      2 |        1 |
| +1636      | %        |      1 |        2 |
| 636        | %        |      2 |        1 |
| 636        | %        |      1 |        2 |
+------------+----------+--------+----------+

route[99] {

t_on_failure("2");
if(!load_gws())
                {
                sl_send_reply("500", "Internal server error, unable to
load gateways");
                break;
                }
        log (1, "Running next_gw\n");
        if(!next_gw())
                {
                sl_send_reply("503", "Service not available, no gateways
found");
                xlog("L_INFO", "<%ru> <%br>\n");
                break;
                }
        xlog("L_INFO", "Time %Tf RURI <%ru> \n");

		t_relay();
		break;
}

failure_route[2]
{
   log(1, "Hit failure route 2\n");
   if(method == "INVITE" && t_check_status("408|500|503|480|400|404"))
   {
        xlog("L_INFO", "NOTICE: Hit failure 2 and error status code\n");
     if (!next_gw())
     {
         xlog("L_INFO", "ERROR: No more gateways for LCR failover
dropping call\n");
       t_reply("503", "Service not available, no more gateways");
       break;
     }
     t_on_failure("2");
     # ...
     t_relay();
   }
}
-----Original Message-----
From: Andres [mailto:andres at telesip.net] 
Sent: Thursday, April 07, 2005 5:11 PM
To: Matt Schulte
Cc: serusers at lists.iptel.org
Subject: Re: [Serusers] LCR failure syntax





Matt Schulte wrote:

>Could anyone post a working example of the lcr next_gw syntax for 
>failure routes? Thanks.
>
>	Matt
>
>  
>
something like this....

route[8] {
   if (!load_gws()) {
      sl_send_reply("500", "Server Internal Error - Cannot load
gateways");
      break;
   };
   if (!next_gw()) {
      sl_send_reply("503", "Service not available - No more gateways");
      break;
    };
         t_on_failure("4");
         if (!t_relay()) {
         sl_reply_error();
         };
}

failure_route[4] {
         if (!next_gw()) {
                 t_reply("503", "Service not available - No more
gateways");
                 break;
         };
                  t_relay();
                  break;
}


>_______________________________________________
>Serusers mailing list
>serusers at lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
>
>
>  
>

-- 
Andres
Network Admin
http://www.telesip.net





More information about the sr-users mailing list