This module provides an API to a telephone.
Since the users of the device can also hang-up the phone explicitly, they might affect the current status of the call. In addition, using this extension in an emulator has no effect since no calls can be connected.
The telephone module has the following functions:
Dials the number set in number. number
is a string, for example
'+' is the
'358' is the country code,
the mobile network code (or the area code), and
'1234567' is the
subscriber number. If there is an ongoing phone call prior to calling
dial from Python, then the earlier call is put on hold and a new
call is established. Calling dial multiple times when, for example,
the first call has been answered and a line has been established results in
subsequent calls not being connected.
answercan be called to answer the call. Without the invocation of function
incoming_call, the function
answerhas no effect.
Answers an incoming call - see also
callablewill be called when there are changes in the telephone line (lines) in the device. The argument for the call is a tuple with first item the possible new state and the second item, the possible incoming call number as a Unicode string.
The possible states in the tuple are defined as
The following data items for state information are available in