Namespaces
Variants
Actions

Archived:How to make time limited calls using PySymbian

Jump to: navigation, search
Archived.png
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.
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:

Timelimited1.jpg Timelimited2.jpg

Related Links

This page was last modified on 8 May 2013, at 09:05.
207 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved