×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jul 2010
    Posts
    159

    application crash on call hangup

    hi all,
    little help needed, i want to block a call. since Ctelephony cannot hang up a call until he answers first. so i m first answering the call then hang up using Ctelephony but application crashes during hangup process. below is the code.

    the BOLD lines show where i am picking and disconnecting a call.

    Code:
    CCallMonitor* CCallMonitor::NewLC(MCallCallBack& aObserver)
    	{
    	CCallMonitor* self = new (ELeave) CCallMonitor(aObserver);
    	CleanupStack::PushL(self);
    	self->ConstructL();
    	return self;
    	}
    CCallMonitor* CCallMonitor::NewL(MCallCallBack& aObserver)
    	{
    	CCallMonitor* self = CCallMonitor::NewLC(aObserver);
    	CleanupStack::Pop(); // self;
    	return self;
    	}
    CCallMonitor::CCallMonitor(MCallCallBack& aCallBack)
    :CActive(EPriorityStandard),iCallBack(aCallBack),iCurrentStatusPckg(iCurrentStatus)
    	{
    	CActiveScheduler::Add(this);
    	}
    CCallMonitor::~CCallMonitor()
    	{
    	Cancel();
    	delete iTelephony;
    	}
    void CCallMonitor::ConstructL(void)
    	{
    	iTelephony = CTelephony::NewL();
    	StartListening();
    	}
    void CCallMonitor::CancelOperation(void)
    	{
    	Cancel();
    	}
    void CCallMonitor::DoCancel()
    	{
    	iTelephony->CancelAsync(CTelephony::EVoiceLineStatusChangeCancel);
    	}
    void CCallMonitor::RunL()
    	{
    	//iCallBack.CallStatusChangedL(iCurrentStatus.iStatus,iStatus.Int());
    	/*if(iStatus != KErrCancel)
    		StartListening();*/
    		if(iStatus.Int() == KErrNone)
    			{
    				//Get call status
    				CTelephony::TCallStatus callStatus = iCurrentStatusPckg().iStatus;
    				switch(callStatus)
    				{
    				case CTelephony::EStatusRinging:
    					Answer();
    					break;
    		 
    				case CTelephony::EStatusAnswering:
    					Breakup();
    					break;
    				}
    		}
    	}
    void CCallMonitor::Answer()
    	{
    		iTelephony->AnswerIncomingCall(iStatus, iCallID);
    		iTelephony->Hangup(iStatus, iCallID);
    		//SetActive();
    		StartListening();
    	}
    void CCallMonitor::Breakup()
    	{
    		//iTelephony->Hangup(iStatus, iCallID);
    		StartListening();
    	}
    void CCallMonitor::StartListening()
    	{
    	Cancel();
    	//iCurrentStatus.iStatus = CTelephony::EStatusUnknown;
    	iTelephony->NotifyChange(iStatus,CTelephony::EVoiceLineStatusChange,iCurrentStatusPckg);
    	SetActive();
    	
    	}

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    43

    Re: application crash on call hangup

    hi
    u will hangup call after Answering . Try like this

    case CTelephony::EStatusAnswering
    {
    iTelephony->Hangup(iStatus, iCallID);
    }

    or

    case CTelephony::EStatusConnected
    {
    iTelephony->Hangup(iStatus, iCallID);
    }

  3. #3
    Regular Contributor
    Join Date
    Dec 2010
    Posts
    142

    Re: application crash on call hangup

    You are not waiting for a request to complete. AnswerIncomingCall,Hangup and NotifyChange are called in succession. You should wait for one request to complete than issue another.

    I advise you to understand how active objects works.

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: application crash on call hangup

    and when something is crashing, it is good idea to get the panic code first: http://wiki.forum.nokia.com/index.php/Panic, it would in most cases tell the ecxat reason for the crash.

Similar Threads

  1. Call HangUp..
    By amol_benare604 in forum Symbian
    Replies: 2
    Last Post: 2009-06-19, 11:41
  2. Replies: 3
    Last Post: 2009-06-11, 09:19
  3. Replies: 3
    Last Post: 2007-01-12, 14:03
  4. Suffering from Hangup a call !!! Please help me
    By hoy_cpe in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-07-31, 08:22
  5. Hangup incoming call
    By agrauballe in forum Symbian
    Replies: 1
    Last Post: 2006-04-01, 14:54

Posting Permissions

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