531 CPEMessageHandler* self = static_cast<CPEMessageHandler*>(aAny); |
525 CPEMessageHandler* self = static_cast<CPEMessageHandler*>(aAny); |
532 |
526 |
533 delete self->iAsyncCallBack; |
527 delete self->iAsyncCallBack; |
534 self->iAsyncCallBack = NULL; |
528 self->iAsyncCallBack = NULL; |
535 return self->HandleSendDtmf(); |
529 return self->HandleSendDtmf(); |
536 } |
|
537 |
|
538 // ----------------------------------------------------------------------------- |
|
539 // CPEMessageHandler::HandlePlusSignInDtmf |
|
540 // Handles plus (+) sign in a DTMF string. |
|
541 // ----------------------------------------------------------------------------- |
|
542 // |
|
543 void CPEMessageHandler::HandlePlusSignInDtmf(const TPEDtmfString& aDtmfString ) |
|
544 { |
|
545 TEFLOGSTRING2( KTAMESINT, "PE CPEMessageHandler::HandlePlusSignInDtmf(), aDtmfString: %S", &aDtmfString ); |
|
546 |
|
547 // Find the SD index after the plus sign |
|
548 TPtrC validManualDTMFChars( KPEValidSpeedDialChars ); |
|
549 TInt index = ECCPErrorNotFound; |
|
550 for ( index = 1 ; index < aDtmfString.Length() ; index++ ) |
|
551 { |
|
552 if ( validManualDTMFChars.Locate( aDtmfString[index] ) == ECCPErrorNotFound ) |
|
553 { |
|
554 TEFLOGSTRING( KTAMESINT, "PE CPEMessageHandler::HandlePlusSignInDtmf(), Not Found" ); |
|
555 break; |
|
556 } |
|
557 } |
|
558 TPESpeedDialSubstituionStatus sdStatus = EPEDtmfSpeedDialOk; |
|
559 |
|
560 // Empty string after the plus sign |
|
561 if ( index == 1 ) |
|
562 { |
|
563 if ( aDtmfString.Length() > 1 ) |
|
564 { |
|
565 // pw+ after the plus sign. |
|
566 sdStatus = EPEDtmfSpeedDialInvalidSpeedDial; |
|
567 } |
|
568 else |
|
569 { |
|
570 // string ended with the plus sign. |
|
571 sdStatus = EPEDtmfSpeedDialPromptUser; |
|
572 } |
|
573 // Clear DTMF string. |
|
574 iDataStore.SetDtmfString( KNullDesC() ); |
|
575 } |
|
576 // Else if the SD location ends the DTMF string, move the index to the |
|
577 // last character instead of one over. |
|
578 else if ( index == aDtmfString.Length() ) |
|
579 { |
|
580 index--; |
|
581 } |
|
582 |
|
583 // Check that the index is valid |
|
584 TInt sdIndex = ECCPErrorNotFound; |
|
585 if ( sdStatus == EPEDtmfSpeedDialOk ) |
|
586 { |
|
587 TLex lexer( aDtmfString.Mid( 1, index ) ); |
|
588 // convert it to a number |
|
589 if ( lexer.Val(sdIndex) == ECCPErrorNone ) |
|
590 { |
|
591 // Is it out of range |
|
592 if ( sdIndex < KPESpeedDialIndexMin || |
|
593 sdIndex > KPESpeedDialIndexMax ) |
|
594 { |
|
595 sdStatus = EPEDtmfSpeedDialInvalidSpeedDial; |
|
596 } |
|
597 } |
|
598 else |
|
599 { |
|
600 sdStatus = EPEDtmfSpeedDialInvalidSpeedDial; |
|
601 } |
|
602 } |
|
603 |
|
604 // Fetch the SD location |
|
605 TPEPhoneNumber speedDialLocationString; |
|
606 if ( sdStatus == EPEDtmfSpeedDialOk ) |
|
607 { |
|
608 TEFLOGSTRING2( KTAMESINT, "PE CPEMessageHandler::HandlePlusSignInDtmf(), SD location %i", sdIndex ); |
|
609 if ( iContactHandling.GetSpeedDialLocation( |
|
610 sdIndex, speedDialLocationString ) == ECCPErrorNone ) |
|
611 { |
|
612 // Is content found |
|
613 if ( speedDialLocationString.Length() == 0) |
|
614 { |
|
615 sdStatus = EPEDtmfSpeedDialNotAssigned; |
|
616 } |
|
617 else if ( speedDialLocationString[0] == KPEDtmfPlusChar) |
|
618 { |
|
619 // plus char must be removed from dtmf string before sending |
|
620 RemovePlusPrefix( speedDialLocationString ); |
|
621 } |
|
622 } |
|
623 else |
|
624 { |
|
625 sdStatus = EPEDtmfSpeedDialInvalidSpeedDial; |
|
626 } |
|
627 } |
|
628 |
|
629 // Now interpret the sdStatus to the next action |
|
630 switch ( sdStatus ) |
|
631 { |
|
632 case EPEDtmfSpeedDialOk: |
|
633 { |
|
634 TEFLOGSTRING2( KTAMESINT, "PE CPEMessageHandler::HandlePlusSignInDtmf(), SD result: %S", &speedDialLocationString ); |
|
635 // Take the SD location string and use that as new DTMF string |
|
636 iDataStore.SetDtmfStringCommand( speedDialLocationString ); |
|
637 |
|
638 // Do recursion asyncronously |
|
639 TCallBack callBack( CallBackHandleSendDtmf, this ); |
|
640 delete iAsyncCallBack; |
|
641 iAsyncCallBack = NULL; |
|
642 // Function does not allow to leave. |
|
643 iAsyncCallBack = new CAsyncCallBack( callBack, CActive::EPriorityStandard ); |
|
644 if ( iAsyncCallBack ) |
|
645 { |
|
646 iAsyncCallBack->CallBack(); |
|
647 } |
|
648 else |
|
649 { |
|
650 iModel.SendMessage( MEngineMonitor::EPEMessageDTMFSendingAborted ); |
|
651 } |
|
652 } |
|
653 break; |
|
654 case EPEDtmfSpeedDialPromptUser: |
|
655 // Speed dial location not given. |
|
656 iDataStore.SetDtmfString( KNullDesC() ); |
|
657 iModel.SendMessage( MEngineMonitor::EPEMessagePromptSpeedDial ); |
|
658 break; |
|
659 case EPEDtmfSpeedDialNotAssigned: |
|
660 // Speed dial location valid but not assigned |
|
661 iDataStore.SetDtmfString( KNullDesC() ); |
|
662 iDataStore.SetDtmfStringCommand( KNullDesC() ); |
|
663 iModel.SendMessage( MEngineMonitor::EPEMessageDTMFSendingAborted); |
|
664 iModel.SendMessage( MEngineMonitor::EPEMessageSpeedDialNotAssigned ); |
|
665 break; |
|
666 case EPEDtmfSpeedDialInvalidSpeedDial: |
|
667 // Speed dial location invalid |
|
668 iDataStore.SetDtmfString( KNullDesC() ); |
|
669 iDataStore.SetDtmfStringCommand( KNullDesC() ); |
|
670 iModel.SendMessage( MEngineMonitor::EPEMessageDTMFSendingAborted); |
|
671 iModel.SendMessage( MEngineMonitor::EPEMessageInvalidSpeedDial ); |
|
672 break; |
|
673 default: |
|
674 Panic( EPEPanicInvalidState ); |
|
675 break; |
|
676 } // end switch |
|
677 } |
530 } |
678 |
531 |
679 // ----------------------------------------------------------------------------- |
532 // ----------------------------------------------------------------------------- |
680 // CPEMessageHandler::CheckPrefix |
533 // CPEMessageHandler::CheckPrefix |
681 // Checks the status of phone number prefix change setting |
534 // Checks the status of phone number prefix change setting |
1080 "PE: CPEMessageHandler::RemoveInvalidChars, Parsed string = %S", |
933 "PE: CPEMessageHandler::RemoveInvalidChars, Parsed string = %S", |
1081 &aString); |
934 &aString); |
1082 return returnValue; |
935 return returnValue; |
1083 } |
936 } |
1084 |
937 |
1085 |
|
1086 // ----------------------------------------------------------------------------- |
|
1087 // CPEMessageHandler::HandleGetLifeTimerData |
|
1088 // Reads lifetimerdata from custom api and stores it to engine info |
|
1089 // ----------------------------------------------------------------------------- |
|
1090 // |
|
1091 TInt CPEMessageHandler::HandleGetLifeTimerData() const |
|
1092 { |
|
1093 TCCPLifeTimeData lifeTimeData; |
|
1094 TCCPLifeTimeDataPckg pckg( lifeTimeData ); |
|
1095 |
|
1096 if ( iCallHandling.GetLifeTime( pckg ) ) |
|
1097 { |
|
1098 TEFLOGSTRING2( |
|
1099 KTAGENERAL, |
|
1100 "PE: CPEMessageHandler::HandleGetLifeTimerData, iHours = %d", |
|
1101 lifeTimeData.iHours); |
|
1102 TEFLOGSTRING2( |
|
1103 KTAGENERAL, |
|
1104 "PE: CPEMessageHandler::HandleGetLifeTimerData, iMinutes = %d", |
|
1105 lifeTimeData.iMinutes); |
|
1106 |
|
1107 iDataStore.SetLifeTimerData( pckg ); |
|
1108 } |
|
1109 |
|
1110 return ECCPErrorNone; |
|
1111 } |
|
1112 |
|
1113 // ----------------------------------------------------------------------------- |
938 // ----------------------------------------------------------------------------- |
1114 // CPEMessageHandler::CallbackSendMessageStoppedDTMF |
939 // CPEMessageHandler::CallbackSendMessageStoppedDTMF |
1115 // ----------------------------------------------------------------------------- |
940 // ----------------------------------------------------------------------------- |
1116 // |
941 // |
1117 TInt CPEMessageHandler::CallbackSendMessageStoppedDTMF( TAny* aAny ) |
942 TInt CPEMessageHandler::CallbackSendMessageStoppedDTMF( TAny* aAny ) |
1914 } |
1728 } |
1915 |
1729 |
1916 TEFLOGSTRING2( KTAINT, "PE CPEMessageHandler::HandleDialCallL: errorCode = %d", errorCode ); |
1730 TEFLOGSTRING2( KTAINT, "PE CPEMessageHandler::HandleDialCallL: errorCode = %d", errorCode ); |
1917 |
1731 |
1918 return errorCode; |
1732 return errorCode; |
|
1733 } |
|
1734 |
|
1735 // ----------------------------------------------------------------------------- |
|
1736 // CPEMessageHandler::ResetClientCallData |
|
1737 // Reset CCCECallParameters to prevent of use a previous callīs parameters |
|
1738 // ----------------------------------------------------------------------------- |
|
1739 // |
|
1740 void CPEMessageHandler::ResetClientCallData() |
|
1741 { |
|
1742 TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::ResetClientCallData()" ); |
|
1743 |
|
1744 CCCECallParameters& params = iDataStore.CallParameters(); |
|
1745 params.SetLineType( CCCECallParameters::ECCELineTypePrimary ); |
|
1746 params.SetUUSId( KNullDesC() ); |
|
1747 params.SetBearer( KNullDesC8() ); |
|
1748 params.SetSubAddress( KNullDesC() ); |
|
1749 params.SetOrigin( CCCECallParameters::ECCECallOriginPhone ); |
1919 } |
1750 } |
1920 |
1751 |
1921 // ----------------------------------------------------------------------------- |
1752 // ----------------------------------------------------------------------------- |
1922 // CPEMessageHandler::HandleSatCallRequestCompleted |
1753 // CPEMessageHandler::HandleSatCallRequestCompleted |
1923 // Sends respond to SAT after dial request completion |
1754 // Sends respond to SAT after dial request completion |
3002 //TODO |
2834 //TODO |
3003 iModel.HandleInternalMessage( MPEPhoneModel::EPEMessageDialServiceCall ); |
2835 iModel.HandleInternalMessage( MPEPhoneModel::EPEMessageDialServiceCall ); |
3004 return errorCode; |
2836 return errorCode; |
3005 } |
2837 } |
3006 |
2838 |
3007 |
|
3008 // ----------------------------------------------------------------------------- |
|
3009 // CPEMessageHandler::ExecuteKeySequenceL |
|
3010 // Only sequences which are not issued with send-key are handled here. SS |
|
3011 // commands etc. are processed in HandleDialCallL(). |
|
3012 // ----------------------------------------------------------------------------- |
|
3013 // |
|
3014 TBool CPEMessageHandler::ExecuteKeySequenceL( const TDesC16 &aSequence ) |
|
3015 { |
|
3016 TBool keySequenceProcessed( EFalse ); |
|
3017 |
|
3018 iOptions->SetOptionStatus( KPhoneOptionInCall, |
|
3019 ( iCallHandling.GetNumberOfCalls() > 0 ) ); |
|
3020 iOptions->SetOptionStatus( KPhoneOptionSend, EFalse ); |
|
3021 iOptions->SetOptionStatus( KPhoneOptionVoipCall, EFalse ); |
|
3022 |
|
3023 if ( iParser->ParseL( aSequence, *iResult, *iOptions ) ) |
|
3024 { |
|
3025 keySequenceProcessed = ETrue; |
|
3026 iGsmParserErrorCode = ECCPErrorNone; |
|
3027 iParserHandlerContainer->ProcessL( *iResult ); |
|
3028 } |
|
3029 |
|
3030 return keySequenceProcessed; |
|
3031 } |
|
3032 |
|
3033 // End of File |
2839 // End of File |