{"id":33,"date":"2007-11-14T15:08:44","date_gmt":"2007-11-14T22:08:44","guid":{"rendered":"http:\/\/www.kernelcrash.com\/blog\/2007\/11\/14\/a-decent-linux-command-line-sip-softphone\/"},"modified":"2007-11-14T15:08:44","modified_gmt":"2007-11-14T22:08:44","slug":"a-decent-linux-command-line-sip-softphone","status":"publish","type":"post","link":"https:\/\/www.kernelcrash.com\/blog\/a-decent-linux-command-line-sip-softphone\/2007\/11\/14\/","title":{"rendered":"A decent linux command line SIP softphone"},"content":{"rendered":"<p>I&#8217;ve recently jumped on the VOIP bandwagon. Sure I&#8217;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&#8217;ve signed myself up with a SIP provider and also have a work Asterisk server I can make calls through.<\/p>\n<p>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&#8217;t make calls or hear anyone. Generally quite annoying. Then if I wanted to use one of these soft-phones under Slackware, I&#8217;d attempt to compile &#8230; and your atypical opensource SIP client seems to have a mountain of dependencies &#8230; which basically mean your chance of getting it to compile is slim.<\/p>\n<p>Of course, I did end up trying some under Debian or Archlinux (using their package repository) &#8230; and this is generally where I would have lockups or something else not working. I&#8217;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.<\/p>\n<p>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.<\/p>\n<p>Of course, I&#8217;ve bought a SPA3102 ATA device and this pretty much &#8216;just works&#8217;. Why can&#8217;t I find a linux softphone like that?<\/p>\n<p>Well, I think I&#8217;ve found one; <a href=\"http:\/\/www.pjsip.org\/pjsua.htm\">pjsua<\/a>. Sure its a command line one &#8230; 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 &#8230; so it actually compiles pretty easily. It actually didn&#8217;t work out of the box since it doesn&#8217;t pick my default ALSA card properly. Here&#8217;s how I run it:<\/p>\n<pre>\r\npjsua-i686-pc-linux-gnu --playback-dev=1 --capture-dev=1\r\n--id sip:myusername@sip.pennytel.com --registrar sip:sip.pennytel.com\r\n--realm '*' --username myusername --password mypassword<\/pre>\n<p>So <em>myusername<\/em> is the username you have with your SIP provider, and <em>mypassword<\/em> is obviously your password. Replace the <em>sip.pennytel.com<\/em> bit with your own SIP provider. The playback-dev and capture-dev args took some digging to find (part of some patch that&#8217;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.<\/p>\n<p>Of course, you get a zillion lines of debug output by default (I think you can turn the verbosity down).  You can press &#8216;?&#8217; to get some help screen. &#8216;q&#8217; to quit etc. I press &#8216;m&#8217; to make a call and then type in something line:<\/p>\n<p><code>sip:61212345678@sip.pennytel.com<br \/>\n<\/code><\/p>\n<p>And it dials out and connects. Press &#8216;h&#8217; to hangup.<\/p>\n<p>So far it works great. Sound quality is great, and latency seems pretty good too.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve recently jumped on the VOIP bandwagon. Sure I&#8217;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&#8217;ve signed myself up with a SIP provider and also have a work Asterisk server I can make calls through. When I [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":0,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}