Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Retrieving incoming and outgoing call numbers using Symbian C++

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Created: User:Technical writer 2 (13 Jun 2007)
Last edited: hamishwillee (14 Jun 2012)



Retrieving incoming and outgoing call numbers


The following code example demonstrates how to retrieve telephone numbers for incoming and outgoing calls using the 3rd party telephony API (CTelephony).
The below code is meant to be implemented in an active object, that is, a class derived from CActive.


 // Class members
CTelephony* iTelephony;
CTelephony::TCallStatusV1 iLineStatus;
CTelephony::TCallStatus iLastInformedLineStatus;

Construction & initialization:

    iTelephony = CTelephony::NewL();   
// Initialize with ’unknown’ statuses
iLineStatus.iStatus = CTelephony::EStatusUnknown;
iLastInformedLineStatus = CTelephony::EStatusUnknown;
CTelephony::TCallStatusV1Pckg lineStatusPckg( iLineStatus );
// Request notification about the changes in voice line status
iTelephony->NotifyChange( iStatus, CTelephony::EVoiceLineStatusChange, lineStatusPckg );

Implementation of CActive::RunL()

    // Within CActive::RunL():
if( iLineStatus.iStatus == CTelephony::EStatusDialling )
if(iLineStatus.iStatus == CTelephony::EStatusRinging)
if(iLastInformedLineStatus != CTelephony::EStatusDialling)
iLastInformedLineStatus = iLineStatus.iStatus;

Implementation of CActive::DoCancel():

    iTelephony->CancelAsync( CTelephony::EVoiceLineStatusChangeCancel );

Implementation of GetNumber():

    CTelephony::TCallInfoV1 callInfoV1;
CTelephony::TCallInfoV1Pckg callInfoV1Pckg( callInfoV1 );
CTelephony::TCallSelectionV1 callSelectionV1;
CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg( callSelectionV1 );
CTelephony::TRemotePartyInfoV1 remotePartyInfoV1;
CTelephony::TRemotePartyInfoV1Pckg remotePartyInfoV1Pckg( remotePartyInfoV1 );
callSelectionV1.iLine = CTelephony::EVoiceLine;
callSelectionV1.iSelect = CTelephony::EInProgressCall;
iTelephony->GetCallInfo( callSelectionV1Pckg, callInfoV1Pckg, remotePartyInfoV1Pckg );
if( remotePartyInfoV1.iRemoteIdStatus == CTelephony::ERemoteIdentityAvailable )
if( remotePartyInfoV1.iRemoteNumber.iTelNumber.Length() > 0 )
// Incoming call number can be read from
// remotePartyInfoV1.iRemoteNumber.iTelNumber;
if( callInfoV1.iDialledParty.iTelNumber.Length() > 0 )
// Outgoing call number can be read from
// callInfoV1.iDialledParty.iTelNumber;
This page was last modified on 14 June 2012, at 07:41.
92 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.