00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "CCallInfo.h"
00032
00040 CCallInfo* CCallInfo::NewL(MExecAsync* aController)
00041 {
00042 CCallInfo* self = new(ELeave) CCallInfo(aController);
00043 CleanupStack::PushL(self);
00044 self->ConstructL();
00045 CleanupStack::Pop(self);
00046 return self;
00047 }
00048
00053 CCallInfo::~CCallInfo()
00054 {
00055 Cancel();
00056 }
00057
00062 void CCallInfo::DoStartRequestL()
00063 {
00064 CTelephony::TCallSelectionV1 callSelectionV1;
00065 CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg( callSelectionV1 );
00066
00067 callSelectionV1.iLine = CTelephony::EVoiceLine;
00068 callSelectionV1.iSelect = CTelephony::EInProgressCall;
00069
00070
00071 iTelephony->GetCallInfo(callSelectionV1Pckg,
00072 iCallInfoV1Pckg,
00073 iRemoteInfoV1Pckg);
00074
00075 switch(iCallInfoV1.iStatus)
00076 {
00077 case CTelephony::EStatusRinging:
00078 iConsole->Printf(_L("RING RING RING\n"));
00079 break;
00080 case CTelephony::EStatusConnected:
00081 iConsole->Printf(_L("Call Status: Connected\n"));
00082 break;
00083 case CTelephony::EStatusConnecting:
00084 iConsole->Printf(_L("Call Status: Connecting\n"));
00085 break;
00086 case CTelephony::EStatusAnswering:
00087 iConsole->Printf(_L("Call Status: Answering\n"));
00088 break;
00089 case CTelephony::EStatusIdle:
00090 iConsole->Printf(_L("Call Status: Idle\n"));
00091 break;
00092 case CTelephony::EStatusDisconnecting:
00093 iConsole->Printf(_L("Call Status: Disconnecting\n"));
00094 break;
00095 default:
00096 iConsole->Printf(_L("Call status: Changed\n"));
00097 break;
00098 }
00099 TDateTime time = iCallInfoV1.iStartTime;
00100
00101
00102 iConsole->Printf(_L("Call recieved at %d:%d:%d\n"),
00103 time.Hour(),
00104 time.Minute(),
00105 time.Second());
00106 iConsole->Printf(_L("on %d.%d.%d\n"),
00107 time.Day(),
00108 time.Month(),
00109 time.Year());
00110
00111 if (iRemoteInfoV1.iRemoteIdStatus == CTelephony::ERemoteIdentityAvailable)
00112 {
00113 iConsole->Printf(iRemoteInfoV1.iRemoteNumber.iTelNumber);
00114 }
00115 else
00116 {
00117 iConsole->Printf(_L("Private Number Dialling\n"));
00118 }
00119 ExampleComplete();
00120 }
00121
00128 CCallInfo::CCallInfo(MExecAsync* aController)
00129 : CISVAPIAsync(aController, KCallInfo),
00130 iCallInfoV1Pckg(iCallInfoV1),
00131 iRemoteInfoV1Pckg(iRemoteInfoV1)
00132 {
00133
00134 }
00135
00139 void CCallInfo::ConstructL()
00140 {
00141
00142 }
00143
00147 void CCallInfo::RunL()
00148 {
00149
00150 }
00151
00155 void CCallInfo::DoCancel()
00156 {
00157
00158 }