Call Forward Settings Tutorial

This tutorial describes how to get and set the call forward settings in a Symbian platform device.

Call forward settings example

The following code gets the list of call forwarding numbers that are used when the call is forwarded because the number is busy. It checks the list and prints each number.

The code assumes iMobilePhone is an RMobilePhone object.

void CClientApp::CallForwardingL()
    {

    // Create and start CF number retriever for forward-when-busy numbers
    CRetrieveMobilePhoneCFList* retrieveCFList = CRetrieveMobilePhoneCFList::NewL(iMobilePhone);

    CleanupStack::PushL(retrieveCFList);
    TRequestStatus status;

    retrieveCFList->Start(status, RMobilePhone::ECallForwardingBusy);
    User::WaitForRequest(status);
    User::LeaveIfError(status.Int());

    // Get the list of numbers
    CMobilePhoneCFList* cfList = retrieveCFList->RetrieveListL();
    CleanupStack::PushL(cfList);

    // Print each number
    TInt nEntries = cfList->Enumerate();
    RMobilePhone::TMobilePhoneCFInfoEntryV1 cfEntry;

    for (TInt i=0; i<=nEntries; i++)
        {
         cfEntry = cfList->GetEntryL(i);
         console->Printf(_L("%S\n"),cfEntry.iNumber);
        }

    // Clean up
    CleanupStack::PopAndDestroy(2); // cfList, retrieveCFList    

    }