Single Call Tutorial

This tutorial describes how to handle single call with the telephony API for applications.

Context

This state diagram shows how to dial or answer one call at a time. It presumes there are no other calls being made.

Figure: Single Call State Diagram

The boxes are states. The enumeration value in each box is the status of the voice line. Voice line status describes the states and their meaning. You can also find the status of individual calls. The line state and the call state are the same in a single call.

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.

Steps

  1. Check the Voice line status
    1. if the line is Idle(CTelephony::EStatusIdle) no calls are in progress
    2. 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
    3. if a call is active, you must wait until it completes before you can dial or receive a call. To detect when this occurs, see Notification Request Tutorial
  2. Dial a call While no calls are in progress, the line status is CTelephony::EStatusIdle. To dial a call, use CTelephony::DialNewCall(). If successful and the remotes party answers the call then the line status is CTelephony::EStatusConnected.
  3. Answer a call When no calls are in progress, the line status is CTelephony::EStatusIdle. When a remote party calls your phone, the voice line status will change to CTelephony::EStatusRinging. When the status is CTelephony::EStatusRinging, use CTelephony::AnswerIncomingCall() to answer the call. The status changes to CTelephony::EStatusConnected and the phone user can talk to the remote party.
  4. Terminate a call
  5. Detect remote party call termination
  6. Hold a Call
  7. Resume a call
  8. Send DTMF tones

Results

When you successfully dial or answer a call, you will be given a CTelephony::TCallId the identifies the call.

A remote party might try to ring your phone. The voice line state will change to CTelephony::EStatusRinging. You can ignore this call. You can still terminate, hold, resume and send DTMF.

Related tasks