outgoing call and CTelephony API
Login to reply to this topic.
ven, 2006-09-01 22:47
Joined: 2004-10-27
Forum posts: 169
Hi all,
I want to hook any outgoing call with CTelephony API.

I used this code...
But I get an error:
===================================================
#include <e32base.h>
#include <Etel3rdParty.h>

class CCallObserver : public CActive
{
public:
CCallObserver();
void RequestNotification();
void Construct();
private:
void RunL();
void DoCancel();
void WriteToFile(TInt aIndex);
private:
CTelephony* iTelephony;
CTelephony::TCallStatusV1 iLineStatus;
CTelephony::TCallStatusV1Pckg iLineStatusPckg;
};


CCallObserver::CCallObserver(): CActive( EPriorityStandard ),
iLineStatusPckg( iLineStatus )
{
iLineStatus.iStatus = CTelephony::EStatusUnknown;
}
void CCallObserver::Construct()
{
iTelephony = CTelephony::NewL();
CActiveScheduler::Add(this);
}
void CCallObserver::RequestNotification()
{
iTelephony->NotifyChange( iStatus, CTelephony::EVoiceLineStatusChange,
iLineStatusPckg );
SetActive();
}
void CCallObserver::RunL()
{
if( iStatus==KErrNone )
{
iTelephony->NotifyChange( iStatus,
CTelephony::ESignalStrengthChange, iLineStatusPckg );
SetActive();
}
}
========================================
if I comment the SetActive() method in RequestNotification() there is no
error but if it exists, I get App.Closed error!!!
where is the problem?

sam, 2006-09-02 06:24
Joined: 2004-10-27
Forum posts: 169
Hey...
Solved Cheezy
I had to add this command
CActiveScheduler::Start();

thanks
ven, 2006-11-17 08:05
Joined: 2006-04-14
Forum posts: 19
HI,
I am developing an application in which i am answering an incoming call using same code as you have posted, but i am getting a problem that after answering dirst incoming call second call is not answered as NotifyChange in commented in RunL() . If i uncomment this statement from RunL device gets hanged.
So i want to ask you that where did u placed  statement    CActiveScheduler::Start();. I tried it at RequestNotification() but it is giving me KERNEL-EXEC 3 error.
void CNotifyExample::RunL()
{
   if(iLineStatus.iStatus == CTelephony::EStatusRinging)
   {

   iTelephony->AnswerIncomingCall(iStatus,iCallId);

   }

   iLastInformedLineStatus = iLineStatus.iStatus;

   /* Request the next notification */
   iTelephony->NotifyChange( iStatus,CTelephony::EVoiceLineStatusChange,iLineStatusPckg );
   SetActive();

}

Waiting for your reply.
Warm Regards,
Vishal
lun, 2006-11-20 21:36
Joined: 2006-10-12
Forum posts: 27
CActiveScheduler::Start() should be called by some sort of executive object after all active objects have added themselves to the active scheduler.  Check out some tutorials on the active scheduler.

copyright 2003-2009 NewLC SARL