Connecting Asterisk to Skype


Asterisk and Skype

I’ve been using Asterisk for years and never really wanted to use Skype, but since many of my friends do, I decided to have a go. It was quite unthinkable to use Skype separately from Asterisk, I mean I have all of my communication unified through Asterisk box, and now this thing called Skype had to be exempted from the rest. No way. So I was looking for a way to connect them. Skype uses proprietary protocol for communication, and the company DOES NOT ALLOW reverse engineering. Therefore, there was no “clean” way of making a Skype channel for Asterisk, like it was done with Cisco’s Skinny protocol. Well, how do we connect then?

There are two possible approaches: hardware and software one. Hardware approach would require some “Skype to phone” adapter “thingy” that connects to Windows PC via USB, and has FXO and FXS, through which it then connects to Asterisk via Sipura 3000, or what have you. I excluded the “enterprise level multi-channel skype gateways” because they are too expensive. I mentioned Windows PC because I had one up and running 24/7, as described in the previous post.

Available software

I decided upon software approach, since I did have available Windows PC, and didn’t want additional “Skype thingy” and addional Sipura. Here are my choices:

  • ChanSkype, Asterisk channel driver for Skype. It sounds great but has one major flaw: it requires X server and I want my Asterisk box to run clean without any additional burdening services.
  • PSGx, Personal Skype to H.323/SIP gateway. I have been using it for a while, and it turned out to be buggy and unreliable.
  • Uplink Skype to SIP adapter is what I am using right now.

Windows installation

You can download Uplink Skype to SIP here.

When you run the setup program you get a dialog like this:

Uplink driver

Then you just let Windows install the unsigned drivers. These audio drivers are the heart of the program. The program sets up these drivers to work as Skype’s headset, and then translates the sound coming from them into SIP packets:

Skype audio settings

As shown in the figureĀ  (Skype audio settings), the sound coming from you, through the microphone, is getting into SIP packets via Uplink’s sound driver, and vice versa for the sound of the speaker. There are similar hacks with the actual microphone and speakers, that is hardware ones, to find out more check out Grynx’s blog.

Uplink settings

Account settings:

Uplink account settings

  • SIP number and password : your Skype number/nickname and password that are the same as in sip.conf.
  • Server: Asterisk IP address.
Network settings:
  • Listening local port: default for these settings is not the same as Asterisk’s default SIP and RTP settings, so pay attention.
  • Public IP address of your Asterisk box..
  • External SIP and external RTP also differ from Asterisk’s default settings.

Uplink network settings

Asterisk Skype2SIP configuration

here’s my configuration:

sip.conf

[tokenskype]
type=friend
host=dynamic
nat=yes
username=tokenskype
secret=tokenskype
canreinvite=no
insecure=very
dtmfmode=inband
disallow=all
allow=alaw
context=incoming_skype
callgroup=2
pickupgroup=2
canreinvite=yes
qualify=yes

extensions.conf

exten => 711,1,SetCallerID(${MY_ID})
exten => 711,n,Dial(SIP/echo123@tokenskype,40,rwW)
exten => 711,n,Hangup()

Here you see extension for Skype’s echo test. Buddies should be added the same way.

Putting it all to work

After everything is installed and upon starting Skype2SIP you should see something like this:
Uplink registered

And if you do “sip show peers” in Asterisk’s prompt:

Skype peer registered

Calling test echo extension:

Dialing Skype echo123

and Uplink’s screen shows (talking for 52 sec, then hanging up, from 9:41 to 10:33):

Uplink talking

Now just add a few buddies, give them extension numbers, and you’re set to talk…

Just a few final words:

  • I made a context for incoming Skype calls “incoming_skype”, as you see in sip.conf excerpt . There you can customize it to dial a specific phone, softphone, send e-mail or whatever…
  • Skype video calls can not be routed through Asterisk, but Asterisk is capable of conducting video calls, which is an entirely new topic…
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Reddit
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Suggest to Techmeme via Twitter
  • MySpace
  • Yahoo! Bookmarks
  • Yahoo! Buzz
  • Yigg
  • Technorati
  • RSS

No related posts.

6 Responses to “Connecting Asterisk to Skype”

  1. Reuben says:

    How many calls could I send from my asterisk through skype ?

  2. mihaelamj says:

    Just one.

  3. henkoegema says:

    Do I need to purchase a license for this software to use?

    I always get: Server 192.168.1.x did not respond to register (sip:tokenskype@192.168.1.x)
    Check server details for that line.

  4. henkoegema says:

    When I leave out everything under ‘Allowing Incoming Calls and Audio through into Private Networks’ (In Settings -> Network tab), then it works OK.

  5. hi, im from chile and found this tutorial, im starting in the asterisk’s world. i have a PSP with skype and where i work, they askme to try to conect the Ip-PBX with Skype.
    so, i read your tutorial and i follow it.
    i can call correctly to the echotest, but when i try to add more buddies it fails. it keep saying “Sip/XXX is ringing.
    what can i Do?
    can you help me?
    i’d be placed

  6. laura says:

    I’m new to asterisk . I just need to know if this configuration is used to make only outbound calls from skype. If yes, can you give me hints on how to configure uplink to receive inbound calls from sip to skype.
    Any feedback would be appreciated.

Trackbacks/Pingbacks


Leave a Reply