User Tools

Site Tools


This is an old revision of the document!

Frequently Asked Questions

This page is open for contributions, you must create an user account via registration form:

If you have a question suitable for FAQ and you don't know the answer, add it and set the answer to 'TBA', others can read it and give the right answer.


Kamailio is a SIP server, implementing the specifications from RFC3261. Its root functionality is routing any kind of SIP packets. On top of that, many conceptual features are implemented, see more at:

No, Kamailio is a flexible SIP proxy. Many people integrate Asterisk, FreeSWITCH, SEMS, or other products with Kamailio for a B2BUA.

No, you must restart after you update the configuration file.

But note that many global parameters can be changed via RPC/MI commands without restart (e.g., TCP connecting timeout, debug level). Applying changes related to loaded modules or routing block require always a restart.

Kamailio is an open source application licensed under GNU Public License version 2 (aka GPLv2). It can be used for free “as in beer”.

Starting with end of 2008, contributions to core and several modules are done under BSD license. That means parts of it can be extracted and used under BSD license terms. But over all, when used as one application, the use must follow the terms of GPLv2, because GPLv2 is viral.

No. There is no official development pushed in this direction, Linux/Unix being the de facto for running servers. But it might not be big effort to make it compile using the Linux-like environments for Windows (such as cygwin).

Transport Layers

At network layer, Kamailio supports both IPv4 and IPv6.

At transport layer, Kamailio support UDP, TCP, TLS and SCTP. Transmission can be done in asynchronous mode (configuration option), inclusive for TCP and TLS.

Kamailio can be used to bridge between any combinations of these protocols, e.g., receiving SIP packets on UDP over IPv4 and sending out on TLS over IPv6.

Starting with version 4.0.0, Kamailio supports WebSocket transport protocol, allowing modern web browsers to call between them directly through Kamailio.

Yes, starting with version 4.0.0. It supports WebSockets over TCP (WS) and over TLS (WSS), on both IPv4 and IPv6.

Yes. You can use Kamailio to receive SIP message on one transport and send out on a different transport. For example, receive TLS on IPv6 and send out UDP on IPv4.

Yes, from signaling point of view. Remember that Kamailio is SIP packet router, not handling media plane at all. Simply, Kamailio can do gatewaying from WebSocket to UDP, TCP, TLS or SCTP for all SIP messages.

However, note that media plane (RTP streams) requires special secure encoding of the RTP packets, which may not be supported by the old SIP phones.


A module is an extension that compiles in a separate object file and can be loaded at Kamailio startup. Usually a module exports new functions that can be used in configuration file routing blocks.

Inside the source tree, there are three directories:

  • modules/
  • modules_k/ - no longer used since version 4.0.0
  • modules_s/ - no longer used since version 4.0.0

Each module is located in its own sub-folder. The documentation for modules that are bundled in Kamailio packages is available at:

The modules that have the same dependencies as the core of Kamailio. Those that are not compiled by default are kept in the variable 'exclude_modules' of Makefile. To print the list of excluded modules:

make printvar v=exclude_modules

Add it to the variable 'include_modules' to the command 'make cfg'. For example, compiling and installing the modules app_lua and db_mysql:

make FLAVOUR=kamailio include_modules="app_lua db_mysql" cfg
make all
make install

The module is not compiled by default, because depends on libmysqlclient. Use following commands to get in compiled and installed:

make modules include_modules="db_mysql"

make install include_modules="db_mysql" 

SIP Message Processing

Kamailio is working always with the received SIP message (request or reply). Changes done to headers or body are kept as a list of operations to be applied before writing to the network. If you want changes to be applied immediately, use msg_apply_changes() from textopsx module:

Be careful with it and don't use it after record_route(), because this function has to insert a header containing the IP address from the local socket that is going to be used for forwarding - the socket is not yet know during configuration file execution.

For example, considering that X-Hdr does not exist in incoming message, here are some cases:

  • without applying changes
append_hf("X-Hdr: xyz\r\n");

if(is_present_hf("X-Hdr")) {
   # this part is not executed
} else {
   # this part is executed
  • with applying changes
append_hf("X-Hdr: xyz\r\n");


if(is_present_hf("X-Hdr")) {
   # this part is executed
} else {
   # this part is not executed

Media Streams

No, however Kamailio can be configured to proxy media if needed.

Kamailio supports all codecs (even codecs that haven't been created yet).

Since Kamailio is a SIP proxy, it does not handle the media streams. Codecs are negotiated between the two endpoints.

Yes, Kamailio can be used for video calls. The two SIP phones must support video codecs/calling.

Getting Started


Yes, there are few of them, each addressing a particular category of topics, see the list at:

You must subscribe to be able to post questions. Subscription is free, instructions are presented at the link related to each mailing list.

The most important rules are to use a decent vocabulary and post about something related to Kamailio.

If the question is related to a stable version of Kamailio, then email to:

If the question is related to development version of Kamailio, then email to:

If the question is related to commercial aspects of Kamailio, then email to:


Yes. See enum module.

Kamailio can do next DNS query types: A-Name, C-Name, AAAA (IPv6), SRV, NAPTR and TXT.

Do not enclose the IP address between quotes. Use like:

if(src_ip== { ...

The next example results in reverse DNS operation, because src_ip is compared with a string:

if(src_ip=="") { ...

Instant Messaging and Presence

Yes. There is nothing special to do for that in configuration file, MESSAGE requests are simply routed as any other SIP request.

Yes. Kamailio offers an embedded MSRP relay function via msrp module. You don't need any external application for relaying MSRP packets.

Yes. There is nothing special to do for that in configuration file, SUBSCRIBE and NOTIFY requests are simply routed as any other SIP request.

Yes. You have to use presence and presence_xml modules to handle PUBLISH and SUBSCRIBE requests.

Yes. You have to use rls module.

Yes. See pua module and its extensions named with 'pua_' prefix (such as pua_usrloc, pua_dialoginfo, etc.).

Yes. You have to use dialog module together with presence_dialoginfo and pua_dialoginfo modules.

Yes. Kamailio offers an embedded XCAP server via xcap_server module. It can receive and handle directly the XCAP requests without using any external application.

The xcap_client module can be used when you want to interact with an external XCAP server (that could be another instance of Kamailio).

NAT Traversal

Yes, Kamailio supports the so called “far-end NAT traversal”. One solution is to use nathelper for NAT traversal of SIP signaling, and rtpproxy modules with the rtpproxy ( application for relaying RTP packets.

Read the comments at top of default configuration file shipped with Kamailio, to enable NAT traversal logic there, one has to enable the define WITH_NAT:

#!define WITH_NAT

Yes. You have to set the public IP address as advertised attribute to listen parameter:

  listen=_localsocket_ advertise _publicaddr_


  listen=udp: advertise

Configuration File Processing

No. The AVPs are automatically deleted when associated SIP transaction is destroyed.

If you want to do it on purpose, you can delete the AVP using assignment to $null, like:

$avp(name) = $null;

SIP Requests Routing

In both cases, the reason is probably an error in request routing script which caused an infinite loop.

You can easily verify whether this happens by watching SIP traffic on loopback interface, for example using ngrep:

ngrep -d lo -qt -W byline port 5060

A typical reason for misrouting is a failure to match local domain correctly. If a server fails to recognize a request for itself, it will try to forward it to current URI in believe it would forward them to a foreign domain.

Alas, it forwards the request to itself again. This continues to happen until value of the max_forwards header field reaches zero or the request grows too big.

The solution: make sure that domain matching is correctly configured.

A quick way to achieve that is to introduce a config option to kamailio.cfg:


where domainname has to be replaced with name of domain, which you wish to serve by Kamailio and which appears in request-URIs.


Most probably you run out of memory allocated for Kamailio. The application does not use the entire system memory, but up to a configured size.

There are two memory pools used by Kamailio:

  • shared memory - shm - common at application level, where most of the data needed for long time is stored (such as location records, least cost routing records, transactions, etc.). The default size is 32MB.
  • private memory - pkg - allocated per process, used for local storage and temporary operations. The default size is 4MB.

To increase the sizes for memory pools you have to give following command line parameters:

  • -m SIZE - specify the shared memory size in MB
  • -M SIZE - specify the shared memory size in MB

For example, start Kamailio with 512MB of shared memory and 8MB of private memory:

/usr/local/bin/kamailio -m 512 -M 8 ...


Use following command:

echo -n 'user:realm:password' | md5sum | awk '{ print $1 }'

Use following command:

echo -n 'user@realm:realm:password' | md5sum | awk '{ print $1 }'

Kamctl couldn't connect to FIFO file for sending MI commands - default FIFO file is /tmp/kamailio_fifo.

Check if your configuration loads the mi_fifo module and configures a fifo name.

Example for the configuration syntax:

loadmodule ""

modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")

Check also the access privileges of the FIFO file in order to be sure that the user running kamctl can read and write to the file.

tutorials/faq/main.1365243405.txt.gz · Last modified: 2013/04/06 12:16 by miconda