Internet telephony with Linphone

Well Connected


When you want to call your friends in distant countries, don't pick up the phone; just put on your headset and fire up Linphone.

By Simone Schäfer

One of the most popular methods for accessing Voice over IP technology is through a so-called softphone. A softphone is simply a computer program running on your desktop that handles call establishment and communication. Linphone [1] is one of the most popular softphone applications for Linux. Linphone is optimized for the Gnome desktop, although that doesn't mean you can't run it on KDE. This articles describes how to install, configure, and troubleshoot Linphone.

Of course, even though Linphone is a software tool, in order to use it, you'll need some basic hardware, such as a headset and a microphone. And if you want to use Linphone as a complete phone system you'll need an account with a VoIP provider. For the examples in this article, I will refer to two fictitious VoIP accounts with two providers: Sipsnip and Purtel. Our fictitious user places calls via the Sipsnip account but wants to take incoming calls via Purtel. The procedures are similar for other providers.

Installation

The source code for the 1.1.0 release, and the libraries, are available on the DVD with this issue below LinuxUser/linphone/.

Mandriva Linux 2006 has the current 1.1.0 version. Gentoo Linux users can install Linphone 1.1.0 simply by running the emerge command. Suse 9.3 and 10.0 give you Linphone version 1.0.0, which is fine for daily use. Check the Telephone entry in the KDE menu for the program. If you use Debian Testing ("Etch") or Ubuntu Linux 5.10 ("Breezy Badger"), the repository has the slighter later 1.0.1 version.

You may prefer to build and install the program manually; if so, make sure you keep to the right order for the build. Linphone uses the Libosip2 library to communicate with the VoIP provider, so you will need to install the library first. To do so, open a terminal window, then become root by typing su and supplying the root password. Unpack the archive by typing tar xzf libosip2-2.2.0.tar.gz, and then change to the new directory (cd libosip2-2.2.0). The following commands will build and install the library:

./configure --prefix=/usr
make
make install
ldconfig

Now leave the Linosip2 folder, and go on to unpack the Linphone archive. Typing tar xzf linphone-1.1.0.tar.gz takes care of this. Enter cd linphone-1.1.0 to change to the required directory, and then use the same commands for building and installing as with the library.

You may be missing some developer packages, such as the Speex codecs. Distributions have different approaches to installing them. Your best option is to use your distribution's install tool to look for a package with a similar name.

Figure 1: Linphone gives users easy access to Voice over IP communication.

Setting Up an Account

When launched, Linphone comes up with minimalistic looking GUI. You now need your VoIP credentials to sign on to the server. Besides a username and a password, you will also have a domain. Just like with an email address, the SIP ID, that is, your VoIP phone number, comprises your username and the domain.

In our example, the SIP ID is penguin@sipsnip.de for the Sipsnip account. The domain looks different from what we expected for the Purtel account: penguin@deu1.purtel.com. The VoIP provider's homepage gives you access to your credentials and allows you to change them if necessary. (Many VoIP providers distinguish between the phone number and the username, but Purtel is an exception, as the username is always the same as the Purtel phone number.)

After you have entered your account data, you are almost finished. The Go menu has a Preferences entry. Click on the SIP tab first, and enter your Identity or SIP address. In our example, we need penguin and then an at sign ("@") followed by sipsnip.com for Your sip address:. Don't forget to uncheck the Automatically guess a valid hostname, which we do not need.

The next thing to do is to tell Linphone which Internet server you want to connect to when you place a call. In the Remote services pane, click Add proxy/registrar. In the popup window that then appears, type the complete SIP address for SIP Identity and the hostname of the SIP server for SIP Proxy. In the case of the providers in our test, this is the same as the domain.

Now click OK to confirm, and the program will prompt you for your username and password. The program then stores this information, and you do not need to enter it again.

Direct Line to the World

After you enter your account data, and assuming that the server accepts your username and password, there is nothing to stop you placing your first call. Enter the SIP ID below Sip address in the main window. (See the "Phone Numbers and SIP IDs" box for multiple numbers.) Version 1.1.0 also lets you select which VoIP account to use, if you have more than one.

Select a proxy server in Proxy to use. Then click on Call or answer to tell the program to place the call. Hangup or Refuse tells the program to refuse the call or hang up.

To make things easier, you should add a name for each address book entry, enter the SIP address, and if you have multiple VoIP accounts, specify the account you will be using for this contact. After completing the contact data entry, you can just click on Select to load the settings.

If you check Show more in the Linphone window, the program will show you options for the playback and record levels. The My online friends tab takes you to an overview of the online status of the entries in your address book - this did not work in our lab, although the problem may have something to do with the VoIP providers we used.

It is a good idea to make a test call to a number of your choice at this point, just to make sure that your basic configuration works. If calls from landlines or mobile phones to your VoIP number also work, you now have a low-budget alternative telephone system. Unfortunately, a number of obstacles may prevent you from getting this far.

Phone Numbers and SIP Ids

In the simplest of all cases, the phone number will be a simple telephone number followed by the SIP domain, such as 123456789@sipsnip.com. If you need to call another provider's VoIP connection, the easiest way is often to enter the SIP ID (as in penguinsfriend@sipgate.de) or just the phone number of the connection at Sipgate (123456789@sipgate.de).

Unfortunately, not all providers support this kind of dialing. Purtel customers can call Sipsnip customers free of charge, but not by dialing the SIP ID. Instead, they have to enter a special provider code, followed by the Sipsnip number. The code for Sipsnip is 000555.

Troubleshooting

Most users are behind some kind of firewall that connects to the Internet. The protocols used with Linphone may sometimes cause problems when used with these protective devices.

The Session Initiation Protocol, SIP, is a network protocol that manages Internet calls for one or multiple subscribers. It simply handles the coordination side, that is, call signaling. The data transport is handled by the Realtime Transport Protocol (RTP). The subscriber addresses follow a similar pattern to mail addresses: sip:user@domain. Many of today's VoIP devices use SIP, which has more or less ousted the H.323 protocol and established itself as an industry standard.

SIP and RTP both rely on the connectionless UDP protocol. This, and the fact that VoIP relies on both components, SIP and RTP, can cause problems with connections via firewalls. SIP tells the VoIP provider both the IP address and the port the caller wants to contact.

If you are experiencing problems with the output, and don't have a router, but do have a firewall, first allow ports 7078/udp and 5060/udp. If the issues continue, your sound card or codecs are probably to blame. If you have a router, forward these two ports to your internal IP address for UDP.

If this still doesn't work, the problem may be the sound card settings. Just to test this, use a recording program to record a short text sample via your headset. Gnome gives you the Audio Recorder, and KDE has the Krecord tool in the Multimedia | Recording menu.

If your recording is empty, adjust the volume control first. To adjust the volume, launch either Kmix or Gnome-volume (Figure 2), depending on your desktop. This takes you to a list of options that depend on your sound card. The Output tab allows you to mute the microphone, which is a good idea, to avoid listening to yourself talking. The Input tab allows you to gradually increase the microphone volume, and possibly the Capture level.

Figure 2: You can use a tool such as Gnome-volume to change the sound configuration.

The microphone symbol below both of these controls should be enabled. If you have a Switches tab with your sound card, use the Microphone Boost option to increase the gain for the microphone signal.

Use the Options tab to select a recording device - that is your microphone. Users with KDE should make sure that the green LEDs for Input and Capture (if present) are both off, but the red LEDs are on. Both have to be set to a high recording level. Again, you might have to set the source and enable "Microphone Boost" in the Switches tab.

Compression methods (codecs) very rarely cause problems with VoIP. There are several methods, and it is possible that the party you are trying to call may not have a system that supports the same codecs. However, Linphone has a good selection of codecs, and this problem did not occur in our lab.

If you encounter other problems, try changing the codec order in the Codecs tab of the Preferences menu. Most programs prefer the PCMU and PCMA methods. Move these two methods up to the top if the issue persists. The Speex codec with a sampling rate of 16 kHz will typically give you the best voice quality.

Conclusions

Linphone has reached a useful level of functionality, and the pace of development is now slowing down. Many users would like to see improved firewall support, in the form of the STUN protocol (see "SIP Details"), and it looks likely that the developers will be implementing STUN support soon. All in all, Linphone is a very useful and convenient softphone.

INFO
[1] Linphone homepage: http://www.linphone.org/?lang=us
[2] Download page for Linphone sources: http://simon.morlat.free.fr/download/1.1.x/source/
[3] Download page for X-Lite: http://www.xten.com/index.php?menu=download
[4] Developer version of Gnome Meeting: http://snapshots.seconix.com
THE AUTHOR

Simone Schäfer is currently studying Computer Visuals and spends most of her time repairing her Arch Linux system. When she is not doing this, she also enjoys testing other distributions.