Page 1 of 1

How to load balance inbound calls to multple Asterisk server

PostPosted: Tue Aug 07, 2018 12:16 pm
by santhuarnold
Hi.

Cluster environment. 1 database server, 3 Asterisk servers and Single Sip line.
how to share or load balance the incoming calls to all 3 asterisk servers.



Vicibox-6.0.4: VERSION: 2.14-679a : BUILD: 180618-2300

Re: How to load balance inbound calls to multple Asterisk se

PostPosted: Tue Aug 07, 2018 2:36 pm
by dgroth02
To clarify - do you mean sort the load so that calls come in from the carrier and are spread across agents on different servers or just have the calls come in to different servers?

Typically inbound call routing by IP address is handled on the carrier side.

Re: How to load balance inbound calls to multple Asterisk se

PostPosted: Tue Aug 07, 2018 4:25 pm
by mflorell
On our VICIhost platform we use OpenSIPs servers to do this, so we can distribute inbound calls to all available Asterisk servers on a specific client's cluster. We've also helped several premise clients set up systems like this.

Re: How to load balance inbound calls to multple Asterisk se

PostPosted: Thu Aug 09, 2018 6:08 am
by santhuarnold
without OpenSIPs cant we achieve this?
By selecting server Ip to all server(0.0.0.0) in carrier setting?

Re: How to load balance inbound calls to multple Asterisk se

PostPosted: Thu Aug 09, 2018 8:14 am
by mflorell
It depends on what your carrier is capable of. Most inbound carriers are not able to load balance like that, but some are able to.

Re: How to load balance inbound calls to multple Asterisk se

PostPosted: Fri Aug 10, 2018 5:13 am
by santhuarnold
only solution, need to use OpenSip kind of sip load balance? or anything in asterisk or vicidial level.

Re: How to load balance inbound calls to multple Asterisk se

PostPosted: Thu Aug 16, 2018 9:24 pm
by richmac2018
You can use this code in your asterisk gateway and just add callerid variable on that code.

exten => _9X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9X.,2,NoOp(LB IS ${lb_trunk})
exten => _9X.,3,GotoIf($[${lb_trunk} != 0]?10)
exten => _9X.,4,Set(GLOBAL(lb_trunk)=1)
exten => _9X.,5,Dial(${trunk_1}/${EXTEN:1},,tTor)

exten => _9X.,10,GotoIf($[${lb_trunk} != 1]?20)
exten => _9X.,11,Set(GLOBAL(lb_trunk)=2)
exten => _9X.,12,Dial(${trunk_2}/${EXTEN:1},,tTor)

exten => _9X.,20,GotoIf($[${lb_trunk} != 2]?30)
exten => _9X.,21,Set(GLOBAL(lb_trunk)=3)
exten => _9X.,22,Dial(${trunk_3}/${EXTEN:1},,tTor)

exten => _9X.,30,Set(GLOBAL(lb_trunk)=0)
exten => _9X.,31,Goto(1)

Re: How to load balance inbound calls to multple Asterisk se

PostPosted: Tue Apr 02, 2019 11:16 am
by Kumba
That last line should be changed to:

exten => _9X.,31,Goto(2)


You've already logged the call in the AGI and re-doing that will not help in any way, just delay processing as the AGI is called twice in a row hitting the database twice and create unnecessary load.