I'm using 1.4.1 final on an E50.
I'd like to use telephone.incoming_call() and telephone.answer() to answer an incoming call. The documentation says:
My app looks like thisincoming call()
Wait for incoming call, returns immediately. If a call arrives, answer can be called to answer the call. Without the invocation of function incoming call, the function answer has no effect.
answer()
Answers an incoming call - see also incoming call.
When a call comes in I see this in the console:Code:import appuifw import e32 import telephone STATES = {telephone.EStatusUnknown: "unknown", telephone.EStatusIdle: "idle", telephone.EStatusDialling: "dialing", telephone.EStatusRinging: "ringing", telephone.EStatusAnswering: "answering", telephone.EStatusConnecting: "connecting", telephone.EStatusConnected: "connected", telephone.EStatusReconnectPending: "reconnect pending", telephone.EStatusDisconnecting: "disconnecting", telephone.EStatusHold: "hold", telephone.EStatusTransferring: "transferring", telephone.EStatusTransferAlerting: "transfer alerting"}; def handleCall((callState, number)): print "callState = "+STATES[callState] if callState == telephone.EStatusRinging: if number == "": print "incoming call" else: print "call from "+number telephone.answer() elif callState == telephone.EStatusAnswering: print "hanging up" telephone.hang_up() elif callState == telephone.EStatusDisconnecting: print "hung up" def quit(): app_lock.signal() appuifw.app.exit_key_handler = quit app_lock=e32.Ao_lock() old_title = appuifw.app.title appuifw.app.title = u"Incoming" telephone.incoming_call() telephone.call_state(handleCall) print "waiting for a call" app_lock.wait() appuifw.app.title = old_title
(caller hangs up after 3 rings - the app did not answer the call)waiting for a call
callState = ringing
incoming call
The call to telephone.answer() seems to have no effect. I have also tried calling it in other spots: before and after the call to telephone.call_state() and in the ringing case in handleCall. Has anyone else gotten telephone.answer() (or incoming_call()) to work?callState = disconnecting
hung up
callState = idle
Thanks.

Reply With Quote

