VoiceGuide IVR Software Main Page
Jump to content

Vbscript Problem

Recommended Posts

I am having some trouble getting a script to run through VoiceGuide, My script runs OK externally but when I insert it into VoiceGuide it fails.

 

I have attached a log file and and the code file that was generated in the temp directory when the sript was run.

As you will see from the log file the script is being executed and follows the success path but doesn't take the success module after the script is finished but goes to the fail module.

 

logfile160908.txt

Share this post


Link to post

I posted earlier but omitted one of the files.

 

To recap - VBScript working externally but when inserted into vbs module does not work, from log files it follows the coreect success path but ends up taking the fail option module.

vbcode1.txt

logfile160908.txt

Share this post


Link to post

The posted script does not seem the be the same one as the one ran when the trace was made.

 

In trace we see this line:

 

190732.240 13 0 comlg **** in success path test employee code

 

and there is no "**** in success path test employee code" line in the posted VBScript.

 

but I'll assume that you just changed that line to be: "**** in success path test parent code" instead.

 

The VBScript itself runs fine. You can after all see it's trace in the log:

 

190732.115 13 0 comlg **** calling CreateObject Excel.Application

190732.162 13 0 comlg **** calling WorkBooks.Open

190732.209 13 0 comlg **** calling xlApp.ActiveSheet

190732.225 13 0 comlg **** calling len(strValueEnteredByCaller)

190732.225 13 0 comlg **** scaning through all entries until match found or a blank cell is reached

190732.225 13 0 comlg **** scanning through column

190732.225 13 0 comlg **** scanning through column

190732.225 13 0 comlg **** scanning through column

190732.225 13 0 comlg **** scanning through column

190732.240 13 0 comlg **** in success section test Mobile Phone code

190732.240 13 0 comlg **** in success path test Mobile Phone Number

190732.240 13 0 comlg **** in success path test employee code

190732.240 13 1 rem Run_ResultReturn [success]

190732.240 13 1 Run_ResultReturn iVgsIdx=0. Ignoring returned information

190732.240 13 0 comlg **** calling xlBook.Close

190732.287 13 0 comlg **** calling xlApp.Quit

190732.287 13 0 comlg **** deallocating

 

and you can see that it has therefore completed.

 

The problem seems to be at this line:

 

190732.240 13 1 Run_ResultReturn iVgsIdx=0. Ignoring returned information

 

VoiceGuide has been put into a mode where it thinks that it is not running a script on that line, so the result returned by Run_ResultReturn is ignored. This is a bit strange and we could not replicate this problem on our test machine when we just tried this.

 

Can you please post the vgEngine trace showing the full call so that we can see exactly which version release of VG v7 are you using and what happened on the call in the lead up to this problem.

 

As an immediate workaround you can try returning "Success" using a "Result File" instead (see: http://www.voiceguide.com/vghelp/source/ht...runprogram.htm)

 

Or upgrade to latest version of VoiceGuide if you are not currently using the latest version.

Share this post


Link to post

The link to the result file information does not work, could you post it again please, could you also show me where I need to insert the code in my vbscript etc

 

 

Share this post


Link to post

Fixed the link in the previous post. Please try using it now.

 

The last trace does not show full call. It only captures script execution from module [Evaluate employee Code] onwards.

 

Please .ZIP up and post the entire vgEngine file from VoiceGuide's \log\ subdirectory.

 

 

 

 

Share this post


Link to post

We have found what is the problem with the VBScript.

 

The VBScript is not correctly specifying the "LineID" parameter in the COM functions calls.

 

Have a look at the Help file entry for Run_ResultReturn and the examples of Run_ResultReturn use there: http://www.voiceguide.com/vghelp/source/ht...esultreturn.htm

 

The first parameter is the "Line ID". The LineID identifies on which of the multiple lines this script and the command calls are associated with. In your script that setting is set to 1. It should not be hardcoded to 1, it should be set to the value of the LineID of the line on which that script is running. You obtain the value of LineID using the $RV_LINEID.

 

So change in your script the line:

 

vg.Run_ResultReturn 1, "success"

 

to be:

 

vg.Run_ResultReturn $RV_LINEID, "success"

 

Similar for all other COM calls, eg. change:

 

vg.script_GOTO 1,"","Re-enter employee Security Code",""

 

to be:

 

vg.Script_Goto $RV_LINEID,"","Re-enter employee Security Code",""

 

and also change all the Admin_TraceLogAdd calls to use $RV_LINEID

 

 

In a separate note you are using an Excel spreadsheet to do a role of a database. This is a very inefficient way and you may encounter Excel caused delays with this approach. Recommend you use a database instead.

Share this post


Link to post

I have done as you suggested, when I test the script with a regesterded phone ALL IS ok, but with an unregestered phone the script exits the Test Parent code module and goes to the Incorrect Mobile Number module, it plays out a tts message and should hang up (which it should do) but instead of hanging up it is going back to the Test Parent Code and carrying out the remainder of that script.

 

I have attached the log file (see line 115727.718.13 19) and the vb script generated in the temp folder.

vbs_19_1.txt

0918_1155_vgEngine.txt

Share this post


Link to post

Have a look at the VBScript in module [Test Parent Code].

 

That calling two Script_Goto commands one after another, which I don’t think is intended. I'd expect for the VBScript to only call Script_Goto once. Looks like there is some logic problem with that script.

 

The trace shows the two Script_Goto calls:

 

115727.703 13 0 comlg **** in fail path test phone number

115727.703 13 19 rem Script_Goto 19, , Incorrect Mobile Number,

 

...

 

115727.718 13 0 comlg **** in fail section test parent code

115727.718 13 19 rem Script_Goto 19, , Re-enter Parent Security Code,

 

There are already a number of Admin_TraceLogAdd entries throughout the script so you can follow their printing out in the vgEngine log and you'll be able to see how the script runs...

Share this post


Link to post

My intention was when an incorrect mobile number was used the module test parent code would send the script via a goto command to an incorrect mobile phone module that would play a message and then hang up.

 

But what seems to be happennig is the script goes to the incorrect mobile phone, plays the message but instaed of going to the end call module and hang up it goes back to the test parent code module.

 

Any ideas for me

Share this post


Link to post

You will need to change the VBScript to ensure that it only makes one call to the Script_Goto function, not two calls one after another like it does right now in the case you are showing us.

 

The second Script_Goto call will not necessarily just cancel the Script_Goto call you made immediately before. The two calls may execute in parallel for some time and which module is eventually ran is not decided by order of Script_Goto calls.

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
×