The Wayback Machine - https://web.archive.org/web/20071003041953/http://www.nslu2-linux.org/wiki/HowTo/ConnectUSBPhone
NSLU2-Linux
view · edit · print · history

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). There is no support for models other than the USB-P1K at this time, but that's definitely a goal for future releases.

Table of contents

Basic Architecture

As 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:

  • Display the phone number of incoming and outgoing calls
  • Show the duration of a call
  • Store and recall 10 phone numbers
  • Mute the ring tone of incoming calls
  • Adjustable volume of the speaker
  • Send DTMF tones

Installation

The necessary parts are

  • Linphone 1.6.0 + a patch for Linphone 1.6.0 (Note: Linphone >= 1.7.1 already includes all patches)
  • Yeaphone 0.1
  • only for linux kernels < 2.6.18: patched kernel module usbhid

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 3.10beta downloading the necessary files into the cross-compile environment could look like:

cd ~/releases/slugos-3.10-beta/openembedded/packages/linphone/
wget  http://download.devbase.at/voip/linphone_1.6.0.bb
mkdir ../yeaphone
cd ../yeaphone
wget http://download.devbase.at/voip/yeaphone_0.1.bb
cd ~/releases/slugos-3.10-beta/

Then you can compile Yeaphone:

bb yeaphone

Note that this will also compile linphone (as yeaphone's dependency) which by default builds both the console version and the GUI. If you do not want all the Gnome stuff to be built you need to adjust the BitBake file linphone_1.6.0.bb - comments "console-only version" inside this file will help you doing that.

Alternatively there are compiled packages available for everything you will need to run Yeaphone at feed.devbase.at.

Software Setup

Yeaphone has 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> soundcard list
    0: ALSA: default device
    1: ALSA: USB Audio
    2: ALSA: VOIP USB Phone
    3: OSS: /dev/dsp
    4: OSS: /dev/dsp1
    linphonec> soundcard use 2
    Using sound device ALSA: VOIP USB Phone
    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. The speaker and microphone of the Yealink handset can be used already, commands still have to be entered through the terminal and the PC keyboard though. The most important commands of linphonec are:

  • help [<command>]
    shows the available commands and provides a detailed description for each command
  • call <phone number or SIP address>
    dials the specified phone number of SIP address
  • answer
    answers an incoming call
  • terminate
    terminates an (incoming or outgoing) call
  • quit
    unregisters at the VoIP provider and quits linphonec

As soon as calls can be make this way, linphonec can be stopped and yeaphone can be invoked. Its output should look similar to this:

    root@NSLU2:~# yeaphone
    Ready
    Registration on sip:sipgate.at sucessful.

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. Now the handset's keyboard can be used to place and receive calls.

To correctly understand the phone number of incoming calls, Yeaphone needs some adjustments in the file ~/.yeaphonerc. After terminating yeaphone the parameters intl-access-code, natl-access-code, and country-code should be changed to your countries access codes.

An example for Austria would be:

      intl-access-code 00
      natl-access-code 0
      country-code     43

For the USA this should be:

      intl-access-code 011
      natl-access-code 1
      country-code     1

Usage

The various phone keys have the following functions:

  1. before a phone call
    • 0-9
      Dial a phone number
    • C
      Remove the last character of the dialed number
    • C pressed long
      Remove the complete number
    • <red key>
      Remove the complete number
    • <green key>
      Initiate the call
    • # + <0-9>
      No number dialed yet: Recall and display a number from memory X
      Number already dialed: Store the currently displayed number at memory X
  2. during a phone call
    • 0-9,*,#
      Generate DTMF tones
    • <red key>
      Terminate the call
    • VOL-/+ (on some models: IN/OUT)
      Adjust the speaker's volume
  3. after a phone call (with the last number displayed)
    • 0-9
      Dial a new phone number
    • C
      Remove the complete number
    • <red key>
      Remove the complete number
    • <green key>
      Redial the last number
    • # + <0-9>
      Store the last number to memory X
  4. when the phone rings
    • #
      Mute the ringing without picking up
    • <red key>
      Immediately terminate the call without picking up
    • <green key>
      Pick up
  5. general
    • <red key> pressed long
      Start and stop the VoIP connection (corresponds to turning on/off a phone)

Performance Considerations

The following performance measurements have been done using linphonec on a TurboSlug with an ARM5-optimized SPEEX library 1.2beta1:

  • Codecs PCMU, PCMA, GSM: There is no significant CPU load during the phone call.
  • Echo Cancellation: With echo cancellation turned on the NSLU2 simply cannot keep up with the audio streams, only a fraction of the signal reaches the speaker.
  • SPEEX (wide-band, 16kb): The CPU load is between 50 and 70 %, occasionally there are audible cuts. The memory consumption rises to 50 %!
  • SPEEX (narrow-band, 8kb): The CPU load stays between 30 and 40 %, there are still some audible cuts.

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 .linphonerc.

view · edit · print · history · Last edited by Thomas Reitmayr.
Originally by Thomas Reitmayr.
Page last modified on June 21, 2007, at 05:52 PM
Morty Proxy This is a proxified and sanitized view of the page, visit original site.