![]() |
Answering calls programmatically
I'd like to write a script to auto-answer a call (actually, my intention is to answer-then-release). Releasing (hangup/reject) is working.
But answering a call always throws a com.nokia.csd.Call.Error.NotAllowed exception. From: http://wiki.maemo.org/PyMaemo/Phone_..._examples#Call (I wrote the quoted part below myself) Quote:
|
Re: Answering calls programmatically
If you answer the call immediately as you receive the call indication the phone seems to be in a specific call state where answering is not allowed yet.
If you answer the call using the described DBUS message after a delay of e.g. 1 s it works out fine. Another (probably better) approach is to register to the CallStatus DBUS message ("com.nokia.csd.Call", "/com/nokia/csd/call/1", "com.nokia.csd.Call.Instance.CallStatus") and wait for a call status >= 2 (=CSD_CALL_STATUS_COMING) after the "Coming" message. Best regards, Roman |
Re: Answering calls programmatically
Thanks roman4 !
Never knew that was the case. I wish this is documented somewhere.. anywhere! |
Re: Answering calls programmatically
Quote:
Is there any possibility you (or anyone else) could create a GUI, so the auto answering can be turned on and off easily? This would be a welcomed addition and something ive been searching for ages, whether for a wired or bluetooth connection. |
Re: Answering calls programmatically
Quote:
hob = bus.get_object('com.nokia.csd.Call', '/com/nokia/csd/call/1') hif = dbus.Interface(hob, dbus_interface='com.nokia.csd.Call.Instance.GetSta tus') print hif The hif that is printed is: <Interface <Proxy object> implementing GetStatus at 0xa..> How do I finally now get the status so that I could use: if call_status >= 2: hif.Answer() and answer calls automatically.. PS: I want to answer calls automatically only when headphones are plugged in.. so that the trouble of picking out from the pocket to answer the call is reduced.. At times, while I get hold of the phone call gets disconnected ;) |
All times are GMT. The time now is 16:41. |
vBulletin® Version 3.8.8