Yeaphone

Configuration

The configuration requires 3 steps:

  1. setting the SIP server vialinphonec, the console version of Linphone
  2. providing different Yeaphone-specific parameters
  3. creating a rule forudev

Setting the SIP server

First you have to log in as the user which should be used for Yeaphone later on. Then linphonec has to be invoked to set the SIP server, as show in the following example (user input printed bold):

user@NSLU2:~# linphonec
Ready
Warning: video is disabled in linphonec. Run with -V option to enable it.
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>

Now the file ~/.linphonerc containing the specified settings was created in the HOME directory.

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:

  • 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 made this way, linphonec can be stopped.

Providing Yeaphone-Specific Parameters

Now the configuration file ~/.yeaphonerc has to be created manually. In order to correctly understand the phone number of incoming calls, Yeaphone needs the parameters intl-access-code, natl-access-code, and country-code according to your country.

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 ~/.yeaphonerc you can also spedify custom ringtones for different numbers by adding lines according to the following example:

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 $HOME/.yeaphone/ringtone.

Another feature to be configured in ~/.yeaphonerc is the minimum ring duration. If for a certain caller ID the duration of the ring should be at least 5 seconds, this can be specified as:

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 comes in handy. This makes sense especially in an environment where multiple handsets are operated next to each other and there is danger of confusing them. Example:

display-id  "  --1234--"

Creating a rule for udev

As Yeaphone should not be run by the user root 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 /etc/udev/rules.d/99-yealink.rules.

KERNEL=="event*", ATTRS{name}=="Yealink*", GROUP="voip", RUN+="/bin/sh -c '/bin/chgrp voip /sys$env{DEVPATH}/device/device/*'"

To activate the rule on a running system, the handset has to be unplugged and plugged in again.

Using Yeaphone

When invoking yeaphone the output on the console should look similar to this:

user@NSLU2:~# yeaphone
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 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+/-
      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)
Disclaimer:
The author does not take any responsibility for problems and damage arising by installing or using this software, use it at your own risk.