Menu Close

Installing Kamailio 3.1 on debian lenny

The original quick start docs for Kamailio 3.1.x are availbale at the kamailio site.

Prerequisities

First, we will add Kamailio repository into our debian /apt/source.list, then we will not need download individual packages or making installation from source files. 

Do not forget update apt source:

apt-get update

look, if package as kamailio is founded:

apt-cache search kamailio

kamailio - very fast and configurable SIP proxy
kamailio-berkeley-modules - Berkeley Database module for Kamailio
...
...

and take a closer look on information about the Kamailio package version, if it is 3.1.x

apt-cache show kamailio

Package: kamailio
Version: 3.1.0+lenny3
Architecture: amd64
Maintainer: Jon Bonilla <manwe@aholab.ehu.es>
Installed-Size: 25760
...
...

Preparing the DNS service

Look as a good practise, if you may, to place correct SIP UDP and SIP TCP SRV records on your DNS server, which are pointing to your Kamailio server IP address, so the dns resolving process will return correct IP address. In my case I've added following lines:

_sip._udp       SRV 0 1 5060    pstest
_sip._tcp       SRV 0 1 5060    pstest
pstest          IN      A       158.193.139.51

The dig dns utility have to return correct IP address pointing to your server

dig SRV _sip._udp.ps.sip.uniza.sk
or
dig SRV _sip._tcp.ps.sip.uniza.sk

Installation

Just

apt-get install kamailio

and the installation process at the end tell us that

Setting up kamailio (3.1.0+lenny3) ...
adduser: Warning: The home directory `/var/run/kamailio' does not belong to the user you are currently creating. Kamailio not yet configured. Edit /etc/default/kamailio first.

Open the  /etc/default/kamailio file:

# Set to yes to enable kamailio, once configured properly.
RUN_KAMAILIO=yes

# User to run as
USER=kamailio

# Group to run as
GROUP=kamailio

# Amount of shared memory to allocate for the running Kamailio server (in Mb)
SHM_MEMORY=64

# Amount of private memory for each Kamailio process (in Mb)
PKG_MEMORY=4

and we may start a base Kamailio server service, which is running default configuration

/etc/init.d/kamailio start
loading modules under /usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/
Listening on
             udp: 127.0.0.1:5060
             udp: 158.193.139.51:5060
             tcp: 127.0.0.1:5060
             tcp: 158.193.139.51:5060
Aliases:
             tcp: pstest:5060
             tcp: pstest.ps.sip.uniza.sk:5060
             tcp: localhost:5060
             udp: pstest:5060
             udp: pstest.ps.sip.uniza.sk:5060
             udp: localhost:5060

Everything looks good till we did not try to register an account using SIP client. The answer from the server is 483 Too many hops. Well, I do not know what I'm doing bad (I made many ser/openser installs), but the problem is solved by adding alias into the cfg file. I never find this note inside of any SER/OpenSer/Kamailio guides.

Now, we have to add information about the serving local doamin. Find inside of your kamailio.cfg something which looks like

/* add local domain aliases */
#alias="sip.mydomain.com"

and add line with your serving domain info, here

alias="ps.sip.uniza.sk"

and restart the kamailio service

/etc/init.d# kamailio start

loading modules under /usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/
Listening on
             udp: 127.0.0.1:5060
             udp: 158.193.139.51:5060
             tcp: 127.0.0.1:5060
             tcp: 158.193.139.51:5060
Aliases:
             tcp: pstest:5060
             tcp: pstest.ps.sip.uniza.sk:5060
             tcp: localhost:5060
             udp: pstest:5060
             udp: pstest.ps.sip.uniza.sk:5060
             udp: localhost:5060
             *: ps.sip.uniza.sk:5060:*
.

The domain added above should appear among serving domains of your server.

We should also check Kamailio processes

# pgrep kamailio

1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437

 

The registration using your favorite client should work.

kamctl ul show

Domain:: location table=512 records=1 max_slot=1
        AOR:: palo
                Contact:: sip:palo@158.193.139.100:3922;rinstance=694c639216cbd981 Q=
                        Expires:: 3591
                        Callid:: MDU5NWIxNTQyZGU4ZTAwM2ZjMzVhMGE2OWY3Mzk1NmI.
                        Cseq:: 1
                        User-agent:: eyeBeam release 1102q stamp 51814
                        State:: CS_NEW
                        Flags:: 0
                        Cflag:: 0
                        Socket:: udp:158.193.139.51:5060
                        Methods:: 5087

 

Server operation monitoring

For server monitoring there is  the kamctl tool, which has a lot of optional switches.

 

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.