{"id":42,"date":"2015-06-04T10:07:16","date_gmt":"2015-06-04T14:07:16","guid":{"rendered":"http:\/\/blog.voipxswitch.com\/?p=42"},"modified":"2015-11-05T10:35:31","modified_gmt":"2015-11-05T15:35:31","slug":"kamailio-compiling-installing-on-debian-8","status":"publish","type":"post","link":"https:\/\/blog.voipxswitch.com\/?p=42","title":{"rendered":"Kamailio: Compiling &#038; Installing on Debian 8"},"content":{"rendered":"<p><b>Here we will compile and install Kamailio from GIT master branch and create our own systemd service configuration file.<\/b><\/p>\n<pre># install dependencies\r\napt-get install libpq-dev pkg-config build-essential bison make libperl-dev git linux-headers-$(uname -r) libunistring-dev flex libjson-c-dev libevent-dev \r\n\r\n# download &amp; compile\r\ncd \/usr\/src\r\ngit clone git:\/\/git.sip-router.org\/kamailio kamailio-git\r\ncd kamailio-git\r\n\r\n# include your own modules, these are what i compile\r\nmake include_modules=\"db_postgres debugger usrloc dispatcher registrar auth auth_db avp avpops tm rr pv sl maxfwd nathelper textops siputils uac uac_redirect db_text xlog sanity htable app_perl path ctrl tls ctl mi_fifo kex permissions dmq dialog websocket xhttp textopsx sdpops kazoo tmx uuid presence presence_xml presence_dialoginfo presence_mwi outbound\" cfg\r\n\r\nmake all\r\n\r\nmake install\r\n\r\n# add kam group\/user\r\ngroupadd -g 6001 kamailio\r\nuseradd -u 6001 -g 6001 -d \/usr\/local\/kamailio -M -s \/bin\/false kamailio\r\n\r\n# create custom directories for kamailio\r\nmkdir -p \/usr\/local\/kamailio\/{run,etc,tmp}\r\n\r\n# create kamailio default file\r\ncat &gt;\/etc\/default\/kamailio &lt;&lt;EOT\r\nRUN_KAMAILIO=yes\r\nUSER=kamailio\r\nGROUP=kamailio\r\nSHM_MEMORY=64\r\nPKG_MEMORY=8\r\nPIDFILE=\/usr\/local\/kamailio\/run\/kamailio.pid\r\nCFGFILE=\/usr\/local\/kamailio\/etc\/kamailio.cfg\r\n#DUMP_CORE=yes\r\nEOT\r\n\r\n# create systemd file\r\ncat &gt;\/etc\/systemd\/system\/kamailio.service&lt;&lt;EOT\r\n[Unit]\r\nDescription=Kamailio (OpenSER) - the Open Source SIP Server\r\nAfter=syslog.target network.target\r\n\r\n[Service]\r\nType=forking\r\nEnvironmentFile=-\/etc\/default\/kamailio\r\nPIDFile=\\$PIDFILE\r\n# ExecStart requires a full absolute path\r\nExecStart=\/usr\/local\/sbin\/kamailio -P \\$PIDFILE -f \\$CFGFILE -m \\$SHM_MEMORY -M \\$PKG_MEMORY -u \\$USER -g \\$GROUP\r\nExecStopPost=\/bin\/rm -f \\$PIDFILE\r\nRestart=on-abort\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n\r\nEOT\r\n\r\n# enable kamailio service\r\nsystemctl enable kamailio\r\n\r\n# if you change the systemd file you can reload changes with:\r\nsystemctl daemon-reload\r\n\r\n# set permissions to \/usr\/local\/kamailio\r\nchown kamailio:kamailio -R \/usr\/local\/kamailio<\/pre>\n<p><b>Please note, b<\/b><strong>y default, Kamailio will install it&#8217;s configuration files in \/usr\/local\/etc\/kamailio, modules in \/usr\/local\/lib64\/kamailio, and binaries in \/usr\/local\/sbin<br \/>\n<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here we will compile and install Kamailio from GIT master branch and create our own systemd service configuration file. # install dependencies apt-get install libpq-dev pkg-config build-essential bison make libperl-dev git linux-headers-$(uname -r) libunistring-dev flex libjson-c-dev libevent-dev # download &amp; compile cd \/usr\/src git clone git:\/\/git.sip-router.org\/kamailio kamailio-git cd kamailio-git # include your own modules, these [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,25,15],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-kamailio","category-sip","category-voip"],"_links":{"self":[{"href":"https:\/\/blog.voipxswitch.com\/index.php?rest_route=\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.voipxswitch.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.voipxswitch.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.voipxswitch.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.voipxswitch.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=42"}],"version-history":[{"count":10,"href":"https:\/\/blog.voipxswitch.com\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions"}],"predecessor-version":[{"id":97,"href":"https:\/\/blog.voipxswitch.com\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions\/97"}],"wp:attachment":[{"href":"https:\/\/blog.voipxswitch.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.voipxswitch.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.voipxswitch.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}