×
Namespaces

Variants
Actions
Revision as of 06:34, 12 January 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Getting call number with CTelephony

From Nokia Developer Wiki
Jump to: navigation, search

This code example illustrates how to get the remote party’s phone number when dialing a call or when there is an incoming call.

Article Metadata
Code ExamplePlatform Security
Signing Required: DevCert
Capabilities: ReadUserData
Article
Created: symbianyucca (27 Mar 2007)
Last edited: hamishwillee (12 Jan 2012)

Headers Required:

#include <Etel3rdParty.h>

Library required:

LIBRARY   Etel3rdParty.lib

Capability required:

CAPABILITY ReadUserData

Source:

TBuf<100> CallerNumber;
 
if(iCurrentStatus.iStatus == CTelephony::EStatusRinging
|| iCurrentStatus.iStatus == CTelephony::EStatusDialling)
{
CTelephony::TRemotePartyInfoV1 RemInfoUse;
CTelephony::TCallInfoV1 CallInfoUse;
CTelephony::TCallSelectionV1 CallSelectionUse;
 
CallSelectionUse.iLine = CTelephony::EVoiceLine;
CallSelectionUse.iSelect = CTelephony::EInProgressCall;
 
CTelephony::TRemotePartyInfoV1Pckg RemParty(RemInfoUse);
CTelephony::TCallInfoV1Pckg CallInfo(CallInfoUse);
CTelephony::TCallSelectionV1Pckg CallSelection(CallSelectionUse);
 
iTelephony->GetCallInfo(CallSelection,CallInfo,RemParty);
 
if(iCurrentStatus.iStatus == CTelephony::EStatusRinging)
{
CallerNumber.Copy(RemInfoUse.iRemoteNumber.iTelNumber);
}
else if(iCurrentStatus.iStatus == CTelephony::EStatusDialling)
{
CallerNumber.Copy(CallInfoUse.iDialledParty.iTelNumber);
}
}

Example Project

File:RetrieveNumber.zip

Related Link

This page was last modified on 12 January 2012, at 06:34.
66 page views in the last 30 days.