Home » Technology » The Incredible PBX: Adding a Free Skype Gateway to Asterisk

The Most Versatile VoIP Provider: FREE PORTING

The Incredible PBX: Adding a Free Skype Gateway to Asterisk

Last week we got The Incredible PBX all set up with free worldwide SIP calls, free U.S./Canada PSTN calls using Google Voice with SIPgate or IPkall, and rock-solid Asterisk® security using our new Zero Internet Footprint™ design. Because of licensing restrictions, we couldn't include Skype out of the box. If you're an individual and not a business, today we'll walk you through adding free Skype calling worldwide to your Incredible PBX. With today's addition, the Incredible PBX now provides free calling to nearly a billion phones around the world via Skype, SIP, ENUM, FreeNUM, and U.S./Canada PSTN connections. Yowza!

If you use the recommended hardware, today's setup procedure takes less than 10 minutes! Once it's complete, inbound and outbound Skype calling is totally transparent on your Incredible PBX. To reach a Skype number, just dial * plus the user's Skype name from any phone with an alphanumeric keypad. To place a Skype Out call (fees apply), dial 8 plus the user's area code and number. When your 500 million friends on Skype contact you using your Skype name, all of your Incredible PBX phones will ring just like any other inbound call. What's the difference in today's solution and Digium®'s commercial Skype for Asterisk product? For openers, our solution is $66 cheaper. It's free! And, if you're an individual, you won't need Skype's commercial Business Control Panel to make calls. Functionally, the results with your Incredible PBX Skype implementation are identical.1

To make the Skype Magic work, you'll need three pieces of software in addition to The Incredible PBX obviously: Sun's 6u12 Java SE Development Kit, Skype's Static Edition for Linux plus an existing Skype account, and Greg Dorfuss' SipToSis product which manages the Skype Gateway to Asterisk.

As far as hardware is concerned, we're assuming you're using our recommended $200 Acer Aspire Revo to host your Incredible PBX. With other hardware, your mileage may vary because CentOS 5.4 may or may not support your audio card and graphics mode with your video card. Both are required to get Skype working properly under X-Windows. If you have problems with some other type of hardware, take a look at the tips in our previous article on Setting Up a Skype Gateway to Asterisk as well as the comments. Better yet, visit your neighborhood Best Buy and purchase an Aspire Revo for a hassle-free install.


Installing JDK. Using your favorite browser, go to Sun's 6u12 Java SE Development Kit website, choose Linux for the platform, and agree to the license. Click Continue. Download jdk-6u12-linux-i586-rpm.bin and copy it to the /root directory of your Incredible PBX. Next, make the file executable (chmod +x jdk-6u12-linux-i586-rpm.bin). Then run it: ./jdk-6u12-linux-i586-rpm.bin. Scroll down the wordy license agreement AGAIN and type yes. Java 1.6 then will be installed on your system. Check to be sure Java was properly installed with this command: rpm -q jdk.

Installing Skype and SipToSis. Now we're ready to load the remaining components. While still logged into your Incredible PBX as root, download and run the skype-setup script2:

cd /root
wget http://incrediblepbx.com/skype-setup
chmod +x skype-setup
./skype-setup

Activating Your Skype Gateway. Now we're ready to place your Skype gateway in production. You'll need to perform these steps from the console on your Incredible PBX since we have to run Skype in graphics mode. This may look complicated. It's really not. It's just a bit tedious to figure out the sequence of steps, but we've done that part for you.

WARNING: Be sure that you use a dedicated Skype account on this server! Do not run the same Skype account on any other server or desktop, or it fails!

1. Start up X-Windows: xinit3

2. Start up Skype. While still logged into your server as root, issue the following commands:

cd /root/skype/skype_static-2.0.0.72
./skype

Now log in to Skype with your Skype name and password. Be sure to set Skype to autologin whenever it is started. Then, in the Skype configuration option, set Skype to always run minimized. Save your settings.

Place a Skype Test Call4 to echo123 to be sure your audio settings are set correctly. Again, with the Aspire Revo, this won't be a problem assuming you have plugged in a microphone and speakers. These can be disconnected after you're sure things are working properly. HINT: Intel Atom-based motherboards are a piece o' cake!

Once you've got Skype working and all of the Skype settings configured above, shut down Skype.

3. Restart Skype in Background Mode: ./skype &

Be sure to write down the PID for Skype in case you need to kill the job if something goes wrong. 🙂 If you forget the PID, you can obtain it with this command: pgrep skype. You can kill Skype with the following command using your actual PID instead of 12345: kill 12345.

4. Start up SipToSis: Press Enter if the command prompt doesn't reappear. Then...

cd /siptosis
./SipToSis_linux

A message from Skype will pop up asking if you want to authorize external use of Skype: yes. Important: Be sure to select the Checkbox to save this setting for future connections!

5. Testing Skype. Go to a softphone (X-Lite recommended!) connected to an extension on your Incredible PBX and dial *echo123. You should be connected to the Skype Call Testing Service. Try *nerdvittles for the Nerd Vittles Demo.

Assuming you have a little money in your Skype Out account, go to any extension connected to your Asterisk server and dial 8 + your home phone number. This will place the outbound call through SkypeOut at 2¢ a minute.

Reboot your server when you're sure everything is working properly.

GUI Tips. Here are a few navigation tips for managing your Asterisk console on your Incredible PBX:

1. Ctrl-Alt-F2 gets you a new login prompt for your server

2. Ctrl-Alt-F7 gets you back to the SipToSis/Skype session. You can kill SipToSis by holding down Ctrl-C for several seconds. To decipher your SipToSis PID: pgrep -f SipToSis. To kill SipToSis: kill pid# (that you wrote down). To kill Skype: kill pid# (that you wrote down). To restart Skype: skype & and to restart SipToSis, just issue the command again: ./SipToSis_linux

3. Ctrl-Alt-F9
gets you to the Asterisk CLI.

Automating the Skype Gateway Startup. Once everything is working reliably, reboot your server again, log in as root, and issue the command: /root/skype-start. Place a test call again using a softphone on your Incredible PBX. If everything works fine, you now can add the skype-start command to your server's startup script, and you're all set.

echo "/root/skype-start" >> /etc/rc.d/rc.local

Setting Up Speed Dials for Skype Friends. One of the wrinkles with Skype is that Skype uses names for its users rather than numbers. If you don't have a SIP URI-capable softphone, there's still an easy way to place calls to your Skype friends using FreePBX. Just add a Speed Dial number to your FreePBX dialplan. Choose Extension, then select the Custom type, provide an Extension Number which is the Speed Dial number (this could actually spell your friend's name using a TouchTone phone), enter a Display Name for your friend, and add an optional SIP Alias. Then insert the following in the dial field replacing joeschmo with your friend's actual Skype name. Save your entries and reload the dialplan when prompted.

SIP/joeschmo@127.0.0.1:5070

Security Warning. Do NOT expose UDP port 5070 to the Internet by opening a port on your hardware firewall. You do not need UDP 5070 exposed to the Internet to implement today's gateway solution for inbound or outbound Skype calling from your server!

Enjoy!

Update: As of May 1, you now can set your Google Voice number as your Skype CallerID number. Previously, Google Voice blocked the verification SMS messages, but no longer. Thanks, @zsafwan.

Adding Multiple Google Voice Trunks to The Incredible PBX



Need help with Asterisk? Visit the PBX in a Flash Forum.
Or Try the New, Free PBX in a Flash Conference Bridge.


whos.amung.us If you're wondering what your fellow man is reading on Nerd Vittles these days, wonder no more. Visit our new whos.amung.us statistical web site and check out what's happening. It's a terrific resource both for us and for you.


 

Special Thanks to Our Generous Sponsors


FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.

BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.

The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.

VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
 

Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
 


Some Recent Nerd Vittles Articles of Interest...

  1. Skype and this suggested implementation are intended for individual use. Your use is, of course, governed by the Skype Terms of Service. []
  2. Here are the actual commands in the skype-setup script if you'd prefer to execute them one at a time:

    cd /root
    mkdir skype
    cd skype
    wget http://www.skype.com/go/getskype-linux-beta-static
    tar jxvf skype_static*
    yum install xorg-x11-server-Xvfb
    yum install qt4
    yum install xterm
    yum install libXScrnSaver.i386
    wget http://pbxinaflash.net/source/skype/siptosis.tgz
    cd /root
    wget http://incrediblepbx.com/skype-start
    chmod +x skype-start
    cp skype-start skype/.
    cd /
    tar zxvf /root/skype/siptosis.tgz
    cd /root


    []

  3. Starting xinit won't be a problem on the Aspire Revo. But, if xinit won't start on your particular machine, you may need to create /etc/X11/xorg.conf. Here's a generic config file that should work fine for our purposes:

    Section "ServerLayout"
    Identifier "X.org Configured"
    Screen 0 "Screen0" 0 0
    EndSection

    Section "Device"
    Identifier "Card0"
    Driver "vesa"
    EndSection

    Section "Screen"
    Identifier "Screen0"
    Device "Card0"
    SubSection "Display"
    Viewport 0 0
    Depth 16
    Modes "800x600"
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 16
    Modes "800x600"
    EndSubSection
    EndSection

    []

  4. If the test call fails with a bad audio message, go into Options, Sound Devices and reconfigure your Audio settings until you can place the test call successfully. Otherwise, none of the rest will work! []

30 Comments

  1. It would appear that the skype kit is not in the anticipated format.

    root@pqpbx:~/skype $ tar zxvf skype_static-2.1.0.81.tar.bz2

    gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: Error exit delayed from previous errors

    [WM: It must be Monday morning. Sorry. Command should be "tar jxvf skype_static*". Fixed. Thanks!]

  2. Nice to see Nerd Vittles still innovating, and making it easy for users to achieve fun and useful stuff with their PBXs.

    There’s another way to kill processes by name instead of finding the PID each and every time:
    killall skype
    killall SipToSis

    I will be installing all this in a VM inside my laptop for testing and demonstration, I’ll let you know how it goes.

    Many thanks from Puerto Rico!

    [WM: Thanks for the tip. Learn something every day. To get this working on VMs, the big hint seems to be to load the dummy sound card driver.]

  3. Is there a way to turn a vanilla version of asterisk pbx into a super charged, multifunction, "INCREDIBLE PBX" now that Asterisk is in the Ubuntu repositories. If you have Ubuntu, all you have to do is sudo apt-get install asterisk. The down side that without the webgui is hard to configure. Can Nerd Vittles help here? Thanks!

    [WM: Wish it were that easy. 🙄 Think of it as converting a Chevy Camaro into a Ford Mustang. Almost every part of the car is different. Yes you could do it given enough time and money. But it’d be a whole lot simpler and cheaper to run out and get a new Mustang. Sorry.]

  4. This is to use only one Skype account, if we want to add multiple skype account still have to pay to SipToSis, is there any free solution for that.

    [WM: Not that we’re aware of. But you can’t beat the stsTrunkBuilder $17.99 price.]

  5. Hi Ward. I got all the way through this – it all works (Atom) and SipToSis connects ok.

    But I am not sure about the last command to start the service as startup

    echo "/root/skype-start" >> /etc/rc.d/rc.local

    I get an error. If I look in /root there is no file called skype-start

    I think it should be

    echo "/root/skype/skype-start" >> /etc/rc.d/rc.local

    [WM: Depending on when you downloaded the installer, you are correct. The script is now available in both places. 🙄 Thanks.]

  6. Hi

    Having followed all the steps, if I run /root/skype-start, I’m getting an error:

    Line 3: Xvfb: command not found.

    Below are the contents of the Skype-start file. I am not sure how to fix this, or what is missing.
    ———————-
    #!/bin/bash

    Xvfb :0 &
    export DISPLAY=:0

    cd /root/skype/skype_static-2.1.0.81
    su root -c "./skype &"

    sleep 9

    cd /siptosis
    su root -c "./SipToSis_linux &"

    [WM: JDK is not installed or didn’t install correctly.]

  7. NEWS FLASH: Skype has announced new Skype Out pricing. Unlimited calls to U.S.-Canada (cell phones and landlines), $2.95 per month; unlimited calls to landlines in 39 countries (not the U.S.) for $5.95 per month, or unlimited calls to over 40 countries worldwide (including U.S. cellphones and landlines) for $12.95 per month.

  8. This works wonderfully! Thank you so much for your determination in making this a truly INCREDIBLE PBX. Until about a month or so ago I had no idea what all Asterisk was capable of. Now I am starting to see the light!

    One question about the Skype in-bound calling: It seems to route straight to the default IVR I use. Can I route it to a specific extension? There doesn’t seem to be a specific inbound route setup for Skype in FreePBX.

    Thanks!
    – Scott

    [WM: Sure. Head to the forums for some tips.]

  9. For those that installed The Incredible PBX prior to this message, there were two missing directories which caused creation of some future reminders to fail. To fix it, log into your server as root and issue the following commands:

    cd /var/spool/asterisk
    mkdir reminders
    mkdir recurring
    chown asterisk:asterisk recurring
    chown asterisk:asterisk reminders

    Our apologies.

  10. Good article and fun experiment. Can you you suggest alternatives or examples for calling out by skype username from a normal touchtone phone?

    [WM: Polycom phones reportedly work when stored as speed dial entries.]

  11. New to Asterisk/Incredible PBX usage. I have setup Skype with no issues on calls to US numbers. How do I place an international call on the Skype trunk? Dialing 8-00-country code-number didn’t work. Thanks!

    [WM: The easiest way is to precede the dial string Skype expects with an asterisk (*). Otherwise, you’ll need to make a modification in FreePBX’s Skype Outbound Route Dial Patterns to accommodate the desired dial string.]

  12. Ward, thanks for the tip. It isn’t making sense to me though. I am trying to dial a German landline and in skype I would dial +49 XXXX XXX XXX. I have tried *8 and 8* with nothing working. I have *|. and 8|NXXNXXXXXX as dial patterns.

    Thanks in advance. B

    PS – I have tried to post in the forums but am unable to, and IRC is dead!

    [WM: Don’t use the 8 at all, just *.]

  13. Ward – another great article. Everything worked great with my softphone but the command sequence didn’t work so well with my Polycom phone.
    However, replacing the 8 with an * when dialing out did the trick.
    Thanks,
    R

  14. Interesting & Informative article.

    However, there are a couple minor issues.

    First, it isn’t "X-Windows", it’s the "X Windowing System", X11, or just X. You disrespect the X developers by implying it was in any way, shape, or form modelled after windows. X11 existed PRIOR to windows, so that couldn’t possibly be the case

    The second point is that graphics card support is not strictly required to run GUI apps.

    Xvnc creates a vnc-based X session that one can connect to from another computer, for example. Most distributions have a ‘vncserver’ package as well, which makes it dead-simple for anyone to start an Xvnc session. Just run ‘vncserver’, type a password, and connect to the address it gives you.

    It’s also fairly easy to render gui apps on a different system running X. Just run ‘ssh -X @’, then launch the app from the ssh session just like any other cli app. Presto! It pops up on your screen just like any other app. This even works in windows if you install Xmingw first.

  15. I have followed all steps and I’m able to call a skype contact using an extension associated with the contact name. I can receive calls from skype as well.
    But I can’t call a regular phone. When I press 8+ phone number, there is a voice saying " all circuits are busy now, please try again later" or something like " your call cannot be completed as dial ".
    I’m I doing something wrong ?

    Do I need to set up a dial plan for the skype trunk ?
    Thanks,
    Chris

  16. 2010-11-08 12:10:14,864 Load Library failed
    java.lang.UnsatisfiedLinkError: /siptosis/libskype.so: /siptosis/libskype.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)

    I have this when trying to install in 64 bits platfrom

    please advise

    [WM: Switch to 32-bits if you want to use Skype or load the 32-bit compatibility layer.]

  17. Finally got around to implement this Skype addition tkx WM!!! I got the Skype inbound to work but when dialout using ext. I got ring then busy tone from a SIP phone or from SoftPhone I got circuit busy recording. Pls advise. Tkx!

  18. Just a quick note to say that you totally rock! Once I’d got PIAF running, the biggest challenge to following your process above was in fact getting X going; as the box in question is a dedicated PBX server, it had never had any kind of GUI installed on it.

    Past that minor hurdle, and everything just works. Now my wife’s sister in South Africa can call her (on a local Johannesburg number), and she can simply pick up any of the phones in the house (here in the UK), no more bother with Skype and buttons and finding the mouse and locked screens and all that rubbish.

    Oh by the way, other readers may be interested: the Siemens DP450 is going cheap in the UK at the moment, have a poke around eBay, I picked up a set with six handsets including delivery for £50. Works like a dream, (now) even with Skype calls!

  19. A major SIP security vulnerability was discovered in all versions of Asterisk today. You can read all about it here.

    We have developed a script for Asterisk 1.8.x which will quickly patch your system and eliminate the problem. Log into your server as root and issue the following commands:

    cd /root
    wget http://incrediblepbx.com/sipfix
    chmod +x sipfix
    ./sipfix

    Please apply this patch immediately to protect your server!

  20. Skype works in by calling from another Skype account and out by using a sip softphone.

    But when I try to forward calls from Skype to another Skype account through an IVR (forward to Skype Extention made with guide above) the call is not forwarded to the Skype account. Any suggestions or tips to where to fine a how to, that I have not found by googling??

  21. Figured out that I needed stsTrunk to solve problem above.

    Another tips (edited post by Ward in another forum). This is how you can get to Skype GUI after you have marked "always run minimized".

    Reboot your machine. Then…

    cd /root
    rm -r .Skype

    xinit
    cd /root/skype/skype_static-2.1.0.81/
    ./skype

  22. Using PIAF-1.7.5.5.5-CentOS-5.5-32bit, I followed these instructions and hit a roadblock. skype-setup downloaded skype_static-2.2.0.25 instead of 2.1.0.81 which I thought was better until I ran it. It gave me this error: "./skype: /usr/lib/libstdc.so.6: version GLIBCXX_3.4.9 not found (required by ./skype)". Any idea how to fix this?

    Thanks!

    [WM: http://nerdvittles.com/?p=748 ]

  23. Hello

    I followed the Adding Skype instructions and I am coming up with the following error message when executing the "./Skype" command

    /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9′ not found (required by ./skype)

    I even did a Linux Software Package Update using Webmin, but it does not help.

    Can anyone help me?

    WM: http://nerdvittles.com/?p=748 ]

  24. Hi,

    I’ve just tried this and get the following error

    GLIBCXX_3.4.9 not found

    The version of skype downloaded was 2.1.0.81, so I’m presuming it requires a newer library.

    I’m no linux expert, so could some kind soul guide me on how to fix this without breaking the existing install?

    [WM: http://nerdvittles.com/?p=748 ]

  25. Is it possible to make skype video calls with the nortel IP 1535 with this setup ?

    [WM: No. Sorry. Skype is proprietary.]

Comments are closed.