Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
asterisk:load-balancing-and-ha [2012/03/24 09:39] – 121.54.125.194 | asterisk:load-balancing-and-ha [2012/03/26 16:13] (current) – removed spam kenny | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Asterisk Load balancing and High Availability with Kamailio (OpenSER) ====== | ||
+ | |||
+ | Kamailio coupled with Asterisk are implemented in many huge installations. | ||
+ | |||
+ | The simplest way to set up load balancing is to use the dispatcher module. | ||
+ | |||
+ | The dispatcher.list file should be set up like: | ||
+ | |||
+ | < | ||
+ | # group sip addresses of your * units | ||
+ | 1 sip: | ||
+ | 1 sip: | ||
+ | 1 sip: | ||
+ | </ | ||
+ | |||
+ | the basic kamailio.cfg should be like: | ||
+ | |||
+ | < | ||
+ | |||
+ | loadmodule(" | ||
+ | |||
+ | ... | ||
+ | |||
+ | if ( method==" | ||
+ | # dst_select( " | ||
+ | ds_select_dst(" | ||
+ | sl_send_reply(" | ||
+ | forward();# | ||
+ | exit(); | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | If you are interested in using the dispatcher to do 300 Redirect, you can do the following: | ||
+ | |||
+ | < | ||
+ | if ( method==" | ||
+ | dst_select_domain(" | ||
+ | # you can also add prefixes, if you need to send account codes | ||
+ | # like: | ||
+ | # prefix(" | ||
+ | sl_send_reply(" | ||
+ | exit; | ||
+ | } | ||
+ | </ | ||
+ | in this fashion, you can put in a very inexpensive Kamailio SIP server installation to use as a load-balancer for your * units. | ||
+ | |||
+ | |||
+ | ====SRV Records==== | ||
+ | |||
+ | Another option is to use SRV records for your asterisk server group and forward the message to the domain. | ||