×
Namespaces

Variants
Actions
Revision as of 08:48, 18 September 2012 by hamishwillee (Talk | contribs)

Archived:How to make a phone call using PySymbian

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia N95, Nokia E90
Compatibility
Platform(s): S60 1st Edition, S60 2nd Edition, S60 3rd Edition
Article
Keywords: telephone
Created: cyke64 (15 Mar 2007)
Last edited: hamishwillee (18 Sep 2012)

Contents

Overview

This snippet shows how to dial and hang up a call in Python.

Source code

import appuifw, e32, telephone
 
 
app_lock = e32.Ao_lock()
#Define the exit function
def quit():
#Cancel the timer when the user exits, if it has not expired
t.cancel()
app_lock.signal()
appuifw.app.exit_key_handler = quit
 
number = "072xxxxxxx"
#The number to be called
#Dial the number
telephone.dial(number)
#Instantiate a timer
t = e32.Ao_timer()
#Let it ring for 10 seconds and then hang up
t.after(10, lambda:telephone.hang_up())
 
#Wait for the user to request the exit
app_lock.wait()

Postconditions

A call is made to the specified number. The call will last for 10 seconds and will then be hung up.

Additional information

The contacts module can be used for retrieving numbers.

77 page views in the last 30 days.