Hi,
I searched around the web to load balance asterisk servers and found Kamailio for possible solution. Let's say I have two identical asterisk servers with same dialplan and configuration and I want both servers look like they have same IP address from clients. Based on my understanding, we need 1 Kamailio as load balancer and 2 Asterisk servers as the real servers. Let's say the setup is :
Kamailio load balancer 192.168.2.1 Asterisk Server #1 192.168.2.2 Asterisk Server #2 192.168.2.3
My question is, X-Lite softphone Configuration should be set to domain 192.168.2.1, right?
I also want to know the step by step configuration to set kamailio as load balancer. I have not used Kamailio before. However after searching the documentation, the step (based on my understanding) is somewhat like this :
1. Install Kamailio. I will use the step by step here : http://kamailio.org/dokuwiki/doku.php/install:kamailio-1.5.x-from-svn
2. Then, using dipatcher module, I will configure it using this guide here : http://kamailio.org/dokuwiki/doku.php/asterisk:load-balancing-and-ha Then modify the dispatcher.list file to match the IP address of my asterisk servers :
*1 sip:192.168.2.2:5060 1 sip:192.168.2.3:5060*
Am I missing some steps? Do I also need to configure dialplan or any other file at Kamailio load balancer? Or those two steps basically done it all for simple load balancing configuration? Thanks for your responses.
Best Regard, Kurt Weasel.
Hi Kurt, Use the LCR and dispatcher modules in Kamailio
Thanks &Regards Ravi Prakash Sunkara VoIP Architect & JAVA-SIP Developer +91-9999882776
Winston Churchillhttp://www.brainyquote.com/quotes/authors/w/winston_churchill.html - "The best argument against democracy is a five-minute conversation with the average voter."
2009/4/27 Kurt Weasel kurt.weasel@gmail.com
Hi,
I searched around the web to load balance asterisk servers and found Kamailio for possible solution. Let's say I have two identical asterisk servers with same dialplan and configuration and I want both servers look like they have same IP address from clients. Based on my understanding, we need 1 Kamailio as load balancer and 2 Asterisk servers as the real servers. Let's say the setup is :
Kamailio load balancer 192.168.2.1 Asterisk Server #1 192.168.2.2 Asterisk Server #2 192.168.2.3
My question is, X-Lite softphone Configuration should be set to domain 192.168.2.1, right?
I also want to know the step by step configuration to set kamailio as load balancer. I have not used Kamailio before. However after searching the documentation, the step (based on my understanding) is somewhat like this :
- Install Kamailio. I will use the step by step here :
http://kamailio.org/dokuwiki/doku.php/install:kamailio-1.5.x-from-svn
- Then, using dipatcher module, I will configure it using this guide here
: http://kamailio.org/dokuwiki/doku.php/asterisk:load-balancing-and-ha Then modify the dispatcher.list file to match the IP address of my asterisk servers :
*1 sip:192.168.2.2:5060 1 sip:192.168.2.3:5060*
Am I missing some steps? Do I also need to configure dialplan or any other file at Kamailio load balancer? Or those two steps basically done it all for simple load balancing configuration? Thanks for your responses.
Best Regard, Kurt Weasel.
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
Hello,
On 04/27/2009 07:10 AM, Kurt Weasel wrote:
Hi,
I searched around the web to load balance asterisk servers and found Kamailio for possible solution. Let's say I have two identical asterisk servers with same dialplan and configuration and I want both servers look like they have same IP address from clients. Based on my understanding, we need 1 Kamailio as load balancer and 2 Asterisk servers as the real servers. Let's say the setup is :
Kamailio load balancer 192.168.2.1 Asterisk Server #1 192.168.2.2 Asterisk Server #2 192.168.2.3
My question is, X-Lite softphone Configuration should be set to domain 192.168.2.1, right?
I also want to know the step by step configuration to set kamailio as load balancer. I have not used Kamailio before. However after searching the documentation, the step (based on my understanding) is somewhat like this :
- Install Kamailio. I will use the step by step here :
http://kamailio.org/dokuwiki/doku.php/install:kamailio-1.5.x-from-svn
- Then, using dipatcher module, I will configure it using this guide
here : http://kamailio.org/dokuwiki/doku.php/asterisk:load-balancing-and-ha Then modify the dispatcher.list file to match the IP address of my asterisk servers :
/1 sip:192.168.2.2:5060 http://192.168.2.2:5060 1 sip:192.168.2.3:5060 http://192.168.2.3:5060/
Am I missing some steps? Do I also need to configure dialplan or any other file at Kamailio load balancer? Or those two steps basically done it all for simple load balancing configuration? Thanks for your responses.
these steps are ok if you do not deal with NAT. If yes, then things get a bit more complex, you need PATH support on load balancer, but AFAIK, Asterisk does not support it -- maybe I am wrong.
Cheers, Daniel
2009/4/27 Daniel-Constantin Mierla miconda@gmail.com:
these steps are ok if you do not deal with NAT. If yes, then things get a bit more complex, you need PATH support on load balancer, but AFAIK, Asterisk does not support it -- maybe I am wrong.
You are not wrong :) In fact Asterisk doens't know what a proxy it, it just expects phones conencted to it XD
On 04/27/2009 03:13 PM, Iñaki Baz Castillo wrote:
2009/4/27 Daniel-Constantin Mierla miconda@gmail.com:
these steps are ok if you do not deal with NAT. If yes, then things get a bit more complex, you need PATH support on load balancer, but AFAIK, Asterisk does not support it -- maybe I am wrong.
You are not wrong :) In fact Asterisk doens't know what a proxy it, it just expects phones conencted to it XD
more and more only peer-to-peer ... probably we have to change our project's goals as well :-).
It is surprisingly how many gateways and other devices are out there without proper sip v2 implementation -- just facing an issue with some vendor and Record-Route -- for them the contact is the master.
Cheers, Daniel
2009/4/27 Daniel-Constantin Mierla miconda@gmail.com:
It is surprisingly how many gateways and other devices are out there without proper sip v2 implementation -- just facing an issue with some vendor and Record-Route -- for them the contact is the master.
A carrier said me that the Contact I sent to it didn't contain the same IP as my proxy, and that is not legal XDD
Hi, sorry forgot to cc before. I have more questions regarding my load balancing setup.
1. Since the dial plan is configured exactly on Asterisk (at etc/asterisk/sip.conf and /etc/asterisk/extension.conf), do we need to enable MySQL for Kamailio installation? Or the default installation configuration will do (without additional dialplan or MySQL setting)? My idea is only using Kamailio as pure load balancer so we hope to do this as simple as possible without degrading the function.
2. I assume using Kamailio dispatcher module will forward some of the users to asterik server 1 and some of them to asterisk server 2. Then if user A is registered with Asterisk server 1 and user B is registered with Asterisk server 2, can user A call user B? Without Kamailio, the answer is no since they are in different Asterisk server. With Kamailio, I am expecting both user A and B can call each other although they are registered with different servers. Is my configuration enough to achieve this function? Or do we need some additional setup for this?
Thanks again.
Best Regards, Kurt
On Mon, Apr 27, 2009 at 8:02 PM, Daniel-Constantin Mierla <miconda@gmail.com
wrote:
Hello,
On 04/27/2009 07:10 AM, Kurt Weasel wrote:
Hi,
I searched around the web to load balance asterisk servers and found Kamailio for possible solution. Let's say I have two identical asterisk servers with same dialplan and configuration and I want both servers look like they have same IP address from clients. Based on my understanding, we need 1 Kamailio as load balancer and 2 Asterisk servers as the real servers. Let's say the setup is :
Kamailio load balancer 192.168.2.1 Asterisk Server #1 192.168.2.2 Asterisk Server #2 192.168.2.3
My question is, X-Lite softphone Configuration should be set to domain 192.168.2.1, right?
I also want to know the step by step configuration to set kamailio as load balancer. I have not used Kamailio before. However after searching the documentation, the step (based on my understanding) is somewhat like this :
- Install Kamailio. I will use the step by step here :
http://kamailio.org/dokuwiki/doku.php/install:kamailio-1.5.x-from-svn
- Then, using dipatcher module, I will configure it using this guide here
: http://kamailio.org/dokuwiki/doku.php/asterisk:load-balancing-and-ha Then modify the dispatcher.list file to match the IP address of my asterisk servers :
/1 sip:192.168.2.2:5060 http://192.168.2.2:5060 1 sip:192.168.2.3:5060 http://192.168.2.3:5060/
Am I missing some steps? Do I also need to configure dialplan or any other file at Kamailio load balancer? Or those two steps basically done it all for simple load balancing configuration? Thanks for your responses.
these steps are ok if you do not deal with NAT. If yes, then things get a bit more complex, you need PATH support on load balancer, but AFAIK, Asterisk does not support it -- maybe I am wrong.
Cheers, Daniel
-- Daniel-Constantin Mierla http://www.asipto.com/
Hello,
On 04/27/2009 05:17 PM, Kurt Weasel wrote:
Hi, sorry forgot to cc before. I have more questions regarding my load balancing setup.
- Since the dial plan is configured exactly on Asterisk (at
etc/asterisk/sip.conf and /etc/asterisk/extension.conf), do we need to enable MySQL for Kamailio installation?
If you store the load balancing list in database, then you need the database storage. Alternative is to use plain text file.
Or the default installation configuration will do (without additional dialplan or MySQL setting)? My idea is only using Kamailio as pure load balancer so we hope to do this as simple as possible without degrading the function.
- I assume using Kamailio dispatcher module will forward some of the
users to asterik server 1 and some of them to asterisk server 2. Then if user A is registered with Asterisk server 1 and user B is registered with Asterisk server 2, can user A call user B? Without Kamailio, the answer is no since they are in different Asterisk server. With Kamailio, I am expecting both user A and B can call each other although they are registered with different servers. Is my configuration enough to achieve this function? Or do we need some additional setup for this?
You can achieve this with proper routing logic in the config. You need to have a rule for partitioning the users and then you know where each user is registered and direct the calls for him to the right asterisk.
Cheers, Daniel
Thanks again.
Best Regards, Kurt
On Mon, Apr 27, 2009 at 8:02 PM, Daniel-Constantin Mierla <miconda@gmail.com mailto:miconda@gmail.com> wrote:
Hello, On 04/27/2009 07:10 AM, Kurt Weasel wrote: Hi, I searched around the web to load balance asterisk servers and found Kamailio for possible solution. Let's say I have two identical asterisk servers with same dialplan and configuration and I want both servers look like they have same IP address from clients. Based on my understanding, we need 1 Kamailio as load balancer and 2 Asterisk servers as the real servers. Let's say the setup is : Kamailio load balancer 192.168.2.1 Asterisk Server #1 192.168.2.2 Asterisk Server #2 192.168.2.3 My question is, X-Lite softphone Configuration should be set to domain 192.168.2.1, right? I also want to know the step by step configuration to set kamailio as load balancer. I have not used Kamailio before. However after searching the documentation, the step (based on my understanding) is somewhat like this : 1. Install Kamailio. I will use the step by step here : http://kamailio.org/dokuwiki/doku.php/install:kamailio-1.5.x-from-svn 2. Then, using dipatcher module, I will configure it using this guide here : http://kamailio.org/dokuwiki/doku.php/asterisk:load-balancing-and-ha Then modify the dispatcher.list file to match the IP address of my asterisk servers : /1 sip:192.168.2.2:5060 <http://192.168.2.2:5060> <http://192.168.2.2:5060> 1 sip:192.168.2.3:5060 <http://192.168.2.3:5060> <http://192.168.2.3:5060>/ Am I missing some steps? Do I also need to configure dialplan or any other file at Kamailio load balancer? Or those two steps basically done it all for simple load balancing configuration? Thanks for your responses. these steps are ok if you do not deal with NAT. If yes, then things get a bit more complex, you need PATH support on load balancer, but AFAIK, Asterisk does not support it -- maybe I am wrong. Cheers, Daniel -- Daniel-Constantin Mierla http://www.asipto.com/
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
Hello, I'm interested with loadbalancer with kamailio in this thread. Because i follow the step on this thread i still can't dispacth a call from sip phone where i register on kamailio server. here my setup servers: Kamailio load balancer 192.168.0.208 Asterisk Server #1 192.168.0.253 Asterisk Server #2 192.168.0.209
on softphone i register on 192.168.0.208. I confused on step two on this thread. 2. Then, using dipatcher module, I will configure it using this guide here : http://kamailio.org/dokuwiki/doku.php/asterisk:load-balancing-and-ha Then modify the dispatcher.list file to match the IP address of my asterisk servers. because the original kamailio.cfg doesn't content this : if ( method=="INVITE" ) { # dst_select( "GROUP", "HASH METHOD") ds_select_dst("1","4"); sl_send_reply("100","Trying"); forward();#uri:host, uri:port); exit(); }
or this if ( method=="INVITE" ) { dst_select_domain("1","4"); # you can also add prefixes, if you need to send account codes # like: # prefix("123456"); sl_send_reply("300","Redirect"); exit; }
I'm sori because i'm beginner. :d here is my config file for kamailio.cfg :
loadmodule "dispatcher.so" # account only INVITEs if (is_method("INVITE")) { #setflag(1); # do accounting ds_select_domain("1","4"); # you can also add prefixes, if you need to send account codes # like: # prefix("123456"); sl_send_reply("100","Trying"); forward(); exit; }
this my dispacther.list : # sip server 1 sip:192.168.0.209:5060 1 sip:192.168.0.253:5060
Is I miss some step on this thread? May I know the configuration file of kamailio.cfg and the dispacther.list can you share me a high availability loadbalance sip. Thanks for your help.
Best regards,
Irvan Kurniawan Indonesia
Kurt Weasel wrote:
Hi,
I searched around the web to load balance asterisk servers and found Kamailio for possible solution. Let's say I have two identical asterisk servers with same dialplan and configuration and I want both servers look like they have same IP address from clients. Based on my understanding, we need 1 Kamailio as load balancer and 2 Asterisk servers as the real servers. Let's say the setup is :
Kamailio load balancer 192.168.2.1 Asterisk Server #1 192.168.2.2 Asterisk Server #2 192.168.2.3
My question is, X-Lite softphone Configuration should be set to domain 192.168.2.1, right?
I also want to know the step by step configuration to set kamailio as load balancer. I have not used Kamailio before. However after searching the documentation, the step (based on my understanding) is somewhat like this :
- Install Kamailio. I will use the step by step here :
http://kamailio.org/dokuwiki/doku.php/install:kamailio-1.5.x-from-svn
- Then, using dipatcher module, I will configure it using this guide here
: http://kamailio.org/dokuwiki/doku.php/asterisk:load-balancing-and-ha Then modify the dispatcher.list file to match the IP address of my asterisk servers :
*1 sip:192.168.2.2:5060 1 sip:192.168.2.3:5060*
Am I missing some steps? Do I also need to configure dialplan or any other file at Kamailio load balancer? Or those two steps basically done it all for simple load balancing configuration? Thanks for your responses.
Best Regard, Kurt Weasel.
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users