diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-79D19798-FC6B-53D5-B99C-A079F74CE540.dita --- a/Symbian3/PDK/Source/GUID-79D19798-FC6B-53D5-B99C-A079F74CE540.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-79D19798-FC6B-53D5-B99C-A079F74CE540.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,87 +1,83 @@ - - - - - - Call -Barring Settings TutorialThis tutorial describes how to get and set the call barring settings -in a Symbian OS device. - - -

The Call Barring supplementary service of the GSM prevents the -subscriber -from making or receiving certain types of call. CDMA does not have this service, -though phone manufacturers can prevent certain call types by using internal -settings. -

- -Use CRetrieveMobilePhoneCBList to -get a list in a CMobilePhoneCBList object -of call barring entries for one or more call barring conditions. -For example the condition can be barring of incoming calls. Conditions -are enumerated in RMobilePhone::TMobilePhoneCBCondition. -A list is required as there can be different barring situations for -different service groups such as voice, fax, data and auxiliary voice. Each -entry in the list is a RMobilePhone::TMobilePhoneCBInfoEntryV1 object, -recording the condition, service group, and the status. - -Set the status of -the call barring services using RMobilePhone::SetCallBarringStatus(). -The change is described in a RMobilePhone::TMobilePhoneCBChangeV1 object. - -Use RMobilePhone::NotifyCallBarringStatusChange() to get the notification of any chages to the status of a call barring service. - -Change the password -associated with the call barring service using RMobilePhone::SetCallBarringPassword(). -Old and new passwords are provided in a RMobilePhone::TMobilePhonePasswordChangeV1 object. - - -Call barring example

The following code gets the -list of call barring entries for outgoing international calls, and prints -each service group for which call barring is active.

The code assumes iMobilePhone is -an RMobilePhone object.

void CClientApp::CallBarringL() - { - // Create and start CB retriever for outgoing international calls - CRetrieveMobilePhoneCBList* retrieveCBList = CRetrieveMobilePhoneCBList::NewL(iMobilePhone); - - CleanupStack::PushL(retrieveCBList); - - TRequestStatus status; - - retrieveCBList->Start(status, RMobilePhone::EBarOutgoingInternational); - User::WaitForRequest(status); - User::LeaveIfError(status.Int()); - - // Get the list of call barring entries - CMobilePhoneCBList* cbList = retrieveCBList->RetrieveListL(); - CleanupStack::PushL(cbList); - - // Print each service group for which CB active - TInt nEntries = cbList->Enumerate(); - RMobilePhone::TMobilePhoneCBInfoEntryV1 cbEntry; - - 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<=nEntries; i++) - { - cbEntry = cbList->GetEntryL(i); - if (cbEntry.iStatus == RMobilePhone::ECallBarringStatusActive) - { - aServiceGroupName = aServiceGroupNameStings[cbEntry.iServiceGroup]; - console->Printf(_L("Outgoing international barring set for %S\n"), aServiceGroupName); - } - } - - // Clean up - CleanupStack::PopAndDestroy(2); // cbList, retrieveCBList - - }
+ + + + + + Call +Barring Settings TutorialThis tutorial describes how to get and set the call barring settings +in a Symbian platform device. +

The Call Barring supplementary service of the GSM +prevents the subscriber from making or receiving certain types of call. CDMA +does not have this service, though phone manufacturers can prevent certain +call types by using internal settings.

+ +Use CRetrieveMobilePhoneCBList to +get a list in a CMobilePhoneCBList object +of call barring entries for one or more call barring conditions. +For example the condition can be barring of incoming calls. Conditions +are enumerated in RMobilePhone::TMobilePhoneCBCondition. +A list is required as there can be different barring situations for +different service groups such as voice, fax, data and auxiliary voice. Each +entry in the list is a RMobilePhone::TMobilePhoneCBInfoEntryV1 object, +recording the condition, service group, and the status. + +Set the status of +the call barring services using RMobilePhone::SetCallBarringStatus(). +The change is described in a RMobilePhone::TMobilePhoneCBChangeV1 object. + +Use RMobilePhone::NotifyCallBarringStatusChange() to get the notification of any chages to the status of a call barring service. + +Change the password +associated with the call barring service using RMobilePhone::SetCallBarringPassword(). +Old and new passwords are provided in a RMobilePhone::TMobilePhonePasswordChangeV1 object. + + +Call barring example

The following code gets the +list of call barring entries for outgoing international calls, and prints +each service group for which call barring is active.

The code assumes iMobilePhone is +an RMobilePhone object.

void CClientApp::CallBarringL() + { + // Create and start CB retriever for outgoing international calls + CRetrieveMobilePhoneCBList* retrieveCBList = CRetrieveMobilePhoneCBList::NewL(iMobilePhone); + + CleanupStack::PushL(retrieveCBList); + + TRequestStatus status; + + retrieveCBList->Start(status, RMobilePhone::EBarOutgoingInternational); + User::WaitForRequest(status); + User::LeaveIfError(status.Int()); + + // Get the list of call barring entries + CMobilePhoneCBList* cbList = retrieveCBList->RetrieveListL(); + CleanupStack::PushL(cbList); + + // Print each service group for which CB active + TInt nEntries = cbList->Enumerate(); + RMobilePhone::TMobilePhoneCBInfoEntryV1 cbEntry; + + 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<=nEntries; i++) + { + cbEntry = cbList->GetEntryL(i); + if (cbEntry.iStatus == RMobilePhone::ECallBarringStatusActive) + { + aServiceGroupName = aServiceGroupNameStings[cbEntry.iServiceGroup]; + console->Printf(_L("Outgoing international barring set for %S\n"), aServiceGroupName); + } + } + + // Clean up + CleanupStack::PopAndDestroy(2); // cbList, retrieveCBList + + }
\ No newline at end of file