|
||
All of the following information is available through the Telephony ISV
API, CTelephony
:
Caller Identification status:
Note: None of this information is available when the phone is in Flight Mode
You can get the current value of all these items. Each item's description gives you an example of this. Some of the methods to get information are asynchronous; the operation can be cancelled before it completes.
You cannot receive notification when any of these items change.
The call carring status indicates whether call barring is active, inactive or not avilable. The status can also be not provisioned on GSM/WCDMA networks.
Phones have different call barring settings for different
conditions. For instance, a phone might bar outgoing calls but accept incoming
calls. You can get the call barring status for each of the conditions in
CTelephony::TCallBarringCondition
.
CTelephony::GetCallBarringStatus()
writes the
information to a packaged
CTelephony::TCallBarringSupplServicesV1
. Pass the method a
CTelephony::TCallBarringCondition
to select the conditon.
This is an asynchronus call; use
CTelephony::EGetCallBarringStatusCancel
to cancel it.
This example finds out whether outgoing calls are barred:
#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);
}
Remember to link to the Etel3rdParty.lib
and
euser.lib
libraries.
You cannot receive notification when this item changes.
The call waiting status indicates whether call waiting is active, inactive or not avilable. The status can also be not provisioned on GSM/WCDMA networks.
CTelephony::GetCallWaitingStatus()
writes the
information to a packaged
CTelephony::TCallWaitingSupplServicesV1
.
This is an asynchronus call; use
CTelephony::EGetCallWaitingStatusCancel
to cancel it.
For example:
#include <e32base.h>
#include <Etel3rdParty.h>
class CClientApp : public CActive
{
private:
CTelephony* iTelephony;
CTelephony::TCallWaitingSupplServicesV1 iCallWaitingSupplServicesV1;
CTelephony::TCallWaitingSupplServicesV1Pckg iCallWaitingSupplServicesV1Pckg;
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),
iCallWaitingSupplServicesV1Pckg(iCallWaitingSupplServicesV1)
{
//default constructor
}
void CClientApp::SomeFunction()
{
iTelephony->GetCallWaitingStatus(iStatus, iCallWaitingSupplServicesV1Pckg);
SetActive();
}
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{
CTelephony::TSupplServiceStatus callWaitingStatus = iCallWaitingSupplServicesV1.iCallWaiting;
}
}
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetCallWaitingStatusCancel);
}
Remember to link to the Etel3rdParty.lib
and
euser.lib
libraries.
You cannot receive notification when this item changes.
The call forwarding status indicates whether call forwarding is active, inactive, not provisioned or not avilable.
Phones can have different call forwarding settings for different
conditions. For instance, a phone might forward calls when the subscriber is
busy, but not when the subscriber doesn't respond. You can get the status for
each of the conditions in
CTelephony::TCallForwardingCondition
.
Note: Call forwarding information is only available on GSM/WCDMA networks. Symbian OS does not provide this information for phones on CDMA networks.
CTelephony::GetCallForwardingStatus()
writes
the information to a packaged
CTelephony::TCallForwardingSupplServicesV1
. Pass the
method a CTelephony::TCallForwardingCondition
to select
the conditon.
This is an asynchronus call; use
CTelephony::EGetCallForwardingStatusCancel
to cancel it.
For example:
#include <e32base.h>
#include <Etel3rdParty.h>
class CClientApp : public CActive
{
private:
CTelephony* iTelephony;
CTelephony::TCallForwardingSupplServicesV1 iCallForwardingSupplServicesV1;
CTelephony::TCallForwardingSupplServicesV1Pckg iCallForwardingSupplServicesV1Pckg;
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),
iCallForwardingSupplServicesV1Pckg(iCallForwardingSupplServicesV1)
{
//default constructor
}
void CClientApp::SomeFunction()
{
CTelephony::TCallForwardingCondition condition = CTelephony::ECallForwardingNoReply;
iTelephony->GetCallForwardingStatus(iStatus, condition, iCallForwardingSupplServicesV1Pckg);
SetActive();
}
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{
if( iCallForwardingSupplServicesV1.iCallForwarding == CTelephony::ENotActive )
{} // The call forwarding condition is inactive;
// If the phone user does not answer a call then the call is _not_ forwarded
}
}
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetCallForwardingStatusCancel);
}
Remember to link to the Etel3rdParty.lib
and
euser.lib
libraries.
You cannot receive notification when this item changes.
When CLIP (Calling Line Identification Presentation) is enabled then the phone displays the number of remote party that calls your phone. The remote party can the withold their number using a complementaty service, CLIR (see below).
CTelephony
can tell you the status of the
CLIP service.
Note: This information is only available on GSM/WCDMA networks. Symbian OS does not provide this information for phones on CDMA networks.
CTelephony::GetIdentityServiceStatus()
writes the information to a packaged
CTelephony::TIdentityServiceV1
. Pass it a
CTelephony::TIdentityService
set to
CTelephony::EIdServiceCallerPresentation
This is an asynchronus call; use
CTelephony::EGetIdentityServiceStatusCancel
to cancel it.
For example:
#include <e32base.h>
#include <Etel3rdParty.h>
class CClientApp : public CActive
{
private:
CTelephony* iTelephony;
CTelephony::TIdentityServiceV1 iTIdentityServiceV1;
CTelephony::TIdentityServiceV1Pckg iTIdentityServiceV1Pckg;
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),
iTIdentityServiceV1Pckg(iTIdentityServiceV1)
{
//default constructor
}
void CClientApp::SomeFunction()
{
CTelephony::TIdentityService condition = CTelephony::EIdServiceCallerPresentation;
iTelephony->GetIdentityServiceStatus(iStatus, condition, iTIdentityServiceV1Pckg);
SetActive();
}
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{
if( iTIdentityServiceV1.iIdentityStatus == CTelephony::EIdServiceActivePermanent )
{} // CLIP is permanently active;
// Your phone will display the callers number whenever this is allowed by the caller
}
}
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetIdentityServiceStatusCancel);
}
Remember to link to the Etel3rdParty.lib
and
euser.lib
libraries.
You cannot receive notification when this item changes.
When CLIR (Calling Line Identification Restriction) is enabled then the remote party cannot see your number when your phone makes a call. Otherwise, they can see your phone's number if they have a complementary service, CLIP, enabled (see above).
CTelephony
can tell you the status of the
CLIR service.
Note: This information is only available on GSM/WCDMA networks. Symbian OS does not provide this information for phones on CDMA networks.
CTelephony::GetIdentityServiceStatus()
writes the information to a packaged
CTelephony::TIdentityServiceV1
. Pass it a
CTelephony::TIdentityService
set to
CTelephony::EIdServiceCallerRestriction
.
This is an asynchronus call; use
CTelephony::EGetIdentityServiceStatusCancel
to cancel it.
For example:
#include <e32base.h>
#include <Etel3rdParty.h>
class CClientApp : public CActive
{
private:
CTelephony* iTelephony;
CTelephony::TIdentityServiceV1 iTIdentityServiceV1;
CTelephony::TIdentityServiceV1Pckg iTIdentityServiceV1Pckg;
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),
iTIdentityServiceV1Pckg(iTIdentityServiceV1)
{
//default constructor
}
void CClientApp::SomeFunction()
{
CTelephony::TIdentityService condition = CTelephony::EIdServiceCallerRestriction;
iTelephony->GetIdentityServiceStatus(iStatus, condition, iTIdentityServiceV1Pckg);
SetActive();
}
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{
if( iTIdentityServiceV1.iIdentityStatus == CTelephony::EIdServiceNotProvisioned )
{} // CLIR is in-active;
// The phone's number is freely available to any remote party that
// has the CLIP service enabled.
}
}
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetIdentityServiceStatusCancel);
}
Remember to link to the Etel3rdParty.lib
and
euser.lib
libraries.
You cannot receive notification when this item changes.