ktruk Report post Posted 05/17/2006 10:06 AM Hi. I want to create a custom number validation VBS routine in a GetNumbers module which will check for a number of different issues, before passing a number. The help says I can do this, but after several attempts, I am getting some odd results. The VG help file states something to the effect that if you play your own sounds in the Validate VBS then the default validate sound sound is ignored. Firstly, heres the code, followed by the problems I have been experiencing: set vg = CreateObject("VoiceGuide.CommandLink") iLineID = $RV_LINEID N = "$RV_ENTEREDNUMBER" if Left(N, 2) <> "07" then vg.Play_Start iLineID, "L07.wav" sResult = "verify_failed" elseif Len(N) < 10 then vg.Play_Start iLineID, "L09.wav" sResult = "verify_failed" else sResult = "verify_passed" end if vg.Run_ResultReturn iLineID, sResult set vg = Nothing When a number entered does not start with "07" then I want to play L07.wav. When a number fails the min length check, I want to play L09.wav heres a snippet from the log: 105058.23 17 eng copy of verification script ran: vbs_17_2_0517105058.vbs 105058.28 17 Run Script waiting. iRunWait=1 (shellid=3508, process=976) 105058.30 17 timer set 1 EV_TIMEOUT_CHECKONSTATE 105058.37 17 cl Play_Start L09.wav,G19.wav 105058.39 17 play set playid=230937 105058.42 17 PlaySoundStart ok [D:\VG\KTRDEV16B\L09.wav] 105058.45 17 timer clear 105058.48 17 cl Run_ResultReturn >>verify_failed<< 105058.50 17 ScriptEventCode 9220 iLineState=1301 105058.53 17 LsGetNbrsRxDigits EV_UNKNOWN_9220 105058.56 17 getnbr EV_MODGETNBRS_VERIFY_FAIL 105058.59 17 getnbr lPlayId=230937 105058.62 17 state [AccMobile] Playing (L01C.wav) Clearly, the returned playlist is being overridden by "L01C.wav" a few milli-seconds later, which is the module main prompt. Thing is, I can't see a way to 'return' from the script with the status "verify_failed" AND play the validation prompt. What am I doing wrong? PS: Running vg ent v5.2.5049. While testing this last week: I got a situation where the previously entered string was pre-pended to the second attempt - can't recreate this now, but thought I would mention it. Also, the help states that the validate prompt is overriden by a VBS prompt, but you have to delete the validate prompt or it just gets played instead of the VBS based prompt. Share this post Link to post
SupportTeam Report post Posted 05/18/2006 08:17 AM Try using an RV for the in the "promt to be played on fail" field and set the RV to point to different files during the verification script. I got a situation where the previously entered string was pre-pended to the second attempt We'd be pretty surprised if that happened... please post a trace if you see this happen again. During testing/development it's a good idea to have traces running all the time. Share this post Link to post
ktruk Report post Posted 05/18/2006 09:53 AM I will try this and get back to you. BUT: 1. I am trying to reduce the number of RVs current in any one call (I have loads!) and 2. HOW do I return an RV in VBS ...AND... return the specific strings "verify_passed/verify_failed"? I suppose I have to set it using vg.RvSet, then return? Share this post Link to post
SupportTeam Report post Posted 05/21/2006 07:55 PM I suppose I have to set it using vg.RvSet, then return? Yes, that's the approach that would need to be used. Share this post Link to post
ktruk Report post Posted 05/26/2006 09:45 AM Apologies for the slow reply - just to confirm that setting an RV in the get-number-validation VBS and then using this RV in the "Messages that the entered number was not correct..." field worked. The code is : set vg = CreateObject("VoiceGuide.CommandLink") iLineID = $RV_LINEID N = "$RV_ENTEREDNUMBER" if Left(N, 2) <> "07" then vg.RvSet iLineID, "BADPHONE", "L07.wav" sResult = "verify_failed" elseif Len(N) < 10 then vg.RvSet iLineID, "BADPHONE", "L09.wav" sResult = "verify_failed" else vg.RvSet iLineID, "BADPHONE", "" sResult = "verify_passed" end if vg.Run_ResultReturn iLineID, sResult set vg = Nothing Then use $RV[bADPHONE] in the failed-validation field. Works, but a bit messy ;-) Share this post Link to post