19 // INCLUDE FILES |
19 // INCLUDE FILES |
20 #include "cpelogevent.h" |
20 #include "cpelogevent.h" |
21 #include "cpeloginfo.h" |
21 #include "cpeloginfo.h" |
22 #include "cpeloghandling.h" |
22 #include "cpeloghandling.h" |
23 #include "cpeloghandlingcommand.h" |
23 #include "cpeloghandlingcommand.h" |
|
24 #include <PbkFields.hrh> |
24 #include <talogger.h> |
25 #include <talogger.h> |
25 #include <logcli.h> |
26 #include <logcli.h> |
26 #include <LogsApiConsts.h> |
27 #include <LogsApiConsts.h> |
27 |
28 |
28 |
29 |
304 subject.Zero(); |
305 subject.Zero(); |
305 |
306 |
306 switch ( iLogInfo->PhoneNumberId() ) |
307 switch ( iLogInfo->PhoneNumberId() ) |
307 { |
308 { |
308 case EPEMobileNumber: |
309 case EPEMobileNumber: |
309 subject.AppendNum( EPEUnknownNumber ); |
310 subject.AppendNum( EPbkFieldIdPhoneNumberMobile ); |
310 break; |
311 break; |
311 case EPETelephoneNumber: |
312 case EPETelephoneNumber: |
312 subject.AppendNum( EPEUnknownNumber ); |
313 subject.AppendNum( EPbkFieldIdPhoneNumberGeneral ); |
313 break; |
314 break; |
314 case EPEPager: |
315 case EPEPager: |
315 subject.AppendNum( EPEUnknownNumber ); |
316 subject.AppendNum( EPbkFieldIdPagerNumber ); |
316 break; |
317 break; |
317 case EPEFaxNumber: |
318 case EPEFaxNumber: |
318 subject.AppendNum( EPEUnknownNumber ); |
319 subject.AppendNum( EPbkFieldIdFaxNumber ); |
319 break; |
320 break; |
320 case EPEAssistantNumber: |
321 case EPEAssistantNumber: |
321 subject.AppendNum( EPEUnknownNumber); |
322 subject.AppendNum( EPbkFieldIdAssistantNumber); |
322 break; |
323 break; |
323 case EPECarNumber: |
324 case EPECarNumber: |
324 subject.AppendNum( EPEUnknownNumber); |
325 subject.AppendNum( EPbkFieldIdCarNumber); |
325 break; |
326 break; |
326 default: |
327 default: |
327 subject.AppendNum( EPEUnknownNumber ); |
328 subject.AppendNum( EPbkFieldIdNone ); |
328 break; |
329 break; |
329 } |
330 } |
330 |
331 |
331 if ( subject.Length() > 0 ) |
332 if ( subject.Length() > 0 ) |
332 { |
333 { |
655 void CPELogEvent::SetRemoteParty( CLogEvent& aEvent, |
656 void CPELogEvent::SetRemoteParty( CLogEvent& aEvent, |
656 const CPELogInfo& aLogInfo ) |
657 const CPELogInfo& aLogInfo ) |
657 { |
658 { |
658 if ( KNullDesC() != aLogInfo.Name() ) |
659 if ( KNullDesC() != aLogInfo.Name() ) |
659 { |
660 { |
660 aEvent.SetRemoteParty( aLogInfo.Name() ); |
661 // This if clause fixes ou1cimx1#320365 Wrong address shown in received log entry |
|
662 if ( aLogInfo.EventType() != CPELogInfo::EPEVoIPEvent || |
|
663 KNullDesC() == aEvent.RemoteParty() ) |
|
664 { |
|
665 aEvent.SetRemoteParty( aLogInfo.Name() ); |
|
666 } |
661 } |
667 } |
662 } |
668 } |
663 |
669 |
664 |
670 |
665 // ----------------------------------------------------------------------------- |
671 // ----------------------------------------------------------------------------- |
667 // ----------------------------------------------------------------------------- |
673 // ----------------------------------------------------------------------------- |
668 // |
674 // |
669 void CPELogEvent::SetRemoteContact( CLogEvent& aEvent, |
675 void CPELogEvent::SetRemoteContact( CLogEvent& aEvent, |
670 const CPELogInfo& aLogInfo ) |
676 const CPELogInfo& aLogInfo ) |
671 { |
677 { |
672 if ( KNullDesC() != aLogInfo.PhoneNumber() ) |
678 if ( KNullDesC() != aLogInfo.PhoneNumber() ) |
673 { |
679 { |
674 aEvent.SetNumber( aLogInfo.PhoneNumber() ); |
680 if ( aLogInfo.EventType() != CPELogInfo::EPEVoIPEvent || |
675 } |
681 ( KNullDesC() == aEvent.Number() && |
676 |
682 KErrNotFound == iEvent->Data().Find( KLogsDataFldTag_URL ) ) ) |
677 if ( KNullDesC() != aLogInfo.VoipAddress() ) |
683 { |
|
684 aEvent.SetNumber( aLogInfo.PhoneNumber() ); |
|
685 } |
|
686 } |
|
687 |
|
688 else if ( KNullDesC() != aLogInfo.VoipAddress() && |
|
689 KNullDesC() == aEvent.Number()) |
678 { |
690 { |
679 TRAPD( error, SetDataFieldL( KLogsDataFldTag_URL, aLogInfo.VoipAddress() ) ); |
691 TRAPD( error, SetDataFieldL( KLogsDataFldTag_URL, aLogInfo.VoipAddress() ) ); |
680 if ( error ) |
692 if ( error ) |
681 { |
693 { |
682 TEFLOGSTRING2( KTAERROR, |
694 TEFLOGSTRING2( KTAERROR, |
683 "LOG CPELogEvent::SetLogEvent()>SetDataFieldL(), error=%d", error ) |
695 "LOG CPELogEvent::SetRemoteContact()>SetDataFieldL(), error=%d", error ) |
684 } |
696 } |
685 } |
697 } |
686 } |
698 } |
687 |
699 |
688 |
700 |