Error while accepting an incoming call

Login to reply to this topic.
Wed, 2006-01-04 08:09
Joined: 2005-08-24
Forum posts: 34
Hello All,

I am working on a telephony application which deals with incoming calls. I have a Phone Engine which deals with the basic connectivity with the RTelServer. I also have a CallReceiver class which is specifically meant for dealing with incoming calls

Whenever an incoming call comes in, the application comes into foreground & asks the user whether he wants to Accept/Reject the incoming call & accordingly accepts/rejects the call

Now I am able to bring the application to foreground & prompt the user for Accept/Reject the call & when I accept the call gets accepted but gives me an Error as "E32USER-CBase - 42" which essentially means
"This panic is raised by the SetActive() member function of an active object, a CActive. It is caused by an attempt to flag the active object as active when it is already active, i.e. a request is still outstanding."

This is happening because of the following code format that I am using:

Code:
void CCallReceiver::RunL()
        {
        if(iStatus.Int() != KErrNone)
                return;

        switch(iState)
                {
                case EWaiting:
                        {
                        //answer the call
                        iState = ERinging;
                        StartL();
                        iObserver.HandleCallInChangeL(RCall::EStatusRinging);
                        callreclog.Write(_L("RunL() EWaiting"));
                        break;
                        }

                case ERinging:
                        {
                        User::LeaveIfError(iLine.GetStatus(iLineStatus));
                        callreclog.Write(_L("RunL() ERinging"));
                        if (iLineStatus == RCall::EStatusHangingUp)
                                {
                                //Caller hung up before the call was accepted/rejected
                                callreclog.Write(_L("Caller HungUp"));
                                iObserver.HandleCallInChangeL(iLineStatus);
                                iState = EWaiting;
                                StartL();
                                }
                        }

                case EAnswering:
                        {
                        iState = EWatching;
                        callreclog.Write(_L("RunL() EAnswering"));
                        StartL();
                        callreclog.Write(_L("HandleCallInChangeL called"));
                        iObserver.HandleCallInChangeL(RCall::EStatusConnected);
                        callreclog.Write(_L("HandleCallInChangeL completed"));
                        break;
                        }

                case EWatching: // To check whether the caller has hung up or not
                        {
                        User::LeaveIfError(iCall.GetStatus(iCallStatus));
                        callreclog.Write(_L("RunL() EWatching"));
                        if (iCallStatus == RCall::EStatusHangingUp)
                                {
                                iObserver.HandleCallInChangeL(iCallStatus);
                                iCall.Close();
                                iState = EWaiting;
                                }
                        StartL();
                        break;
                        }
                }
        }

void CCallReceiver::DoCancel()
        {
        Stop();
        }

void CCallReceiver::StartL()
        {
        switch(iState)
                {
                case EWaiting:
                        // sets iCallName when it receives an incoming call
                        iLine.NotifyIncomingCall(iStatus, iCallName);
                        callreclog.Write(_L("StartL - EWaiting"));
                        break;

                case ERinging:
                        callreclog.Write(_L("StartL - ERinging"));
                        iLine.NotifyStatusChange(iStatus, iLineStatus);
                        break;

                case EAnswering:
                        callreclog.Write(_L("Enters EAnswering"));
                        User::LeaveIfError(iCall.OpenExistingCall(iLine, iCallName));
                        iCall.AnswerIncomingCall(iStatus);
                        callreclog.Write(_L("StartL - EAnswering"));
                        break;

                case EWatching:
                        callreclog.Write(_L("StartL - EWatching"));
                        iCall.NotifyStatusChange(iStatus, iCallStatus);
                        break;
                }
        SetActive();
        }

After the RunL() for EWaiting the RunL() for ERinging is only called if the caller hangs up the call & it checks for EStatusHangingUp otherwise if the call is accepted then the code described below gets called by the application & it straightaway goes for answering the call & hence doesnot finish the RunL() for ERinging & if RunL() for EAnswering is called then it gives me the panic error as described above

Code:
void CCallReceiver::AcceptCall()
{
  callreclog.Write(_L("AcceptCall called"));
  iState = EAnswering;
  StartL();
  callreclog.Write(_L("AcceptCall completed"));
}


Can Anybody please help me out in this ASAP




Thanks,

Yogesh Khanolkar
  • Login to reply to this topic.