phoneengine/loghandling/src/cpeloghandling.cpp
branchRCL_3
changeset 3 8871b09be73b
parent 0 5f000ab63145
child 24 41a7f70b3818
equal deleted inserted replaced
2:c84cf270c54f 3:8871b09be73b
   392         aLogInfo.SetPhoneNumber( iDataStore.RemotePhoneNumber( aCallId ) );
   392         aLogInfo.SetPhoneNumber( iDataStore.RemotePhoneNumber( aCallId ) );
   393         }
   393         }
   394     
   394     
   395     if ( EPECallTypeVoIP == iDataStore.CallType( aCallId ) )
   395     if ( EPECallTypeVoIP == iDataStore.CallType( aCallId ) )
   396         {
   396         {
   397         // voip address field must be used for voip calls
   397         if ( EFalse == IsValidPhoneNumber( aLogInfo.PhoneNumber() ) )
   398         aLogInfo.SetVoipAddress( aLogInfo.PhoneNumber() );
   398             {
   399         aLogInfo.SetPhoneNumber( KNullDesC() );
   399             // voip address field must be used for voip calls if
   400         }
   400             // string is not valid for CS call.
   401     }
   401             aLogInfo.SetVoipAddress( aLogInfo.PhoneNumber() );
   402 
   402             aLogInfo.SetPhoneNumber( KNullDesC() );
       
   403             }
       
   404         }
       
   405     }
   403 
   406 
   404 // -----------------------------------------------------------------------------
   407 // -----------------------------------------------------------------------------
   405 // CPELogHandling::SaveCallInfoL
   408 // CPELogHandling::SaveCallInfoL
   406 // Update log external data.
   409 // Update log external data.
   407 // Call SaveEventL if event should be saved to log db.
   410 // Call SaveEventL if event should be saved to log db.
   839         const TUid& aPluginUid ) const
   842         const TUid& aPluginUid ) const
   840     {
   843     {
   841     return CPELogExtensionWrapper::NewLC( aPluginUid );
   844     return CPELogExtensionWrapper::NewLC( aPluginUid );
   842     }
   845     }
   843 
   846 
       
   847 // -----------------------------------------------------------------------------
       
   848 // CPELogHandling::IsValidPhoneNumber
       
   849 // -----------------------------------------------------------------------------
       
   850 //
       
   851 TBool CPELogHandling::IsValidPhoneNumber( 
       
   852         const TDesC& aString ) const
       
   853     {
       
   854     _LIT( KAllowedCharsInPhoneNumber, "0123456789*+pw#PW" );
       
   855     
       
   856     TLex input( aString );
       
   857     TPtrC validChars( KAllowedCharsInPhoneNumber );
       
   858     while ( validChars.Locate( input.Peek() ) != KErrNotFound )
       
   859         {
       
   860         input.Inc();
       
   861         }
       
   862     
       
   863     return ( !input.Remainder().Length() );
       
   864     }
       
   865 
   844 // End of File
   866 // End of File