A decent linux command line SIP softphone

I’ve recently jumped on the VOIP bandwagon. Sure I’ve played with Skype and the voice quality is generally very good, but SIP based stuff seems to be a lot more flexible and interesting. I’ve signed myself up with a SIP provider and also have a work Asterisk server I can make calls through.

When I first signed up to a SIP provider I naturally tried to use a soft-phone with it under linux. This was generally a frustrating experience. Some would crash, some would lock up, some would seem to register with the SIP provider, but you couldn’t make calls or hear anyone. Generally quite annoying. Then if I wanted to use one of these soft-phones under Slackware, I’d attempt to compile … and your atypical opensource SIP client seems to have a mountain of dependencies … which basically mean your chance of getting it to compile is slim.

Of course, I did end up trying some under Debian or Archlinux (using their package repository) … and this is generally where I would have lockups or something else not working. I’ve tried Ekiga, Twinkle, linphone, Wengophone and some others. The current version of Wengophone is OK, but I never had much luck with the older ones. I must admit SIP stuff is difficult to troubleshoot due to the array of ports a phone uses, and the various NAT/firewall requirements which seem to vary.

Of course, if you look at the windows world, something like X-lite just tended to work. I think I ended up using X-lite under windows in vmware many a time due to my endless frustrations.

Of course, I’ve bought a SPA3102 ATA device and this pretty much ‘just works’. Why can’t I find a linux softphone like that?

Well, I think I’ve found one; pjsua. Sure its a command line one … and that will scare most people off, but this thing works great so far and has its own libraries statically linked in for the most part … so it actually compiles pretty easily. It actually didn’t work out of the box since it doesn’t pick my default ALSA card properly. Here’s how I run it:

pjsua-i686-pc-linux-gnu --playback-dev=1 --capture-dev=1
--id sip:myusername@sip.pennytel.com --registrar sip:sip.pennytel.com
--realm '*' --username myusername --password mypassword

So myusername is the username you have with your SIP provider, and mypassword is obviously your password. Replace the sip.pennytel.com bit with your own SIP provider. The playback-dev and capture-dev args took some digging to find (part of some patch that’s already in the latest source). You might have to try a number other than 1 to pick your ALSA device number correctly. I just ran the sndtest-i686-pclinux-gnu program to get a list of ALSA devices.

Of course, you get a zillion lines of debug output by default (I think you can turn the verbosity down). You can press ‘?’ to get some help screen. ‘q’ to quit etc. I press ‘m’ to make a call and then type in something line:


And it dials out and connects. Press ‘h’ to hangup.

So far it works great. Sound quality is great, and latency seems pretty good too.