This tutorial describes how to get the call barring status information with the telephony API for applications
The call barring is a supplementary service. The client applications can determine the status of the service with the CTelephony functions.
#include <e32base.h> #include <Etel3rdParty.h> class CClientApp : public CActive { private: CTelephony* iTelephony; CTelephony::TCallBarringSupplServicesV1 iCallBarringSupplServicesV1; CTelephony::TCallBarringSupplServicesV1Pckg iCallBarringSupplServicesV1Pckg; public: CClientApp(CTelephony* aTelephony); void SomeFunction(); private: /* These are the pure virtual methods from CActive that MUST be implemented by all active objects */ void RunL(); void DoCancel(); }; CClientApp::CClientApp(CTelephony* aTelephony) : CActive(EPriorityStandard), iTelephony(aTelephony), iCallBarringSupplServicesV1Pckg(iCallBarringSupplServicesV1) { //default constructor } void CClientApp::SomeFunction() { CTelephony::TCallBarringCondition condition = CTelephony::EBarAllOutgoing; iTelephony->GetCallBarringStatus(iStatus, condition, iCallBarringSupplServicesV1Pckg); SetActive(); } void CClientApp::RunL() { if(iStatus==KErrNone) { if( iCallBarringSupplServicesV1.iCallBarring == CTelephony::EStatusActive ) {} // The call barring condition is active; // all outgoing calls are barred. } } void CClientApp::DoCancel() { iTelephony->CancelAsync(CTelephony::EGetCallBarringStatusCancel); }