VoiceGuide IVR Software Main Page
Jump to content

Problem Passing Variables From Vb Script

Recommended Posts

Hi,

 

I've been trying to follow the transfer of variables from VB scripts into other modules but don't seen to be having any luck. The script will read dtmf tiones from an sql server stored procedure, but for now, I'm just trying to pass a test string.

 

I am running the evaluation version of the application - but the specs don't appear to indicate that this is excluded from this version.

 

The first VBScript module just consists of:

 

dim  vg

 

set vg = CreateObject("VoiceGuide.CommandLink")

vg.Run_ResultReturn $RV_LINEID,  "[NewDTMF]{12121212}"

set vg = Nothing

 

And on success, this modules goes to a 'play sound file' module where the 'sound file to play' field contains: $RV[NewDTMF]

 

However, when run from the dialer, it will call but no tones are sent. Further, from the event log:

 

..

..

024018.33  8 Live person answered, starting C:\Program Files\VoiceGuide\Scripts\qqqq.vgs

024018.36  2 tr    NewVgsVgm_Goto C:\Program Files\VoiceGuide\Scripts\qqqq.vgs,,,,,0

024018.38  8 rv    add [scriptEnd_Time]{02/08/2004 02:40:18}

024018.41  8 rv    add [scriptEnd_Goto_Script]{C:\Program Files\VoiceGuide\Scripts\qqqq.vgs}

024018.44  8 rv    add [scriptEnd_Goto_Module]{}

024018.47  8 rv    add [scriptStart_Time]{02/08/2004 02:40:18}

024018.50  8 rv    add [scriptStart_CalledFrom_Module]{Play 2}

024018.52  0 LoadedVgs_Find C:\Program Files\VoiceGuide\Scripts\qqqq.vgs at idx=2

024018.55  8 AddRVns [scriptsPath]{C:\Program Files\VoiceGuide\Scripts\}

024018.58  8 AddRVns [scriptPath]{C:\Program Files\VoiceGuide\Scripts}

024018.61  8 cl    NewVgsVgm_RunModule module not found:

024018.98  8 timer clear

024019.02  8 [Play 2] Playing

024019.06  8 rv    replace start: [$RV[NewDTMF]]

024019.11  8 rv    ns none[OutDial_RetriesLeft]{2}[OutDial_Result]{Contacted_Human}[scriptEnd_Time]{02/08/2004 02:40:18}[scriptEnd_Goto_Script]{C:\Program Files\VoiceGuide\Scripts\qqqq.vgs}[scriptEnd_Goto_Module]{}[scriptStart_Time]{02/08/2004 02:40:18}[scriptStart_CalledFrom_Module]{Play 2}[scriptsPath]{C:\Program Files\VoiceGuide\Scripts\}[scriptPath]{C:\Program Files\VoiceGuide\Scripts}

024019.17  8 rv    replace end: []

024019.20  8 [Play 2] Playing ()

024019.23  8 ScriptEventCode 8001 iLineState=1100

024019.27  8 LsPlayMsg EV_PLAY_FINISHED

024019.30  8 timer set 5  EV_TIMEOUT_REPLAYMSG

024019.33  8 RunModule PLAY end

..

..

 

Where the lines:

 

024019.17  8 rv    replace end: []

024019.20  8 [Play 2] Playing ()

 

again show the variable isn't being transferred.

 

Does anyone know what I'm doing wrong?

 

Steve

Share this post


Link to post

Trace shows that the script is set to begin at module [Play 2] - so it is not even running the VB Script module from within which you are setting the RV.

 

In Script Designer go to "Edit"->"Script Properties" menu and select the module from which you'd like the script to start.

 

(Which version of VG are you running?)

Share this post


Link to post

I use VBscripts frequently throughout my 200+ module VG-script. The way I pass variables out of a VBscript module to be used in subseq. modules is as follows:

 

I define my own function in each VBscript, and this doesn't change:

 

function WriteResultFile(strResult)

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

Dim filename, fso, ts, outdata, outdata2, outdata3

filename = "VGRUNRESULT_$RV_DEVICEID.TXT"

set fso = CreateObject("Scripting.FileSystemObject")

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

ts.WriteLine(strResult)

ts.Close

WriteResultFile = 0

end function

 

Then towards the end of the main script I issue a call to this function with the set of variables as the param:

strResultVariables="[LookUpPwd_1_1]{" & v_cust_id & "}[addnewtel]{1}[getNewCustMaxKontor_2_1]{0}[kk_son4]{" & cc_num_d & "}"

 

'msgbox strResultVariables

 

iRet = WriteResultFile(strResultVariables)

 

hope this helps.

== LEVENT ==

Share this post


Link to post

Just a note:

 

Levent returns results using the "Result File" which is then read in by VoiceGuide. This reading in of result file may take up to about half a second to complete.

 

The Run_ResultReturn COM function returns data to VoiceGuide instantaneously.

Share this post


Link to post

can some one help me to poke following prometers

<user>:

<vendor>:

<partner>:

<password>:

<hostAddress>:

via VG script into the bellow VB script and run it? This VB script is located out of the VG script.

I am not sure how to use DDE, Run Program, or VB script module to poke the above date into the VB script. And I don’t have any VB programming experience. Any help would be appreciated. Thanks

 

Private Sub Command1_Click()

Dim client As Object

Dim strParm As String

Dim Ctx1 As Long

Dim Response As String

 

' gray out the send button so two transaction can't go

' out at the same time

Command1.Enabled = False

 

' create the PNCOMClient component

Set client = CreateObject("PFProCOMControl.PFProCOMControl.1")

 

strParm = ParmList.Text

strLength = Len(strParm)

 

Ctx1 = client.CreateContext(HostAddress.Text, HostPort.Text, Timeout.Text, "", 0, "", "")

Response = client.SubmitTransaction(Ctx1, ParmList.Text, Len(ParmList.Text))

TranOutput.AddItem Response

client.DestroyContext (Ctx1)

 

 

TranOutput.AddItem " "

 

' Free the save button for another transaction

Command1.Enabled = True

 

 

End Sub

Share this post


Link to post

Just run the VBScript from within a "Run VBScript" module, and then just use teh relevant Result Variables within the script...

Share this post


Link to post

Here is the log file when I run the previous VB script in VG file. also please see the error picture attached file that VG is displaying when VG module is runes.

 

Any suggestion I clear this error?

 

 

080257.45 6 callstate CONNECTED 65999,1,0

080257.47 6 WorkingModeTAPI@Connected=

080257.47 6 WorkingModeScript@Connected=

080257.50 6 Inband detection not enabled

080257.50 6 StartLoadedVgs at 9/12/2004 8:02:57 AM

080257.50 6 AddRVns [scriptsPath]{C:\Program Files\ivg\Scripts\PBPScript\test\}

080257.50 6 AddRVns [scriptPath]{C:\Program Files\ivg\Scripts\PBPScript\test}

080257.50 6 rv add [$RV_STARTTIME]{9/12/2004 8:02:57 AM}

080257.52 6 rv add [$RV_DEVICEID]{6}

080257.52 6 rv add [$RV_CIDNAME]{}

080257.52 6 AddRVns [PathApp]{C:\Program Files\VoiceGuide\}

080257.52 6 rv add [$RV_CIDNUMBER]{}

080257.52 6 tapi Reply (LineEvReply) ok 66000 0

080257.52 6 timer clear

080257.52 6 [Run VB Script 1] Running VB Script...

080257.53 6 eng copy of script ran: vbs_6_1.vbs

080257.56 6 Run Script waiting... (shellid=2156, process=152)

080257.56 6 timer set 1 EV_TIMEOUT_CHECKONSTATE

080257.56 6 callinfo MONITORMODES

080258.55 6 timer fired EV_TIMEOUT_CHECKONSTATE

080258.55 6 ScriptEventCode 9007 iLineState=1501

080258.55 6 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE

080258.55 6 task still running (shellid=2156, process=152)

080258.56 6 timer set 1 EV_TIMEOUT_CHECKONSTATE

080259.66 6 timer fired EV_TIMEOUT_CHECKONSTATE

080259.66 6 ScriptEventCode 9007 iLineState=1501

080259.66 6 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE

080259.66 6 task still running (shellid=2156, process=152)

080259.67 6 timer set 1 EV_TIMEOUT_CHECKONSTATE

080300.77 6 timer fired EV_TIMEOUT_CHECKONSTATE

080300.77 6 ScriptEventCode 9007 iLineState=1501

080300.77 6 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE

080300.77 6 task still running (shellid=2156, process=152)

080300.78 6 timer set 1 EV_TIMEOUT_CHECKONSTATE

080301.88 6 timer fired EV_TIMEOUT_CHECKONSTATE

080301.88 6 ScriptEventCode 9007 iLineState=1501

080301.88 6 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE

080301.88 6 task still running (shellid=2156, process=152)

080301.89 6 timer set 1 EV_TIMEOUT_CHECKONSTATE

080302.98 6 timer fired EV_TIMEOUT_CHECKONSTATE

080302.98 6 ScriptEventCode 9007 iLineState=1501

080302.98 6 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE

080302.98 6 task still running (shellid=2156, process=152)

080303.00 6 timer set 1 EV_TIMEOUT_CHECKONSTATE

080304.09 6 timer fired EV_TIMEOUT_CHECKONSTATE

080304.09 6 ScriptEventCode 9007 iLineState=1501

080304.09 6 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE

080304.11 6 task still running (shellid=2156, process=152)

080304.11 6 timer set 1 EV_TIMEOUT_CHECKONSTATE

080305.03 0 btn Hangup on line 6

post-2-1095001733.jpg

Share this post


Link to post

Looks like the error is right at the beginning of your VBScript - did you have a look at the line number mentioned in the error message and see what could be causing this error? You may want to ask a programmer who knows VBScript to take a look at it for you - they should be able to tell you where the error is.

 

If you are stuck please post the VoiceGuide script which produces this error and we can take a quick look at it for you.

Share this post


Link to post

I am stuck. thank you for helping me on this problem.

Please find my VG script attached. I have not enter the Result Variables into the VB script yet, because I don't know whether I have to input the result variable into the "params.txt" or into the VB script. Your advice on this part would be appreciated too.

DepositCashInDisposalCard.vgs

Share this post


Link to post

The trace shows that the VBScript problem occurred in module [Run VB Script 1], yet the attached script does not even have a module with that name...

Share this post


Link to post

sorry, I have attached the worng file. Here is the file I use to transct the C/CNum to veisign.

the script is works well out of the VG script. but when I use it inside of the VG script it give me above error. since I have no exparince with VB programing, I don't have any idea how to resulve the error.

I realy faced wall, you are the only hope I have to fix this problem.

Edited by fsoudbakhsh

Share this post


Link to post

Looking at "TransactToVerisign" module I can see that you do not know how to program in VBScript.

 

I'd recommend speaking to a programmer to get this all sorted out for you.

Share this post


Link to post

I have attached my CCTransactions scripts in my privouse posts. would you please remove my script from this fourm?

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
×