×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    31

    Error while accepting an incoming call

    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

  2. #2
    Registered User
    Join Date
    Mar 2006
    Posts
    5

    Re: Error while accepting an incoming call

    As far as I can see, your call to StartL() from within RunL() is the bad cause. You can either use a delayed function to let RunL() finish with the loop then SetActive() from outside the RunL(), or have some kind of observer vs notifier model to pass on the task of SetActive().

    HTH

Similar Threads

  1. Replies: 31
    Last Post: 2008-02-13, 16:45
  2. incoming call event handling
    By anandrenake in forum Symbian
    Replies: 16
    Last Post: 2005-12-30, 10:46
  3. Series 40 Sound and Incoming Call Confliction
    By jl1337 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-11-09, 05:17
  4. Series 40 Sound and Incoming Call Confliction
    By jl1337 in forum General Development Questions
    Replies: 0
    Last Post: 2005-11-08, 09:26
  5. Incoming call, 7650 and iPAQ
    By paller in forum Bluetooth Technology
    Replies: 0
    Last Post: 2003-03-19, 08:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×