Knowledge Base

General Configuration Guide Skype for SIP and Asterisk


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 “vanilla” Asterisk server.


To install Asterisk on your server, please see the Digium documentation here


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:-

apt-get install asterisk



Configuration Files for Vanilla Asterisk


In configuring Skype for SIP on a vanilla Asterisk system we are primarily concerned with two configuration files:-


  1. sip.conf (located in the /etc/asterisk/ directory)
    The sip.conf file holds the registration details for the Skype for SIP channel
  2. extensions.conf (located in the /etc/asterisk/ directory)The extensions.conf holds the dial plan telling Asterisk what to do with incoming and outgoing calls.-


Let’s do a walkthrough of the configuration steps.


Configuring the sip.conf File


Step 1


The sip.conf file has two sections that need to be completed. The “General” section (denoted in the file with the [general] heading) and peer section denoted in the file with the [peers] heading.


In the General section we need to add a “register” line. This tells Asterisk to register with Skype at the Skype local point of presence.


Add the following, under the “[general]” 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):-


register => 99051000xxxxxx: /99051000xxxxxx


Step 2

To ensure that we also receive the callerID from Skype clients we also should add:-


trustrpid = no

sendrpid = yes



Step 3

Next, we add a section for the peer, in the “[peers]” 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):-



type = peer

username = 99051000xxxxxx

fromdomain =

fromuser = 99051000xxxxxx

realm =

host =

dtmfmode = rfc2833

secret = PaSsW0rD

nat = no ;This should be set to reflect your network NAT configuration

canreinvite = no

insecure = invite

qualify = yes

disallow = all

allow = alaw

allow = ulaw

;allow = g729 ; Uncomment this if you have G729 licences

amaflags = default

trustrpid = no

sendrpid = yes

context = skype_in


Please Note:

If your Asterisk PBX is behind a NAT device, you should set “nat = yes” in this section.


If your Asterisk PBX has a dedicated internet IP address, set this to “nat = no”.


Step 4

After setting these changes, reload the Asterisk’s SIP module by typing:-


asterisk -rx “reload”


…….at the command line.


Step 5

After the SIP Module has reloaded enter asterisk -rx “sip show peers” at the command line, which should return:


pbx*CLI> sip show peers

Name/username Host Dyn Nat ACL Port Status

99051000xxxxxx/99051000xx 5060 OK (52 ms)


Then enter asterisk -rx sip show registry” which should return:


pbx*CLI> sip show registry

Host Username Refresh State Reg.Time 99051000xxxx 105 Registered day, dd mmm yyyy hh:mm:ss


If you see output similar to the above, then you are registered to the Skype SIP gateway and ready to make and receive calls.


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.


Configuring the extensions.conf File


The extensions.conf file requires a “context” and an “extension” to be added for incoming Skype calls, plus an extension to be added to the context that users use for outgoing calls.


Incoming “context”


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:-



exten => 99051xxxxxxxx,Noop(${CALLERID(name)} , ${CALLERID(num)})

exten => 99051xxxxxxxx,n,Dial(SIP/100,30,t,r)

exten => 99051xxxxxxxx,n,voicemail(100|u)


This is a simple “vanilla” 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:-



exten => 99051xxxxxxxx,1,Noop(${CALLERID(name)} , ${CALLERID(num)})

exten => 99051xxxxxxxx,n,Queue(sfs|r|||40)

exten => 99051xxxxxxxx,n,voicemail(100|u)



Outgoing “Context”


The outgoing context must be included in the context for your user’s phones. Usual security measures apply. Do not include this in a context for incoming calls.




exten => _90Z.,1,Set(CALLERID(num)= 99051xxxxxxxx)

exten => _90Z.,n,Dial(SIP/0044${EXTEN:2}@99051xxxxxxxx)


exten => _900.,1,Set(CALLERID(num)= 99051xxxxxxxx)

exten => _900.,n,Dial(SIP/${EXTEN:1}@99051xxxxxxxx)



In the sip.conf add the following to create user 100





callerid=”myskypetrunk” <100>

















in the extensiosn.conf add the following to the default context


exten => _XXX,1,Dial(SIP/${EXTEN},20)


Also create a context called international



include => default

include => skype_out