This is an old revision of the document!
Kamailio SIP Server
Kamailio (former OpenSER) is an Open Source SIP Server.
To know Kamailio is to know SIP.
Note: AstLinux 1.2.0 or later is required, with custom build
Initial Configuration
The CLI (Command Line Interface) must be used to enable, and disable kamailio. Kamailio will be enabled if the /mnt/kd/kamailio/
directory exists. Issue the command…
cp -a /stat/etc/kamailio /mnt/kd/
The /mnt/kd/kamailio/
directory now exists, populated with defaults. Start kamailio using the default configuration with the following command, this will also create a symlink from /etc/kamailio/
→ /mnt/kd/kamailio/
…
service kamailio init
You should see output similar to:
Starting kamailio... loading modules under /usr/lib/kamailio/modules/ Listening on udp: 127.0.0.1:5065 Aliases: udp: localhost:5065
Not all configurations will require a database, though at this point you can create a SQLite database with the standard schema. Issue the command…
kamdbctl create
You should see output similar to:
INFO: creating database /mnt/kd/kamailio/data/kamailio.sqlite3 ... INFO: Core Kamailio tables succesfully created. Install presence related tables? (y/n): y INFO: creating presence tables into /mnt/kd/kamailio/data/kamailio.sqlite3 ... INFO: Presence tables succesfully created. Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist htable purple uac pipelimit mtree sca mohqueue rtpproxy? (y/n): y INFO: creating extra tables into /mnt/kd/kamailio/data/kamailio.sqlite3 ... INFO: Extra tables succesfully created.
At this point you can customize your kamailio configuration. Edit the /etc/kamailio/kamailio-local.cfg file to add switches such as:
service kamailio restart
General Configuration
Kamailio proxy's SIP but Asterisk does the RTP directly:
Example: EXTIP 10.10.50.65 - DNS 'pbx4', INTIP 192.168.110.1/24 network
/etc/kamailio/kamailio-local.cfg:
####### Include Local Config ######### #!define WITH_ASTERISK auto_aliases=no alias="pbx4" listen=udp:127.0.0.1:5060 listen=udp:10.10.50.65:5060 listen=udp:192.168.110.1:5060
/etc/asterisk/sip.conf snippet:
udpbindaddr=0.0.0.0:5080
Note -> Requires Pass EXT→Local UDP 10000-20000 (default asterisk rtp.conf range)
Kamailio proxy's SIP and RTP using rtpproxy:
Example: EXTIP 10.10.50.65 - DNS 'pbx4', INTIP 192.168.110.1/24 network
/etc/kamailio/kamailio-local.cfg:
####### Include Local Config ######### #!define WITH_NAT #!define WITH_ASTERISK auto_aliases=no alias="pbx4" listen=udp:127.0.0.1:5060 listen=udp:10.10.50.65:5060 listen=udp:192.168.110.1:5060
/etc/asterisk/sip.conf snippet:
udpbindaddr=127.0.0.1:5080
Tip -> The 'rtpproxy' daemon is automatically started when WITH_NAT
is defined.
Note -> Requires Pass EXT→Local UDP 16384-16639 (default rtpproxy range)