You Are Here:

Community: Wiki

This page was last modified 14:16, 5 November 2008.

TSS000685 - Retrieving incoming and outgoing call numbers

From Forum Nokia Wiki



ID TSS000685 Creation date June 13, 2007
Platform S60 3rd Edition Devices
Category Symbian C++ Subcategory Networking, Telephony


Keywords (APIs, classes, methods, functions):

Overview

Retrieving incoming and outgoing call numbers

Description

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.

Solution

    // 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 );
    SetActive();
Implementation of CActive::RunL()
    // Within CActive::RunL():
    if( iLineStatus.iStatus == CTelephony::EStatusDialling )
        {
        GetNumber();
        }
    if(iLineStatus.iStatus == CTelephony::EStatusRinging)
        {
        if(iLastInformedLineStatus != CTelephony::EStatusDialling)
            {
            GetNumber();
            }
        }   
    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;
        }

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fTSS001192E5fE2dE5fUsingE5fapplicationE2dspecificE5fcustomE5ffontsX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfnTypeZCommunityContentQ qdcZtypeQUqfnTypeZKnowledgeBaseContentQ qdcZtypeQUqfnTypeZE52esourceQ qdcZtypeQUqfnTypeZTechnicalSolutionQ qdcZtypeQUqfnTypeZWebpageQ qdcZtypeQUqfnTypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZKnowledgeBaseContentQ qfnZtypeQUqfnTypeZE52esourceQ qfnZtypeQUqfnTypeZTechnicalSolutionQ qfnZtypeQUqfnTypeZWebpageQ qfnZtypeQUqfnTypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfnTypeZCommunityContentQ qrdfZtypeQUqfnTypeZKnowledgeBaseContentQ qrdfZtypeQUqfnTypeZE52esourceQ qrdfZtypeQUqfnTypeZTechnicalSolutionQ qrdfZtypeQUqfnTypeZWebpageQ qrdfZtypeQUqfnTypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
User Rating: qfnZuserE5FratingQNx5E2E0000X