Installing and configuring skype for asterisk

Simple but powerful PBX setup

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 —

Average time for completion – approximately 1:30 hrs

— SYSTEM SETUP —

  1. 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/.
  2. 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
    1. For installing PIAF on any other Virtualized environment, follow the same procedure as installing on a physical box.
  3. 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.
  4. 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.
    1. The Skype for Asterisk registration process ties your license to the MAC address of your ethernet device.
      1. To determine what your MAC address type (at the prompt):
              # ifconfig eth0
              
        

        That will display your interface' s details. Backup the HWADDR address set as  ##:##:##:##:##:##

    2. 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)
  5. Change your IP address according to your network landscape. To change your IP settings type (at the prompt):
          # netconfig
          
    
    1. 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
          
      
    2. 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)

  6. 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
        
    
  7. — SKYPE FOR ASTERISK SETUP —

    NEW INSTALLS - SKIP TO #8 FOR SYSTEM RESTORE

  8.    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     
                
    
  9. 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).
  10. Download Skype for Asterisk from  http://downloads.digium.com/pub/telephony/skypeforasterisk/.
  11. Uncompress the package to your preferred location (home is fine). Type (at the prompt):
     
                # tar -xvzf skypeforasterisk*
                # cd skypeforasterisk*
                # make
                # make install
                # make samples
                
    
  12. 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).
    1. To restart Asterisk type (at the prompt):
                  # asterisk -rx " restart now"
                  
      
    2. 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 —

  13. If you have restored your system now it' s time to restore your license file.
    1. Using WinSCP connect to your server and browse to /var/lib/asterisk/
    2. Create a folder named  licenses
      1. Copy your previously backed up license to that folder
      2. 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
  14. Create a skype business account via  http://www.skype.com/intl/en-us/business/
    1. 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.
    2. Add credits to your account.  **Currently Skype for asterisk does not support subscription plans.
      1. Make sure to create a child account using only letters. Underscores ( _ ) are acceptable, but no other symbols will work.
  15. 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     
                
    
    1. 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
                  
      
    2. Also, make sure to set the ownership for the configuration. Type (at the prompt):
                  # chown asterisk:asterisk /etc/asterisk/chan_skype.conf     
                  
      
    3. Make sure to restart your asterisk server for the settings to take effect:
                  # asterisk –rx " restart now"     
                  
      
  16. 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)
                
    
  17. Also, test if your user was logged in correctly:
     
                # asterisk –rvvv
                *CLI> skype show users     
                Skype Users     
                your-skype-user-name: Logged In     
                
    
  18. If both or either doesn’t work you need to review your work!
  19. — CONFIGURING EXTENSIONS —

  20. In order to set your Inbound Route (step 21) you must setup at least one extension – 2 is best for testing purposes:
    1. Click on Extensions
    2. Select Generic SIP device and click on Submit
    3. Set your Display Name – for our test let’s call it Ext1
    4. Set your Outbound CID the extension number you’d like to use – such as 200
    5. Set your secret – such as Pass123
    6. Submit
  21. 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
  22. — CONFIGURING TRUNK AND ROUTES —

  23. Now, you need to configure your trunk in order to receive and make calls via FREEPBX
    1. Login into your FREEPBX server via http://yourIPAddress - in our example it’s http://192.168.1.100
    2. Change your view to Admin
    3. Click on FreePBX Administration
    4. Insert your username and password when prompted – defaolt is maint/password
    5. Click on Trunks
  24. 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:
    1. Add a custom Trunk
    2. Set your trunk name something familiar – such as SkypeTrunk
    3. 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

    4. Set your custom dial string as skype/+/$OUTNUM$
  25. Configuring your inbound route:
    1.  Click on Inbound Routes
    2. Add Incoming Route
    3. Set your description something related – such as SkypeInbound
    4. Disable FAX Extension
    5. Change your CID Lookup Source to None
    6. Set your destination to one of the extensions you’ve created on step 17-18
  26. Configuring your outbound route:
    1. Click on Outbound Routes
    2. Add Route
    3. Set your Route Name – such as SkypeOutbound
    4. 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)
    5. 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)
    6. Submit Changes
  27. — CONFIGURE YOUR SIP PHONES —

  28. 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
  29. After installation you will need to Configure the SIP Account Settings:
    1. Set your Display Name – for our example you may set it as Ext1
    2. The username is the extension you’ve set on FreePBX – in our case it’s 200
    3. The password is the same you’ve setup for the Extension – in our case it’s Pass123
    4. Authorization user name the same as the extension number
    5. The domain is the IP address for your PIAF server – in our case it’s 192.168.1.100
    6. Make sure you setup the Domain proxy as well:
      1. Check the Register with domain and receive incoming calls
      2. Proxy is the IP address of your PIAF server – in our case it’s 192.168.1.100
    7. Click OK
  30. For VoIP devices the settings are also the same – such as PaP2 from Linksys
  31. — FINAL TESTS —

  32. First test calling the other extension to make sure your PIAF doesn’t have any other issues
  33. 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

  34. 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)
  35. 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.
  36. IF AFTER FOLLOWING ALL THE STEPS YOU STILL HAVE ISSUES, OR IF THERE ARE ANY BROKEN LINKS OR INCORRECT INSTRUCTIONS, PLEASE CONTACT US

References

http://pbxinaflash.net/
http://www.vmware.com/

Created on 8/8/2011 6:26:38 PM by Carlos Casalicchio
Last Update on: 1/3/2012 3:05:08 PM | Tags: pbx,voip,piaf,pbx-in-a-flash,step-by-step,tutorial,how-to

Back to top