This tutorial describes how to handle two call with the telephony API for applications.
This state diagram shows how to dial or answer one or two calls at a time.
Figure: Simultaneous Call State Diagram
The boxes are states. The enumeration value in each box is the status
of the voice line. Voice
line status describes these states and their meaning. The arrows show
events that trigger a change of state. In these events, a word in bold indicates
a CTelephony
method that you can call.
if the line is Idle (CTelephony::EStatusIdle
)
then no calls are in progress
if the line is on
hold (CTelephony::EStatusHold
) then there is another
call in progress, but it is on hold and you can still dial or answer a second
call. Now go to point four below
if another call is active, you must wait until it completes before you can dial or receive a call.
CTelephony::EStatusIdle
.
To dial a call, use CTelephony::DialNewCall()
. If dialling
was successful and the remote party answers the call then the line's status
will become CTelephony::EStatusConnected
.
CTelephony::EStatusIdle
.
When a remote party calls your phone, the voice line's status will change
to CTelephony::EStatusRinging
.
When the status is CTelephony::EStatusRinging
, use CTelephony::AnswerIncomingCall()
to
answer the call. The status will change to CTelephony::EStatusConnected
and
the phone user can talk to the remote party.
CTelephony::EStatusRinging
.
You can receive notification when this occurs; see Detect
an incoming call. Before answering the second call, you must put the
original call on hold. This is shown in the diagram above.
CTelephony::TCallId
will be given to you when you
successfully connect a second call. You will also have a CTelephony::TCallId
from
the first call. Now you will be the owner of two calls: at any one time, one
will always be active and one will always be on hold.
Now you can:
Terminate either call. If you terminate the active call then you will be left with a call on hold. If you terminate the on-hold call then you will be left with an active call.
Detect remote party terminating either call. Once again, if the active call ends then you will be left with a call on hold and vice versa.