Inbound Skype to every desk phone (or Skype == Big PSTN )

Just for holiday fun I got my macmini a new incoming Skype line that can be picked up by any extension, transferred to any extension in our Asterisk PBX. The macmini hosts the Skype Client and Asterisk PBX. You could do the same with better results on a Linux server.

Here’s the basic recipe:

1)FXO Device
2)USB-Skype RJ11 Adaptor with stable drivers for my OS
3)Recent version of Asterisk on a stable machine
4)Text editor

In particular, I used the following brands/versions:

1)Grandstream Handytone-488 for its FXO port
2)CuPhone PPG with TjInit 1.11
3)Asterisk 1.2.1 on MacMini with OS X 10.3.9

Because this was my first experience with the HandyTone, I spent a great deal of time banging my head on my desk trying to get the logic (or apparent lack of) of this crucial piece of the puzzle.

The CuPhone USB adaptor just works as advertised right out of the box. I played with it in a number of configurations and if you don’t need a pbx, it simply makes your standard favorite analog telephone into a Skype phone. Incoming calls to my extension ring just as usual, as do direct incoming skype calls, ie. the phone rings and you pick it up and start talking. When dialing out, you lift the receiver and your skype contact list pops on the desktop, you highlight the contact you like and press ‘##’ to initiate a call. There is a serious issue with DTMF on outgoing calls, they only work occasionally. But my main focus was accepting direct incoming skype calls. The other irritating thing on outgoing calls is the need to hit ‘#’ to bypass skype inorder to make normal calls to other extensions. That’s where asterisk comes in handy, let asterisk do the hard stuff…

With all the pieces put together, you could put the macmini in a closet with the screen off. But since it’s a macmini, I won’t, because it can handle the phones and a whole lot more.I already have a working skype account and working asterisk pbx. Here is the basic setup I have added to receive skype calls to all desks:

  • Added the CuPhone’s TjInit software and start it just before I startup Skype

  • CuPhone is connected to a full power USB port

  • Grandstream HT-488 is Powered up

  • A phone cord connects from the ‘Phone’ jack on Cuphone to the ‘Line’ jack on the HT-488 (FXO port)

  • My good ole two line AT&T 732 analog phone is in the HT-488 ‘phone’ jack (FXS port)

  • A Cat5 cable connects from the HT-488’s ‘WAN’ port to my network switch

The HT-488 treat’s the incoming skype calls as a standard PSTN and transfers (after the minimum 1 ring) calls to my Asterisks ‘inbound’ context and I have it blast all extensions in the office, to be picked up by the first person available, or the call is sent to the office default voicemail box. But obviously you could do anything you can do with a normal PSTN call.

If anyone would like examples from my working ‘sip.conf’, ‘extensions.conf’ or settings for the HT-488, let me know.

If I were doing this again, I’d save $10.00 on the CuPhone by getting the single CuPhone RJ11 Usb Device, and I’d probably spend an extra $20.00 and use the Sipura 3000 instead of the Grandstream HT-488 (seems like there’s more support) but I’m set for now. (out of playtime and playmoney)

Negative and positive reactions…

  1. We get annoying echo at the extension from people calling our Skype-in numbers, I hear myself echo’ed back after a second, and the person calling hears their voice echo’d back.

  2. Skype-out works okay from sitting at the macmini using my analog phone, but if I make the same call using the same analog phone via asterisk over my line, the sound is much better.

  3. direct skype inbound calls are excellent, ie. not the ‘skype-in’ service, but folks who call our skype account directly, their skype to our ‘skype on asterisk’ regardless of the extension inside the pbx.

Since the goal was to receive skype into the pbx, I feel it’s a success so far. Skype-in quality would be “icing-on-the-cake”, but iax2 and sip DID providers are actually better quality and less expensive, so far.

Just out of curiosity… Why do you want to use Skype at all?

I have customers in Mexico where local and long distance lines are prohibitively expensive, with a skype id, they can call in the specifications and place orders for free. They requested skype, but I didn’t want to bog down a bunch of pc’s with it or use up all my bandwidth, so I keep the udp packets open but squeezed down on skype’s default ports and so far it’s behaving.

Well, it’s actually pretty simple, (after you’ve pulled your hair out trying things that don’t work).

  1. Setup the CuPhone with the drivers from their website for MacintoshOSX
  2. Set Skype to use the CuPhone USB audio device for input and output.

Now your analog phone will ring when a skype call comes in.

Next step, is the grab that ring before it goes to an analog phone by plugging in an FXO device in place of the phone. I plugged the ‘Phone’ jack from the CuPhone into the ‘Line’ jack on the Grandstream HT-488 and put my analog phone into the ‘Phone’ jack of the grandstream. Without powering up the Grandstream calls to my skype account still ring on the analog phone. Make sure that’s true before proceding.

Next step is to make the FXO and FXS ports register to the Asterisk server and direct incoming calls on the FXO (Line) port to the ‘inbound’ context of the asterisk server, so I can send it to which ever extensions I want to ring. I chose to create extension 2100 for the FXO (line) and extension 2000 for the FXS (phone). On the Grandstream this is done via a web configuration menu. Key here is to match the basic setting ‘Forward to VoIP’ to the inbound extension name, in my case ‘SkypePSTN’ (no @blah.blah). I also set the ‘basic setting’ called ‘Number of Rings’ to 1 (number of rings before a PSTN incoming call is forwarded to VoIP).

Here are my snips from ‘/etc/asterisk/sip.conf’ on my MacMini.
====== Cut from sip.conf ================
type=user ; I set this to user because I’m just doing inbound
user=phone ; not sure if this is correct but it works
caninvite=yes ; not sure if this is correct but it works
canreinvite=yes ; again not sure, but it works

====== cut from extensions.conf ===============
DIALIN1=SIP/2222&SIP/2219&SIP/2000 ; extensions that ring on inbound

exten => 3605551212,1,Macro(inbound) ;
exten => 7785551212,1,Macro(inbound) ;
exten => 2535551212,1,Macro(inbound) ;
exten => 3605551234,1,Macro(inbound) ;
exten => 8885551212,1,Macro(inbound) ;
exten => 12065551212,1,Macro(inbound) ; virtualnumber
exten => SipPhoneLine1,1,Macro(inbound) ; sipphone
exten => SkypePSTN,1,Macro(inbound) ;skype/ht488fxo

exten => s,1,Answer
exten => s,2,Wait(2)
exten => s,3,Playback(Cepstral-Lawrence)
exten => s,4,Dial(${DIALIN1},10,r)
exten => s,5,Voicemail,u${VMBOX}
exten => s,6,Hangup
exten => s,105,Voicemail,b${VMBOX}
exten => s,106,Hangup

On linux this might work better using the pci FXO cards from digium, but that isn’t an option on a macmini. DTMF doesn’t work very well, so this is really an incoming call hack. Outbound works find if you’re sitting at the mac mini and selecting your contact with a mouse…

If screen shots from the setup of the grandstream ht-488 would be helpful I can post them as well.

Evaluation: after 3 weeks

Due to the rapid changes in the software at Skype for Mac OS X , this really is a silly thing to rely on. With the latest updates to Skype(non-beta, CuPhone drivers no longer work. So I’m sticking to the older version ( But there are a couple of options that make this hardware solution unnecessary.

  1. You can simply (for a fee of 2 euro cents a minute) forward all calls to your skype account to the land line of your choice. No bandwidth issues, no drivers to worry about. (this requires using a client that supports call forwarding to set it up, then you just leave your skype account offline and let the calls forward to your forwarding number)

  2. The same skype account will run on multiple desks, but I’d worry about bandwidth.

So, although my setup does works, I don’t recommend it. You can talk customers into trying one of the other options instead of Skype, AOL instant messaging, Gizmoproject, direct peer to peer sip with SJphone and others…