VoiceGuide IVR Software Main Page
Jump to content

Can't Return Results From Vbscript

Recommended Posts

Hi

 

I recently purchased the 4-line Professional edition of voiceguide, which states that it will run VBScript without a problem.

 

However, when I try to return a value to Voiceguide with RVSET, it hangs up on the caller with the following event log:

 

203628.80 5 [Chosen Item] Playing (C:\Program Files\VoiceGuide\1900_soundfiles\itemchoice01.wav)

203628.84 5 PlaySoundStart ok [C:\Program Files\VoiceGuide\1900_soundfiles\itemchoice01.wav]

203628.86 5 RunModule PLAY end

203631.43 5 Play End line[5] (id=876529)

203631.45 5 LsPlayMsg EV_PLAY_FINISHED

203631.47 5 LsPlayMsgFinished EV_TIMEOUT_GOTOMODULE

203631.49 5 [Chosen] Running VB Script...

203631.52 5 RVreplace start (strlen>100)

203631.64 5 Run Script waiting... (shellid=1200, process=1456)

203631.85 5 cl RvSet ItemFileToPlay, C:\program files\voiceguide\1900_soundfiles\itemchoice_polyphonic.wav

203631.88 5 COM interface not supported in this version.

203632.60 5 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE

203632.63 5 task completed (shellid=1200, process=1456)

203632.64 5 No information returned from program to VG (no VGRUNRESULT_5.TXT or SHLRESLT.TXT)

203632.66 5 Hanging up call... [WaitTillFinished - next module not specified]

 

I'm not really sure I understand the implications correctly, but it looks like Professional will let you run VBScripts, but you can't actually do anything useful with them, like return values, where Enterprise will? Is this correct?

 

If so, is there an alternate means of returning a string to Voiceguide, from a VBScript?

 

Additionally,I have noticed a bug in Voice Guide 5.1.3 (don't know if it exists in earlier versions). When writing VBScripts, you must leave a carriage return at the end of your scripts, otherwise VBScripts will fail to execute because VoiceGuide has appended data to the end of the script, right on the end of the last line of your VBS.

 

Adam

Share this post


Link to post

From VG Help file's section on "Run VBScript module":

Once VoiceGuide detects that a VB Script has completed (and no COM response was received beforehand) then VoiceGuide will see if a "Result File" has been created by the script. If one has been created then VoiceGuide will read in it's contents and then determine what to do next based on the contents of the file.

 

The syntax of the Result File is the same as that used by the Run Program module. The Result Files must be placed in VoiceGuide's data subdirectory. Please refer to the Run Program module Help file's section for more information.

 

From VG Help file's section on "Run Program module":

The syntax for the VGRUNRESULT_LineNumber.TXT file is:

 

[Result Variable Name]{Result Variable Value}

 

Multiple Result Variables can be specified. For Example, the following contents:

 

[RvName1]{Value1}[RvName2]{Value2}[RvName3]{Value3}[RvName4]{Value4}

 

Would return 4 Result Variables to VoiceGuide, whose values would be whatever is contained in the curly brackets. All Result Variables must be listed on a single line..

 

From VG Help file's section on "Run VBScript module":

Example 9:

The VB Script below demonstrates how the $RV_DEVICEID Result Variable is used to generate a Result file from which the data is read back into VoiceGuide. Please note that using the COM function Run_ResultReturn() is a preferable way of returning information to VoiceGuide (it's faster) - but a result file can be used if there is no other way.

 

Dim iIndexDow, iIndexNasdaq, iIndexSP500

 

'Do some work here to retrieve the data and initialize

'the iIndexDow, iIndexNasdaq and iIndexSP500 variables

 

strResultVariables= "[indexDow]{" & iIndexDow & "}" & _

"[indexNasdaq]{" & iIndexNasdaq & "}" & _

"[indexSP500]{" & iIndexSP500 & "}"

 

iRet = WriteResultFile(strResultVariables)

 

Function WriteResultFile(strResult)

  Const ForReading=1, ForWriting=2, ForAppending=8

  filename = "VGRUNRESULT_$RV_DEVICEID.TXT"

  Set fso = CreateObject("Scripting.FileSystemObject")

  Set ts = fso.OpenTextFile(filename, ForWriting, True)

  ts.WriteLine(strResult)

  ts.Close

  WriteResultFile=0

 

  'always deallocate after use...

  set ts = Nothing

  set fso = Nothing

end function

 

Additionally,I have noticed a bug in Voice Guide 5.1.3 (don't know if it exists in earlier versions). When writing VBScripts, you must leave a carriage return at the end of your scripts, otherwise VBScripts will fail to execute because VoiceGuide has appended data to the end of the script, right on the end of the last line of your VBS.

Thanks for reporting this, we'll have that looked into and I'm sure the issue will be resolved in v5.1.4 onwards.

Share this post


Link to post

Thanks for your reply.

 

Can I just clarify, is it correct then, that only Enterprise users can use the RvSet method of the VG Connection object?

 

Adam

Share this post


Link to post
only Enterprise users can use the RvSet method of the VG Connection object?

Yes. VoiceGuide's COM interface is only enabled in the Enterprise version.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×