{"id":718,"date":"2012-03-14T18:52:48","date_gmt":"2012-03-14T18:52:48","guid":{"rendered":"http:\/\/cyber-cottage.co.uk\/en\/?p=718"},"modified":"2012-03-14T18:52:48","modified_gmt":"2012-03-14T18:52:48","slug":"718","status":"publish","type":"post","link":"https:\/\/www.cyber-cottage.co.uk\/?p=718","title":{"rendered":""},"content":{"rendered":"<p><strong>General Configuration Guide\u00a0Skype for SIP and Asterisk<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>If you are new to SIP, Asterisk is a useful, open-source (GPL) platform with which to test and experiment with the Skype for SIP. This is a guide on how to install Skype for SIP on a system agnostic or \u201cvanilla\u201d Asterisk server.<\/p>\n<p>&nbsp;<\/p>\n<p>To install Asterisk on your server, please see the Digium documentation here http:\/\/www.asterisk.org.<\/p>\n<p>&nbsp;<\/p>\n<p>This configuration guide is based on Debian Linux (Lenny 64bit). With a basic installation of Debian you can install Asterisk by issuing the following APT command at the command line:-<\/p>\n<p>apt-get install asterisk<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Configuration Files for Vanilla Asterisk<\/p>\n<p>&nbsp;<\/p>\n<p>In configuring Skype for SIP on a vanilla Asterisk system we are primarily concerned with two configuration files:-<\/p>\n<p>&nbsp;<\/p>\n<ol>\n<li><strong>sip.conf (located in the \/etc\/asterisk\/ directory)<br \/>\n<\/strong>The sip.conf file holds the registration details for the Skype for SIP channel<\/li>\n<li><strong>extensions.conf (located in the \/etc\/asterisk\/ directory)<\/strong>The\u00a0extensions.conf holds the dial plan telling Asterisk what to do with incoming and outgoing calls.-<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>Let\u2019s do a walkthrough of the configuration steps.<\/p>\n<p>&nbsp;<\/p>\n<p>Configuring the sip.conf File<\/p>\n<p>&nbsp;<\/p>\n<p>Step 1<\/p>\n<p>&nbsp;<\/p>\n<p>The sip.conf file has two sections that need to be completed. The \u201cGeneral\u201d section (denoted in the file with the [general] heading) and peer section denoted in the file with the [peers] heading.<\/p>\n<p>&nbsp;<\/p>\n<p>In the General section we need to add a \u201cregister\u201d line. This tells Asterisk to register with Skype at the Skype local point of presence.<\/p>\n<p>&nbsp;<\/p>\n<p>Add the following, under the \u201c[general]\u201d section in the file, substituting your 9905xxxx number and password with your actual credentials for the Skype for SIP profile you wish to use. Your SIP Profile details can be found in the Skype Business Control Panel (BCP):-<\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>register =&gt; 99051000xxxxxx:\u00a0<a href=\"mailto:PaSsW0rD@sip.skype.com\">PaSsW0rD@sip.skype.com<\/a>\u00a0\/99051000xxxxxx<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p>Step 2<\/p>\n<p>To ensure that we also receive the callerID from Skype clients we also should add:-<\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>trustrpid = no<\/strong><\/em><\/p>\n<p><em><strong>sendrpid = yes<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Step 3<\/p>\n<p>Next, we add a section for the peer, in the \u201c[peers]\u201d section of the sip.conf file. Again we substitute the 9905xxxxx number and password with the SIP Profile credentials from the Skype Business Control Panel (BCP):-<\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>[99051000xxxxxx]<\/strong><\/em><\/p>\n<p><em><strong>type = peer<\/strong><\/em><\/p>\n<p><em><strong>username = 99051000xxxxxx<\/strong><\/em><\/p>\n<p><em><strong>fromdomain = sip.skype.com<\/strong><\/em><\/p>\n<p><em><strong>fromuser = 99051000xxxxxx<\/strong><\/em><\/p>\n<p><em><strong>realm = sip.skype.com<\/strong><\/em><\/p>\n<p><em><strong>host = sip.skype.com<\/strong><\/em><\/p>\n<p><em><strong>dtmfmode = rfc2833<\/strong><\/em><\/p>\n<p><em><strong>secret = PaSsW0rD<\/strong><\/em><\/p>\n<p><em><strong>nat = no ;<\/strong><\/em><em>This should be set to reflect your network NAT configuration<\/em><\/p>\n<p><em><strong>canreinvite = no<\/strong><\/em><\/p>\n<p><em><strong>insecure = invite<\/strong><\/em><\/p>\n<p><em><strong>qualify = yes<\/strong><\/em><\/p>\n<p><em><strong>disallow = all<\/strong><\/em><\/p>\n<p><em><strong>allow = alaw<\/strong><\/em><\/p>\n<p><em><strong>allow = ulaw<\/strong><\/em><\/p>\n<p><em><strong>;allow = g729 ;\u00a0<\/strong><\/em><em>Uncomment this if you have G729 licences<\/em><\/p>\n<p><em><strong>amaflags = default<\/strong><\/em><\/p>\n<p><em><strong>trustrpid = no<\/strong><\/em><\/p>\n<p><em><strong>sendrpid = yes<\/strong><\/em><\/p>\n<p><em><strong>context = skype_in<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>Please Note:<\/strong><\/em><\/p>\n<p>If your Asterisk PBX is behind a NAT device, you should set \u201cnat = yes\u201d in this section.<\/p>\n<p>&nbsp;<\/p>\n<p>If your Asterisk PBX has a dedicated internet IP address, set this to \u201cnat = no\u201d.<\/p>\n<p>&nbsp;<\/p>\n<p>Step 4<\/p>\n<p>After setting these changes, reload the Asterisk\u2019s SIP module by typing:-<\/p>\n<p>&nbsp;<\/p>\n<p>asterisk -rx &#8220;reload chan_sip.so&#8221;<\/p>\n<p>&nbsp;<\/p>\n<p>\u2026\u2026.at the command line.<\/p>\n<p>&nbsp;<\/p>\n<p>Step 5<\/p>\n<p>After the SIP Module has reloaded enter\u00a0<em><strong>asterisk -rx &#8220;sip show peers&#8221;<\/strong><\/em><em>\u00a0at the command line,\u00a0<\/em>which should return:<\/p>\n<p>&nbsp;<\/p>\n<p><strong>pbx*CLI&gt; sip show peers<\/strong><\/p>\n<p><strong>Name\/username Host Dyn Nat ACL Port Status<\/strong><\/p>\n<p><strong>99051000xxxxxx\/99051000xx 193.120.218.68 5060 OK (52 ms)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Then enter\u00a0<em><strong>asterisk -rx\u00a0<\/strong><\/em>\u201c<em><strong>sip show registry<\/strong><\/em>\u201d which should return:<\/p>\n<p>&nbsp;<\/p>\n<p><strong>pbx*CLI&gt; sip show registry<\/strong><\/p>\n<p><strong>Host Username Refresh State Reg.Time<\/strong><\/p>\n<p><strong>sip.skype.com:5060 99051000xxxx 105 Registered day, dd mmm yyyy hh:mm:ss<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>If you see output similar to the above, then you are registered to the Skype SIP gateway and ready to make and receive calls.<\/p>\n<p>&nbsp;<\/p>\n<p>We now need to setup the extensions.conf so that we have a dialplan setup and Asterisk knows how to deal with incoming and outgoing calls.<\/p>\n<p>&nbsp;<\/p>\n<p>Configuring the extensions.conf File<\/p>\n<p>&nbsp;<\/p>\n<p>The extensions.conf file requires a \u201ccontext\u201d and an \u201cextension\u201d to be added for incoming Skype calls, plus an extension to be added to the\u00a0<em>context that users use for outgoing calls<\/em>.<\/p>\n<p>&nbsp;<\/p>\n<p>Incoming \u201ccontext\u201d<\/p>\n<p>&nbsp;<\/p>\n<p>Add the following lines to the [context] section of extensions.conf, substituting 9905xxxxxxx with the 9905 number for the SIP Profile. Again you can find the details of your Skype SIP Profiles in the Skype BCP:-<\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>[skype_in]<\/strong><\/em><\/p>\n<p><em><strong>exten =&gt; 99051xxxxxxxx,Noop(${CALLERID(name)} , ${CALLERID(num)})<\/strong><\/em><\/p>\n<p><em><strong>exten =&gt; 99051xxxxxxxx,n,Dial(SIP\/100,30,t,r)<\/strong><\/em><\/p>\n<p><em><strong>exten =&gt; 99051xxxxxxxx,n,voicemail(100|u)<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p>This is a simple \u201cvanilla\u201d context that shows us the callerID name and number, dials extension 100 for 30 seconds and finally, if unanswered, goes to voicemail. This sequence will need to be amended to suit your requirements. If you are planning on having many SIP Profiles or Online Numbers that all need to end up at the same destination, or the destination is decided by the Skype Business Account that the online number is registered against, a more complicated Dialplan can be used. For example:-<\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>[skype_in]<\/strong><\/em><\/p>\n<p><em><strong>exten =&gt; 99051xxxxxxxx,1,Noop(${CALLERID(name)} , ${CALLERID(num)})<\/strong><\/em><\/p>\n<p><em><strong>exten =&gt; 99051xxxxxxxx,n,Queue(sfs|r|||40)<\/strong><\/em><\/p>\n<p><em><strong>exten =&gt; 99051xxxxxxxx,n,voicemail(100|u)<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Outgoing \u201cContext\u201d<\/p>\n<p>&nbsp;<\/p>\n<p>The outgoing context must be included in the context for your user\u2019s phones. Usual security measures apply. Do not include this in a context for incoming calls.<\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>[skype_out]<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>exten =&gt; _90Z.,1,Set(CALLERID(num)= 99051xxxxxxxx)<\/strong><\/em><\/p>\n<p><em><strong>exten =&gt; _90Z.,n,Dial(SIP\/0044${EXTEN:2}@99051xxxxxxxx)<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>exten =&gt; _900.,1,Set(CALLERID(num)= 99051xxxxxxxx)<\/strong><\/em><\/p>\n<p><em><strong>exten =&gt; _900.,n,Dial(SIP\/${EXTEN:1}@99051xxxxxxxx)<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>In the sip.conf add the following to create user 100<\/p>\n<p>&nbsp;<\/p>\n<p>[100]<\/p>\n<p>secret=secret<\/p>\n<p>mailbox=100<\/p>\n<p>callerid=&#8221;myskypetrunk&#8221; &lt;100&gt;<\/p>\n<p>type=friend<\/p>\n<p>host=dynamic<\/p>\n<p>context=international<\/p>\n<p>;nat=no<\/p>\n<p>nat=yes<\/p>\n<p>canreinvite=no<\/p>\n<p>dtmfmode=rfc2833<\/p>\n<p>pickupgroup=1<\/p>\n<p>callgroup=1<\/p>\n<p>subscribecontext=default<\/p>\n<p>notifyringing=yes<\/p>\n<p>disallow=all<\/p>\n<p>;allow=alaw<\/p>\n<p>allow=ulaw<\/p>\n<p>allow=gsm<\/p>\n<p>&nbsp;<\/p>\n<p>in\u00a0the\u00a0extensiosn.conf add the following to the default context<\/p>\n<p>&nbsp;<\/p>\n<p><strong>exten =&gt; _XXX,1,Dial(SIP\/${EXTEN},20)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Also create a context called international<\/p>\n<p>&nbsp;<\/p>\n<p>[international]<\/p>\n<p>include =&gt; default<\/p>\n<p>include =&gt;\u00a0<em>skype_out<\/em><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>General Configuration Guide\u00a0Skype for SIP and Asterisk &nbsp; If you are new to SIP, Asterisk is a useful, open-source (GPL) platform with which to test and experiment with the Skype for SIP. This is a guide on how to install Skype for SIP on a system agnostic or \u201cvanilla\u201d Asterisk server. &nbsp; To install Asterisk [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[11],"tags":[23,33,35,37,40,51,76,77],"class_list":["post-718","post","type-post","status-publish","format-standard","hentry","category-knowledge","tag-asterisk","tag-digium","tag-elastix","tag-ethernet","tag-freepbx","tag-linux","tag-voip","tag-xorcom"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/s5daZy-718","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=718"}],"version-history":[{"count":0,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/718\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}