VoiceGuide IVR Software Main Page
Jump to content

Want To Pull Log Entry

Recommended Posts

Looked through the forum, couldn't find anything on this. I was wondering if there's any set variable or way to pull the entire call log entry to the VGL file (*.vgl) for ability to save as text somewhere, to be used for other purposes. The log entry in raw format would be preferred. I was particularly wondering if there's any simple method, similar to the $RV_* method of naming variables, that can be used from within a script.

Share this post


Link to post

Have you had a look at the COM functions:

 

RvGet

RvGet_All

RvGet_AllXml

 

and

 

RvSet

RvSet_RvList

 

You can use these functions from within VoiceGuide, or from external applications to read/set RV's in VoiceGuide...

 

If these functions are not enough could you please provide an example of what you need to do and we could then suggest of how it can be done...

Share this post


Link to post

I've looked at these functions, but I don't think this is what I need. These functions are fine to be used in scripts, although what I'm looking for specifically is a way to get all steps through the script taken by a user (the log, basically) in a text format, to be ready for immediate insertion into a database. For example, I used $RV_STARTTIME for the date and time of the call in my database insert. I'm interested in a similar method of inserting a value containing all the entries found in the log for that single call.

 

Is there a way to do this with a single reference, or will a script need to be written to associate the values I want with a variable?

Share this post


Link to post

Have you tried using the function RvGet_AllXml ?

 

While VoiceGuide is handling a call (or after call hangup) please run the VB Script below (it’s the same script as quoted in VG Help file).

set vg = CreateObject("VoiceGuide.CommandLink")
'see what Result Varaibles are currently defined on current line
sReturnValue = vg.RvGet_AllXml($RV_LINEID)
set vg = Nothing
MsgBox sReturnValue

To run the script just save the above in a file with a .VGS suffix and double click on that file – the VB Script contained in that file will then be executed by Windows.

 

The returned information is in XML format which makes it easy to insert into most databases…

Share this post


Link to post

I've successfully written the script you mentioned, although my issue now is taking the relevant data (sReturnValue) and passing it to the Database Query function/module. I want to do an insert with the sReturnValue information, but at the moment, the script runs and then stops. I have "on {success} goto [Database insert]", but it doesn't seem to function that way. How can I use the VB Script information in that module and pass it to a Database Query module? This is all done in the VGS file that is run on hangup.

Share this post


Link to post

I have an IVR that requires a database entry be made for each step the caller takes-- it sounds like you are looking for something similar.

 

What I've done is write a database insert query for each step. It's painful, but it works and there isn't really any delay so it doesn't interrupt the caller.

 

The first step of my IVR is to assign a unique call identifier to a RV. Then, for eachstep, I write the call identifier, the time, and the step to a database. Then on hangup, I record all of the call's general information, Caller ID, the unique call identifier, etc. to a different database. It gives me pretty comprehensive information.

Share this post


Link to post

To return data from VBScript back to VoiceGuide you need to use the Script_Return COM function.

 

So your VBScript should look something like this:

 

set vg = CreateObject("VoiceGuide.CommandLink")

sReturnValue = vg.RvGet_AllXml($RV_LINEID)

vg.Script_Return iLineId, "[DataToSave]{" & sReturnValue & "}"

set vg = Nothing

 

and then in a following DB Query module you should use:

 

$RV[DataToSave]

 

as part of your SQL statement to insert the data into your database.

 

I'd suggest reading the VG Help file's entry on the VB Script Module:

http://www.voiceguide.com/vghelp/html/modVbs.htm

Share this post


Link to post

I've made the changes to use the Script_Return function, although the variable does not seem to have been carried through to the Database Query (nothing is inserted into the database for that field).

 

Since this is being run on hangup, I'm writing the VGS file manually, not through the software. So the VB Script is the Start Module, and I want to pass the DataToSave (as indicated in the example you gave me) information simply to the Database Query module. I've read the documentation, and I know that for success the VB Script needs to find a file on exit. Is this file required for the Database Query to successfully use the data (the RV) I need? I can run the Query after the VB Script by using "on {fail} goto" and then indicating the Database Query, but I don't know that the data has been kept or passed.

 

Am I missing something here?

 

Oh, and CSI, thanks for the recommendation. That is what I'm trying to do, although the amount of work involved in using your approach would require more than the amount of time I have available to do this.

Share this post


Link to post

When using Script_Return COM function there is no need for any result files to be written as well - the Script_Return function returns information to VG...

 

Please .ZIP up and post here both your scripts and the trace file capturing a call on your system.

(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

Both the script and trace are small, so I'll put them here.

 

The script:

Version=5.0
DefaultModuleDisplayHeight=
StartModule=Return value
RunAtHangup=
StartWithoutAnswer=0
CtmAsiName=

[Return value]
Type=Run VB Script
DispSize=69
Txt=Get the full XML sequence of the call steps taken.
set vg = CreateObject("VoiceGuide.CommandLink")
'see what Result Varaibles are currently defined on current line
sReturnValue = vg.RvGet_AllXml($RV_LINEID)
vg.Script_Return iLineId, "[DataToSave]{" & sReturnValue & "}"
set vg = Nothing


on {success} goto [Database insert]
on {fail} goto [Database insert]

Position=208,108

[Database insert]
Type=Database Query
DispSize=69
Txt=Search the database for data. You can then use the returned results later in your script 

(see Result Variables), eg: in the Say Number module or as parameters to the program calles in a Run Program module.
DbDatabase=RPA
DbUser=
DbConnectString=ODBC;DRIVER={SQL Server};UID=sa;PWD=****
DbSql=INSERT INTO CallInformation (surveyID, callDateTime, callerIDNumber, callerIDName, callPath)  VALUES ('25', '$RV_STARTTIME', '$RV_CIDNUMBER', '$RV_CIDNAME', '$RV[DataToSave]')

Position=208,106

 

And the trace:

124840.32  9 linedevstate 2048 0 0
124840.32  9 callstate OFFERING 66501 0 4
124840.32  9 Answer the call at 4/27/2004 12:48:40 PM
124840.36  9 lineAnswer(66501) => 66091
124840.36  9 Lev_CallerID [9734372125,MCI]
124840.37  9 Lev_CallerID [9734372125,MCI]
124840.37  9 callinfo CALLEDID
124840.37  9 callinfo ORIGIN
124840.37  9 ring 0
124840.90  9 callstate CONNECTED 66501,1,0
124840.90  9 WorkingModeTAPI@Connected=
124840.90  9 WorkingModeScript@Connected=
124840.93  9 Inband detection not enabled
124840.93  9 StartLoadedVgs at 4/27/2004 12:48:40 PM
124840.93  9 tapi  Reply (LineEvReply) ok 66091 0
124840.94  9 [Intro] Playing
124840.94  9 [Intro] Playing (C:\Program Files\VoiceGuide\Scripts\rpa\sounds\intro.wav)
124840.95  9 PlaySoundStart err=[0 play  PlaySoundStart ResetWavOutAndContinuePlay=>2] file[C:\Program Files\VoiceGuide\Scripts\rpa\sounds\intro.wav]
124841.06  9 PlaySoundStart line[9] err=[0 wavec waveOutOpen(0x0, 0x3, 0x3ee7688, 0x0, 0x0, 0x1) => 2 (MMSYSERR_BADDEVICEID) - format query] [C:\Program Files\VoiceGuide\system\voice\ErrorPlayingFile.wav]
124841.06  9 For Dialogic use: PCM 11Khz 8bit Mono
124841.06  9 Hanging up call... [srlib PlaySoundStart]
124841.07  9 RecSoundStop ok
124841.07  9 PlaySoundStop ok
124841.07  9 fnHangupCall end
124841.07  9 RunModule PLAY end
124841.08  9 tapie PlayEnd old line=9 0 7652
124841.08  9 tapie PlayEnd old line=9 0 7652
124842.95  9 linedevstate 2048 0 0
124842.95  9 callstate IDLE 66501 0 0
124842.95  9 WorkingMode@Idle=
124843.04  9 After Hangup script:[C:\Program Files\VoiceGuide\Scripts\databaseonhangup.vgs]
124843.04  0 Script Load C:\Program Files\VoiceGuide\Scripts\databaseonhangup.vgs
124843.10  9 Loaded VbsAtHangup into:2
124843.11  9 tapi  Reply (LineEvReply) ok 65698 0
124843.12  9 [Return value] Running VB Script...
124843.14  9 Run Script waiting... (shellid=2328, process=1380)
124844.11  9 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE
124844.11  9 task completed (shellid=2328, process=1380)
124844.12  9 No information returned from program to VG (no VGRUNRESULT_9.TXT or SHLRESLT.TXT)
124844.12  9 [Database insert] DB Query
124844.13  9 ODBC mode used 
124844.56  9 RVreplace start (strlen>100)
124844.56  9 About to execute Action Query
124844.57  9 Hanging up call... [srlib 282]
124844.57  9 HangupCall_Common Mode=AfterHangupRun
124844.57  9 ReinitTelephony due to IDLE start
124844.58  9 tapic lineDeallocateCall(MainCall:66501) 0
124844.63  9 lineOpen(9) => 0
124844.63  9 Waiting for a call...
124844.63  9 lineOpen(9)LineHandle=65664

 

The DB Query runs, but there is nothing inserted into callPath. Not just for the call listed above, but for the previous several calls.

Share this post


Link to post

I can see where the oversight was...

 

The first parameter to function Script_Return is the ID of the line to which the results need to be returned.

 

In your current VBScript you are specifying iLineId - but that variable was not assigned any value...

 

You should be using:

 

set vg = CreateObject("VoiceGuide.CommandLink")

sReturnValue = vg.RvGet_AllXml($RV_LINEID)

vg.Script_Return $RV_LINEID, "[DataToSave]{" & sReturnValue & "}"

set vg = Nothing

 

or:

 

iLineId = $RV_LINEID

set vg = CreateObject("VoiceGuide.CommandLink")

sReturnValue = vg.RvGet_AllXml(iLineId)

vg.Script_Return iLineId, "[DataToSave]{" & sReturnValue & "}"

set vg = Nothing

 

(I see that initial script snippet supplied used iLineId without initializing it first as well - looks like that script snippet was incomplete and that's what caused the confusion...)

Share this post


Link to post

Ah yes, I can see that now. It was easy to overlook. I've made the correction, but it's still not submitting anything to that field in the database. Is there anything else I've missed? All the other fields are being properly filled. There is no change to the event trace to indicate errors.

 

Again, here's the VGS file:

Version=5.0

DefaultModuleDisplayHeight=

StartModule=Return value

RunAtHangup=

StartWithoutAnswer=0

CtmAsiName=

 

[Return value]

Type=Run VB Script

DispSize=69

Txt=Get the full XML sequence of the call steps taken.

iLineId = $RV_LINEID

set vg = CreateObject("VoiceGuide.CommandLink")

'see what Result Varaibles are currently defined on current line

sReturnValue = vg.RvGet_AllXml(iLineId)

vg.Script_Return iLineId, "[DataToSave]{" & sReturnValue & "}"

set vg = Nothing

 

on {success} goto [Database insert]

on {fail} goto [Database insert]

 

Position=208,108

 

[Database insert]

Type=Database Query

DispSize=69

Txt=Search the database for data. You can then use the returned results later in your script (see Result Variables), eg: in the Say Number module or as parameters to the program calles in a Run Program module.

DbDatabase=RPA

DbUser=

DbConnectString=ODBC;DRIVER={SQL Server};UID=sa;PWD=***

DbSql=INSERT INTO CallInformation (surveyID, callDateTime, callerIDNumber, callerIDName, callPath)  VALUES ('25', '$RV_STARTTIME', '$RV_CIDNUMBER', '$RV_CIDNAME', '$RV[DataToSave]')

 

Position=208,106

Share this post


Link to post

Please post the file vbs_9_1.vbs from VG's \data\ subdirectory. - that file contains the VBScript as it was actually executed after all of the Result Variable substitutions were made..

(If you are using older version of VG that file may just be called vbs_9.vbs)

 

Which version of VG are you using? Looking at the trace I can see it's not v5.2.1 as the Result Variable tracing substitution (which would be very helpful right now in resolving the problem) is not present. Can you install v5.2.1 and try with that version?

 

Note that COM interface was only introduced in v5.0 of VG - no COM commands will work in v4.9 or prior...

Share this post


Link to post

I had a closer look at that VGS file you posted:

Version=5.0

DefaultModuleDisplayHeight=

StartModule=Return value

RunAtHangup=

StartWithoutAnswer=0

CtmAsiName=

 

[Return value]

Type=Run VB Script

DispSize=69

Txt=Get the full XML sequence of the call steps taken.

iLineId = $RV_LINEID

set vg = CreateObject("VoiceGuide.CommandLink")

'see what Result Varaibles are currently defined on current line

sReturnValue = vg.RvGet_AllXml(iLineId)

vg.Script_Return iLineId, "[DataToSave]{" & sReturnValue & "}"

set vg = Nothing

 

on {success} goto [Database insert]

on {fail} goto [Database insert]

 

Position=208,108

 

[Database insert]

Type=Database Query

DispSize=69

Txt=Search the database for data. You can then use the returned results later in your script (see Result Variables), eg: in the Say Number module or as parameters to the program calles in a Run Program module.

DbDatabase=RPA

DbUser=

DbConnectString=ODBC;DRIVER={SQL Server};UID=sa;PWD=***

DbSql=INSERT INTO CallInformation (surveyID, callDateTime, callerIDNumber, callerIDName, callPath)  VALUES ('25', '$RV_STARTTIME', '$RV_CIDNUMBER', '$RV_CIDNAME', '$RV[DataToSave]')

 

Position=208,106

 

Did you by any chance edit the .VGS file directly in a text editor?

Both .VGS files you posted are invalid - the VBScript info would not have been loaded by VG as it is missing a few important information bits... Try loading those files in VoiceGuide's Script Editor and you'll see the VBScript information does not get loaded at all....

 

I'd suggest using the script editor to create your script.

 

here is what it should look like when viewed as a text file, the important bits which are missing in your VGS files are highlighted:

 

Version=5.0

DefaultModuleDisplayHeight=

StartModule=Return value

RunAtHangup=

StartWithoutAnswer=0

CtmAsiName=

 

[Return value]

Type=Run VB Script

DispSize=69

Txt=Get the full XML sequence of the call steps taken.

VbsFileToRun=

VbsWait=1

VbScript=iLineId = $RV_LINEID

set vg = CreateObject("VoiceGuide.CommandLink")

'see what Result Varaibles are currently defined on current line

sReturnValue = vg.RvGet_AllXml(iLineId)

vg.Script_Return iLineId, "[DataToSave]{" & sReturnValue & "}"

set vg = Nothing

VbsHoldPlay=

on {success} goto [Database insert]

on {fail} goto [Database insert]

 

Position=103,59

 

[Database insert]

Type=Database Query

DispSize=69

Txt=Search the database for data. You can then use the returned results later in your script (see Result Variables), eg: in the Say Number module or as parameters to the program calles in a Run Program module.

DbDatabase=RPA

DbUser=

DbConnectString=ODBC;DRIVER={SQL Server};UID=sa;PWD=***

DbSql=INSERT INTO CallInformation (surveyID, callDateTime, callerIDNumber, callerIDName, callPath)  VALUES ('25', '$RV_STARTTIME', '$RV_CIDNUMBER', '$RV_CIDNAME', '$RV[DataToSave]')

 

Position=115,189

 

If you are using a text editor to edit .VGS files then try pasting above in your .VGS file...

 

If you still have the problems after saving with Script Editor then post the file saved by script editor please.

Share this post


Link to post

All right, I put it in the script editor, saved it, and tried it again. The trace is very interesting this time:

 

230225.22  9 linedevstate 2048 0 0
230225.22  9 callstate OFFERING 66305 0 4
230225.24  9 Lev_CallerID [##########,ERIC]
230225.24  9 callinfo CALLEDID
230225.26  9 callinfo ORIGIN
230225.26  9 ring 0
230231.23  9 ring 2
230231.23  9 No old processes from last call (could not obtain handle) 1568, 1384
230231.23  9 Answer the call at 4/27/2004 11:02:31 PM
230231.23  9 lineAnswer(66305) => 66322
230231.77  9 callstate CONNECTED 66305,1,0
230231.77  9 WorkingModeTAPI@Connected=
230231.77  9 WorkingModeScript@Connected=
230231.82  9 Inband detection not enabled
230231.82  9 StartLoadedVgs at 4/27/2004 11:02:31 PM
230231.82  9 rv    add [$RV_STARTTIME]{4/27/2004 11:02:31 PM}
230231.82  9 rv    add [$RV_DEVICEID]{9}
230231.82  9 rv    add [$RV_CIDNAME]{ERIC}
230231.82  9 AddRVns [PathApp]{C:\Program Files\VoiceGuide\}
230231.84  9 rv    add [$RV_CIDNUMBER]{##########}
230231.84  9 tapi  Reply (LineEvReply) ok 66322 0
230231.84  9 TimeoutClear
230231.84  9 [Intro] Playing
230231.84  9 [Intro] Playing (C:\Program Files\VoiceGuide\Scripts\rpa\sounds\intro.wav)
230231.84  9 PlaySoundStart err=[0 play  PlaySoundStart ResetWavOutAndContinuePlay=>2,play  pss   EnsureWaveOutIsOpenAndReady=>play  waveOutOpen failed MMSYSERR_BADDEVICEID] [C:\Program Files\VoiceGuide\Scripts\rpa\sounds\intro.wav]
230231.85  9 PlaySoundStart err=[0 play  PlaySoundStart ResetWavOutAndContinuePlay=>2,play  pss   EnsureWaveOutIsOpenAndReady=>play  waveOutOpen failed MMSYSERR_BADDEVICEID] [C:\Program Files\VoiceGuide\system\voice\ErrorPlayingFile.wav]
230231.85  9 For Dialogic use: PCM 11Khz 8bit Mono
230231.87  9 rv    add [Hangup Time]{4/27/2004 11:02:31 PM}
230231.87  9 Hanging up call... [srlib PlaySoundStart]
230231.87  9 RecSoundStop ok
230231.88  9 PlaySoundStop err=0
230231.88  9 TimeoutSet 2 EV_TIMEOUT_WAITFORIDLEAFTERLINEDROP
230231.88  9 fnHangupCall end
230231.88  9 RunModule PLAY end
230231.88  9 tapie PlayEnd old line=9 0 928545
230231.88  9 tapie PlayEnd old line=9 0 928545
230231.88  9 callinfo MONITORMODES
230233.80  9 linedevstate 2048 0 0
230233.80  9 callstate IDLE 66305 0 0
230233.80  9 WorkingMode@Idle=
230233.80  9 TimeoutClear
230233.91  9 After Hangup script:[C:\Program Files\VoiceGuide\Scripts\databaseonhangup.vgs]
230233.91  0 LoadedVgs_Find C:\Program Files\VoiceGuide\Scripts\databaseonhangup.vgs at idx=3
230233.91  9 TimeoutClear
230233.91  9 [Return value] Running VB Script...
230233.93  9 RVreplace start: [iLineId = $RV_LINEID
set vg = CreateObject("VoiceGuide.CommandLink")
'see what Result Variables are currently defined on current line
sReturnValue = vg.RvGet_AllXml(iLineId)
vg.Script_Return iLineId, "[DataToSave]{" & sReturnValue & "}"
set vg = Nothing

]
230233.93  9 RVns [PathSysVoice]{C:\Program Files\VoiceGuide\system\voice\}[PathApp]{C:\Program Files\VoiceGuide\}[PathDataVm]{C:\Program Files\VoiceGuide\data\}[PathVgSys]{C:\Program Files\VoiceGuide\system\}[$RV_STARTTIME]{4/27/2004 11:02:31 PM}[$RV_DEVICEID]{9}[$RV_CIDNAME]{ERIC}[PathApp]{C:\Program Files\VoiceGuide\}[$RV_CIDNUMBER]{##########}[Hangup Time]{4/27/2004 11:02:31 PM}
230233.00  9 Run Script waiting... (shellid=1568, process=1416)
230233.00  9 TimeoutSet 1 EV_TIMEOUT_CHECKONSTATE
230233.00  9 tapi  Reply (LineEvReply) ok 66287 0
230234.05  9 cl    RvGet_AllXml 
230234.05  9 cl    Script_Return [DataToSave]{<$RV_STARTTIME>4/27/2004 11:02:31 PM</$RV_STARTTIME><$RV_DEVICEID>9</$RV_DEVICEID><$RV_CIDNAME>ERIC</$RV_CIDNAME><$RV_CIDNUMBER>##########</$RV_CIDNUMBER><Hangup Time>4/27/2004 11:02:31 PM</Hangup Time>}
230234.05  9 rv    add [Hangup Time]{4/27/2004 11:02:34 PM}
230234.05  9 Hanging up call... [scr   return from [Return value] failed - stack empty.]
230234.05  9 HangupCall_Common Mode=AfterHangupRun
230234.07  9 ReinitTelephony due to IDLE
230234.07  9 tapic lineDeallocateCall(MainCall:66305) 0
230234.41  9 lineOpen(9)=>
230234.41  9 Waiting for a call...
230234.41  9 LineHandle=66288
230234.42  9 TimeoutSet 3 EV_TIMEOUT_ATERIDLE_ALLOWOUT
230237.32  9 Timer fired EV_TIMEOUT_ATERIDLE_ALLOWOUT
230237.32  9 ScriptEventCode 9013 iLineState=900

 

Here's what the script editor left the script as (after I made the edits you indicated).

Version=5.0
DefaultModuleDisplayHeight=
StartModule=Return value
RunAtHangup=
StartWithoutAnswer=0
CtmAsiName=

[Return value]
Type=Run VB Script
DispSize=69
Txt=Get the full XML sequence of the call steps taken.
VbsFileToRun=
VbsWait=1
VbScript=iLineId = $RV_LINEID
set vg = CreateObject("VoiceGuide.CommandLink")
'see what Result Variables are currently defined on current line
sReturnValue = vg.RvGet_AllXml(iLineId)
vg.Script_Return iLineId, "[DataToSave]{" & sReturnValue & "}"
set vg = Nothing

VbsHoldPlay=
on {success} goto [Database insert]
on {fail} goto [Database insert]

Position=208,108

[Database insert]
Type=Database Query
DispSize=69
Txt=Search the database for data. You can then use the returned results later in your script (see Result Variables), eg: in the Say Number module or as parameters to the program calles in a Run Program module.
DbDatabase=RPA
DbUser=
DbConnectString=ODBC;DRIVER={SQL Server};UID=sa;PWD=***
DbSql=INSERT INTO CallInformation (surveyID, callDateTime, callerIDNumber, callerIDName, callPath)  VALUES ('25', '$RV_STARTTIME', '$RV_CIDNUMBER', '$RV_CIDNAME', '$RV[DataToSave]')

Position=495,126

Share this post


Link to post

OK, we see that the VBScript is working now, with Script_Return function returning information to VG.

 

Please use the COM function Run_ResultReturn instead of Script_Return

 

...should have picked up earlier that we advised you to use an incorrect COM function to return data from VBScript - Script_Return causes VG to return to calling script, Run_ResultReturn is what should be used in your case...

Share this post


Link to post

That did it. Thank you! It was an epic struggle, but it's finally working as it was originally intended to work. I greatly appreciate your assistance on this.

Share this post


Link to post

Eric, Looks from these scripts that you provide support for MCI's outbound sales harrassment division. 973-437-2125? 410-864-0019? 514-667-5260? Look your trunk numbers up on the internet, and you will find lots of pissed off people who ARE ON the national do not call registry (including myself) who are getting 2 to 3 call attempts per day from MCI. How do you sleep at night? Lots of FCC complaints will be mitigated, I'm sure. For now, I just wanted to know how you sleep. I will now return you to the forum full of more appropriate technical troubleshooting materials.

Share this post


Link to post

Just a comment about DNC (Do Not Call) lists:

 

VoiceGuide's Telephone Number Loader application fully supports the Do Not Call list. We have tested it with a recent full DNC list and the numbers on that list are correctly weeded out.

 

That does not of course stop any user from calling a DNC listed number if they are not using the Telephone Number Loader application, or if they do not specify the DNC list when using the Telephone Number Loader.

 

 

 

 

PS.

If you have a complaint with MCI then you should be contacting MCI.

Share this post


Link to post
This topic is now closed to further replies.
×