dcodof Report post Posted 02/13/2006 09:25 PM Hello. I've implemented a very simple test of authentication, using the example code you give on your help file, but it doesn't work with three tests in the IF statement. The verification code I'm using is just this: set vg = CreateObject("VoiceGuide.CommandLink") iLen = Len("$RV_ENTEREDNUMBER") sFirstChar = Left("$RV_ENTEREDNUMBER",1) sSecondChar = Left("$RV_ENTEREDNUMBER",2) if (iLen <> 4 or sFirstChar <> "1" or sSecondChar <> "2") then sResult = "verify_failed" else sResult = "verify_passed" end if vg.Run_ResultReturn $RV_LINEID, sResult set vg = Nothing However, if the caller enters {1234} which should cause a "verify_passed", it doesn't and the software just ask for the numbers again. I'm sending attached the EventTraceLog. One last thing: when I use the option "Play back the entered number and ask caller to confirm", the play back only happens after the verification has sucessfully occurred. Is this the way it is suppose to work? I thought it would ask for the confirmation BEFORE the verification was executed... Thanks. EventTraceLog.txt Share this post Link to post
SupportTeam Report post Posted 02/13/2006 09:44 PM using the example code you give on your help file The Help file example is: set vg = CreateObject("VoiceGuide.CommandLink") iLen = Len("$RV_ENTEREDNUMBER") sFirstChar = Left("$RV_ENTEREDNUMBER",1) if iLen<13 or iLen>16 or (sFirstChar <> "3" and sFirstChar <> "4") then sResult = "verify_failed" else sResult = "verify_passed" end if vg.Run_ResultReturn $RV_LINEID, sResult set vg = Nothing and you're using: set vg = CreateObject("VoiceGuide.CommandLink") iLen = Len("$RV_ENTEREDNUMBER") sFirstChar = Left("$RV_ENTEREDNUMBER",1) sSecondChar = Left("$RV_ENTEREDNUMBER",2) if (iLen <> 4 or sFirstChar <> "1" or sSecondChar <> "2") then sResult = "verify_failed" else sResult = "verify_passed" end if vg.Run_ResultReturn $RV_LINEID, sResult set vg = Nothing Have a closer look at your code... In your code sSecondChar will be set to "12", which will result in verify_failed returned... the play back only happens after the verification has sucessfully occurred. Is this the way it is suppose to work? Yes. This lets you intercept problems before making the caller listen to the number again. You still have the option of making the caller confirm the number - just return "verify_passed" and do your verification in some other following VBScript module. Share this post Link to post
Harry L. Roberts Report post Posted 02/13/2006 09:53 PM Your Code: sSecondChar = Left("$RV_ENTEREDNUMBER",2) Should be: sSecondChar = Mid("$RV_ENTEREDNUMBER",2,1) The "Mid" function returns a specified number of characters from a string. Syntax Mid(string,start[,length]) Share this post Link to post
Harry L. Roberts Report post Posted 02/14/2006 11:54 AM Your Code: set vg = CreateObject("VoiceGuide.CommandLink") iLen = Len("$RV_ENTEREDNUMBER") sFirstChar = Left("$RV_ENTEREDNUMBER",1) sSecondChar = Left("$RV_ENTEREDNUMBER",2) if (iLen <> 4 or sFirstChar <> "1" or sSecondChar <> "2") then sResult = "verify_failed" else sResult = "verify_passed" end if vg.Run_ResultReturn $RV_LINEID, sResult set vg = Nothing Why not use: sFirstTwoChar = Left("$RV_ENTEREDNUMBER", 2) and if (iLen <> 4 or sFirstTwoChar <> "12") then Share this post Link to post
dcodof Report post Posted 02/14/2006 02:53 PM Thanks SupportTeam. I was with the wrong idea about the sintax. This lets you intercept problems before making the caller listen to the number again What exact problems are you talking about here? Thank you very much too, Harry. Your syntax explanation and your code suggestions were great! Share this post Link to post
Harry L. Roberts Report post Posted 02/14/2006 03:42 PM Support Said: Yes. This lets you intercept problems before making the caller listen to the number again. You still have the option of making the caller confirm the number - just return "verify_passed" and do your verification in some other following VBScript module. I think what they are saying is that you will first check for obvious problems before asking for them to confirm the number entered. In your case if the entered number does not begin with "12" then why ask them to confirm an obviously incorrect entry? If you would rather ask for confirmation of the number before running the verification process you might have to use a seperate module for the verification. I think you can do it either way. One is obviously a little easier because it requires only one module. Share this post Link to post