VoiceGuide IVR Software Main Page
Jump to content

Run Vb Script

Recommended Posts

hello,

Attached file contains VG log files and VB Script code. The problem is, however VB code does its job, but Result Variable doesn't returned to Voice Guide some time. Yes the Result Variable returns fine most of the time but some time Because "Run VB Scripts" runs for long time, Dialogic hung up due to Loop Current Off.

 

Would you please advice me how can stop this problem?

Thanks

 

 

Log.zip

Share this post


Link to post

It looks like the FTPing of a file from your ftp server (over the internet?) sometimes takes a long time, and the caller gets tired of waiting and just hangs up.

 

This is not a VoiceGuide related issue. You should look into why the you are unable to FTP the file reliably.

 

You should really design the script in such a way that it does not need to wait on some process that may take a long time to complete.

 

Also before doing a WScript.Quit you may want to call vg.Run_ResultReturn call first. This way you can return different result to VoiceGuide depending on whether the error/timeout ocurrend at OpenFTP or at the GetFile stage.

 

Dim ftp
Dim success
Set ftp = CreateObject("Farzad.FTPClass")


' The default data transfer mode is "Active" as opposed to "Passive".
' Connect and login to the FTP server.
Dim server
Dim username
Dim password

server = "www.farzadinc.com"
username = "**********"
password = "*********"

success = ftp.OpenFTP(CStr(server), CStr(username), CStr(password))
If success = False Then
    MsgBox "Could not connect to FTP server: " & server, 16
    WScript.Quit
End If

' Download a file. You're now in vbs folder
' The downloaded file will overwrite the existing one on local computer
localFilename = "C:\Program Files\IVR\IVR_Announcement\Data\$RV_LINEID\IVR_Announcement.mdb"
remoteFilename = "/farzadincco\IVR_Announcement.mdb"
success = ftp.GetFile(CStr(remoteFilename), CStr(localFileName), True)
If success = False Then
    MsgBox "Could not download file: " & remoteFilename
    WScript.Quit
End If

ftp.CloseFTP
Set fpt = Nothing

Set vg = CreateObject("VoiceGuide.CommandLink")
vg.Run_ResultReturn $RV_LINEID, "[success]{"& success &"}"

Share this post


Link to post

thanks, the key was to place WScript.Quit before vg.Run_ResultReturn call.

Thanks gain.

Share this post


Link to post

I think you must mean placing a vg.Run_ResultReturn call before the WScript.Quit call...

 

If you have WScript.Quit before vg.Run_ResultReturn then vg.Run_ResultReturn would never get called.

 

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
×