phoneengine/phonemodel/src/cpeparserphonenumberhandler.cpp
branchRCL_3
changeset 24 41a7f70b3818
parent 3 8871b09be73b
child 25 5266b1f337bd
equal deleted inserted replaced
23:40a3f856b14d 24:41a7f70b3818
    67     TEFLOGSTRING3( KTAINT, 
    67     TEFLOGSTRING3( KTAINT, 
    68         "PE CPEParserPhoneNumberHandler::ProcessDialToNumberL, number: %S, dtmf postfix: %S", 
    68         "PE CPEParserPhoneNumberHandler::ProcessDialToNumberL, number: %S, dtmf postfix: %S", 
    69         &aNumber, 
    69         &aNumber, 
    70         &aDtmfPostfix );
    70         &aDtmfPostfix );
    71     
    71     
       
    72     // Check if phone is locked
       
    73     iOwner.CheckIfPhoneIsLockedL();
       
    74     
    72     if ( aNumber.Length() == 0 )
    75     if ( aNumber.Length() == 0 )
    73         {
    76         {
    74         User::Leave( ECCPErrorInvalidPhoneNumber );
    77         User::Leave( ECCPErrorInvalidPhoneNumber );
    75         }
    78         }
    76 
    79 
    87     
    90     
    88     TPECallType processType = iDataStore.CallTypeCommand();
    91     TPECallType processType = iDataStore.CallTypeCommand();
    89     if( processType != EPECallTypeVideo )
    92     if( processType != EPECallTypeVideo )
    90         {
    93         {
    91         // TSY not accept phone number that include + or w chartes.
    94         // TSY not accept phone number that include + or w chartes.
    92         TPEPhoneNumber postfix = FilterPostfix( aDtmfPostfix );
    95         TPEPhoneNumber postfix = FilterPostfixL( aDtmfPostfix );
    93         if( postfix.Length() )
    96         if( postfix.Length() )
    94             {
    97             {
    95             phoneNumber.Append( postfix );
    98             phoneNumber.Append( postfix );
    96             }
    99             }
    97         }
   100         }
   161 
   164 
   162 // -----------------------------------------------------------------------------
   165 // -----------------------------------------------------------------------------
   163 // CPEParserPhoneNumberHandler::FilterPostfix
   166 // CPEParserPhoneNumberHandler::FilterPostfix
   164 // -----------------------------------------------------------------------------
   167 // -----------------------------------------------------------------------------
   165 // 
   168 // 
   166 TPtrC CPEParserPhoneNumberHandler::FilterPostfix( TPtrC aPostfix )
   169 TPtrC CPEParserPhoneNumberHandler::FilterPostfixL( TPtrC aPostfix )
   167     {
   170     {
   168     TLex input( aPostfix );
   171     TLex input( aPostfix );
   169     TInt stripStart = KErrNotFound;
   172     TInt stripStart = KErrNotFound;
   170     TInt postfixLength = aPostfix.Length();
   173     TInt postfixLength = aPostfix.Length();
   171     for ( TInt i = 0; i != postfixLength; i ++ )
   174     for ( TInt i = 0; i != postfixLength; i ++ )
   172         {
   175         {
   173         TChar ch( input.Peek() );
   176         TChar ch( input.Peek() );
   174         if ( ch == KDtmfWait ||
   177         if (ch == KDtmfPlus)
   175              ch == KDtmfPlus )
   178             {
       
   179             User::Leave ( ECCPErrorInvalidPhoneNumber );
       
   180             }
       
   181         else if ( ch == KDtmfWait )
   176             {
   182             {
   177             if ( i < stripStart || stripStart == KErrNotFound )
   183             if ( i < stripStart || stripStart == KErrNotFound )
   178                 {
   184                 {
   179                 stripStart = i;
   185                 stripStart = i;
   180                 }
   186                 }
   181             }
   187             }
       
   188         input.Inc();
   182         }
   189         }
   183     if ( stripStart != KErrNotFound )
   190     if ( stripStart != KErrNotFound )
   184         {
   191         {
   185         return aPostfix.Left( stripStart );
   192         return aPostfix.Left( stripStart );
   186         }
   193         }
   197 TBool CPEParserPhoneNumberHandler::IsPhoneOffline()
   204 TBool CPEParserPhoneNumberHandler::IsPhoneOffline()
   198     {
   205     {
   199     TBool isPhoneOffline( EFalse );
   206     TBool isPhoneOffline( EFalse );
   200 
   207 
   201     if( FeatureManager::FeatureSupported( KFeatureIdOfflineMode )
   208     if( FeatureManager::FeatureSupported( KFeatureIdOfflineMode )
   202         && ( iDataStore.ProfileId() == EProfileOffLineId ) )
   209         && ( EFalse == iOwner.IsNetworkConnectionAllowed() ) )
   203         {
   210         {
   204         isPhoneOffline = ETrue;
   211         isPhoneOffline = ETrue;
   205         }
   212         }
   206     
   213     
   207     TNWNetworkRegistrationStatus networkRegStatus
   214     TNWNetworkRegistrationStatus networkRegStatus
   212         || ( networkRegStatus == ENWStatusNotRegisteredEmergencyOnly )
   219         || ( networkRegStatus == ENWStatusNotRegisteredEmergencyOnly )
   213         || ( networkRegStatus == ENWStatusRegistrationDenied ) )
   220         || ( networkRegStatus == ENWStatusRegistrationDenied ) )
   214         {
   221         {
   215         isPhoneOffline = ETrue;
   222         isPhoneOffline = ETrue;
   216         }
   223         }
   217     
   224 
   218     return isPhoneOffline;
   225     return isPhoneOffline;
   219     }
   226     }
   220 
       
   221     
   227     
   222 //  End of File
   228 //  End of File