Namespaces
Variants
Actions

Retrieve General Telephony information using Shared Data API

Jump to: navigation, search
Article Metadata

Code Example
Article
Created: kiranmudiyam (27 Sep 2007)
Last edited: hamishwillee (03 Feb 2012)

The TelephonyInternalPSKeys.h provides Publish & Subscribe keys related to telephony call general information like remote party contact info, caller number, caller name (if present in contacts). It also provides the keys for getting status of Integrated Hands Free (IHF) while call is active.

Note: The TelephonyInternalPSKeys.h can be found in Shared Data API which is a part of S60 3rd SDK MR API Plug-In Pack v4(can be dowloaded here).

Example code

// Displays Remote party caller name, if present in contacts
void CTelephonyKeysAppUi::GetCallerName()
{
TBuf<50> info;
TInt ret=RProperty::Get(KPSUidTelephonyCallHandling,KTelephonyCLIName,info);
if(ret!=KErrNone)
{
if(ret==KErrNotFound)
CEikonEnv::InfoWinL(_L("Remote Party"),_L("Name Not Found"));
}
else
{
CEikonEnv::InfoWinL(_L("Remote Party Name:"),info);
}
}
// Displays Remote party caller number  
void CTelephonyKeysAppUi::GetCallerNum()
{
TBuf<50> info;
TInt ret=RProperty::Get(KPSUidTelephonyCallHandling,KTelephonyCLINumber,info);
if(ret!=KErrNone)
{
if(ret==KErrNotFound)
CEikonEnv::InfoWinL(_L("Remote Party"),_L("Number Not Found"));
}
else
{
CEikonEnv::InfoWinL(_L("Remote Party Number:"),info);
}
}
// Displays Integarted hands free status
void CTelephonyKeysAppUi::GetIHFStatus()
{
TInt value;
TInt ret = RProperty::Get(KPSUidTelephonyAudio,KTelephonyIhfMode,value);
if(KErrNone==ret)
{
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
TBuf<30> msg;
switch(value)
{
case EPSTelephonyIhfOff:
{
msg.Copy(_L("IHF is OFF"));
informationNote->ExecuteLD(msg);
break;
}
case EPSTelephonyIhfOn:
{
msg.Copy(_L("IHF is ON"));
informationNote->ExecuteLD(msg);
break;
}
}
}
}

Example project

File:TelephonyKeys.zip

Note: Only ReadDeviceData Capability is required for above application.

This page was last modified on 3 February 2012, at 09:08.
102 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved