Making a call and Hanging up calls:
#Copyright (c) 2008 Pankaj Nathani
#Making a call
import telephone, appuifw, e32
#Ask the user for the number to call
n=appuifw.query(u"Enter number", "number")
telephone.dial(str(n))
#Wait a while
e32.ao_sleep(5)
#Now hang up
telephone.hang_up()
Waiting for a call:
#Copyright (c) 2008 Pankaj Nathani
#Waiting for a call
import telephone, e32, appuifw
#Define the exit function
app_lock=e32.Ao_lock()
def quit():
app_lock.signal()
appuifw.app.exit_key_handler=quit
def handle_call(state):
print "There was an incoming call"
def cb(state):
if(state[0]==telephone.EStatusRinging):
handle_call(state)
#Wait for a call
telephone.call_state(cb)
app_lock.wait()