850 _DPRINT( 4, |
822 _DPRINT( 4, |
851 "PhSrv.UssdHandleReceivedEventL.SAtReturn" ); |
823 "PhSrv.UssdHandleReceivedEventL.SAtReturn" ); |
852 return; |
824 return; |
853 } |
825 } |
854 } |
826 } |
855 //6. Check if the response is valid for the extension |
827 |
856 //RM-RIM 417-66528 |
|
857 if (iUssdExtnInterface && isResponseValidated) |
|
858 PorcessReceivedMessageInExtesnionL(aMsgData, aMsgAttributes); |
|
859 else |
|
860 ProcessReceivedMessageL(aMsgData, aMsgAttributes); |
|
861 |
|
862 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Editor" ); |
|
863 if (aMsgAttributes.iType == RMobileUssdMessaging::EUssdMTRequest |
|
864 && UssdAppTaskExistsL()) |
|
865 { |
|
866 iEmptyEditor = ETrue; |
|
867 } _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.End" ); |
|
868 } |
|
869 // ----------------------------------------------------------------------------- |
|
870 // CPhSrvUssdManager::ProcessReceivedMessageL |
|
871 // |
|
872 // |
|
873 // |
|
874 // ----------------------------------------------------------------------------- |
|
875 // |
|
876 void CPhSrvUssdManager::ProcessReceivedMessageL(const TDes8& /*aMsgData*/, |
|
877 const RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttributes) |
|
878 { |
|
879 // empty string is handled as ok message |
828 // empty string is handled as ok message |
880 if (!iDecodedMessage.Length()) |
829 if ( !iDecodedMessage.Length() ) |
881 { |
830 { |
882 TurnLightsOn(); //Ensure lights on |
831 TurnLightsOn(); //Ensure lights on |
883 |
|
884 // debug print |
832 // debug print |
885 _DPRINT( 4, |
833 _DPRINT( 4, |
886 "PhSrv.UssdHandleReceivedEventL.EmptyString" ); |
834 "PhSrv.UssdHandleReceivedEventL.EmptyString" ); |
|
835 |
887 ShowDoneNoteL(); |
836 ShowDoneNoteL(); |
|
837 |
888 // debug print |
838 // debug print |
889 _DPRINT( 4, |
839 _DPRINT( 4, |
890 "PhSrv.UssdHandleReceivedEventL.EmptyString.OK" ); |
840 "PhSrv.UssdHandleReceivedEventL.EmptyString.OK" ); |
891 } |
841 } |
892 else |
842 else |
893 { |
843 { |
894 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.String" ); |
844 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.String" ); |
895 iNotifyMessage = (aMsgAttributes.iType |
845 iNotifyMessage = ( aMsgAttributes.iType == RMobileUssdMessaging::EUssdMTNotify ); |
896 == RMobileUssdMessaging::EUssdMTNotify); |
846 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
897 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
|
898 _DDPRINT( 4, "PhSrv.UssdNOHREventL.iNotifyMessage: ", iNotifyMessage ); |
847 _DDPRINT( 4, "PhSrv.UssdNOHREventL.iNotifyMessage: ", iNotifyMessage ); |
899 iMsgTypeReply = (aMsgAttributes.iType |
848 iMsgTypeReply = ( aMsgAttributes.iType == RMobileUssdMessaging::EUssdMTReply ); |
900 == RMobileUssdMessaging::EUssdMTReply); |
|
901 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iMsgTypeReply: ", iMsgTypeReply ); |
849 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iMsgTypeReply: ", iMsgTypeReply ); |
902 |
850 |
903 if (iNotifyMessage) |
851 if ( iNotifyMessage ) |
904 { |
852 { |
905 // need to send an MO ack |
853 // need to send an MO ack |
906 iAcksToBeSent++; |
854 iAcksToBeSent ++; |
907 } |
855 } |
908 |
856 |
909 if (iNotifyMessage || iMsgTypeReply) |
857 if ( iNotifyMessage || iMsgTypeReply ) |
910 { |
858 { |
911 //This is for reply message in notifyarray |
859 //This is for reply message in notifyarray |
912 iNotifyMessage = ETrue; |
860 iNotifyMessage = ETrue; |
913 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
861 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
914 |
862 |
915 //Notify added to array |
863 //Notify added to array |
916 iNotifyArray->AppendL(iReceivedMessage); |
864 iNotifyArray->AppendL( iReceivedMessage ); |
917 |
865 |
918 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.AppendL" ); // debug print |
866 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.AppendL" ); // debug print |
919 UpdateNotifyMessage(); |
867 UpdateNotifyMessage(); |
920 |
868 |
921 if (!iSendRelease && NotifyCount() <= 1) |
869 if ( !iSendRelease && NotifyCount() <= 1 ) |
922 { |
870 { |
923 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.!SendRelease.Cancel" ); // debug print |
871 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.!SendRelease.Cancel" ); // debug print |
924 Cancel(); |
872 Cancel(); |
925 } |
873 } |
926 } |
874 } |
927 else |
875 else |
928 { |
876 { |
929 // New message deletes old message, i.e. Cancel existing query. |
877 // New message deletes old message, i.e. Cancel existing query. |
930 Cancel(); |
878 Cancel(); |
931 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NewAnswerable" ); // debug print |
879 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NewAnswerable" ); // debug print |
932 } |
880 } |
933 CreateGlobalMessageQueryL(aMsgAttributes); |
881 |
934 AsyncProcessMoAcks(); |
882 if ( !iGlobalMsgQuery ) |
935 } |
883 { |
936 _DPRINT( 4, "PhSrv.ProcesdReceivedMessageL.End" ); |
884 iGlobalMsgQuery = CAknGlobalMsgQuery::NewL(); |
937 } |
885 } |
938 |
886 |
939 // ----------------------------------------------------------------------------- |
887 // Delay after message query so that application execution order will |
940 // CPhSrvUssdManager::PorcessReceivedMessageInExtesnionL |
888 // be correct. |
941 // |
889 iGlobalMsgQuery->SetExitDelay( KPhSrvUssdNoteExitPeriod ); |
942 // |
890 |
943 // |
891 TInt softkeys = R_AVKON_SOFTKEYS_USSD_ANSWER_EXIT__ANSWER; |
944 // ----------------------------------------------------------------------------- |
892 if( !( aMsgAttributes.iFlags & RMobileUssdMessaging::KUssdMessageType ) |
945 // |
893 || aMsgAttributes.iType != RMobileUssdMessaging::EUssdMTRequest ) |
946 void CPhSrvUssdManager::PorcessReceivedMessageInExtesnionL( |
894 { |
947 const TDes8& /*aMsgData*/, |
895 softkeys = R_AVKON_SOFTKEYS_EXIT; |
948 const RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttributes) |
896 } |
949 { |
897 |
950 TInt errfromextension = KErrNone; |
898 // Set timer that lauches Global MessageQuery after time interval. |
951 // empty string is handled as ok message |
899 iSoftkeys = softkeys; |
952 if (!iDecodedMessage.Length()) |
900 |
953 { |
|
954 // debug print |
901 // debug print |
955 _DPRINT( 4, |
902 _DPRINT( 4, |
956 "PhSrv.UssdHandleReceivedEventL.EmptyString" ); |
903 "PhSrv.UssdHandleReceivedEventL.String.Middle" ); |
957 //RM-RIM 417-66528 |
904 |
958 TRAP_IGNORE(iUssdExtnInterface->ProcessReceivedUssdL(iDecodedMessage, errfromextension)); |
905 // Play the USSD tone if needed. Logically should be in RunL, but here |
959 // debug print |
906 // to give better balancing with voice and visible message. |
960 _DPRINT( 4, |
907 if ( IsTelephonyFeatureSupported( KTelSrvLVFlagUssdTone ) ) |
961 "PhSrv.UssdHandleReceivedEventL.EmptyString.OK" ); |
908 { |
962 } |
909 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.PlayTone" ); |
963 else |
910 PlayUssdTone(); |
964 { |
911 } |
965 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.String" ); |
912 |
966 iNotifyMessage = (aMsgAttributes.iType |
913 // Launch the new message query |
967 == RMobileUssdMessaging::EUssdMTNotify); |
914 if ( !IsActive() ) |
968 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
915 { |
969 _DDPRINT( 4, "PhSrv.UssdNOHREventL.iNotifyMessage: ", iNotifyMessage ); |
916 iLaunchGMQ = ETrue; |
970 iMsgTypeReply = (aMsgAttributes.iType |
917 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
971 == RMobileUssdMessaging::EUssdMTReply); |
918 SetActive(); |
972 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iMsgTypeReply: ", iMsgTypeReply ); |
919 } |
973 |
920 AsyncProcessMoAcks(); |
974 if (iNotifyMessage) |
921 } |
975 { |
922 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Editor" ); |
976 // need to send an MO ack |
923 if( aMsgAttributes.iType == RMobileUssdMessaging::EUssdMTRequest && UssdAppTaskExistsL() ) |
977 iAcksToBeSent++; |
924 { |
978 } |
925 iEmptyEditor = ETrue; |
979 |
926 } |
980 if (iNotifyMessage || iMsgTypeReply) |
927 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.End" ); |
981 { |
928 } |
982 //This is for reply message in notifyarray |
929 |
983 iNotifyMessage = ETrue; |
|
984 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
|
985 if (!iSendRelease && NotifyCount() <= 1) |
|
986 { |
|
987 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.!SendRelease.Cancel" ); // debug print |
|
988 Cancel(); |
|
989 } |
|
990 } |
|
991 else |
|
992 { |
|
993 // New message deletes old message, i.e. Cancel existing query. |
|
994 Cancel(); |
|
995 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NewAnswerable" ); // debug print |
|
996 } |
|
997 TInt errfromextension = KErrNone; |
|
998 ProcessMoAcksL(); |
|
999 iLaunchGMQ = EFalse; |
|
1000 TRAP_IGNORE(iUssdExtnInterface->ProcessReceivedUssdL(iDecodedMessage, errfromextension)); |
|
1001 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Extn.ProcessReceivedUssdL.ErrCode", errfromextension); |
|
1002 } |
|
1003 } |
|
1004 // ----------------------------------------------------------------------------- |
930 // ----------------------------------------------------------------------------- |
1005 // CPhSrvUssdManager::RestartReplyTimerL |
931 // CPhSrvUssdManager::RestartReplyTimerL |
1006 // |
932 // |
1007 // |
933 // |
1008 // |
934 // |
1418 break; |
1339 break; |
1419 } |
1340 } |
1420 _DPRINT( 4, "PhSrv.RunL.End" ); // debug print |
1341 _DPRINT( 4, "PhSrv.RunL.End" ); // debug print |
1421 } |
1342 } |
1422 } |
1343 } |
1423 // RM-RIM 417-66528 |
1344 |
1424 // ----------------------------------------------------------------------------- |
|
1425 // CPhSrvUssdManager::CreateGlobalMessageQueryL |
|
1426 // ----------------------------------------------------------------------------- |
|
1427 // |
|
1428 void CPhSrvUssdManager::CreateGlobalMessageQueryL( |
|
1429 const RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttributes) |
|
1430 { |
|
1431 if (!iGlobalMsgQuery) |
|
1432 { |
|
1433 iGlobalMsgQuery = CAknGlobalMsgQuery::NewL(); |
|
1434 } |
|
1435 |
|
1436 // Delay after message query so that application execution order will |
|
1437 // be correct. |
|
1438 iGlobalMsgQuery->SetExitDelay(KPhSrvUssdNoteExitPeriod); |
|
1439 |
|
1440 TInt softkeys = R_AVKON_SOFTKEYS_USSD_ANSWER_EXIT__ANSWER; |
|
1441 if (!(aMsgAttributes.iFlags & RMobileUssdMessaging::KUssdMessageType) |
|
1442 || aMsgAttributes.iType != RMobileUssdMessaging::EUssdMTRequest) |
|
1443 { |
|
1444 softkeys = R_AVKON_SOFTKEYS_EXIT; |
|
1445 } |
|
1446 |
|
1447 // Set timer that lauches Global MessageQuery after time interval. |
|
1448 iSoftkeys = softkeys; |
|
1449 |
|
1450 // debug print |
|
1451 _DPRINT( 4, |
|
1452 "PhSrv.UssdHandleReceivedEventL.String.Middle" ); |
|
1453 |
|
1454 // Play the USSD tone if needed. Logically should be in RunL, but here |
|
1455 // to give better balancing with voice and visible message. |
|
1456 if (IsTelephonyFeatureSupported(KTelSrvLVFlagUssdTone)) |
|
1457 { |
|
1458 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.PlayTone" ); |
|
1459 PlayUssdTone(); |
|
1460 } |
|
1461 // Launch the new message query |
|
1462 if (!IsActive()) |
|
1463 { |
|
1464 iLaunchGMQ = ETrue; |
|
1465 iTimer.After(iStatus, KPhSrvUssdMessageQueryInterval); |
|
1466 SetActive(); |
|
1467 } |
|
1468 } |
|
1469 // ----------------------------------------------------------------------------- |
1345 // ----------------------------------------------------------------------------- |
1470 // CPhSrvUssdManager::LaunchGlobalMessageQueryL |
1346 // CPhSrvUssdManager::LaunchGlobalMessageQueryL |
1471 // ----------------------------------------------------------------------------- |
1347 // ----------------------------------------------------------------------------- |
1472 // |
1348 // |
1473 void CPhSrvUssdManager::LaunchGlobalMessageQueryL() |
1349 void CPhSrvUssdManager::LaunchGlobalMessageQueryL() |