Symbian3/PDK/Source/GUID-C328D060-62A9-5425-B33A-704E5FC18290.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 11 Mar 2010 18:02:22 +0000
changeset 3 46218c8b8afa
parent 1 25a17d01db0c
child 5 f345bda72bc4
permissions -rw-r--r--
week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task xml:lang="en" id="GUID-C328D060-62A9-5425-B33A-704E5FC18290"><title>Call Waiting Settings Tutorial</title><shortdesc>This tutorial describes how to get and set the call waiting settings in a Symbian OS device. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> <steps-unordered> <step id="GUID-A978B2DF-12FD-5047-87D2-A1BA087111E3"><cmd>Use <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>CRetrieveMobilePhoneCWList</apiname></xref> to get a list of call waiting entries in a <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>CMobilePhoneCWList</apiname></xref> object. </cmd> <info>A list that indicates different waiting status for different service groups such as voice, fax, data and auxiliary voice is required. Each entry in the list is a <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::TMobilePhoneCWInfoEntryV1</apiname></xref> object, recording the service group and call waiting status. </info> </step> <step id="GUID-474DFCA5-ABAD-5367-9030-0B1E78516DED"><cmd>Set the status of the call waiting service using <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::SetCallWaitingStatus()</apiname></xref>. </cmd> <info>The action taken is described in <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::TMobilePhoneServiceAction</apiname></xref>. This is possible only in the CDMA mode if the feature code strings are programmed for the call forwarding service, see <xref href="GUID-EE8660B7-DAC2-5A57-BDEA-418900BAE421.dita">Call Supplementary Services Tutorial</xref> for more information </info> </step> <step id="GUID-B6555A38-7061-5D95-9E20-B98CBC09A044"><cmd>Use <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::NotifyCallWaitingStatusChange()</apiname></xref> to get the notification of any changes in the status of the call waiting service. </cmd> </step> </steps-unordered> <example><title>Call waiting settings example</title> <p>The following code gets the list of call waiting entries, and prints each service group for which call waiting is active. The code assumes <codeph>iMobilePhone</codeph> is an <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone</apiname></xref> object. </p> <codeblock id="GUID-920D3E9E-CBE3-5075-A262-CA73D331E00B" xml:space="preserve">void CClientApp::CallWaitingL()
    {

    // Create and start CW retriever
    CRetrieveMobilePhoneCWList* retrieveCWList = CRetrieveMobilePhoneCWList::NewL(iMobilePhone);
    CleanupStack::PushL(retrieveCWList);

    TRequestStatus status;
    retrieveCWList-&gt;Start(status);
    User::WaitForRequest(status);
    User::LeaveIfError(status.Int());

    // Get the list of call waiting entries
    CMobilePhoneCWList* cwList = retrieveCWList-&gt;RetrieveListL();
    CleanupStack::PushL(cwList);

    // Print each service group for which CW is active
    TInt nEntries = cwList-&gt;Enumerate();
    RMobilePhone::TMobilePhoneCWInfoEntryV1 cwEntry;

    // Names of service groups 
    TText* aServiceGroupNameStings[]={_S("Unspecified"), _S("Voice"), _S("Auxiliary Voice"),
        _S("CSD"),_S("Packet"),_S("Fax"),_S("SMS"),_S("All")};
    TPtr aServiceGroupName(NULL,20);

    for (TInt i=0; i&lt;=nEntries; i++)
        {
         cwEntry = cwList-&gt;GetEntryL(i);
         if (cwEntry.iStatus == RMobilePhone::ECallWaitingStatusActive)
            {
             aServiceGroupName = aServiceGroupNameStings[cwEntry.iServiceGroup];
             console-&gt;Printf(_L("Call waiting active for service group %d\n"),aServiceGroupName); 
            }
        }

    // Clean up
    CleanupStack::PopAndDestroy(2); // cwList, retrieveCWList    

    }</codeblock> </example> </taskbody></task>