NOTE: THIS ARTICLE ASSUMES THE USE OF CENTOS 6.2
»»»»» Skype for Asterisk is no longer available for sale or activation since July 26, 2011. «««««
Read the Announcement here
RECOMMENDED TOOLS
- Putty SSH -
http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
Remote shell for connecting to your server remotely (via SSH) - for copy/paste commands - WinSCP - http://winscp.net/eng/download.php
FTP client based on SSH (SFTP) - for backing up or restoring your license file, and configuration - VMware Player - http://www.vmware.com/go/downloadplayer/
Virtual Machine host - for testing and configuration without needing a physical machine
Average time for completion – approximately 1:30 hrs
SYSTEM SETUP
- First thing you need to do is download the pbx-in-a-flash iso image. The ISO image can be
found on http://sourceforge.net/projects/pbxinaflash/files/.
- If you are installing PIAF (PBX-in-a-Flash) on a VMware you can also download the Virtual
Machine from http://nerdvittles.dreamhosters.com/pbxinaflash/downloads/pbxinaflash.zip
- For installing PIAF on any other Virtualized environment, follow the same procedure as installing on a physical box.
- Follow the installation prompts until you face the option to install the flavor / version
of Asterisk (GOLD-SILVER-BRONZE-PURPLE-etc) - It is best to chose the version that is supported in the
PIAF forums, especially for a production server.
NOTE: Normally the install wizard will inform you which version is supported. - Once the whole installation is completed, make sure to take note of the MAC address you'
ve been assigned. Place it together with your license file (step 7) for backup.
- The Skype for Asterisk registration process ties your license to the MAC address
of your ethernet device.
- To determine what your MAC address type (at the prompt):
# ifconfig eth0That will display your interface' s details. Backup the HWADDR address set as ##:##:##:##:##:##
- To determine what your MAC address type (at the prompt):
- If you are restoring your system from a previous crash, now it' s the time to dig up the MAC address you were first assigned when you registered Skype for Asterisk (more details on step 7)
- The Skype for Asterisk registration process ties your license to the MAC address
of your ethernet device.
- Change your IP address according to your network landscape. To change your IP
settings type (at the prompt):
# netconfig- The netconfig command will bring you to the IP Configuration dialog.
Example:IP: 192.168.1.100 Mask: 255.255.255.0 Gateway: 192.168.1.1 DNS: 192.168.1.1 - If you are restoring from a backup you may want to change your IP manually. You
can edit your IP details by editing the network script related to your ethernet device.
Type (at the prompt):
# vim /etc/sysconfig/network-scripts/ifcfg-eth0
you may use your preferred text editor (vi, emacs, Gedit, etc)- The ifcfg-eth0 should look similar to this:
DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.1.100 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 MACADDR=##:##:##:##:##:##(MACADDR is replaced with your actual MAC)
- The ifcfg-eth0 should look similar to this:
- The netconfig command will bring you to the IP Configuration dialog.
- After you change your network settings make sure to restart the eth0 interface
and restart the network service. You can do both by typing (at the prompt):
# ifdow eth0 # ifup eth0 # service network restart -
SKYPE FOR ASTERISK SETUP
NEW INSTALLS - SKIP TO #8 FOR SYSTEM RESTORE
- Download the register application from digium at http://downloads.digium.com/pub/register/x86-32/register.
Preferably, you should download it directly from your PIAF appliance. Type (at the prompt):# cd /root # wget http://downloads.digium.com/pub/register/x86-32/register # chmod 500 /root/register # /root/register - The register prompts will guide you through registering and activating your Skype for
Asterisk license. It will create a license file *.lic located at
/var/lib/asterisk/licenses.
Make sure to backup your license file (WinSCP is most recommended). - Download Skype for Asterisk from http://downloads.digium.com/pub/telephony/skypeforasterisk/.
- Uncompress the package to your preferred location (home is fine). Type (at the prompt):
# tar -xvzf skypeforasterisk* # cd skypeforasterisk* # make # make install # make samples - Skype for asterisk is now installed on your server. Make sure to restart asterisk for the
Skype for Asterisk modules to load (autoload default is yes).
- To restart Asterisk type (at the prompt):
# asterisk -rx " restart now" - If you' d like to manually load the Skype for Asterisk module type (at the prompt):
# asterisk –rvvv
This command enters you into the asterisk console (CLI)# module load res_skypeforasterisk.so # module load chan_skype.so CONFIGURING SKYPE CHANNELS
- To restart Asterisk type (at the prompt):
- If you have restored your system now it' s time to restore your license file.
- Using WinSCP connect to your server and browse to /var/lib/asterisk/
- Create a folder named licenses
- Copy your previously backed up license to that folder
- Remember from step 4 and 5 that you need to make sure your MAC address is the same when you' ve first registered your channel
- Create a skype business account via http://www.skype.com/intl/en-us/business/
- Notice that you will need to create 2 accounts. One master account for your skype for business and one to be used with Skype for Asterisk. Skype for Asterisk does not support master accounts, so you' ll have to create a child skype name in order to configure it with Skype for Asterisk.
- Add credits to your account. **Currently Skype for asterisk does not support
subscription plans.
- Make sure to create a child account using only letters. Underscores ( _ ) are acceptable, but no other symbols will work.
- Using either putty or WinSCP browse to /etc/asterisk/ and edit your channel
configuration. Type (at the prompt) or edit:
# vi /etc/asterisk/chan_skype.conf- Your configuration should look like this (change only what' s below, other options
are for advanced settings)
[general] default_user=your-skype-user-name [your-skype-user-name] secret=skype-secret-password context=from-pstn exten=your-skype-user-name allow=ulaw - Also, make sure to set the ownership for the configuration. Type (at the prompt):
# chown asterisk:asterisk /etc/asterisk/chan_skype.conf - Make sure to restart your asterisk server for the settings to take effect:
# asterisk –rx " restart now"
- Your configuration should look like this (change only what' s below, other options
are for advanced settings)
- The best way to test if everything you’ve done went right is to check if the system has
loaded your license information:
# asterisk –rvvv *CLI> skype show licenses Skype for Asterisk Licensing Information ======================================== Total licensed channels: 100 Licenses Found: File: S4A-ABCDEFGHIJKL.lic -- Key: S4A-ABCDEFGHIJKL -- Expires: 2039-07-31 -- Host-ID: ab:cd:12:34:ab:cd:12:34:ab:cd:12:34:ab:cd:12:34:ab:cd:12:34 -- Channels: 100 (OK) - Also, test if your user was logged in correctly:
# asterisk –rvvv *CLI> skype show users Skype Users your-skype-user-name: Logged In - If both or either doesn’t work you need to review your work!
-
CONFIGURING EXTENSIONS
- In order to set your Inbound Route (step 21) you must setup at least one extension – 2 is
best for testing purposes:
- Click on Extensions
- Select Generic SIP device and click on Submit
- Set your Display Name – for our test let’s call it Ext1
- Set your Outbound CID the extension number you’d like to use – such as 200
- Set your secret – such as Pass123
- Submit
- Follow the same steps from 17 to create another extension – you may call it Ext2 and set
the Outbound CID as 201
Testing both extensions will be possible after you create your trunk and routes -
CONFIGURING TRUNK AND ROUTES
- Now, you need to configure your trunk in order to receive and make calls via FREEPBX
- Login into your FREEPBX server via http://yourIPAddress - in our example it’s http://192.168.1.100
- Change your view to Admin
- Click on FreePBX Administration
- Insert your username and password when prompted – defaolt is maint/password
- Click on Trunks
- Although some details of your configuration may vary – like your dial role – others like
the your Custom Dial String need to be exactly the same as below:
- Add a custom Trunk
- Set your trunk name something familiar – such as SkypeTrunk
- Your Dial Role is whatever dialing pattern will tell your FreePBX that you’re going
to use Skype for Asterisk – in our example our Dial Role is 0|. (the dot at the end is
part of the role)
For additional details on dialing roles visit http://www.freepbx.org/support/documentation/howtos/howto-route-dial-patterns-and-trunk-dial-rules
- Set your custom dial string as skype/+/$OUTNUM$
- Configuring your inbound route:
- Click on Inbound Routes
- Add Incoming Route
- Set your description something related – such as SkypeInbound
- Disable FAX Extension
- Change your CID Lookup Source to None
- Set your destination to one of the extensions you’ve created on step 17-18
- Configuring your outbound route:
- Click on Outbound Routes
- Add Route
- Set your Route Name – such as SkypeOutbound
- Set your dial pattern according to your needs – in our example our Dial Pattern is 0|. (the dot at the end is part of the role)
- Select your trunk sequence – since we’re using Skype for Asterisk our Sequence will necessarily be skype/+/$OUTNUM$ (that we’ve created on step 20)
- Submit Changes
-
CONFIGURE YOUR SIP PHONES
- You may download any SIP client. There are many out there. For our example we’ll use CounterPath’s X-Lite. You may download it from http://www.counterpath.com/x-lite-download.html
- After installation you will need to Configure the SIP Account Settings:
- Set your Display Name – for our example you may set it as Ext1
- The username is the extension you’ve set on FreePBX – in our case it’s 200
- The password is the same you’ve setup for the Extension – in our case it’s Pass123
- Authorization user name the same as the extension number
- The domain is the IP address for your PIAF server – in our case it’s 192.168.1.100
- Make sure you setup the Domain proxy as well:
- Check the Register with domain and receive incoming calls
- Proxy is the IP address of your PIAF server – in our case it’s 192.168.1.100
- Click OK
- For VoIP devices the settings are also the same – such as PaP2 from Linksys
-
FINAL TESTS
- First test calling the other extension to make sure your PIAF doesn’t have any other issues
- Test your Skype Channel by calling a known phone line – such as your own cell
phone.
Please remember that in order to allow international calling the Trunk has no country set, so you’ll need to dial the country code as well
- Try calling a number by dialing 0CNNNNNNNNNN (0 is the dial out pattern, so FreePBX knows you’re calling out, and not another extension, C is country code – being 1 for US, 55 for BR and so forth, and NNNNNNNNNN is the actual phone number of your preference)
- If you are able to dial with no errors, and talk normally during the call then everything was setup correctly, otherwise please check your work.
-
IF AFTER FOLLOWING ALL THE STEPS YOU STILL HAVE ISSUES, OR IF THERE ARE ANY BROKEN LINKS OR INCORRECT INSTRUCTIONS, PLEASE CONTACT US



