×

Discussion Board

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

    hang up outgoing call

    Hi
    I try this code in order to detect a dialling status and hang up the call.
    This code works on the Sony Ericsson P900 but it doesn't work on the Nokia 6600 !!!

    please help me understand what to change or add in order to succeed also on the Nokia 6600 ,

    Thanks in advance , TE

    Code:
     
    void CActiveClass::RunL() 
    { 
       if (iStatus == KErrNone) 
       { 
    
          if (iCallStatus == RCall::EStatusHangingUp || iCallStatus == RCall::EStatusIdle || iCallStatus == RCall::EStatusUnknown) 
          { 
             iCall.Close(); //iCall is declared as RMobileCall
          } 
          else if(iCallStatus == RCall::EStatusDialling) 
          { 
             RLine::TLineInfo lineInfo; 
             iLine.GetInfo(lineInfo); 
             //iCall is declared as RMobileCall
             TInt aResult = User::LeaveIfError(iCall.OpenExistingCall(iLine, lineInfo.iNameOfLastCallAdded)); 
             iCall.HangUp(); 
            iCall.Close(); 
          } 
          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 theError; 
       if (iLineInited) 
       { 
          return KErrNone; 
       } 
       theError = iTelServer.Connect(); 
        
       // Find the number of phones available from the tel server 
       TInt numberPhones; 
       theError = iTelServer.EnumeratePhones(numberPhones); 
    
       // Read the TSY module name 
       theError = iTelServer.GetTsyName(0, iTsyName); 
        
       // Load in the phone device driver 
       theError = iTelServer.LoadPhoneModule(iTsyName); 
        
       // Get info about the first available phone 
       RTelServer::TPhoneInfo info; 
       theError = iTelServer.GetPhoneInfo(0, info); 
        
       // Use this info to open a connection to the phone, the phone is identified by its name 
       theError = iPhone.Open(iTelServer, info.iName); 
        
       RPhone::TLineInfo lineInfo; 
       theError = iPhone.GetLineInfo(0, lineInfo); 
        
       theError = iLine.Open(iPhone, lineInfo.iName); 
        
       iLineInited = ETrue; 
       return KErrNone; 
    }

  2. #2
    Regular Contributor
    Join Date
    Apr 2004
    Posts
    322
    Update :
    the HangUp works on the Nokia 6600 but only when I replace the EStatusDialling to EStatusConnected .
    that means that the hang up occures only when the destination phone answers the outgoing call which is not good for my needs .(maybe its good for a broken heart guy who wants to call his ex girlfriend and hang up immediatly :-))

    its like the hang up is not supported at the StatusDialling ...

    Any ideas ?

Posting Permissions

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