Question : OpenSips in Asterisk

Hi,

Can you help me to implement Load Balancing with OpenSips in Asterisk, i have the OpenSips already installed (attached code)

but i don't have a single clue how to implement load balancing in my asterisk server for external cell phone calls...

I have 2 Telular devices and i want to balance their loads.

can you please guide me through the process to implement my load balancing.

Thanks in advanced

Regards

JG
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
[trixbox1.localdomain opensips-cp]# opensipsctl start 
INFO: Starting OpenSIPS :
root      4646     1  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4648  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4649  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4650  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4651  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4652  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4653  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4654  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4655  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4656  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4657  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4658  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4659  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4660  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4661  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4662  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4663  4646  0 14:05 ?        00:00:00 /usr/local/sbin/opensips -P /var/run/opensips.pid
root      4904  4002  0 16:10 pts/0    00:00:00 /bin/bash /usr/local/sbin/opensipsctl start
root      4920  4904  0 16:10 pts/0    00:00:00 /bin/egrep opensips
-rw-r--r-- 1 root root 5 Nov 10 14:05 /var/run/opensips.pid
INFO: PID file exists (/var/run/opensips.pid)! OpenSIPS already running?

Answer : OpenSips in Asterisk

Using Opensips to load balance across two ZAP channels seems like a sledgehammer to crack a tiny nut in my opinion. However, if you really want to do it that way then you could do it by setting up two different host names in DNS, both of which resolve to the IP address of the Asterisk server. Suppose the two host names were zap37.myasterisk.local and zap38.myasterisk.local. In sip.conf you would then add two lines like this:
domain=zap37.myasterisk.local,myzap37
domain=zap38.myasterisk.local,myzap38

In extensions.conf you would add two contexts like this:
[myzap37]
exten => _X.,1,Dial(ZAP/37/${EXTEN},30)

[myzap38]
exten => _X.,1,Dial(ZAP/38/${EXTEN},30)

If you don't have your own internal DNS server, then you could use entries in /etc/hosts on the opensips server instead.

Personally, I wouldn't bother with opensips and would just use a global variable in the dial plan of Asterisk to send calls alternately to each channel. Or simpler, just put both channels in a group and send calls to the group so Asterisk will just pick a free channel from those that are in the group.
http://www.voip-info.org/wiki/view/Channels+and+Groups
Random Solutions  
 
programming4us programming4us