{"id":508,"date":"2012-02-21T23:02:46","date_gmt":"2012-02-21T22:02:46","guid":{"rendered":""},"modified":"2019-11-19T09:53:14","modified_gmt":"2019-11-19T08:53:14","slug":"installing-and-configuring-restund-stunturn-server","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/installing-and-configuring-restund-stunturn-server\/","title":{"rendered":"Installing and configuring Restund &#8211; STUN\/TURN server"},"content":{"rendered":"<p>This guide describes how to install and configure RESTUND STUN\/TURN server for supporting TURN functionality.&nbsp;<\/p>\n<p>This sollution is still in TESTING STATE!!!<\/p>\n<p>TURN server seems to work properly, but sometimes the klient channel allocation on server side is not working and the media stream wont start!<\/p>\n<p>Testing with: Restund v0.4.0, Kamailio v3.2, X-lite 4.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>First we need to install compiler g++ and make:<\/p>\n<pre> apt-get install g++ make<\/pre>\n<p>&nbsp;<\/p>\n<p>The instalation and configuration of RESTUND STUN\/TURN server takes more steps (official site <u>http:\/\/www.creytiv.com\/restund.html<\/u>).&nbsp;<\/p>\n<p>The first sten is installing libre (Toolkit library for asynchronous network IO with protocol stacks including SIP, SDP, RTP, STUN, TURN, ICE, BFCP and DNS):<\/p>\n<pre> wget http:\/\/www.creytiv.com\/pub\/re-0.4.0.tar.gz\n\n tar xf re-0.4.0.tar.gz\n\n cd re-0.4.0\/\n\n make\n\n make install<\/pre>\n<p>Now we can install the STUN\/TURN server:<\/p>\n<pre> wget http:\/\/www.creytiv.com\/pub\/restund-0.4.0.tar.gz\n\n tar xf restund-0.4.0.tar.gz\n\n cd restund-0.4.0\/\n\n make\n\n make install<\/pre>\n<p>And finally the configuration file. The sample configuration file is in restund etc directory:<\/p>\n<pre>joe ...\/restund-0.4.0\/etc\/restund.conf<br type=\"_moz\"><\/pre>\n<p>Hint: Some notes about configuration file items could be find in &#8230;\/restund\/docs\/restund.txt<\/p>\n<p>&nbsp;<\/p>\n<p>Following changes in configuration file will provide the basic TURN server functionality:<\/p>\n<pre>debug                     yes\nsyncinterval              600<o:p><\/o:p>\nudp_listen                158.193.139.47:3478 #YOUR IP ADDRESS<o:p><\/o:p>\nudp_listen                158.193.139.48:3478 #YOUR IP ADDRESS<o:p><\/o:p>\nudp_sockbuf_size          524288<o:p><\/o:p>\ntcp_listen                158.193.139.47:3478 #YOUR IP ADDRESS<o:p><\/o:p>\ntcp_listen                158.193.139.48:3478 #YOUR IP ADDRESS<o:p><\/o:p>\n\n# modules<o:p><\/o:p>\nmodule_path               \/usr\/local\/lib\/restund\/modules<o:p><\/o:p>\nmodule                    stat.so<o:p><\/o:p>\nmodule                    binding.so<o:p><\/o:p>\n#module                   auth.so   #no authentication configured, so comment<o:p><\/o:p>\nmodule                    turn.so<o:p><\/o:p>\n#module                   mysql_ser.so  <span lang=\"EN-US\">#Mysql  not yes supported, so comment<o:p><\/o:p><\/span>\nmodule                    syslog.so<o:p><\/o:p>\nmodule                    status.so<o:p><\/o:p>\n\n# turn<o:p><\/o:p>\nturn_max_allocations   512<o:p><\/o:p>\nturn_max_lifetime      600<o:p><\/o:p>\nturn_relay_addr        158.193.139.47 #YOUR IP ADDRESS<o:p><\/o:p>\n#turn_relay_addr6      ::1 #comment if not using IPv6 <o:p><\/o:p>\n\n<span lang=\"EN-US\">#Mysql  not yes supported, so comment following lines<o:p><\/o:p><\/span>\n# mysql<o:p><\/o:p>\n#mysql_host                     localhost<o:p><\/o:p>\n#mysql_user                     ser<o:p><\/o:p>\n#mysql_pass                     heslo<o:p><\/o:p>\n#mysql_db                        ser<o:p><\/o:p><\/pre>\n<p class=\"MsoNormal\" style=\"margin-bottom: 0.0001pt; \"><o:p><\/o:p><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;After making changes above copy the configuration file into \/etc\/ directory:<\/p>\n<pre>cp ...\/restund-0.4.0\/etc\/restund.conf \/etc\/<\/pre>\n<p>&nbsp;<\/p>\n<p>To run RESTUND STUN\/TURN server use following command:<\/p>\n<pre>restund \/etc\/restund.conf<\/pre>\n<p>With debbuging mode on following message (or similar) appear:<\/p>\n<pre><span style=\"background-color: rgb(255, 255, 255); \">udp listen: 158.193.139.47:3478  <\/span>udp listen: 158.193.139.48:3478\ntcp listen: 158.193.139.47:3478\ntcp listen: 158.193.139.48:3478\nstat: module loaded\nbinding: module loaded\nturn: lifetime=120 ext=158.193.139.47 ext6=? bsz=1024\nsyslog: module loaded facility=24\nstatus: module loaded (udp=127.0.0.1:33000 http=158.193.139.47:8080)<\/pre>\n<p>&nbsp;<\/p>\n<p>To see the actual status of your TURN server, we need to install apache server:<\/p>\n<pre>apt-get install apache2<\/pre>\n<p>&nbsp;<\/p>\n<p>And next do following changes in configuration file:<\/p>\n<pre># status\n#status_udp_addr      127.0.0.1 #comment\n#status_udp_port      33000     #comment\nstatus_http_addr      158.193.139.47 #YOUR IP ADDRESS\nstatus_http_port      8080 #port for http access<\/pre>\n<p class=\"MsoNormal\" style=\"margin-bottom: 0.0001pt; \"><o:p><\/o:p><\/p>\n<p>&nbsp;<\/p>\n<p>Restart your RESTUND STUN\/TURN server. Now you are able to if your server is running and how long with your web browser:<\/p>\n<pre>http:\/\/YOUR_IP_ADDRESS:8080<\/pre>","protected":false},"excerpt":{"rendered":"<p>This guide describes how to install and configure RESTUND STUN\/TURN server for supporting TURN functionality.&nbsp;<\/p>\n<p>This sollution is still in TESTING STATE!!!<\/p>\n<p>TURN server seems to work properly, but sometimes the klient channel allocation on server side is not working and the media stream wont start!<\/p>\n<p>Testing with: Restund v0.4.0, Kamailio v3.2, X-lite 4.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>First we need to install compiler g++ and make:<\/p>\n<pre>\r\n apt-get install g++ make<\/pre>\n<p>&nbsp;<\/p>","protected":false},"author":434,"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":[771],"tags":[],"class_list":["post-508","post","type-post","status-publish","format-standard","hentry","category-sip-en"],"taxonomy_info":{"category":[{"value":771,"label":"SIP"}]},"featured_image_src_large":false,"author_info":{"display_name":"","author_link":"https:\/\/nil.uniza.sk\/en\/author\/"},"comment_info":8,"category_info":[{"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\/508","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\/434"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=508"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/508\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}