Retrieve General Telephony information using Shared Data API
Article Metadata
Code Example
Source file: Media:TelephonyKeys.zip
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
Note: Only ReadDeviceData Capability is required for above application.


05 Sep
2009
Very handy code snippets for retrieving general Telephony information. The example provides code snippets for retrieving the caller name, number and integrated hands free status. Also included is an example project implementing the same. Beginner can easily make use of these code snippets.
08 Sep
2009
This article had explaine about the Retrieving general telephony information it is used to get the hand free status and caller name and these is help full for the beginners who are intrested to do the applications in telephony