[OpenSIPS-Users] Record congestion/failure rates per load balanced provider

Sammy Govind govoiper at gmail.com
Wed Feb 22 06:38:35 CET 2012


Anyways yes you can call failure route while using the load_balancer too.
just use

t_on_failure("record-stats");
before calling the
if(!load_balancer("1","10"))

what it should do is send the call to an active destination and if that
active destination returns negative stats you can do something about those
in failure route.

Also her's some piece of code I collected from searching in 10 minutes.

# SELECT AN ACTIVE DESTINATION FROM LOAD_BALANCER ---RESULTSET GOES TO $du
if (!load_balance("1","mygws","0")) {
sl_send_reply("480","Temporarily Unavailable: service full");
exit;
         }
    ......
  .......
      # SEND THE CALL TO $du
if (!t_relay("0x09")) {
xlog("L_ERR", "Carrier termination failed with status code $rs: $rr using
outbound carrier: '$du' \n");
sl_reply_error();
};

Regards,
Sammy

On Wed, Feb 22, 2012 at 10:27 AM, Matt Riddell <lists at venturevoip.com>wrote:

> On 22/02/12 6:22 PM, Sammy Govind wrote:
>
>>    I can take care of the logic of changing the DB and resizing the
>>    load balancing rules but don't see how I can log the
>>    failures/failure codes for
>>
>>
>> Yes why not, give it a try. If the carrier is already down in
>> load-balancer list then it won't even try the itsp but if its available
>> and return congestion you can definitely lock the response.
>>
>> hmmm..give it a try first. Why don';t you try the LCR module for this !
>> usually load_balancer is used for distributed load to internal servers,
>> but you are using inverse..
>> see this: http://www.opensips.org/html/**docs/modules/1.7.x/drouting.**
>> html <http://www.opensips.org/html/docs/modules/1.7.x/drouting.html>
>>
>
> Problem with LCR is that we're needing to go to a max number of
> simultaneous channels to a provider - requiring dialog support rather than
> just dispatching.
>
>
> --
> Cheers,
>
> Matt Riddell
> ______________________________**_________________
>
> http://www.venturevoip.com/**news.php<http://www.venturevoip.com/news.php>(Daily Asterisk News)
> http://www.venturevoip.com/**pabx_on_disk.php<http://www.venturevoip.com/pabx_on_disk.php>(PABX on a Disk)
> http://www.venturevoip.com/**exchange.php<http://www.venturevoip.com/exchange.php>(Full ITSP Solution)
> http://www.venturevoip.com/cc.**php <http://www.venturevoip.com/cc.php>(Call Centre Solutions)
>
> ______________________________**_________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-**bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120222/c786814c/attachment-0001.htm>


More information about the Users mailing list