Zoltan Report post Posted 01/30/2006 12:56 PM I am trying to create a conditional menu based on something like this as a starting point: To make a transaction press 1 To check your balance press 2 To check your latest payments press 3 To change your PIN press 4 And the path is: on {1} goto [Make Transanction] on {2} goto [balance check] on {3} goto [Check latest Transanction] on {4} goto [Change your PIN] Before this Play Sound File module I use a Run VB script module to assembly different sequences of sound files so that the caller will hear certain menu points - but not all - depending on different conditions. For example, if the caller’s money balance = 0, then he will hear only two menu points : To check your balance press 2.wav, To change your PIN press 4.wav While I can easily control the menu points the caller can hear using vbscript, I cannot prevent them to press the buttom they are not supposed to press. In the example above, I want them to press 2 or 4 while the menu points 1 and 3 should not work in that case. Of course, if I use a lot of Play Sound File modules for each possible conditions, I can solve the problem. Is there a solution where I only use one Run VB script module and one Play Sound File module to build a conditional menu? I know complicated solutions; I am looking for a simple one. Share this post Link to post
Harry L. Roberts Report post Posted 01/30/2006 01:59 PM You might want to look at something a little different. Try using the play module to play the menu options that the caller can choose from just as you are doing now. If I read your post correctly you have already worked out a way to present different menu options to the caller based on some predetermined criteria. Instead of having the paths as you indicate in your post have all the paths lead to a new module that is a VBScript module. Use the VBScript module to prevent or allow certain paths to be chosen. You will need to use $RV_LastKeyPress to evaluate what the caller actually pressed. You will use basically the same logic you used in your VBScript module to decide which file to play in the Play Sound File module. In your example; "For example, if the caller’s money balance = 0, then he will hear only two menu points : To check your balance press 2.wav, To change your PIN press 4.wav" Using the VBScript you should have it send the caller back to the play module if any number other than 2 or 4 is chosen. This may or may not make sense but I'm going to try to expalin it a little better. Here it goes with the limited information available. Lets just say that we have created a new RV called CallersMenuChoice. You set this in your VBScript file that you use to decide which file to play. All keypress paths from your Play Sound File module will be directed to our new VBScript Module. Lets call it something.... I'm going to use BankMenuKeyProcess. So in our new BankMenuKeyProcess VBScript module we will have code similar to the following; Select Case CallersMenuChoice Case "money balance = 0" Select Case "$RV_LastKeyPress" Case 2 Goto Check Balance Script/Module Case 4 Goto Change Pin Script/Module Else Goto Play Sound File Module that provide the caller the options to press End Select Case "money balance <> 0" Select Case "$RV_LastKeyPress" Case 1 Goto where ever you want them to go when they press 1 Case 6 Goto where ever you want them to go when they press 6 Else Goto Play Sound File Module that provide the caller the options to press End Select End Select I'm not suggesting you copy and paste this code but it should give you an idea of how to go about writing the proper code for your application. Basically what you need to do is determine what options you want to make available to the caller and then check to see what key they pressed. If you anticipate needing more that 12, the number of keys on the key pad, different menu choices available you should consider using the Get Numbers module to play your menu choices to the caller. This should allow you basically an unlimited number of menus available to the caller. Share this post Link to post
Zoltan Report post Posted 01/30/2006 05:35 PM Thank you very much for your great idea. I understand it and I will use it. Zoltan Share this post Link to post