{"id":482,"date":"2011-11-21T14:13:38","date_gmt":"2011-11-21T13:13:38","guid":{"rendered":""},"modified":"2018-11-01T00:57:28","modified_gmt":"2018-10-31T23:57:28","slug":"installing-kamailio-git-debian-lenny","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/installing-kamailio-git-debian-lenny\/","title":{"rendered":"Installing Kamailio from GIT &#8211; debian lenny"},"content":{"rendered":"<p>In some situation is direct installation of precompiled kamailio packages from prepared repositories not appropriate. There is a simple way to keep a touch with latest kamailio releases with using GIT (an revision control system).&nbsp;&nbsp;The article describe a simple way how to manually compile and install Kamamilio and its module from source code offered through GIT.<\/p>\n<h1>Install kamailio from GIT<\/h1>\n<h2>Prerequisities<\/h2>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">&nbsp;<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">To fullfill all tasks, we will need following packages, so we will install them:<\/p>\n<pre style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\napt-get install git-core gcc flex bison libmysqlclient-dev make libssl-dev libcurl4-openssl-dev libxml2-dev libpcre3-dev\r\n<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">In a case of some missing dependencies install also other required packages.<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">&nbsp;<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">Then we make a folder where we will download kamailio source files<\/p>\n<pre class=\"code\" style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\nmkdir -p \/usr\/local\/src\/<span class=\"search_hit\">kamailio<\/span>-3.2\r\ncd \/usr\/local\/src\/<span class=\"search_hit\">kamailio<\/span>-3.2<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">then download main files<\/p>\n<pre class=\"code\" style=\"background-color: rgb(243, 243, 243); line-height: 13px; \"><span style=\"background-color: rgb(255, 255, 153); \"><strong><span class=\"search_hit\">git<\/span> clone --depth 1 <span class=\"search_hit\">git<\/span>:\/\/<span class=\"search_hit\">git<\/span>.sip-router.org\/sip-router <span class=\"search_hit\">kamailio<\/span><\/strong><\/span>\r\n<em>Cloning into kamailio...<br \/>remote: Counting objects: 24459, done.<br \/><br \/>remote: Compressing objects: 100% (13723\/13723), done.<br \/>Receiving objects: 100% (24459\/24459), 16.83 MiB | 7.18 MiB\/s, done.<br \/>remote: Total 24459 (delta 17363), reused 15407 (delta 10395)<br \/>Resolving deltas: 100% (17363\/17363), done.<\/em>\r\n\r\n<strong>cd <span class=\"search_hit\">kamailio<\/span><\/strong>\r\n<span style=\"background-color: rgb(255, 255, 153); \"><strong><span class=\"search_hit\">git<\/span> checkout -b 3.2 origin\/3.2<\/strong><\/span>\r\n\r\n<em>Branch 3.2 set up to track remote branch 3.2 from origin.<br \/>Switched to a new branch '3.2'<\/em>\r\n<\/pre>\n<h2>Setting makefiles<\/h2>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">Since the version 3.0.0,&nbsp;Kamailio&nbsp;and SER are built from same source code, so the&nbsp;<strong>most important and first step<\/strong>&nbsp;is to set build flavour to&nbsp;<strong><span class=\"search_hit\">kamailio<\/span><\/strong>.<\/p>\n<pre class=\"code\" style=\"background-color: rgb(243, 243, 243); line-height: 13px; \"><strong>root@homer:\/usr\/local\/src\/kamailio-3.2\/kamailio# make FLAVOUR=<span class=\"search_hit\">kamailio<\/span> cfg<\/strong>\r\n<em>target architecture &lt;x86_64&gt;, host architecture &lt;x86_64&gt;<br \/>making config...<br \/>rm -f modules.lst<br \/>make --no-print-directory modules.lst<br \/>saving modules list...<\/em>\r\n\r\n<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">If you forget to set the flavour to&nbsp;<span class=\"search_hit\">kamailio<\/span>, the default build is SER.<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">Next step is to enable required modules for compilation, for example here mysql and sipcapture:<\/p>\n<pre style=\"background-color: rgb(243, 243, 243); line-height: 13px; \"><strong>root@homer:\/usr\/local\/src\/kamailio-3.2\/kamailio# <\/strong><span style=\"background-color: rgb(255, 255, 153); \"><strong>make modules-cfg include_modules=&quot;db_mysql sipcapture&quot;<\/strong><\/span>\r\nrm -f modules.lst\r\nmake --no-print-directory modules.lst\r\nsaving modules list...<br type=\"_moz\" \/><\/pre>\n<p>or alternatively we may manually edit module.lst file and mark\/unmark\/edit required lines:<\/p>\n<pre>\r\nvim module.lst<\/pre>\n<p>or manually edit debian compilation rules at:<\/p>\n<pre>\r\nvim pkg\/kamailio\/deb\/debian\/rules<\/pre>\n<h2>Compilation and installation<\/h2>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">We start the compilation and after installation with following commands:<\/p>\n<pre style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\nmake all\r\nmake install\r\n<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">Attention, the binaries and executable scripts were installed in:<\/p>\n<pre class=\"code\" style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\n  \/usr\/local\/sbin<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">modules in:<\/p>\n<pre>\r\n  \/usr\/local\/lib\/<span class=\"search_hit\" style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(255, 255, 153); \">kamailio<\/span>\/modules\/ <\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">man pages in:<\/p>\n<pre>\r\n\/usr\/local\/share\/man\/man5\/\r\n\/usr\/local\/share\/man\/man8\/\r\n<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">and config files are located in<\/p>\n<pre style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\n\/usr\/local\/etc\/kamailio\r\n<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">To be able to use the binaries from command line, make sure that &#8218;\/usr\/local\/sbin&#8216; is set in PATH environment variable. You can check that with &#8218;echo $PATH&#8216;. If not and you are using &#8218;bash&#8216;, open &#8218;\/root\/.bash_profile&#8216; and at the end add:<\/p>\n<pre class=\"code\" style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\n  PATH=$PATH:\/usr\/local\/sbin\r\n  export PATH<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">More info at:&nbsp;<a href=\"http:\/\/www.kamailio.org\/wiki\/install\/3.2.x\/git\">http:\/\/www.kamailio.org\/wiki\/install\/3.2.x\/git<\/a><\/p>\n<h3>Prepare init.d script and \/etc\/default\/kamailio script<\/h3>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">Be able to use usual<em><strong>&nbsp;\/etc\/init.d\/kamailio start | stop<\/strong><\/em>&nbsp;syntax we have to prepad init scripts. So for debian just copy init.d script<\/p>\n<pre style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\ncp \/usr\/local\/src\/kamailio-3.2\/kamailio\/pkg\/kamailio\/deb\/debian\/kamailio.init \/etc\/init.d\/kamailio\r\n<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">and set chmod<\/p>\n<pre class=\"code\" style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\nchmod 755 \/etc\/init.d\/<span class=\"search_hit\">kamailio<\/span><\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">Then open the file<\/p>\n<pre style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\nvim \/etc\/init.d\/kamailio\r\n<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">and edit DAEMON&nbsp;value to point out on correct place, so change default DAEMON=\/usr\/sbin\/kamailio change to<\/p>\n<pre class=\"code\" style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\nDAEMON=\/usr\/local\/sbin\/<span class=\"search_hit\">kamailio<\/span><\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">plus change CFGFILE value to point out to correct kamailio.cfg file<\/p>\n<pre style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\nCFGFILE=\/usr\/local\/etc\/kamailio\/kamailio.cfg\r\n<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">Finally copy default config file:<\/p>\n<pre style=\"background-color: rgb(243, 243, 243); line-height: 13px; \">\r\ncp \/usr\/local\/src\/kamailio-3.2\/kamailio\/pkg\/kamailio\/deb\/debian\/kamailio.default \/etc\/default\/kamailio\r\n<\/pre>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">edit them and change RUN_KAMAILIO=no to&nbsp;<strong>yes<\/strong>.<br \/>\n&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h1>Future maintenance<\/h1>\n<p>The future maintenance process is very simple:<\/p>\n<pre>\r\ncd \/usr\/local\/src\/kamailio-3.2\/kamailio\r\ngit pull origin\r\nmake all\r\nmake install\r\n\/etc\/init.d\/kamailio restart\r\n<\/pre>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>In some situation is direct installation of precompiled kamailio packages from prepared repositories not appropriate. There is a simple way to keep a touch with latest kamailio releases with using GIT (an revision control system).&nbsp;&nbsp;The article describe a simple way how to manually compile and install Kamamilio and its module from source code offered through GIT.<\/p>\n<h1>Install kamailio from GIT<\/h1>\n<h2>Prerequisities<\/h2>\n<p style=\"margin-top: 0px; margin-bottom: 0px; line-height: 13px; background-color: rgb(243, 243, 243); \">&nbsp;<\/p>","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[781,685,771],"tags":[],"class_list":["post-482","post","type-post","status-publish","format-standard","hentry","category-kamailio-en","category-linux_-_howto-en","category-sip-en"],"taxonomy_info":{"category":[{"value":781,"label":"Kamailio"},{"value":685,"label":"Linux - HOWTO"},{"value":771,"label":"SIP"}]},"featured_image_src_large":false,"author_info":{"display_name":"admin","author_link":"https:\/\/nil.uniza.sk\/en\/author\/admin\/"},"comment_info":6,"category_info":[{"term_id":781,"name":"Kamailio","slug":"kamailio-en","term_group":0,"term_taxonomy_id":779,"taxonomy":"category","description":"","parent":771,"count":29,"filter":"raw","cat_ID":781,"category_count":29,"category_description":"","cat_name":"Kamailio","category_nicename":"kamailio-en","category_parent":771},{"term_id":685,"name":"Linux - HOWTO","slug":"linux_-_howto-en","term_group":0,"term_taxonomy_id":683,"taxonomy":"category","description":"","parent":0,"count":71,"filter":"raw","cat_ID":685,"category_count":71,"category_description":"","cat_name":"Linux - HOWTO","category_nicename":"linux_-_howto-en","category_parent":0},{"term_id":771,"name":"SIP","slug":"sip-en","term_group":0,"term_taxonomy_id":769,"taxonomy":"category","description":"","parent":0,"count":23,"filter":"raw","cat_ID":771,"category_count":23,"category_description":"","cat_name":"SIP","category_nicename":"sip-en","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=482"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/482\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}