Load balance 5 inbound Asterisk servers


I am trying to set up a call center with 5 Asterisk server machines which can take the inbound calls and route to the call center agents.

My understanding is that each Asterisk server box needs to have some Digium TDM cards which can take inbound calls from PSTN. But how do I connect or wire the land lines to these TDM cards on diffefrent Asterisk server. I mean, given M number of PSTN lines and N number of Asterisk servers, how can I distribute M lines among N Asterisk server boxes.

Can someone point me to a good document on the net explaining how I can stack up multiple Asterisk servers for call center.

Many many thanks - jamiec

I cannot be to specific in my reply, as I new to Asterisk, but in a standard phone senario, you would have a T1 (or multiple T1s) running into a channel bank which would go out to your Asterisk servers. Then you would have an IAX channel running between them to get everything communicating on the same page.

How do you plan to implement a common SIP contacts database between your 5 asterisk servers?

Sounds pretty ambitious project you have yourself into…
So…assuming this is a new center?
How many agents?
Whats the number of calls you want to have in queue during peak call hours?

Ideally, with Asterisk, you populate your call center with a bunch of VoIP phones…thats the easiest, doesn’t require an abnormal amount of specialized equipment. Phones plug into a LAN network and talk to asterisk via IP.

Assuming that perhaps you want to use regular plain old analog phones (nothing too fancy) then you have a couple of options. You can use a channel bank which (generally speaking) is designed to handle 24 extensions. So your channel bank would plug into a Digium T1 card in an asterisk box and the signal gets translated form an analog stream into an IP stream, processed by asterisk and out your PRI links from your telephone company. (an alternative is the new digium 2400 card that will basically let you plug in 24 phones into it via a breakout box or a termination method of your choice, such as a BIX strip for example)

Hooking up multiple asterisks boxes isn’t too dificult generally, but it can be a case by cases scenerio depending on bugets and technology being used.

Yes, it seems easy until userA on one asterisk box tries to reach userB who’s registered on another Asterisk system. Also, for queues to work, the queue app needs to be able to find the agents to do a callback. If it can’t, agents won’t get queue calls.

Then you have one point of failure.

you HAVE this " failure-point" already
it is a PRI or E1/T1 channel…
i think you must use one asterisk-server only as PSTN-VOIP gate, not load other applications and channels… it shell be VERY stable…
i you want you can use in it hi-quality components and raid-0 arrays, memory with ECC etc…
You can also configure another one for backup.
and then you can manage and balance your channels to other asterisk.
it is possible to reach on PSTN-VOIP gate more then 100 calls.

your must answer the question ARE YOU REALY NEED IN more then 2 asterisks(ONE PSTN gate another -enduser/voicemail/application) ?

Many thanks for all of your replies. I learned something. Our call volume is high and we think one Asetrisk is not capable to handle the volume, so this is the reason we would like to distribute the load to multiple Asterisk boxes. Here is the data I got and I don’t know who came up 5 Asterisk servers. But our objective is to have multiple Asterisk servers for 1 call center

  • expected 1500 calls per hour
  • 200 seats
  1. After reading your replies, I think I need to use 1 Channel Bank connect to 5 Asterisk servers, am I right
  2. I think the centrailized SIP database for 200 seats is the key issue, so that each Asterisk can look up other agents at different Asterisk. Can someone share me how to do this?

Many thanks

Asterisk (on a good size box) should be able to handle 200 users without any problem. Also keep in mind- SIP reinvites will save it from having to do that much.

I suggest a frontend-backend system as follows: (this assumes your agents are using SIP phones)

Have one or more Asterisk boxes connected to your PRI ports. No more than 4 PRI (about 100 channels) per box. Set these up however you want. THey will also contain most of your dialplans and scripts.
Connect these via SIP (NOT IAX) to your main Asterisk box, which has all your users registered to it. On that box put queues and voicemail (if needed). Then register your SIP phones to it. This box does NOT do transcoding.
Nowhere in this setup may you use canreinvite=no.
What will happen is calls will come in on your PRI boxes and will wait in queues on the main box. When agents are connected, SIP will reinvite them, so the audio data goes directly to their phone from the PRI box, without looping through the main box.

If you have analog lines, then just add FXO channel banks, or use TDM2400 cards (up to 3-4 per PRI server) instead of PRI.

As I see it, this will leave you with 3-4 Asterisk boxes and a pretty smooth system. Usual server recommendations apply all around (good quality gear, ECC ram, raid-1 disk, etc).
As far as failure goes, keep a hot spare of the Main box. Whenever you change anything, do it to the spare, then plug the spare in instead. If it breaks, then switch it back.

Many thanks for that information. Very helpful

(Q) How can I have a centrailized sip_additional.conf? Sip_additional.conf is the place to store the sip extensions. Now I have multiple Asterisk boxes, how can I store all of SIP extensions to one centralized file?

(Q) Call Center agent can set his status to be Ready/NoReady/Wrapup/Busy/Aux. How can I do this in Asterisk?

you have no need for a centralized sip.conf under my system, becuase it is stored on the central asterisk server. The PRI boxes just know that for any extensions that match the right patterns, send the call out via SIP to the central server. The central server will process the extension-bound call according to its rules (stdexten macro etc) and then once the call is picked up, it will reinvite the phone and the PRI server together, stepping out of the audio path.

That said, there’s two ways to do it- the ghetto way (NFS/samba server, and #include the extra file in each box’s extensions.conf), or the right way RealTime with shared MySQL database).

As for agents, I don’t think Asterisk has all those states. An agent can log on or off of their queue, and you can set a wrapup time (after each call wait 30 seconds before sending the agent another call), but I don’t think an agent can so easily manage their queue.
However, I’m talking about the Asterisk queue system. I’ve seen other queueing scripts built onto asterisk (the name OrderlyQ comes to mind) that manage queues differently.

I have never done this before, but we have very good history with RADWARE devices that Load balances pretty much anything you want. check it out at radware.com

If you need more info… shout …

IronHelix: Asterisk can’t use Realtime to share sip/user information. I’m not sure that it can deal with sharing extensions.conf either. Hard to believe I know, but that’s what Digium has said. If you like I could dig up the posts from Kevin Fleming that confirm this.

I actually called Digium yesterday and asked if they would have support for multiple Asterisk boxes using a common database via Realtime anytime soon. They’re response was that it would probably take someone the better part of a year to implement it and fix all the current problems.

Many thanks for your inputs.

[quote=“dgarstang”]IronHelix: Asterisk can’t use Realtime to share sip/user information. I’m not sure that it can deal with sharing extensions.conf either. Hard to believe I know, but that’s what Digium has said. If you like I could dig up the posts from Kevin Fleming that confirm this.

I actually called Digium yesterday and asked if they would have support for multiple Asterisk boxes using a common database via Realtime anytime soon. They’re response was that it would probably take someone the better part of a year to implement it and fix all the current problems.[/quote]

It loolks like about 1 Year has past since DIGIUM said * would support “multiple boxes using a common database via Realtime anytime soon.”

So, has anyone heard of any prgress on this ???

Between Realtime and the MySQL command (see voip-info.org/wiki/view/Asterisk+cmd+MYSQL) I can not see why you could not have a distributed system on one database. The extensions for the agents should each be in their own context and extensions on other boxes would have another context which you can reference from the database. Just write yourself a macro that does the extension dial/transfer.

My two cents…
-Cheers, Peter.

to clarify- i was not suggesting load balancing via SQL…

i was just thinking of a possible architecture. Have multiple boxes interface with the PRI lines as you generally don’t want more than 4x PRI per server if you can avoid it, and especially if using g.729 or whatever.

so my idea was the multiple interface servers would trunk all their calls to one call processing server which would handle the queues and talk to the SIP clients. Asterisk can handle 200 SIP clients if you have a good box for it.

You could then put the IVRs either on the outside boxes or on the main queue box, I’d put it on the outside boxes to spread the load around.

This is EXACTLY what I would LOVE to be able to do and I am suprised Asterisk doenst allow it as the addion to the code would be trivial and be a Major benefit for *.

At present :

     - Agents Can be in a seperate tabale in a database
      - Mutiple Asterisk boxes CAN look at the agsnet table via Realtime

What is horribely lacking is this:

     + The * serverr can NOT tell if another * server is using the Agents

All it would take is this

          1) Add a "status" fied to the Agent Table to indicate "in-use"

          2) When * needs to get an agent for a call in the queue it would

                  a) Lock the agent table

                   b) Query the table for a agent with status of "not-inuse"

                   c) If row is returned, update the staus fiekl to indicate 
                    d) Unlock the table

                    e) When agen hang up, * would update the status in
                        the table for the agent as "not in use"

This would be such a HUGE bebefit for * and it use is large call centers.

I have a big project that I would use * for it it would do this !

There is a dialplan app called ischanavail (or ischanavailable).

Can this be used on an agent channel?


We’re planning to use multiple asterisk servers using real time architecture (common database) and SER to do the load balancing. Everything will flow to SER first. SER will decide which asterisk to send to using the dispatcher() module. We have not tested whether how the asterisk server will know about what the other asterisk server knows. i.e. like the above user mentioned, if the agent is available to take a call.

What are some things I should watch for in creating an environment with multiple asterisk servers to load balance with SER?