DTMF Tones Tutorial

This tutorial describes how to send the Dual Tone Multi Frequency (DTMF) tones to the network.

Dual Tone Multi-Frequency (DTMF) is a touch tone system used for choosing menu options in communication with an automated call handling service.

Tones can only be sent over an active and connected voice calls. The caller does not need a handle to the specific call. The telephony system can send the tones over the voice calls that are connected.

  1. Use RMobilePhone::GetDTMFCaps() to check that the tones can be sent to the network. Capabilities are described by RMobilePhone::TMobilePhoneDTMFCaps.
  2. Use RMobilePhone::NotifyDTMFCapsChange() to get the notification of any changes to the capabilities.
  3. Use RMobilePhone::SendDTMFTones() to send a sequence of fixed length DTMF tones.
  4. Use RMobilePhone::StartDTMFTone() and RMobilePhone::StopDTMFTone() to control a DTMF tone length. .
  5. Use RMobilePhone::NotifyStopInDTMFString() to get the notification when the phone has encountered a 'w' char in the transmission of the DTMF string.
  6. Use RMobilePhone::ContinueDTMFStringSending() to resume the transmission.

DTMF example

The following code checks that if a string of DTMF tones can be sent, and if so, sends the tone sequence specified in KTones.

The code assumes iMobilePhone is an RMobilePhone object.

TUint32 dtmfCaps;
User::LeaveIfError(iMobilePhone.GetDTMFCaps(dtmfCaps));

if (dtmfCaps & RMobilePhone::KCapsSendDTMFString)
    {
    _LIT(KTones, "#1234");
    TRequestStatus status;

    iMobilePhone.SendDTMFTones(status, KTones);
    User::WaitForRequest(status);
    User::LeaveIfError(status.Int());

    }