Reply
Thread Tools
Posts: 36 | Thanked: 13 times | Joined on Dec 2009 @ Bandung, Indonesia
#1
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)

Answer current phone call

dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call/1 com.nokia.csd.Call.Answer

This will answer/pickup the current (first) call.

TODO: Early experiments show that this function throws com.nokia.csd.Call.Error.NotAllowed exception. How to get around this?
Can someone shed a light on this? Thank you.
 
Posts: 5 | Thanked: 8 times | Joined on Jun 2010
#2
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
 

The Following 2 Users Say Thank You to roman4 For This Useful Post:
Posts: 36 | Thanked: 13 times | Joined on Dec 2009 @ Bandung, Indonesia
#3
Thanks roman4 !

Never knew that was the case. I wish this is documented somewhere.. anywhere!
 
Posts: 44 | Thanked: 34 times | Joined on May 2010
#4
Originally Posted by ceefour View Post
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)



Can someone shed a light on this? Thank you.
I saw from your wiki entry you seemed to have updated the script to answer the call automatically.

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.
 
Posts: 4 | Thanked: 3 times | Joined on Aug 2010
#5
Originally Posted by roman4 View Post
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
To answer incoming calls automatically, Answer() method of the call instance shows not allowed exception.. And to know the call_status of the incoming call I tried creating an instance of CallStatus interface.. but it raised unknown method exception, I found about GetStatus and implemented it in the following way:

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

Last edited by njain; 2011-04-03 at 18:06.
 
Reply


 
Forum Jump


All times are GMT. The time now is 09:20.