VoiceGuide IVR Software Main Page
Jump to content

Referring To Result Variables In Executeglobal Vbscript Statements

Recommended Posts

Dear support team,

 

I am using ExecuteGlobal VBScript statements to access the external scripts, which includes connection string and common functions.

My questions is, how do I refer to a result variable generated from a previous module?

 

For the given variables such as CID Number and Script path, I can use "RV_CIDNUMBER" or "RV_ScriptsPath."

But if I try to refer to the value from one module using "RV_ModuleName," it doesn't seem to work.

I believe it worked before Ver. 7 (I may be wrong.)

 

Please let me know if there is a way to get this worked.

 

Thaks.

Share this post


Link to post

Please post a demo script which demonstrates what you are trying to do and indicate with which module/$RV are you having a problem.

Share this post


Link to post

Using

strPath = RV_ScriptsPath & "Include\vbsUseADO.vbs"
ExecuteGlobal CreateObject("Scripting.FileSystemObject").OpenTextFile(strPath).ReadAll

 

the following code (saved in vbsUseADO.vbs file) is referred from each vbScript module,

Option Explicit

Dim strPath
strPath = RV_ScriptsPath & "Include\adovbs.vbs"
ExecuteGlobal WScript.CreateObject("Scripting.FileSystemObject").OpenTextFile(strPath).ReadAll

Sub TraceError(strQry)
'This procedure catches an error and stores the information on db in the same way VTI does.
'It also stores the record on Voice Guide Trace log. 

Dim gblVg
Dim gblErrorObject
Dim gblCmd
Dim gblRs
Dim strQ
Dim strErrorDetail
Dim strErrSource
Dim strErrDesc
Dim strEmpNumber

'''''''''''''''''''''''''''''''''''''''''''''''''
''''''' This is the problem '''''''''''''''''''''
strEmpNumber = RV_PlayWelcomeGetEmpNumber
'''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''

Set gblVg = WScript.CreateObject("vgServices.CommandLink")
Set gblCmd = WScript.CreateObject ("ADODB.Command")
Set gblErrorObject = Err
Set gblRs = WScript.CreateObject("ADODB.Recordset")
strErrorDetail=""
strErrSource = Replace(Err.Source,"'","''")
strErrDesc = Replace(Err.Description,"'","''")


strQ = "EXEC dbo.storedProcName '" & strErrSource & "','" & strErrDesc & "','" & _
	"EmpNumber: " & strEmpNumber & "', '" & _
	strQry & "','" & WScript.ScriptName & "','',''"   



ExecuteCommand(strQ)

Err.Clear
'Send the call to voice prompt for error and hangs up the call
gblVg.Script_Goto RV_LineID, "SystemError.Vgs","PlayError",""

Set gblVg = Nothing
Set gblRs = Nothing

End Sub

"RV_ScriptsPath " gets the script path correctly, but not RV_PlayWelcomeGetEmpNumber, which could've been $RV[PlayWelcomeGetEmpNumber] inside the voiceguide script. It simply does not return any value.

I would like to know how to grab the value of $RV[PlayWelcomeGetEmpNumber] from an external file like above.

 

 

Thanks.

 

Share this post


Link to post

On closer look it looks like you are trying to use $RV's in a VBScript that is not executed from VoiceGuide (vbsUseADO.vbs).

 

This will not work. VoiceGuide does not know it has to parse vbsUseADO.vbs and replace RVs in it with their values before the script is executed.

 

 

$RVs are only replaced with their values when used within VoiceGuide and the scripts and commands that VoiceGuide itself starts.

 

You may want to try passing contents of $RVs are parameter to your external functions/scripts.

Share this post


Link to post

Yeah, that (providing it as a parameter) is what I was gonna do as the second approach. Only thing that mattered was that It had seemed to work before Ver 7.

 

By the wasy, I was trying to find C# samples in the program folders but couldn't. Do I need to reinstall it or do you have those avaialbe online?

 

Thanks again!

Share this post


Link to post

I don’t think it would have worked in previous versions, after all VoiceGuide has no way of replacing RVs with their values if the VBScripts are not ran by VoiceGuide.

 

Which C# samples were you looking for and in which folder did you expect them to be?

Share this post


Link to post

I found your reply, saying:

 

Please update to the latest version of v7 available from our WWW now.

After installing that version see in VG's \Scripts\ subdirectory for directory called vgServices_WCF. Unzip the .ZIP file found there.

You will find a C# project which shows how to attach to VoiceGuide using WCF.

Note that there are 4 methods shown:

PortCommandLink TCP
PortCommandLine HTTP
LineComamdnLink TCP
LineCommandLink HTTP

The LineCommandLink is the 'old' command line where LineID is used to reference the channels used by the system
The PortCommandLink is the same as the LineCommandLink, but the Port Numbers are used instead of LineIDs. This makes it easier to use as Port Numbers are just 1,2,3,4,etc with 1 used to reference the 'first' (topmost) telephony channel. This makes it easier to reference the channel you want to address.

When subscribing to events use "-1" to subscribe to events for all channels. Similarly then unsubscribing "-1" will unsubscribe from all channels.

Please let us know if you have any further questions.

The supplied WCF demo will not work with previous versions of v7.

The WCF support in VoiceGuide will also allow you to include references to the WCF generated WSDL Web Services for direct inclusion in your projects. 

 

From the following post:

http://voiceguide.com/forums/index.php?showtopic=5461&hl=VoiceGuide\.CommandLink

 

Is this "sample" available for anyone?

Share this post


Link to post

That demo program is in the VoiceGuide \Scripts\ subdirectory (as stated in the quoted comments)

 

Maybe you are using an older version of v7, in which case you should download and install the latest v7 available from our WWW.

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
×