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?
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();
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.
Forum posts: 169
Solved
I had to add this command
CActiveScheduler::Start();
thanks
Forum posts: 19
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
Forum posts: 27