Call Center Load Balancing with Kamailio

Session Initiation Protocol (SIP) hasn’t officially been crowned king of call center technologies, but it has become ubiquitous. The wide availability of SIP service providers and the way Asterisk is pushing Open Source technologies into the call center has made it undeniable. Especially now with the widespread adoption of Cloud-based call center software and remote agents, SIP is cementing its importance.

While Asterisk has been a major topic in this blog, there are other ways to serve up SIP. Q-Suite has its high availability SIP proxy which manages call recovery. HAASIPP development was driven primarily with call survival in mind, however. A less-focussed, more feature rich SIP product that is widely used is Kamailio (formerly OpenSER). Kamailio has a huge feature set, but a few of these are important for the Cloud-based multiple server install. The ones that come first to mind are:

  • SIP packet capture and logging
  • Smart SIP proxy for routing calls to specific servers
  • Single point of registration for multiple servers

The SIP packet capture feature is something that proves to be invaluable when trying to diagnose VoIP issues. SIP packets themselves aren’t large; most of the bandwidth of VoIP is consumed in the Real-time Transport Protocol (RTP) packets which carry the media itself. SIP concerns itself with the connection, not the data. Issues with calls can often be diagnosed by examining these packets and looking for lapses in the protocol. Unanswered requests, dropped or ignored requests, and timeouts can be spotted when examining the SIP session. When compared with the other end of the connection, such as against the provider’s own logs, a cause to the issue can often be confirmed or ruled out.

Kamailio can be used to store these packets, so that diagnosis of an issue can be carried out on first report, rather than having to set up monitoring and wait for the issue to arise again. Tools such as Homer can be used to produce graphs and more easy to read displays of SIP data. This can be invaluable and save a lot of time in diagnosis.

Kamailio is also used quite frequently as a SIP proxy. When using it as a proxy, it can be set to deliver calls from specific trunks to specific Asterisk servers. This is useful in a multi-tenant multiple Asterisk server configuration, when a tenant may be assigned to a subset of the Asterisk servers. Rather than having calls delivered to the “wrong” server and routed back to an agent over an additional channel, the overhead caused by the tenant can be limited to the specifically assigned servers.

What might be the most important use for Kamailio in the multiple Asterisk server configuration is the ability to act as a single point of registration. It can be set to handle agent phone registrations, while handing off the RTP part of the call. This gives one location for phones to be registered to, while allowing call load balancing over multiple servers. In a Cloud setting, this allows for instances to be brought up and down in order to manage changes in demand without having to reconfigure phones or registrations.

For these reasons, Indosoft Q-Suite is moving to increase integration of Kamailio with Asterisk and its own features. Smartly directing calls and handling registrations can reduce the amount of work the Asterisk servers are required to do and reduce the resources needed. This will reduce costs due to server load and bandwidth.