Archived:How to make time limited calls using PySymbian
Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.
All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
Article Metadata
Tested with
Devices(s): Nokia N95
Compatibility
Platform(s): S60 1st Edition, S60 2nd Edition, S60 3rd Edition
Article
Keywords: telephone
Created: diegodobelo
(11 Mar 2009)
Last edited: hamishwillee
(08 May 2013)
Contents |
Overview
Here is a very simple example teaching how to make time limited calls. In this example we just need to define the number to be called and the call duration. After that the call will be established and will automatically hanged up in the time you have entered in the application.
Code Snippet
import telephone
import e32
import appuifw
number = appuifw.query(u"Enter Your Phone Number",'number')#Enter the number you want to call
duration = appuifw.query(u"Enter the Durations",'number') #Enter the time
telephone.dial(str(number)) #make call
#define the handler function
def handle_hang_up(status):
#test if the call was complete
if status[0] == telephone.EStatusConnected:
#hangup after defined duration
e32.ao_sleep(float(duration), telephone.hang_up)
telephone.call_state(handle_hang_up) #set the handler function
PostConditions
The below are screenshots which will help you to understand the program:




16 Sep
2009