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

Daniel-Constantin Mierla miconda at gmail.com
Fri Apr 8 13:12:15 CEST 2011


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

On 4/8/11 12:20 AM, Sören Berger wrote:
> Hi all,
> I currently setup a HA/LB conference. I currently have 1 SER and 2 asterisk conference servers. The goal is to distribute the conferences based on the room number on different server. I use ubuntu 10.04 LTS and the packages from http://deb.kamailio.org/kamailio (kamailio_3.1.2+lucid1_amd64.deb)
>
> During the implementation I run into trouble with the "8 - first destination" policy which choose not my second server in case of a failure.
>
> The dial in is eg. 330 with round robin to any of my asterisk servers. There they check the room number and append it to the dial number. When somebody calls 330 and enter the room number 12345 the asterisk route it back to kamilio with 33012345
>
> route[ASTERISK_CONFERENCE_AUTH] {
>    if ($rU=~"(33[0-4]$)") {
>      if ( method=="INVITE" ) {
>        ds_select_dst("1","4");
>        forward();
>        exit();
>      }
>    }
> }
>
> When the number 33012345 arrives kamailio decides on which server the conference takes place. For redundancy reasons I use the dispatcher again. If one of the server fails, another will take over the conferences. For the scenario with 2 servers this is trivial. There I also could do it another way. But when I add more conference servers it looks like the best solution to me. Here are my rules for the servers.
> In this case I used the policy "8" which should use the first destination according to the dispatcher.list file. So if I add more servers I can decide about a order for the fail over servers.
>
> route [ASTERISK_CONFERENCE] {
>    if ($rU=~"(33[0-4][0-4][0-9][0-9][0-9][0-9]$)") {
>      if ( method=="INVITE" ) {
>        ds_select_dst("2","8");
>        forward();
>        exit();
>      }
>    }
>    if ($rU=~"(33[0-4][5-9][0-9][0-9][0-9][0-9]$)") {
>      if ( method=="INVITE" ) {
>        ds_select_dst("3","8");
>        forward();
>        exit();
>      }
>    }
> }
>
>
> distpatcher.list
>
> # This group will be used with round robin for getting the room number
> 1 sip:172.16.1.88:5060 0 1
> 1 sip:172.16.1.89:5060 0 2
>
> # failover schedule for ast-conf1
> 2 sip:172.16.1.88:5060 0 1
> 2 sip:172.16.1.89:5060 0 2
>
> # failover schedule for ast-conf2
> 3 sip:172.16.1.89:5060 0 1
> 3 sip:172.16.1.88:5060 0 2
>
> My current problem is, that the policy "8" don't select the other server in case of an failure. I simply blocks and the clients retransmit the request to kamailio.I am currently going crazy with that. :)
> When I change the policy to round robin (replacing "8" with "4"), everything is working fine. But this an option because in the normal case all calls to a conference room should be placed on the same server. Could this be a bug or something like that?
>
> Maybe not the right list here, but I didn't find anything about meetme implementation with more that one server or a HA/LB solution for that and was really wondering about that. Somebody maybe heart from such a implementation?
>
> Kind Regards,
> Sören Berger
>
>
>
>

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




More information about the sr-users mailing list