[SR-Users] Problems with dispatcher policy in HA/LB kamailio/asterisk environment

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 11 12:59:33 CEST 2011


Hello,

On 4/8/11 4:28 PM, Sören Berger wrote:
> On Fri, 08 Apr 2011 13:12:15 +0200
> Daniel-Constantin Mierla<miconda at gmail.com>  wrote:
>
>> Hello,
>>
>> you use forward() which is stateless forwarding, which means the LB
>> kamailio doesn't detect when the selected destination is down in order
>> to re-route to alternative. Anyhow, you should do re-routing in the
>> config by using failure_route[x] block.
>>
>> See the readme of dispatcher module for devel version, it has improved
>> example, showing how to do failure routing:
>>
>> http://kamailio.org/docs/modules/devel/modules_k/dispatcher.html#id2866599
>>
>> Cheers,
>> Daniel
>>
> Ok, I now completely understood the different. I rewrote my script based on your comments and the example and it now works perfectly. I fought a little with the fail over time, but modparam("tm", "fr_timer", 2000) solved this issue. For completeness I attached the working configuration to the mail.
>
> Thanks for your support.
Thanks for sharing the config file updates, maybe you find time to put a 
short description of what you tried to accomplish and the config file 
somewhere in the wiki pages, to the tutorials or examples sections:
http://www.kamailio.org/dokuwiki/doku.php

It should be easier to find by people than searching the archive.

Cheers,
Daniel


> Best Regards,
> Sören
>
>
>
>
> route[ASTERISK_CONFERENCE_AUTH] {
>          # Conference bridges
>          if ($rU=~"(33[0-4]$)") {
>                  if (!ds_select_dst("1", "4")) {
>                          sl_send_reply("500", "No destination available");
>                          exit;
>                  }
>          }
> }
>
> route [ASTERISK_CONFERENCE] {
>
>          if ($rU=~"33[0-4][0-4][0-9][0-9][0-9][0-9]$") {
>                  if (!ds_select_dst("2", "8")) {
>                          sl_send_reply("500", "No destination available");
>                          exit;
>                  }
>          }
>          if ($rU=~"33[0-4][5-9][0-9][0-9][0-9][0-9]$") {
>                  if (!ds_select_dst("3", "8")) {
>                          sl_send_reply("500", "No destination available");
>                          exit;
>                  }
>          }
> }
>
> failure_route[DISPATCH] {
>          if (t_is_canceled()) {
>                  exit;
>          }
>          if (t_branch_timeout()&&  !t_branch_replied()) {
>                  xlog("L_NOTICE", "Entering failure route\n");
>                  if(ds_next_dst()) {
>                          t_on_failure("DISPATCH");
>                          t_relay();
>                          exit;
>                  }
>          }
>
> }

-- 
Daniel-Constantin Mierla
http://www.asipto.com




More information about the sr-users mailing list