Jump to content


< Back to Forum


 

Error On Back To Back Vbscript Modules


  • Please log in to reply

#1 iTime 14 October 2016 - 07:54 AM

Hello,

 

If I use 2 VBScript modules back to back (VBModule goes to another VBModule after "success" path), would it be a problem?

I have a script that receives time in military format from user, validate if it is correct time in VBScript module, validate if minutes are in 15 minutes of increments in VBScript module, then play wave to confirm the hours entered.

 

But after receiving a correctly formatted hours (i.e. "0800", which is 8:00 AM), VG would hang up abruptly while playing the confirmation wave files.

If I use just one of the validation scripts at a time (just use time validation OR increment validation), the script works correctly and proceeds to the next module.

Does it mean I cannot use 2 VBScript modules in a row?

 

If you see the attached script, after the time "0800" is received, VG will execute [ValidateStartTime] module, then move to [ValidateStartTimeIncrement] module, then move and start playing [PlayConfirmSickstartTime], but hangs up without proceeding to the next module.

 

Thanks for your help in advance.

 



#2 SupportTeam 14 October 2016 - 08:58 AM

Module [ValidateStartTime] calls Run_ResultReturn twice.

 

Run_ResultReturn must only be called once (and only if Script_Goto/Script_Gosub/etc. has not been called already).

 

Right now the second "Run_ResultReturn" response returned from task started in [ValidateStartTime] is received after [ValidateStartTimeIncrement] has already started, and that causes system to move onto next module: [PlayConfirmSickStartTime]

 

Then, when the "Run_ResultReturn - success" from task started in [ValidateStartTimeIncrement] arrives there is no matching path in module [PlayConfirmSickStartTime] and system hangs up the call.

143901.048  10   3   1 state [ValidateStartTime] RunScript vbs, onhold=

143902.248  26   3   1 rem   Run_ResultReturn [[StartTime]{1900-1-1 08:00}[StartTimeString]{WAV Files\Numbers\8.wav,WAV Files\Numbers\AM.wav}] 94

143902.249  10   3   1 state [ValidateStartTimeIncrement] RunScript vbs, onhold=

143902.251  26   3   1 rem   Run_ResultReturn [success] 7

143902.252   7   3   1 state [PlayConfirmSickStartTime] Playing wav (WAV Files\Common_ConfirmSelection.wav,WAV Files\Numbers\8.wav,WAV Files\Numbers\AM.wav,WAV Files\Common_ConfirmProceed.wav)

143903.477  32   3   1 rem   Run_ResultReturn [success] 7

143903.478   7   3   1       HangupCall qScr add (Run_ResultReturn - no path match (same vgm)) crn_in=0, L1=Connected, L2=Running_Normal, lPlayId=95840, lRecId=0

.

 

From Module [ValidateStartTime] :

 

 

If strStartTime <> "" Then
    'Corrent Date format is ready. pass to the RVs.
    vg.Run_ResultReturn $RV_LINEID, "[StartTime]{" & strStartTime & "}[StartTimeString]{" & strStartTimeString & "}"
    sResult = "success"
Else
    'return fail to IVR to play error msg
    sResult = "fail"
End If

If (Err.Number <> 0) Then
     Call TraceError($RV[PlayWelcomeGetEmpNumber],"Input Validation for Start Time")
     Err.Clear
Else
    'Return result
    vg.Run_ResultReturn RV_LINEID, sResult                  
End If

 

 

Maybe change above to:

 

 

If strStartTime <> "" Then
    'Corrent Date format is ready. pass to the RVs.
    sResult = "[StartTime]{" & strStartTime & "}[StartTimeString]{" & strStartTimeString & "}"
Else
    'return fail to IVR to play error msg
    sResult = "fail"
End If

If (Err.Number <> 0) Then
     Call TraceError($RV[PlayWelcomeGetEmpNumber],"Input Validation for Start Time")
     Err.Clear
Else
    'Return result
    vg.Run_ResultReturn RV_LINEID, sResult                  
End If

 

 

Returning a $RV string in Run_ResultReturn results in module taking the "success" path.

 

Another alternative is to use RvSet or RvSet_RvList to set the RVs before returning Success.

Please see: 

http://www.voiceguid...l/com_rvset.htm

http://www.voiceguid...vset_rvlist.htm



#3 iTime 14 October 2016 - 09:15 AM

Oh, I see.

I have changed the first "Result Return" to "RvSet_RvList" and now it works.

 

Thanks a lot!