×
Namespaces

Variants
Actions

电话呼叫信息API

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

代码示例
测试基于
设备:: Nokia N78

兼容于
平台: S60 3rd Edition, FP2

文章
翻译:
hoolee
最后由 hamishwillee 在 15 Jun 2012 编辑
  • 详细描述

电话呼叫信息API提供了检查电话呼叫状态的功能,如呼出,接听,铃声和挂接状态,以及电话呼叫类型,如数据呼叫,语音呼叫以及传真。


使用方法

我们可以找到打入电话的呼叫类型和状态。


示例代码

头文件

#include <ctsydomainpskeys.h> // new header for S60 3rd Edition, FP2
#include<e32property.h>

可以通过传递KPSUidCtsyCallInformation(电话呼叫处理PS UID)和KTelephonyCallState,或者KTelephonyCallType到RProperty的Get()方法来检测呼叫类型和状态,这是一个发布和订阅的用户端接

口,示例代码如下:

RProperty的KCTsyCallState及KCTsyCallType类型为EInt

void CCallStatusAppUi::GetTelephonyStateAndType()
{
TBuf<20> printInfo;
TInt aVal;
RProperty iRP;
iRP.Get(KPSUidCtsyCallInformation ,KCTsyCallState ,aVal);
switch(aVal)
{
case EPSCTsyCallStateUninitialized:
{
printInfo.AppendNum(aVal);
CEikonEnv::InfoWinL(_L("Call Status - Uninitialized:"),printInfo);
}
break;
case EPSCTsyCallStateNone:
{
printInfo.AppendNum(aVal);
CEikonEnv::InfoWinL(_L("Call Status - None:"),printInfo);
}
break;
case EPSCTsyCallStateAlerting:
{
printInfo.AppendNum(aVal);
CEikonEnv::InfoWinL(_L("Call Status - Alert:"),printInfo);
}
break;
case EPSCTsyCallStateRinging:
{
printInfo.AppendNum(aVal);
CEikonEnv::InfoWinL(_L("Call Status - Ringing:"),printInfo);
}
break;
case EPSCTsyCallStateDialling:
{
printInfo.AppendNum(aVal);
CEikonEnv::InfoWinL(_L("Call Status - Dialing:"),printInfo);
}
..............
..............
}
 
printInfo.Zero();
 
iRP.Get(KPSUidCtsyCallInformation ,KCTsyCallType ,aVal);
switch (aVal)
{
case EPSCTsyCallTypeUninitialized:
{
printInfo.AppendNum(aVal);
CEikonEnv::InfoWinL(_L("Call Type - Uninitialized:"),printInfo);
}
break;
case EPSCTsyCallTypeNone:
{
printInfo.AppendNum(aVal);
CEikonEnv::InfoWinL(_L("Call Type - None:"),printInfo);
}
break;
case EPSCTsyCallTypeCSVoice:
{
printInfo.AppendNum(aVal);
CEikonEnv::InfoWinL(_L("Call Type - CSVoice:"),printInfo);
}
break;
case EPSCTsyCallTypeFax:
{
printInfo.AppendNum(aVal);
CEikonEnv::InfoWinL(_L("Call Type - Fax:"),printInfo);
}
..............
..............
}
}

枚举类型如下:

enum TPSCTsyCallState :

   EPSCTsyCallStateUninitialized,
EPSCTsyCallStateNone,
EPSCTsyCallStateAlerting,
EPSCTsyCallStateRinging,
EPSCTsyCallStateDialling,
EPSCTsyCallStateAnswering,
EPSCTsyCallStateDisconnecting,
EPSCTsyCallStateConnected,
EPSCTsyCallStateHold

enum TPSCTsyCallType:

   EPSCTsyCallTypeUninitialized,
EPSCTsyCallTypeNone,
EPSCTsyCallTypeCSVoice,
EPSCTsyCallTypeFax,
EPSCTsyCallTypeData,
EPSCTsyCallTypeHSCSD,
EPSCTsyCallTypeH324Multimedia,
EPSCTsyCallTypeVoIP
  • 示例代码

下列代码在Nokia N78手机上测试过File:TelephonyCallInfoAPIFor3rdFP2.zip

This page was last modified on 15 June 2012, at 05:12.
89 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×