YlSkypeConnector

Overview

Although there is an official SkypeMate for Linux available from Yealink Inc. it is compiled against an outdated DBUS library and therefore cannot be used with any recent Linux distribution. Lukily the Linux kernel provides support for the USB-P1K handset, and the models USB-P1KH, B2K, B3G, and P4K are supported by the update kernel module provided on this site (http://svn.devbase.at:5071/viewvc/voip/yealink-module/). On Skype's side a public DBUS API provides everything needed to place and answer calls and to browse through the contacts.

The missing link between the yealink kernel module and Skype should be provided by YlSkypeConnector. This Python script can be configured with a few simple command line options or a configuration file and otherwise stays in the background of things.

Download

Yealink Kernel Module SVN Tree
(only required for P1KH, B2K, B3G, P4K)
YlSkypeConnector SVN Tree

Command Invocation

Please stick to the following order:
  1. Connect your USB handset.
  2. Start up Skype. Make sure that the "Public API" tab of the configuration shows a check mark at "D-BUS". If it is not checked, please try to start Skype with the following command:
      skype --enable-dbus --use-session-dbus
  3. If not already done: Select the handset as the speaker and microphone device in the Skype options.
  4. Start ylskypeconnector.py

YlSkypeConnector's command line options are:

Usage: ylskypeconnector.py [options]
	--intlacc-code=<nums>	Set international access code.
	--natlacc-code=<nums>	Set national access code.
	--country-code=<nums>	Set country code.
	--area-code=<nums>	Set areacode.
	--verbose|-v		Increase verbosity
	--help|-h		Print this help message.

Configuration

Apart from specifying the various phone number codes on the command line (see above), they can be stored in a configuration file $HOME/.ylskypeconnector . The following parameters are available:

	intlacc-code  <nums>
	natlacc-code  <nums>
	country-code  <nums>
	area-code     <nums>

Examples:

  • Austria (Vienna):
    	intlacc-code  00
    	natlacc-code  0
    	country-code  43
    	area-code     1
    
  • USA (San Francisco):
    	intlacc-code  011
    	natlacc-code  1
    	country-code  1
    	area-code     415
    

Usage

The following keys of the handsets are supported:

  • 0-9, #, *
    Dial a number (# at the beginning means '+' for international numbers), or
    send DTMF tones during a call
    B2K, B3G only: * switches to PSTN mode, # sends a dialed number
  • C
    remove the last digit of the dialed number
  • <red key>
    remove the whole number dialed so far, or
    hang up an active or incoming call
  • <green key>
    dial number of contact, or
    pick up an incoming call
  • ▲,▼
    browse through the list of contacts

Known Problems

  • When Skype is started there is no entry selected in the list of contacts. The user has to manually select a contact before YlSkypeConnector is able to browse through the list.
10 Kommentare bisher (eigenen Kommentar verfassen)
[1] Eingetragen von Vitali am Montag, 30.03.2009 @ 22:30
Great work!!!
[2] Eingetragen von Vitali am Dienstag, 31.03.2009 @ 18:47
I could not start this script from an ordinary user, so I've made a simple script to do this:

#!/bin/bash
sudo chmod 777 /dev/input/event*
sudo chmod -R 777 $(find /sys/ -name get_icons|sed 's/get_icons//')
skype & # I use 'echo username password | skype --pipelogin &'
sleep 7;./ylskypeconnector.py

It will be great if "out" "in" buttons would work too.
Antwort von Thomas: You could also use some udev-rules to assign those files a specific group name which you are a member of (example at http://www.devbase.at/voip/yeaphone-doc.php).

The IN and OUT buttons are a bit tricky, some phones have them labeled VOL- and VOL+. Still, what is your suggestion for their function?
-Thomas
[3] Eingetragen von Vitali am Mittwoch, 1.04.2009 @ 11:36
Unfortunately, I am not familiar with the rules for udev. How can I replace the following string with the rules:
sudo chmod -R 777 $(find /sys/ -name get_icons|sed 's/get_icons//') ?

For the first string of my script the rule from your link works fine, but not for the second. It gives error:

Connected to Skype
Found a P1K
Handset seems to be Connected to Skype
Found a P1K
Handset seems to be disconnected -> shutdown
Handset seems to be disconnected -> shutdown
Exception AttributeError: "MainApp instance has no attribute 'skype_object'" in <bound method Yealink_displ_obj.__del__ of <__main__.Yealink_displ_obj instance at 0x9ef1c2c>> ignored
disconnected -> shutdown
Handset seems to be disconnected -> shutdown
Exception AttributeError: "MainApp instance has no attribute 'skype_object'" in <bound method Yealink_displ_obj.__del__ of <__main__.Yealink_displ_obj instance at 0x9ef1c2c>> ignored

As for buttons, I was a little wrong, it seems I don't need they. Just anytime there are shown three dashes (---) and I can't pick out any contact or, when I dial the number, it displays a "bad number". So I need to go to my computer and click in the contact list. Initially, I assumed for (---) - button "in", so I can pick out from my contacts, and "out" for a bad number warning so I could dial normally. But it is not so important, because mostly it works fine.

Thank you!
[4] Yealink USB-p1k phone
Eingetragen von M Natiello am Donnerstag, 9.04.2009 @ 09:49
Hi

Thank you for writing this programme. One feature I would
like to see is that steps 2 and 3 in your connection sequence
are completely eliminated. I mean:
1. plug in the usb-p1k phone
2. start a programme that perform tasks 2-3-4.

Consider that usually skype is already running since
startup, but using the default audio devices. The script
should tell the running skype to change audio device to
usb-p1k and then start ylskypeconnector.py

Is this possible?

Thanks,

M. Natiello
[5] Yay!
Eingetragen von Oyvind am Donnerstag, 28.05.2009 @ 22:56
Great tool! Thanks!
Had some problems at first with the B2K not defaulting to my PSTN phone on start, but fixed that by changing the self.pstn = False to True in the script.
[6] Ringtone volume
Eingetragen von Mike am Dienstag, 1.09.2009 @ 19:56
Thanks for writing this awesome script! I've had a P1K for four years now, and I've been waiting just as long for someone to write this! I have one little request though, it would be really neat to be able to set the ringtone volume, at least at startup. As it is now you can barely hear the phone ringing if you're too far away. I would do it myself, but unfortunately I don't have the skills needed. :(

Keep up the good work!

/ Mike
[7] refused calls doesn't go to voicemail
Eingetragen von Joao Borsoi am Mittwoch, 9.09.2009 @ 07:11
Very useful program. I'm using it under fedora 10 with some little adjusts so it can find the proc files. I made the following change:
# sysfs = commands.getoutput('ls /sys/bus/usb/drivers/yealink/*/show_icon')
sysfs = commands.getoutput('find /sys -name show_icon')

I have only two issues. The worst is that when I refuse calls from the phone, skype doesn't go to the voicemail. If I do it from the skype, it does. Maybe it's a skype issue and not from ylskypeconnector

The other problem, is that when I don't answer the call, the phone keeps ringing forever. Until I refuse it, and then the script freezes. I have to plug/unplug the phone so script dies, to run it again after.
[8] What should appear on the screen?
Eingetragen von Gregg am Sonntag, 16.05.2010 @ 04:05
Thank you for writing this. It isn't working for me (yet) but I'd like to keep trying with your help. It may be that the new version of Skype (2.1) has broken it or changed the way it runs...

skype: unrecognized option '--enable-dbus'
skype: unrecognized option '--use-session-dbus'

Maybe dbus is included by default now? It is installed. Skype recognises that the software wants to have access to skype by opening a window to confirm. So far so good.

Nothing appears on the Yealink phone screen other than the symbol of a computer, an X and something that looks like a egg. The manual says that this means it is connected. Nothing happens in Skype, but commands such as these appear in the terminal where I start ylskypeconnector:

160510 11:55:22 Key #108
160510 11:55:22 "OPEN CONTACTS" -> "OK"
160510 11:55:22 "GET CONTACTS_FOCUSED" -> "CONTACTS FOCUSED"
160510 11:55:22 IDLE - - - None
160510 11:55:22 Key #108
160510 11:55:22 "OPEN CONTACTS" -> "OK"
160510 11:55:22 "GET CONTACTS_FOCUSED" -> "CONTACTS FOCUSED"
160510 11:55:22 IDLE - - - None
160510 11:55:23 Key #108
160510 11:55:23 "OPEN CONTACTS" -> "OK"
160510 11:55:23 "GET CONTACTS_FOCUSED" -> "CONTACTS FOCUSED"
160510 11:55:23 IDLE - - - None

I sense that I'm almost there. Can you please help me reach the next level?

Thank you!
[9] Development
Eingetragen von Mike am Montag, 20.02.2012 @ 17:16
Any further development on this since 2009? What was the corrective action for Post number 3?
[10] ylskypeconnector.py
Eingetragen von Jeroen Petrick am Dienstag, 15.05.2012 @ 20:37
Hello thank you very much for this guide but i have a question. Where and how can i download ylskypeconnector.py script?
Antwort von Thomas: I am currently in the process of upgrading the server hardware and software, the SVN service will be up again in the next few days.
Then you will be able to find the script at the link shown at the top of this page.
Notice: A non well formed numeric value encountered in /home/.sites/8/site377/web/lib-php/comments_inc.php on line 158
Eigenen Kommentar verfassen
Name:
Email:
Betreff:
Kommentar:
 

Anmerkung: Die Email-Adresse ist optional und wird weder gespeichert noch veröffentlicht, kann aber zur Kontaktaufnahme angegeben werden. Bitte nur sachbezogene Kommentare verfassen, anstößiger Inhalt wird entfernt.

HTML-Code ist nicht erlaubt. Zeilenumbrüche werden automatisch erzeugt. URLs werden in Links umgewandelt. Zur Formatierung bitte BBCode verwenden. Beispiele:
[b]fett[/b] ... fett
[code]Quelltext[/code] ... Quelltext

Hinweis:
Die Verwendung dieser Software erfolgt auf eigene Gefahr, der Autor übernimmt keinerlei Haftung für allfällige Schäden oder negative Auswirkungen, die durch Installation oder Verwendung dieser Software entstehen.