{"id":541,"date":"2012-10-10T19:26:18","date_gmt":"2012-10-10T17:26:18","guid":{"rendered":""},"modified":"2018-11-01T00:48:39","modified_gmt":"2018-10-31T23:48:39","slug":"enabling-sctp-support-kamailio-33x-debian-squeeze","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/enabling-sctp-support-kamailio-33x-debian-squeeze\/","title":{"rendered":"Enabling SCTP support in Kamailio 3.3.x &#8211; debian squeeze"},"content":{"rendered":"<p>Preprepared&nbsp;binary package of the Kamailio server hasn&#39;t enabled the SCTP support. You may check this on your running platform both ways:<\/p>\n<p><strong>First <\/strong>running kamailio command with -V options and checking the output for the sctp flag:<\/p>\n<p>kamailio -V<\/p>\n<p>or<\/p>\n<pre>\r\nkamailio -V | grep SCTP<\/pre>\n<p>and if nothing to see, there is no SCTP support enabled.<\/p>\n<p><strong>Second, <\/strong>using sercmd tool, but we have to <a href=\"http:\/\/kamailio.org\/docs\/modules\/3.0.x\/modules\/ctl.html\">load and enable<\/a> ctl module in our kamailio.cfg. Then run<\/p>\n<pre>\r\nsercmd core.sctp_info<\/pre>\n<p>and if Kamailio does not support, we may see this:<\/p>\n<pre>\r\nsercmd core.sctp_info\r\nerror: 500 - sctp support not compiled<\/pre>\n<p>Therefore in this article we try to prepare pure Kamailio server without any modules but with enabled support of the SCTP protocol, so using them we may start to play with SCTP. And, of course, we do this by compiling new binaries from the source.<\/p>\n<p>First of all, check if your linux machine kernel support sctp, so install<\/p>\n<pre>\r\napt-get install lksctp-tools<\/pre>\n<p>and check sctp support running command checksctp<\/p>\n<pre>\r\nchecksctp\r\nSCTP supported\r\n<\/pre>\n<p>should be supported by your OS, if not, solve it!<\/p>\n<p>No we are going to prepare for the compilation of our new kamailio. Please follow instructions described in <a href=\"https:\/\/www.kamailio.org\/wiki\/install\/3.3.x\/git\">Install And Maintain Kamailio v3.3.x Version From GIT<\/a> guide up to step <strong>3<\/strong>.<\/p>\n<p>Now we prepare make files, so run:<\/p>\n<pre class=\"code\">\r\nmake FLAVOUR=kamailio cfg<\/pre>\n<p>without any include_module parameters. Then run:<\/p>\n<pre>\r\n make PREFIX=&quot;\/usr\/local\/kamailio-3.3&quot; <strong><span style=\"\"><span style=\"background-color:#ffff00;\">SCTP=1<\/span><\/span><\/strong><span style=\"background-color:#ffff00;\"> <\/span>FLAVOUR=kamailio cfg<\/pre>\n<p>The <span>SCTP=1 <\/span>is very important parameter for us, because it switch on SCTP support for upcoming compilation.<\/p>\n<p>Ckeck make config file (config.mak) for SCTP flags<\/p>\n<p>less config.mak | grep SCTP<\/p>\n<p>C_DEFS=&nbsp;&nbsp; -DNAME=&#39;&quot;kamailio&quot;&#39; -DVERSION=&#39;&quot;3.3.2&quot;&#39; -DARCH=&#39;&quot;i386&quot;&#39; -DOS=&#39;linux_&#39; -DOS_QUOTED=&#39;&quot;linux&quot;&#39; -DCOMPILER=&#39;&quot;gcc 4.4.5&quot;&#39; -D__CPU_i386 -D__OS_linux -DSER_VER=3003002 -DCFG_DIR=&#39;&quot;\/usr\/local\/kamailio-3.3\/etc\/kamailio\/&quot;&#39; -DPKG_MALLOC -DSHM_MEM&nbsp; -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP&nbsp; -DF_MALLOC -DMEM_JOIN_FREE -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024&nbsp; -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DUSE_RAW_SOCKS -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT <strong><span style=\"\"><span style=\"background-color:#ffff00;\">-DUSE_SCTP<\/span><\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>and you should see SCTP.<\/p>\n<p>Now we begin compiling<\/p>\n<pre>\r\nmake all\r\n<\/pre>\n<p>and then the installation<\/p>\n<pre>\r\nmake install<\/pre>\n<p>Move to install dir, in our case<\/p>\n<pre class=\"code\">\r\n\/usr\/local\/kamailio-3.3\/sbin<\/pre>\n<p>and check again SCTP support with<\/p>\n<pre>\r\n<strong>.\/kamailio -V | grep SCTP<\/strong>\r\nflags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS,<span> <\/span><strong><span style=\"\"><span style=\"background-color:#ffff00;\">USE_SCTP<\/span><\/span><span style=\"\"><span style=\"background-color:#ffff00;\">,<\/span><\/span><\/strong> TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES\r\n<\/pre>\n<p>You should see USE_SCTP flag.<\/p>\n<p>And if we start kamailio process, we should see:<\/p>\n<pre>\r\nkamailio\r\nloading modules under \/usr\/local\/kamailio-3.3\/lib\/kamailio\/modules_k\/:\/usr\/local\/kamailio-3.3\/lib\/kamailio\/modules\/\r\nListening on\r\n             udp: 127.0.0.1:5060\r\n             udp: 192.168.10.186:5060\r\n             tcp: 127.0.0.1:5060\r\n             tcp: 192.168.10.186:5060\r\n             <span style=\"\"><span style=\"background-color:#ffff00;\">sctp: 127.0.0.1:5060\r\n             sctp: 192.168.10.186:5060<\/span><\/span>\r\nAliases:\r\n             <span style=\"\"><span style=\"background-color:#ffff00;\">sctp: localhost:5060<\/span><\/span>\r\n             tcp: localhost:5060\r\n             udp: localhost:5060\r\n<\/pre>\n<p>Which means, that sctp is by default enabled and<\/p>\n<pre>\r\nenable_sctp = 1<\/pre>\n<p>parameter in kamailio.cfg is not required.<\/p>\n<p>Now continue with the rest of <a href=\"https:\/\/www.kamailio.org\/wiki\/install\/3.3.x\/git\">Install And Maintain Kamailio v3.3.x Version From GIT<\/a> guide, especially with step 9, init scripts. Or you should start from begining again and compile the kamailio with all modules required. Now we know how to enable the SCTP support!<\/p>\n<p>&nbsp;<\/p>\n<p>NOte: For the usability of our installation prepare correct DNS NAPTR and SRV records, including support for SCTP.<\/p>","protected":false},"excerpt":{"rendered":"<p>Preprepared&nbsp;binary package of the Kamailio server hasn&#39;t enabled the SCTP support. You may check this on your running platform both ways:<\/p>\n<p><strong>First <\/strong>running kamailio command with -V options and checking the output for the sctp flag:<\/p>\n<p>kamailio -V<\/p>\n<p>or<\/p>\n<pre>\r\nkamailio -V | grep SCTP<\/pre>\n<p>and if nothing to see, there is no SCTP support enabled.<\/p>\n<p><strong>Second, <\/strong>using sercmd tool, but we have to <a href=\"http:\/\/kamailio.org\/docs\/modules\/3.0.x\/modules\/ctl.html\">load and enable<\/a> ctl module in our kamailio.cfg. Then run<\/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-541","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":7,"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\/541","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=541"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/541\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}