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
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
On Fri, 08 Apr 2011 13:12:15 +0200 Daniel-Constantin Mierla miconda@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.
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; } }
}
Hello,
On 4/8/11 4:28 PM, Sören Berger wrote:
On Fri, 08 Apr 2011 13:12:15 +0200 Daniel-Constantin Mierlamiconda@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; } }
}