VoiceGuide IVR Software Main Page
Jump to content

Rvget Does Not Seem To Retrieve The Latest Value

Recommended Posts

Dear VoiceGuide Support,

 

We're trying to use the .RvGet COM method to retrieve the current value of a VoiceGuide variable in a VBScript module.

 

However, the .RvGet method always seems to return the value that the specified VG variable contained at the start VBScript, rather than the value of the VG variable at the time the line of code containing the call to the .RvGet method is executed.

 

Please see attached sample script.

 

Is there a way to get the current value of a VG variable at the exact instant in which the call to the .RvGet method is executed in the VBScript module?

 

Thanks in advance,

Test4.zip

Share this post


Link to post

The RvGet Function was initially designed to be used by other applications trying to access VoiceGuide's RVs....

 

When running VB Scripts from VoiceGuide's VBScript module all the RVs get replaced by their values before the VB Script is executed... so when you are using

 

vg.RvGet($RV_LINEID, "$RV[TEST]")

 

in VoiceGuide's VB Script then when actually executing the script the RvGet function will get called not with $RV[TEST] as a parameter, but with the value of $RV[TEST] at the time the script is started as a paramter... so in your case when the second VB script starts running it will be running this:

Dim vgObj    ' as Object

 

Set vgObj = CreateObject( "VoiceGuide.CommandLink" )

 

Call vgObj.Admin_TraceLogAdd( 8, 0, "TEST = " & vgObj.RvGet( 8, "" ) )

Do While ( vgObj.RvGet( 8, "" ) = "" )

    Call WScript.Sleep( 250 )

    Call vgObj.Admin_TraceLogAdd( 8, 0, "TEST = " & vgObj.RvGet( 8, "" ) )

Loop

Call vgObj.Admin_TraceLogAdd( 8, 0, "TEST = " & vgObj.RvGet( 8, "" ) )

 

Set vgObj = Nothing

 

We'll look into supporting retrieval of current RV values using RvGet() when called from within the "Run VB Script" module - we should have a fix for you which will be able to do this within 24 hours.

 

Again thanks for providing sample script and traces - it made the process of diagnosing the problem much quicker.

Share this post


Link to post

please update your 5.1.3 installation with the .exe attached.

 

The sRv parameter of the RvGet() COM function is now described as:

 

Result Variable who's value is to be returned. The leading dollar sign can be ommited. eg. in case of $RV[GetCardDetails] just the RV[GetCardDetails] can be specified, and in case of $RV_CALLLENGTH just the RV_CALLLENGTH can be specified.

Omiting the dollar sign is necessary if RvGet() is used from within VoiceGuide's VB Script Module, as any fully specified RVs will be replaced with their value before the script is ran.

 

In case of your script the second module should use:

Dim vgObj    ' as Object

 

Set vgObj = CreateObject( "VoiceGuide.CommandLink" )

 

Call vgObj.Admin_TraceLogAdd( $RV_DEVICEID, 0, "TEST1 = " & vgObj.RvGet( $RV_DEVICEID, "RV[TEST]" ) )

Do While ( vgObj.RvGet( $RV_DEVICEID, "RV[TEST]" ) = "" )

    Call WScript.Sleep( 250 )

    Call vgObj.Admin_TraceLogAdd( $RV_DEVICEID, 0, "TEST2 = " & vgObj.RvGet( $RV_DEVICEID, "RV[TEST]" ) )

Loop

Call vgObj.Admin_TraceLogAdd( $RV_DEVICEID, 0, "TEST3 = " & vgObj.RvGet( $RV_DEVICEID, "RV[TEST]" ) )

 

Set vgObj = Nothing

 

Tested your demo script and it works as intended now... seconds VB Script module picks up the change in the value of the Result Variable.

 

 

Just as a note, when trying to pass events/information from one parallel running process to another it may be more straightforward to use Databases - with one task writing info into the database and other reading, or (slightly more complicated) use sockets to transfer the information - socket communications would not require polling, which may be an advantage when running a large number of lines...

 

Some sample code on using sockets can be found in:

http://voiceguide.com/forums/index.php?showtopic=582

VgMulti.zip

Share this post


Link to post

Dear VoiceGuide Support,

 

Thank you so much for fixing this so quickly. It now allows me to synchronise concurrent VBScripts that are running on the same line.

 

Regards,

Share this post


Link to post

Dear VoiceGuide Support,

 

I've just downloaded and installed the latest version of VoiceGuide v5.1.6 and this version seems to have regressed the solution provided above.

 

For example: vgObj.RvGet( $RV_DEVICEID, "RV[TEST]" )

 

now returns: RV[TEST] instead of the value of the TEST variable.

 

Could you please advise.

 

Thanks,

Share this post


Link to post

I've just tested our version here and it seems to work OK, a call to:

 

vgObj.RvGet( $RV_DEVICEID, "RV[TEST]" )

 

returns an empty string until $RV[TEST] is defined...

 

... if you are still experiencing problems could you please send us a copy of VoiceGuide's Debug Printout which captures the problem, this will allow us to see what is going wrong.

(When running the script click on VoiceGuide's View menu and select 'Event Trace Log' option - any log information will then appear in this window. You must open the trace window before making the call.)

Share this post


Link to post

Dear VoiceGuide Support,

 

I've just tested the script in the attached file and VG is returning RV[TEST] instead of <blank> before I set the value of the TEST variable (see Log file for results).

 

Incidentally, even though I've installed v5.1.6, when I click on Help - About VoiceGuide, it says that the version is v5.1.4060. Is this correct?

 

Thanks,

Test4_221203.zip

Share this post


Link to post

Thank you. That has fixed the problem.

 

Will v5.1.7001 be included in a future version?

Share this post


Link to post

Dear VoiceGuide Support,

 

Before I download v5.1.7 from your "Download" page, can you please confirm that the above enhancement has been included in this release.

 

Thanks,

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
×