Kamailio Usage In Front of Asterisk

What would be the purpose of putting kamailio on the frontline for asterisk?

All I learnt from basic scope is that it can handle thousands of calls at a time, which asterisk cannot but also on the other side kamailio is said to be unable to handle or process media. So whats actually is the scenario here?

say like asterisk can handle for example maximum of 25 concurrent calls(handle the media/sip), but it cannot handle the 26th call. So we put kamailio and kamailio will be able to handle all the 26 calls at the same time but as because it cannot handle media/sounds and only asterisk can handle it, what does it mean in that context that kamailio can handle calls more than asterisk? how does kamailio helps handling the 26th call whereas it cannot process any media(the phone call conversation between the caller and agent).

Load balancing between multiple instances of Asterisk. Once the working instance has been determined, the media can be set up directly.

I would note that taking Asterisk out of the media path is a common requirement for simple call handling systems.

Asterisk can handle a lot more than 25 concurrent calls, although exact numbers depend on processing power and what is being done with the calls.

Hey david!

So in that sense what Kamailio doing is basically just directing(supervising/ facilitating) the process in a cluster environment of asterisk servers if im not wrong.

One more thing as you were about to enlighten me which is about handling more than 25 calls in asterisk… So does asterisks strength and capability scale up with the hardware requirements? If so what do you suggest to be capable hardware requirements for an asterisk server or a cluster environment for handling nearly 1000 calls or atleast concurrent 500 calls.

You would need to bench mark for your specific requirements. I know there are people who ran up to that sort of load on a single machine, but my main experience is with functionality testing, and is out of date.

The person with the largest loading I’ve seen had loaded the system up to the point where a single extra dialplan step couldn’t be tolerated, but the loading for a given number of calls could vary by, maybe, an order of magnitude, depending on what one is doing with the calls.

Beyond capacity, think maintenance and reliability.

If you put 1,000 eggs in one basket, your boss will think you are a hero today.

When you tell him a disk failed and a replacement arrives in 2 days, all he hears is that you are going to terminate 1,000 calls and he’s not making any money. Now you’re a zero.

Distributing calls across a farm of servers has many advantages. Consider rolling out a new application version. Put it on 1 server and configure your ‘distributor’ to send calls from your CID and your boss’s CID to that 1 server. When everybody is happy, push it out to 1/2 of the farm. Still happy? Push out to the rest.

Thanks for the reply david

Nice example edwards! I got your point now. Thanks edward!

So one last question my friends @david551 @sedwards .

If I make a configuration(Stack => Asterisk Server + MySQL-DB Server) of 4 core CPU and 8GB ram with 1TB SSD/HDD and unlimited bandwidth, how many concurrent calls I can expect my asterisk to handle/ take load of?

The best you will get is statements about what people have achieved with specific hardware, and a very brief summary of what they thought were the key factors that affected sizing on their system.

Database usage can vary from virtually zero to moderately high, depending on what yo are doing.

About the only thing that can make significant use of your disk space is if you record all calls, which can involve 16kB a second per call, with typical settings, although there are various tradeoffs that cold vary this from maybe 13% to 400%. You need to avoid swapping in telephony applications. (Other than call recording, and voicemail, most disk usage scales on call attempt rates, not on Erlangs.

I think most people run out of CPU first.

You want any critical database to be on the same servers as the Asterisk daemon.

Ok great! Got your point!

Kamailio also allows you to configure more things at a lower level. Depending on to what you need to connect, you might need these degrees of freedom.

1 Like

Thanks fudrek for sharing

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.