Skip to content

What Is Kamailio and How Does It Work?

Kamailio is an open source SIP server. Learn its role as a SIP router, how kamailio.cfg is structured, its key modules and its release history.

By · Updated · Published

People at a technology trade show booth with server hardware and computer monitors
Photo by Matin Huseynzade · Unsplash License · via Unsplash

What is Kamailio?

Kamailio is an open source SIP server released under GPLv2+. Its home page describes it as the successor of the former OpenSER and SER projects. It is written in pure C for Unix/Linux-like systems.

The project's GitHub README calls it an open source implementation of a SIP signaling server. It says the server is designed for scalability, targeting large deployments. Most of the code is licensed under GPLv2, and some parts are licensed under BSD.

Kamailio works on SIP messages, not on audio. The Getting Started guide notes that a VoIP call is seen as a sequence of SIP messages. To understand Kamailio, you need to understand those messages and how the server routes them.

What does our Kamailio fact sheet show?

We compiled a one-page fact sheet on Kamailio from the project's own pages, checked on November 14, 2026. The sources were the home page, the features page, the news page, the Getting Started guide, the Core Cookbook (labelled v6.1.x devel), the stable modules index (v6.1.x) and the GitHub README.

Nothing here was tested. Every item comes from those pages. Introductions usually give only a definition. This guide gathers the role, history, limits and configuration structure in one place.

The capacity figures are the project's own published claims. They are not our results, and the section on capacity below presents them as claims.

How does Kamailio work as a SIP proxy?

Kamailio is a SIP router at its core, not a telephony engine. It works at the lower layer of SIP packets, routing each and every SIP message that it receives. The routing blocks in its configuration decide what happens to each message.

The features page lists the roles Kamailio can play: registrar, location server, proxy, redirect server and SIP application server. The project also names SIP load balancer, least cost routing, SIP firewall, edge proxy, SBC and IMS/VoLTE among its uses.

Kamailio is also used for scaling. The home page says it can scale up SIP-to-PSTN gateways, PBX systems or media servers such as Asterisk, FreeSWITCH or SEMS. In that setup, Kamailio sits in front of those systems and routes SIP traffic to them.

How does Kamailio route a SIP message?

Routing happens in routing blocks. A routing block is a group of actions that specify what should be done for each SIP message. The Core Cookbook lists these block types:

  • request_route
  • route
  • branch_route
  • failure_route
  • reply_route
  • onreply_route
  • onsend_route
  • event_route

Only request_route is mandatory. It contains the actions for deciding the routing for SIP requests, and the project describes it as the equivalent of main(). It runs for each SIP request that arrives, so it is the best place to start when you read a configuration file.

Blocks run on network events, timer events and module events. A network event happens when a SIP message arrives. A timer event includes a retransmission timeout.

The route block defines sub-routes. A block can call one with route(NAME), for example route(REQINIT). This lets several blocks reuse the same steps.

How is kamailio.cfg structured?

Flow chart: kamailio.cfg has three parts in order: global parameters, then modules settings, then routing blocks.
The three parts of kamailio.cfg

The Core Cookbook says the kamailio.cfg file has three parts: global parameters, modules settings and routing blocks. The docs recommend keeping them in that order.

In kamailio.cfg, global parameters are name=value lines. The Core Cookbook, labelled Kamailio v6.1.x devel, gives examples like these:

Kamailio config
children=4
disable_tcp=yes
alias="sip.mydomain.com"

The first line sets the children parameter to 4. The second line, disable_tcp=yes, disables TCP support completely, which is the job the cookbook gives the core parameter disable_tcp. The third line sets alias to sip.mydomain.com, an example domain name.

Global parameter names must match a core parameter. If a name does not match one, Kamailio will not start and reports an error during startup. A typo in this section stops the server at once, so check each name before you restart. The cookbook gives one rule for these lines: the name must match a core parameter. The cookbook's other examples include log_facility=LOG_LOCAL0 for logging and a listen line that sets the address and port Kamailio listens on. This guide does not list every core parameter, so check the Core Cookbook before you add a new one.

Modules come next. Use loadmodule to load a module and modparam to set one of its parameters. The cookbook gives these examples:

Kamailio config
loadmodule "tm"
loadmodule "debugger.so"
modparam("debugger", "cfgtrace", 1)

Each modparam line takes three arguments: the module name, the parameter name and the value. The stable modules index lists the modules you can load, so check it for each module before you add a loadmodule line.

The first two lines load the tm module and the debugger module. The third line sets the cfgtrace parameter of the debugger module to 1. Routing blocks come last, as described in the section above.

Which modules does a basic SIP proxy use?

The stable modules index describes each module in one line. The table below shows the modules a basic SIP proxy job usually maps to.

ModuleJob
tmTransaction (stateful) handling
slStateless replier
rrRecord-Route and Route headers
registrarSIP registrar
usrlocUser location
authAuthentication interface
dispatcherLoad balancer
nathelperNAT traversal signaling functions
rtpengine / rtpproxyControl of the RTPEngine and RTPProxy media relays

Transactions use tm, and stateless replies use sl. The rr module handles Record-Route and Route headers. Registrations use registrar, and usrloc handles user location. The auth module is the authentication interface.

For load balancing, dispatcher is the module to use. NAT traversal signaling comes from nathelper, and rtpengine or rtpproxy control the media relay. Load the modules you use with loadmodule, as shown in the configuration section above.

How many calls and users can Kamailio handle?

The features page publishes capacity claims. The table shows each one as the project states it.

SetupProject's published claim
Stateless load balancerOver 5,000 call setups per second
Systems with 4GB of memoryOver 300,000 online subscribers
Embedded systemsUp to hundreds of call setups per second

The first claim applies when Kamailio is used as a load balancer in stateless mode. The second applies to systems with 4GB of memory. The third covers embedded systems.

These figures are the project's own, and they are not our results. Use them as a starting point for your own planning, not as a guarantee.

Where did Kamailio come from?

Timeline: 2001, SER started at Fraunhofer Fokus; 2005, OpenSER was forked from SER; July 2008, renamed Kamailio.
Kamailio history, from SER to Kamailio

The project's README gives this timeline. It does not give a date for the merge.

YearEvent
2001Development started at Fraunhofer Fokus as SIP Express Router (SER).
2005A fork named OpenSER was created.
July 2008OpenSER was renamed Kamailio due to trademark issues.
LaterAfter a merge, Kamailio became the project's main name.

In short, the project started as SER, forked as OpenSER and became Kamailio under that name after the 2008 rename.

What is the latest Kamailio version?

The news page lists the current releases. Kamailio SIP Server v6.1.5 stable was released on October 15, 2026, and it is the latest stable release. v6.0.8 stable, on the 6.0 branch, was released on September 16, 2026.

The Core Cookbook and the stable modules index are both labelled v6.1.x. The configuration examples in this guide come from that cookbook, so check the version of your own installation before you copy them.

What is the difference between Kamailio and Asterisk or FreeSWITCH?

Kamailio is a SIP router, and Asterisk, FreeSWITCH and SEMS are media servers that Kamailio can scale. The home page names all three as servers Kamailio can put in front of for scaling.

The features page says Kamailio offers load balancing with many distribution algorithms and failover support. That is the main way it works with these servers. It is not a telephony engine at its core, and its media relays are separate modules.

More guides in Open-Source PBX and SIP Servers.

Frequently asked questions

Is Kamailio a SIP proxy, a PBX or a softswitch?
Kamailio works as a SIP proxy, registrar, redirect server and SIP application server, and it is described as a SIP router at its core. It can scale PBX systems and media servers. The home page lists IP telephony among its uses, but the Getting Started guide says it is not a telephony engine at its core.
Does Kamailio handle audio and video (RTP)?
Kamailio is a signaling server, and media relays are separate applications. The default kamailio.cfg relies on RTPProxy for RTP relaying. The rtpengine and rtpproxy modules control the RTPEngine and RTPProxy media relays.

Sources

  1. Kamailio, the successor of OpenSER and SER, is an open source SIP server released under GP (www.kamailio.org)
  2. The README describes Kamailio as an open source implementation of a SIP signaling server. (github.com)
  3. Kamailio is a SIP router at its core, not a telephony engine; a VoIP call is seen as a seq (www.kamailio.org)
  4. Kamailio can act as a registrar, location server, proxy server, SIP application server and (www.kamailio.org)
  5. kamailio.cfg has three parts, global parameters, modules settings and routing blocks, whic (www.kamailio.org)
  6. The tm module provides stateful transaction handling (Kamailio modules v6.1.x stable). (www.kamailio.org)
  7. Kamailio v6.1.5 stable was released on October 15, 2026. (www.kamailio.org)