[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-users] [PATCH] answer call on unix SIGUSR1

From: David Mansfield
Subject: [Linphone-users] [PATCH] answer call on unix SIGUSR1
Date: Wed, 26 Dec 2012 12:21:46 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.8) Gecko/20121005 Thunderbird/10.0.8

I have a headset (microsoft lifechat lx-3000) with an "answer" button on the cord, which I wanted to have work with linphone.

Because of reasons like:

* answer button press doesn't generate an actual X keyboard event (but is visible through /dev/hidrawX) * linphone is running on local desktop, but I'm working on a fullscreen remote desktop and all keyboard events get sent there

I decided to use a simple Unix signal IPC to hook into the linphone gtk main loop, as described in:

The implementation is basically:

* create a "self-pipe" during initialization
* create GIOChannel on "read" end of pipe, and add a watch to main loop
* unix signal handler writes "message" into pipe
* GIOChannel event reads "message" from pipe and calls linphone_gtk_answer_clicked(NULL), which already takes care of what to do if no call is currently ringing.

Last part is a perl script which reads bytes from /dev/hidrawX and looks for a specific byte-sequence and sends the "kill" to the pid of the running linphone. Perl script is currently hard-coded to hell, but I'll attach anyway for "documentation purposes". Note: requires "read" access to be granted on /dev/hidrawX device to current user before running. Note2: script also pauses playing rhythmbox on answer press.

David Mansfield
Cobite, INC.

Attachment: linphone-3.5.2-answer-SIGUSR1.patch
Description: Text document

Description: Perl program

reply via email to

[Prev in Thread] Current Thread [Next in Thread]