×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Apr 2004
    Posts
    322

    Try to Hang up outgoing call - Update

    Hi
    this message is related to the Series 60 :
    I try to use this code in order to detect and stop an outgoing call in an app that runs in the Background .
    I did many tests and changes , now the app doesnt fall , and the call continues and doesnt stop.

    I'm sure that I get to the "if(iCallStatus == RCall::EStatusDialling)" block .

    I did many changes and tests but nothing stopped the call , also tried the DialCancel method ...
    most of my changes where related to the params I use in the OpenExistingCall method.
    (Tthe RGsmCallGroup is not relevant here because it doesnt work on Symbian v7.0 ...)

    Please look at the code and tell me if you have any ideas ,


    Thanks a lot , TE


    Code:
    void CActiveClass::RunL()
    {
    	if (iStatus == KErrNone) 
    	{ 
    
    		if (iCallStatus == RCall::EStatusHangingUp || iCallStatus == RCall::EStatusIdle || iCallStatus == RCall::EStatusUnknown) 
    		{ 
    			iCall.Close(); 
    		} 
    		else if(iCallStatus == RCall::EStatusDialling)
    		{ 
    			RCall iCall; 
    			RLine::TLineInfo lineInfo; 
    			iLine.GetInfo(lineInfo); 
    			TInt aResult = User::LeaveIfError(iCall.OpenExistingCall(iLine, lineInfo.iNameOfLastCallAdded));
    			iCall.HangUp();
    		}
    		iLine.NotifyStatusChange(iStatus, iCallStatus); 
    		SetActive();
    	}
    }
    
    CActiveClass* CActiveClass::NewL()
    	{
    	CActiveClass* self = new (ELeave) CActiveClass();
    	CleanupStack::PushL(self);
    	self->ConstructL();
    	CleanupStack::Pop(self);
    	return self;
    	}
    
    CActiveClass::CActiveClass()
    : CActive(0)
    {
    	iLineInited = EFalse; 
    	iCallActive = EFalse; 
    }
    
    void CActiveClass::ConstructL()
    {
    	User::LeaveIfError(iTimer.CreateLocal());
    	TRequestStatus aStatus;
    	iEnv = CEikonEnv::Static();
    	CActiveScheduler::Add(this); 
    	StartObserver();
    }
    
    void CActiveClass::StartObserver() 
    { 
    	Cancel(); 
    	if (InitializePhone() == KErrNone) 
    	{ 
    		iLine.NotifyStatusChange(iStatus, iCallStatus); 
    		SetActive(); 
    	} 
    } 
    
    TInt CActiveClass::InitializePhone() 
    { 
    	TInt  val; 
    	if (iLineInited) 
    	{ 
    		return KErrNone; 
    	} 
    	val = iTelServer.Connect(); 
    	
    	// Find the number of phones available from the tel server 
    	TInt numberPhones; 
    	val = iTelServer.EnumeratePhones(numberPhones); 
    
    	// Read the TSY module name 
    	val = iTelServer.GetTsyName(0, iTsyName); 
    	
    	// Load in the phone device driver 
    	val = iTelServer.LoadPhoneModule(iTsyName); 
    	
    	// Get info about the first available phone 
    	RTelServer::TPhoneInfo info; 
    	val = iTelServer.GetPhoneInfo(0, info); 
    	
    	// Use this info to open a connection to the phone, the phone is identified by its name 
    	val = iPhone.Open(iTelServer, info.iName); 
    	
    	RPhone::TLineInfo lineInfo; 
    	val = iPhone.GetLineInfo(0, lineInfo);
    	
    	val = iLine.Open(iPhone, lineInfo.iName); 
    	
    	iLineInited = ETrue; 
    	return KErrNone; 
    }

  2. #2
    Regular Contributor
    Join Date
    Apr 2004
    Posts
    322

    strange

    I checked this exact code on the SE P900 and it works !!!
    Why doesn't this code work on the Nokia 6600 ?
    Is there something to change in the Phone's settings ?
    Please advise ,

    Thanks a lot , TE

  3. #3
    Regular Contributor
    Join Date
    Apr 2004
    Posts
    322

    so stuck in this :(

    could this be related to the ownership of the call ?
    I checked and the ownership's status is not owned ...
    does it metter ?
    can this be the reason that I can't hang up the Call ?

    Thanks , TE

Posting Permissions

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