satengine/SatServer/Commands/SetUpCallCmd/src/csetupcallrequesthandler.cpp
changeset 19 e44a8c097b15
parent 12 ae8abd0db65c
child 31 a2467631ae02
equal deleted inserted replaced
15:d7fc66ccd6fb 19:e44a8c097b15
    59     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::NewL calling" )
    59     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::NewL calling" )
    60 
    60 
    61     CSetupCallRequestHandler* self =
    61     CSetupCallRequestHandler* self =
    62         new ( ELeave ) CSetupCallRequestHandler( aPhone, aDispatcher );
    62         new ( ELeave ) CSetupCallRequestHandler( aPhone, aDispatcher );
    63  
    63  
    64     CleanupStack::PushL( self );
       
    65     self->ConstructL();
       
    66     CleanupStack::Pop( self );
       
    67     
       
    68     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::NewL exiting" )
    64     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::NewL exiting" )
    69     return self;
    65     return self;
    70     }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // CSetupCallRequestHandler::ConstructL
       
    74 // Two-phased constructor.
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 void CSetupCallRequestHandler::ConstructL()
       
    78     {
       
    79     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::ConstructL calling" )
       
    80     iStatusHandler = CSetupCallStatusHandler::NewL( iPhone, this );
       
    81     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::ConstructL exiting" )    
       
    82     }
    66     }
    83 
    67 
    84 // -----------------------------------------------------------------------------
    68 // -----------------------------------------------------------------------------
    85 // CSetupCallRequestHandler::~CSetupCallRequestHandler
    69 // CSetupCallRequestHandler::~CSetupCallRequestHandler
    86 // Destructor
    70 // Destructor
    90     {
    74     {
    91     LOG( SIMPLE, "SETUPCALL: \
    75     LOG( SIMPLE, "SETUPCALL: \
    92             CSetupCallRequestHandler::~CSetupCallRequestHandler calling" )
    76             CSetupCallRequestHandler::~CSetupCallRequestHandler calling" )
    93     Cancel();
    77     Cancel();
    94     iDispatcher = NULL;
    78     iDispatcher = NULL;
    95     delete iStatusHandler;
    79 
    96     
       
    97     LOG( SIMPLE, "SETUPCALL: \
    80     LOG( SIMPLE, "SETUPCALL: \
    98             CSetupCallRequestHandler::~CSetupCallRequestHandler exiting" )
    81             CSetupCallRequestHandler::~CSetupCallRequestHandler exiting" )
    99     }
    82     }
   100 
    83 
   101 // -----------------------------------------------------------------------------
    84 // -----------------------------------------------------------------------------
   128     if( !IsActive() )
   111     if( !IsActive() )
   129         {
   112         {
   130         if( KErrNone == terminateRes )
   113         if( KErrNone == terminateRes )
   131             {
   114             {
   132             iPhone.DialNoFdnCheck( iStatus, aCallParams, aTelNumber );
   115             iPhone.DialNoFdnCheck( iStatus, aCallParams, aTelNumber );
   133             if ( iStatusHandler )
       
   134                 {
       
   135                 iStatusHandler->Start();
       
   136                 }
       
   137             SetActive();
   116             SetActive();
   138             }
   117             }
   139         else
   118         else
   140             {
   119             {
   141             iDispatcher->SetupCallRequestComplete( terminateRes );
   120             iDispatcher->SetupCallRequestComplete( terminateRes );
   181     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::RunL calling" )
   160     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::RunL calling" )
   182     
   161     
   183     LOG2( NORMAL, "SETUPCALL: CSetupCallRequestHandler::RunL\
   162     LOG2( NORMAL, "SETUPCALL: CSetupCallRequestHandler::RunL\
   184           iStatus == %i", iStatus.Int() )
   163           iStatus == %i", iStatus.Int() )
   185 
   164 
   186     if( !iResponsed )
   165     if ( iEmergencyCall )
   187         {
   166         {
   188         if ( iEmergencyCall || KErrNone == iStatus.Int() )
   167         iEmergencyCall = EFalse;
   189             {
   168         }
   190             iEmergencyCall = EFalse;
   169     
   191             iDispatcher->SetupCallRequestComplete( iStatus.Int() );
   170     iDispatcher->SetupCallRequestComplete( iStatus.Int() );                
   192             }
   171     
   193         else
       
   194             {
       
   195             RMobileCall::TMobileCallInfoV8 info;
       
   196             RMobileCall::TMobileCallInfoV8Pckg infoPkg( info );
       
   197             TInt res = iPhone.GetMobileCallInfo( infoPkg );
       
   198         
       
   199             LOG2( NORMAL, "SETUPCALL: CSetupCallRequestHandler::\
       
   200                   HandleSetupCallStatusChange exit code == %i",
       
   201                   info.iExitCode )
       
   202         
       
   203             if( ( KErrNone == res ) && 
       
   204                     (KErrNone != info.iExitCode) &&
       
   205                     (KErrNotFound != info.iExitCode) )
       
   206                 {
       
   207                 iDispatcher->SetupCallRequestComplete( info.iExitCode );
       
   208                 }
       
   209             else
       
   210                 {
       
   211                 iDispatcher->SetupCallRequestComplete( iStatus.Int() );
       
   212                 }
       
   213             }
       
   214         }
       
   215    
       
   216     if( iStatusHandler )
       
   217         {
       
   218         iStatusHandler->Cancel();
       
   219         }
       
   220     iResponsed = EFalse;
       
   221     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::RunL exiting" )
   172     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::RunL exiting" )
   222     }
   173     }
   223 
   174 
   224 // -----------------------------------------------------------------------------
   175 // -----------------------------------------------------------------------------
   225 // CSetupCallRequestHandler::CancelOperation
   176 // CSetupCallRequestHandler::CancelOperation
   228 void CSetupCallRequestHandler::CancelOperation()
   179 void CSetupCallRequestHandler::CancelOperation()
   229     {
   180     {
   230     LOG( SIMPLE, "SETUPCALL: \
   181     LOG( SIMPLE, "SETUPCALL: \
   231                   CSetupCallRequestHandler::CancelOperation calling" )
   182                   CSetupCallRequestHandler::CancelOperation calling" )
   232     iPhone.DialCancel();
   183     iPhone.DialCancel();
   233     if( iStatusHandler )
       
   234         {
       
   235         iStatusHandler->Cancel();
       
   236         }
       
   237     LOG( SIMPLE, 
   184     LOG( SIMPLE, 
   238         "SETUPCALL: CSetupCallRequestHandler::CancelOperation exiting" )
   185         "SETUPCALL: CSetupCallRequestHandler::CancelOperation exiting" )
   239     }
   186     }
   240 
   187 
   241 // -----------------------------------------------------------------------------
   188 // -----------------------------------------------------------------------------
   248     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::DoCancel calling" )
   195     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::DoCancel calling" )
   249     CancelOperation();
   196     CancelOperation();
   250     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::DoCancel exiting" )
   197     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::DoCancel exiting" )
   251     }
   198     }
   252 
   199 
   253 // -----------------------------------------------------------------------------
       
   254 // CSetupCallRequestHandler::HandleConnectingStatusChange
       
   255 // -----------------------------------------------------------------------------
       
   256 //
       
   257 void CSetupCallRequestHandler::CallSatatusChanged( const TInt aStatus )
       
   258     {
       
   259     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::\
       
   260             CallSatatusChanged  calling" )
       
   261     
       
   262     LOG2( NORMAL, "SETUPCALL: CSetupCallRequestHandler::\
       
   263         CallSatatusChanged status == %i", aStatus )
       
   264     // We only care about the connecting status, after call is
       
   265     // connecting, we can send the respones to the SIM. For other status we will
       
   266     // waiting for the status of DialNumber.    
       
   267     if( ( aStatus == RMobileCall::EStatusConnected )
       
   268         || ( aStatus == RMobileCall::EStatusConnecting ))
       
   269         {
       
   270         iResponsed = ETrue;
       
   271         iDispatcher->SetupCallRequestComplete( KErrNone );
       
   272         }
       
   273     else
       
   274         {
       
   275         if ( iStatusHandler )
       
   276             {
       
   277             iStatusHandler->Start();
       
   278             }
       
   279         }
       
   280 
       
   281     LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::\
       
   282             CallSatatusChanged  exiting" )
       
   283     }
       
   284 
       
   285 
       
   286 //  End of File
   200 //  End of File