--- a/phoneengine/loghandling/src/cpeloghandling.cpp Tue Aug 31 15:14:29 2010 +0300
+++ b/phoneengine/loghandling/src/cpeloghandling.cpp Wed Sep 01 12:30:10 2010 +0100
@@ -186,15 +186,15 @@
CallIdCheck::IsVideo( aCallId )
)
{
- CPELogInfo* logInfo( NULL );
+ CPELogInfo* logInfo( NULL );
TRAP( errorCode, logInfo = CPELogInfo::NewL(); );
if ( logInfo )
{
// continue gathering log data
- // set phonenumber and/or voip address
- SetRemoteContact( aCallId, *logInfo );
+ // set phonenumber and/or voip address
+ SetRemoteContact( aCallId, *logInfo );
logInfo->SetEventData( aCallId, iDataStore );
TRAP_IGNORE(
// Contact link can be big, not critical for basic functionality.
@@ -394,13 +394,16 @@
if ( EPECallTypeVoIP == iDataStore.CallType( aCallId ) )
{
- // voip address field must be used for voip calls
- aLogInfo.SetVoipAddress( aLogInfo.PhoneNumber() );
- aLogInfo.SetPhoneNumber( KNullDesC() );
+ if ( EFalse == IsValidPhoneNumber( aLogInfo.PhoneNumber() ) )
+ {
+ // voip address field must be used for voip calls if
+ // string is not valid for CS call.
+ aLogInfo.SetVoipAddress( aLogInfo.PhoneNumber() );
+ aLogInfo.SetPhoneNumber( KNullDesC() );
+ }
}
}
-
// -----------------------------------------------------------------------------
// CPELogHandling::SaveCallInfoL
// Update log external data.
@@ -841,4 +844,23 @@
return CPELogExtensionWrapper::NewLC( aPluginUid );
}
+// -----------------------------------------------------------------------------
+// CPELogHandling::IsValidPhoneNumber
+// -----------------------------------------------------------------------------
+//
+TBool CPELogHandling::IsValidPhoneNumber(
+ const TDesC& aString ) const
+ {
+ _LIT( KAllowedCharsInPhoneNumber, "0123456789*+pw#PW" );
+
+ TLex input( aString );
+ TPtrC validChars( KAllowedCharsInPhoneNumber );
+ while ( validChars.Locate( input.Peek() ) != KErrNotFound )
+ {
+ input.Inc();
+ }
+
+ return ( !input.Remainder().Length() );
+ }
+
// End of File