{"id":332,"date":"2010-11-16T15:14:44","date_gmt":"2010-11-16T14:14:44","guid":{"rendered":""},"modified":"2018-11-01T11:09:43","modified_gmt":"2018-11-01T10:09:43","slug":"installing-kamailio-31-debian-lenny","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/installing-kamailio-31-debian-lenny\/","title":{"rendered":"Installing Kamailio 3.1 on debian lenny"},"content":{"rendered":"<p>\n\tThe original quick start docs for Kamailio 3.1.x are availbale at the <a href=\"http:\/\/kamailio.org\/docs\/install\/INSTALL.kamailio-3.1.x\">kamailio site.<\/a><\/p>\n<h2>\n\tPrerequisities<\/h2>\n<p>\n\tFirst, we will add Kamailio repository into our debian <a href=\"https:\/\/nil.uniza.sk\/en\/sip\/kamailio\/how-install-kamailio-debian-apt-repository\/\">\/apt\/source.list<\/a>, then we will not need download individual packages or making installation from source files.&nbsp;<\/p>\n<p>\n\tDo not forget update apt source:<\/p>\n<pre>\r\napt-get update\r\n<\/pre>\n<p>\n\tlook, if package as kamailio is founded:<\/p>\n<pre>\r\napt-cache search kamailio\r\n\r\nkamailio - very fast and configurable SIP proxy\r\nkamailio-berkeley-modules - Berkeley Database module for Kamailio\r\n...\r\n...\r\n<\/pre>\n<p>\n\tand take a closer look on information about the Kamailio package version, if it is 3.1.x<\/p>\n<pre>\r\napt-cache show kamailio\r\n\r\nPackage: kamailio\r\nVersion: 3.1.0+lenny3\r\nArchitecture: amd64\r\nMaintainer: Jon Bonilla &lt;manwe@aholab.ehu.es&gt;\r\nInstalled-Size: 25760\r\n...\r\n...<\/pre>\n<h2>\n\tPreparing the DNS service<\/h2>\n<p>\n\tLook 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&#39;ve added following lines:<\/p>\n<pre>\r\n_sip._udp       SRV 0 1 5060    pstest\r\n_sip._tcp       SRV 0 1 5060    pstest\r\npstest          IN      A       158.193.139.51\r\n<\/pre>\n<p>\n\tThe dig dns utility have to return correct IP&nbsp;address pointing to your server<\/p>\n<pre>\r\ndig SRV <span><strong>_sip._udp<\/strong><\/span>.ps.sip.uniza.sk\r\nor\r\ndig SRV <span><strong>_sip._tcp<\/strong><\/span>.ps.sip.uniza.sk\r\n<\/pre>\n<h2>\n\tInstallation<\/h2>\n<p>\n\tJust<\/p>\n<pre>\r\napt-get install kamailio\r\n<\/pre>\n<p>\n\tand the installation process at the end tell us that<\/p>\n<pre>\r\nSetting up kamailio (3.1.0+lenny3) ...\r\n<span>adduser: Warning: The home directory `\/var\/run\/kamailio&#39; does not belong to the user you are currently creating. Kamailio not yet configured. Edit \/etc\/default\/kamailio first.<\/span><\/pre>\n<p>\n\tOpen the&nbsp; <em>\/etc\/default\/kamailio<\/em> file:<\/p>\n<pre>\r\n# Set to yes to enable kamailio, once configured properly.\r\nRUN_KAMAILIO=yes\r\n\r\n# User to run as\r\nUSER=kamailio\r\n\r\n# Group to run as\r\nGROUP=kamailio\r\n\r\n# Amount of shared memory to allocate for the running Kamailio server (in Mb)\r\nSHM_MEMORY=64\r\n\r\n# Amount of private memory for each Kamailio process (in Mb)\r\nPKG_MEMORY=4\r\n<\/pre>\n<p>\n\tand we may start a base Kamailio server service, which is running default configuration<\/p>\n<pre>\r\n\/etc\/init.d\/kamailio start\r\nloading modules under \/usr\/lib\/kamailio\/modules_k\/:\/usr\/lib\/kamailio\/modules\/\r\nListening on\r\n             udp: 127.0.0.1:5060\r\n             udp: 158.193.139.51:5060\r\n             tcp: 127.0.0.1:5060\r\n             tcp: 158.193.139.51:5060\r\nAliases:\r\n             tcp: pstest:5060\r\n             tcp: pstest.ps.sip.uniza.sk:5060\r\n             tcp: localhost:5060\r\n             udp: pstest:5060\r\n             udp: pstest.ps.sip.uniza.sk:5060\r\n             udp: localhost:5060\r\n<\/pre>\n<p>\n\tEverything looks good till we did not try to register an account using SIP client. The answer from the server is <strong>483 Too many hops<em>. <\/em><\/strong>Well,<strong><em>&nbsp;<\/em><\/strong>I do not know what I&#39;m doing bad (I made many ser\/openser installs), but the problem is solved by adding <strong><em>alias<\/em><\/strong> into the cfg file. I never find this note inside of any SER\/OpenSer\/Kamailio guides.<\/p>\n<p>\n\tNow, we have to add information about the serving local doamin. Find inside of your kamailio.cfg something which looks like<\/p>\n<pre>\r\n\/* add local domain aliases *\/\r\n#alias=&quot;sip.mydomain.com&quot;<\/pre>\n<p>\n\tand add line with your serving domain info, here<\/p>\n<pre>\r\nalias=&quot;ps.sip.uniza.sk&quot;<\/pre>\n<p>\n\tand restart the kamailio service<\/p>\n<pre>\r\n\/etc\/init.d# kamailio start\r\n\r\nloading modules under \/usr\/lib\/kamailio\/modules_k\/:\/usr\/lib\/kamailio\/modules\/\r\nListening on\r\n             udp: 127.0.0.1:5060\r\n             udp: 158.193.139.51:5060\r\n             tcp: 127.0.0.1:5060\r\n             tcp: 158.193.139.51:5060\r\nAliases:\r\n             tcp: pstest:5060\r\n             tcp: pstest.ps.sip.uniza.sk:5060\r\n             tcp: localhost:5060\r\n             udp: pstest:5060\r\n             udp: pstest.ps.sip.uniza.sk:5060\r\n             udp: localhost:5060\r\n             *: ps.sip.uniza.sk:5060:*\r\n.<\/pre>\n<p>\n\tThe domain added above should appear among serving domains of your server.<\/p>\n<p>\n\tWe should also check Kamailio processes<\/p>\n<pre>\r\n# pgrep kamailio\r\n\r\n1420\r\n1421\r\n1422\r\n1423\r\n1424\r\n1425\r\n1426\r\n1427\r\n1428\r\n1429\r\n1430\r\n1431\r\n1432\r\n1433\r\n1434\r\n1435\r\n1436\r\n1437<\/pre>\n<p>\n\t&nbsp;<\/p>\n<p>\n\tThe registration using your favorite client should work.<\/p>\n<pre>\r\nkamctl ul show\r\n\r\nDomain:: location table=512 records=1 max_slot=1\r\n        AOR:: palo\r\n                Contact:: sip:palo@158.193.139.100:3922;rinstance=694c639216cbd981 Q=\r\n                        Expires:: 3591\r\n                        Callid:: MDU5NWIxNTQyZGU4ZTAwM2ZjMzVhMGE2OWY3Mzk1NmI.\r\n                        Cseq:: 1\r\n                        User-agent:: eyeBeam release 1102q stamp 51814\r\n                        State:: CS_NEW\r\n                        Flags:: 0\r\n                        Cflag:: 0\r\n                        Socket:: udp:158.193.139.51:5060\r\n                        Methods:: 5087\r\n<\/pre>\n<p>\n\t&nbsp;<\/p>\n<h2>\n\tServer operation monitoring<\/h2>\n<p>\n\tFor server monitoring there is&nbsp; the <strong>kamctl<\/strong> tool, which has a lot of optional switches.<\/p>\n<p>\n\t&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>\n\tThe original quick start docs for Kamailio 3.1.x are availbale at the <a href=\"http:\/\/kamailio.org\/docs\/install\/INSTALL.kamailio-3.1.x\">kamailio site.<\/a><\/p>\n<h2>\n\tPrerequisities<\/h2>\n<p>\n\tFirst, we will add Kamailio repository into our debian <a href=\"https:\/\/nil-test.kis.fri.uniza.sk\/sip\/kamailio\/how-install-kamailio-debian-apt-repository\">\/apt\/source.list<\/a>, then we will not need download individual packages or making installation from source files.&nbsp;<\/p>\n<p>\n\tDo not forget update apt source:<\/p>\n<pre>\r\napt-get update\r\n<\/pre>\n<p>\n\tlook, if package as kamailio is founded:<\/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],"tags":[],"class_list":["post-332","post","type-post","status-publish","format-standard","hentry","category-kamailio-en"],"taxonomy_info":{"category":[{"value":781,"label":"Kamailio"}]},"featured_image_src_large":false,"author_info":{"display_name":"admin","author_link":"https:\/\/nil.uniza.sk\/en\/author\/admin\/"},"comment_info":1,"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}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/332","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=332"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/332\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}