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