![]() |
There are various USB phones available which are marketed as VoIP phones. While usually rather cheap their built-in logic does not provide much more than an audio device, reading a user's key presses and possibly displaying simple messages. The following article describes how to connect and use a YeaLink USB-P1K handset with the NSLU2 as a standalone SIP VoIP phone. The USB-P1K was chosen because it is well-supported by the Linux kernel module yealink (see http://savannah.nongnu.org/projects/usbb2k-api/). It is sold for ~30€ under various brand names (cistrix, comsel, freshtel, laser, peoplefone, siptronic, us robotics, etc). Please note that nowadays most devices advertised as USB-P1K are actually its successor, the USB-P1KH. Although it is not supported by the driver shipped with the kernel, there is a new version of the yealink kernel module available at http://www.devbase.at/svn/view.cgi/yealink-module/?root=voip for kernel versions >= 2.6.18. There is no support for models other than the USB-P1K(H) at this time, but some may not need much work in the application. Table of contentsBasic ArchitectureAs mentioned above the USB-P1K provides the basic phone interface (speaker, microphone, keys, display) but no VoIP functionality. On the other side there are the numerous VoIP soft phones, most of which can only be controlled via their GUI and therefore are not suitable for the NSLU2. This gap is closed by Yeaphone, which interfaces to the kernel module and provides VoIP functionality by using the liblinphone SIP phone backend. Yeaphone's main features are:
InstallationThe necessary parts are
The BitBake files are available in the OpenEmbedded database but can also be downloaded from the developer's web-site for Yeaphone: http://www.devbase.at/voip/yeaphone.php For SlugOS/BE 4.8beta downloading the necessary files into the cross-compile environment could look like: cd ~/slugos-4.8-beta/openembedded/packages/linphone/ wget http://download.devbase.at/voip/linphone_2.1.1.bb mkdir ../yeaphone cd ../yeaphone wget http://download.devbase.at/voip/yeaphone_0.1.5.bb cd ~/slugos-4.8-beta/ Then you can compile Yeaphone: bb yeaphone
Note that this will only build the console version of linphone (as yeaphone's dependency). If you also want the GUI to be built you need to adjust the BitBake file linphone_2.1.1.bb. Alternatively there are compiled packages available for everything you will need to run Yeaphone at feed.devbase.at. Software SetupSetting a SIP ServerThe SIP servers for Yeaphone have to be configured through linphonec, the console version of Linphone. The following example shows how to get a working connection to a VoIP provider (user input printed bold). root@NSLU2:~# linphonec
Ready
linphonec> proxy add
Adding new proxy setup. Hit ^D to abort.
Enter proxy sip address: sip:sipgate.at
Your identity for this proxy: sip:1234567@sipgate.at
Do you want to register on this proxy (yes/no): yes
Specify register expiration time in seconds (default is 600): 600
Expiration: 600 seconds
Specify route if needed: [leave empty]
No route specified.
--------------------------------------------
sip address: sip:sipgate.at
route:
identity: sip:1234567@sipgate.at
register: yes
expires: 600
--------------------------------------------
Accept the above proxy configuration (yes/no) ?: yes
Proxy added.
linphonec>
Password for 1234567 on "sipgate.at": [enter password]
Registration on sip:sipgate.at sucessful.
linphonec>
Using linphonec the VoIP connection can be tested immediately before using Yeaphone. Commands still have to be entered through the terminal and the PC keyboard though. Note that if other sound cards are connected to the system, than it is likely that at this stage the speaker and microphone of the Yealink handset are not used yet. Yeaphone will later choose the correct audio settings automatically. The most important commands of linphonec are:
Providing Yeaphone-Specific ParametersNow the configuration file An example for Austria would be: intl-access-code 00
natl-access-code 0
country-code 43
For the USA this would be: intl-access-code 011
natl-access-code 1
country-code
In ringtone_default /usr/share/yeaphone/ringtones/default_p1k.bin
ringtone_01234567 /usr/share/yeaphone/ringtones/special_p1k.bin
ringtone_0555777 doorbell_p1k.bin
If you specify relative paths to the ringtones, they are based on Another feature to be configured in minring_01234567 5 If in its idle state the handset should not only display the current
date and time but also a certain fixed text, then the option
display-id " --1234--" Creating a rule for udevAs Yeaphone should not be run by the user <i>root</i> for security reasons,
the access rights of the files providing the interface to the yealink
driver have to be adjusted. The following line changes the group from
root to voip assuming that the yeaphone user is a member
of this group. The line has to be writting to a file called
KERNEL=="event*", DRIVERS=="yealink", GROUP="voip", RUN+="/bin/sh -c '/bin/chgrp voip /sys$env{PHYSDEVPATH}/*'"
To activate the rule on a running system, the handset has to be unplugged and plugged in again. Using YeaphoneWhen invoking yeaphone the output on the console should look similar to this: user@NSLU2:~# <b>yeaphone</b>
Ready
Registration on sip:sipgate.at successful.
At the same time the current date and time are show on the handset's display, a quick sequence of status messages appear, and finally the lower part of the display should be empty (or show the text set with 'display-id'). Now the handset's keyboard can be used to place and receive calls. The various phone keys have the following functions:
For special use cases Yeaphone provides a few command-line options. In a multi-head environment you may choose a specific handset (out of multiple connected devices) using the option --id=<id> Attach to the device with an ID <id>.
--wait=[<sec>] Check for the handset every <sec> seconds.
-w Check for the handset every 10 seconds.
--help|-h Print this help message.
Performance ConsiderationsThe following performance measurements have been done using linphonec on a TurboSlug with an ARM5-optimized SPEEX library 1.2beta1 and SlugOS/4.8 (OABI):
Conclusion:
The NSLU2 does not have enough horse power for echo cancellation or the SPEEX codecs, these should be turned off in the configuration file Page last modified on October 06, 2008, at 09:23 PM
|