Result Variables

Result Variables store information on activity in each module during the call.
These Result Variables ($RVs) can then be used later in the VoiceGuide script, allowing the VoiceGuide script to act based on the information in the previously set $RVs.

Result Variables can also be accessed and created/set by external systems, using VoiceGuide's COM/WCF/REST/etc interfaces. This is one of the mechanisms by which external systems can directly monitor and control the progress of the VoiceGuide script in real-time.

Please refer to each module's reference for more information on $RVs created by that module. VoiceGuide vgEngine trace files also contain details of all created/set $RVs.

 

Often Used Result Variables :

$RV[module title]

Used to access the 'main' information saved by a particular module. eg:

Module Type Result Variable will contain
Play The key pressed by the caller
Get Number Sequence The number entered by the caller
Record The last recorded filename.

 

All modules create more then one Result Variable. Please see documentation for each module type and the vgEngine trace file to see what $RVs are created by each module.

The module Result Variables are created for the duration of the call, and all modules running on that line during the call will be able to access them. Even if the script jumps to another script then the next script will still be able to access the Result Variables created by any previous script during current call.

$RV_CIDNAME

Caller's Name (if available). Can be used in Evaluate Expression modules to switch to different areas on the script based on who is the caller.

On traditional analog telephone lines the Caller ID information is often sent between the first and the second Ring. Hence it is usually necessary to set analog systems to answer after the second Ring if this Result Variable is to carry any information. On ISDN and VoIP systems Caller ID is provided at beginning of the call.

$RV_CIDNUMBER

Caller's Telephone Number (if available). Can be used in Evaluate Expression modules to switch to different areas on the script based on who is the caller.

On analog telephone systems the Caller ID information is often sent between the first and the second Ring. Hence it is usually necessary to set analog systems to answer after the second Ring if this Result Variable is to carry any information. On ISDN and VoIP systems Caller ID is provided at beginning of the call.

$RV_DNIS

Telephone number called by the caller. This information is usually only provided on ISDN lines, and is usually used when multiple numbers are terminated the the T1/E1 ISDN line. Using $RV_DNIS the system can then determine which script it should be starting for the call.

$RV_LINEID

Identification number of the line device which is handling this call. Can be used in Run Program module to help the called program generate the appropriate Results filename, or in the COM interface to return results to the correct line. The ID number refers to an internal line ID number - not the position in which that line's status is displayed in VoiceGuide's status window.

$RV_PORTNUMBER

Line Device's position is VoiceGuide's line status listing. Numbering starts from the top, with first line/port having a $RV_PORTNUMBER of 1, the seconds line/port having a $RV_PORTNUMBER of 2, etc.

$RV_STARTTIME

The Date and Time the call was started. The 'Medium' Date format and the 'Long' Time format is used. These formats can be set in the Windows' Control Panel - Regional Settings applet.

$RV_CALLLENGTH

Number of seconds since the call started. Checking the value of this variable during the running of the script can be used to limit length of the call. Also see $RV[CallMaxTime]

$RV_LINESINUSE

Number of lines on system currently busy taking calls.

$RV_LIC_LINES

Number of lines system is licensed for.

$RV_LIC_TYPE

Professional, Professional+Dialer, Enterprise or Enterprise+Dialer

$RV_SOFT_VERSION

Version number of software running.

$RV_RINGCOUNT

Number of rings an incoming call has rung so far. This variable can be used to determine at which point to answer the call if the script was started with the "Start  the script before answering the call" option.

$RV_DIALEDNUMBER

If the call is an outbound call this variable stores the telephone number which was dialed.

$RV_LastKeyPress

Last Key that was pressed, or “timeout” if a timeout event fired.

$RV_PreviousModule

Title of the previous module, ie: from which module the script arrived at the current module.

$RV_EventListXml

Significant events which occurred during the call along with the times when those events occurred. This information is usually used in in system usability analysis.

$RV_CALLSTATE

Current state of call.

$RV_STATUSDISPLAYED

What is currently displayed in the Line Status Monitor.

$RV[RUNAFTERHANGUP]

The filename of the script ran when the caller hangs up. This filename can be set in the Evaluate Expression module. Setting of $RV[RUNAFTERHANGUP] is only valid during the current script. This "OnHangup Script" setting is wiped whenever a goto/gosub is made to another script, and the new script's "OnHanup Script" setting is used.

$RV[module title_RowCount]
$RV[module title_ColumnIndex_RowIndex]

Please see the Database Query module for more information on the two Result Variables above.

$RV_PathScript

The path to the location where the script is located. Does not include the "\" at the end.

$RV_PathVoiceGuide

The path to the location where the VoiceGuide application is located. Does not include the "\" at the end.

$RV[CallMaxTime]

Used to set the maximum time (seconds) a call is allowed to be present on the system.
eg. setting this $RV to 1200 will result in VoiceGuide hanging up the call automatically if the call is on the system for over 20 minutes.

$RV[VoicemailMessage]

$RV[VoicemailMessageXXXX]

The last recorded voicemail message during this call.
$RV[VoicemailMessage] returns the filename of the last recorded voicemail message regardless of in which voicemail box it was recorded.
$RV[VoicemailMessageXXXX] returns the filename of the last recorded voicemail message in a particular voicemail box - which is specified by replacing XXXX with the number of the voicemail box.
The message must be recorded during the current call for them to be accessible using these Result Variables.

$RV[VmbId]

ID of the last voicemail box that was accessed (either logged into or message left for).

 

Outbound dialing related Result Variables

$RV[OutDial_Result]

When the outgoing call has been answered, or the number of retries has been used up, this RV stores the type of outcome. Possible values are: Contacted_Human, Contacted_AM Contacted_Pager, Contacted_Fax, Uncontactable_OnDontDialList, SIT_Reorder, SIT_NoCircuit, SIT_CustIrReg, SIT_Unknown, SIT_Unavailable, Uncontactable_NoAnswer

$RV[OutDial_RetriesLeft]

Number of retries left for an outgoing call. If this is the last call attempt then this RV will have a value of 0.

$RV[OutDial_ID]

ID associated with that call's entry in the callque table.

$RV[OutDial_GUID]

GUID associated with that call's entry in the callque table.

$RV[OutDial_CampaignName]

Campaign Name specified for that call when call was loaded into the system.

$RV[AmWelcMsg_RecLen100ms]

Length of Answering Machine message. in 100ms units. eg: a value of 40 would indicate answering machine message was 4 seconds long.

$RV_CALLTRACK_ContactName

Name attached to loaded number.

$RV_CALLTRACK_ContactData1

Data1 attached to loaded number.

$RV_CALLTRACK_ContactData2

Data2 attached to loaded number.

$RV_CALLTRACK_CampaignName

Campaign Name for the call.

$RV_CALLTRACK_History

Summary of major events for this dialed number.

 

Conference & Call Transfers related Result Variables

$RV[Conf_DevName_X]

The device name of party X in a conference call. eg: $RV[Conf_DevName_2] would be the device name of device carrying the 2nd leg of a call in the "Dial and Conference" call.

$RV[Conf_LineID_X]

The Line number of party X in a conference call. eg: $RV[Conf_LineId_2] would be the Line ID number of device carrying the 2nd leg of a call in the "Dial and Conference" call.

 

Script Branching (Goto/Gosub/Return) related Result Variables

These RVs are set when a Goto or Gosub branch is made to another script. The names are fairly self explanatory:

$RV[ScriptEnd_Time]
$RV[ScriptEnd_Goto_Script]
$RV[ScriptEnd_Goto_Module]
$RV[ScriptStart_Time]
$RV[ScriptStart_CalledFrom_Script]
$RV[ScriptStart_CalledFrom_Module]

 

Current Date/Time Result Variables

$RV_WEEKDAY

Takes on a value between 1 and 7, depending on what day it is. 1 is a Monday and 7 is a Sunday. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the day of the week.

$RV_DD

Takes on a 2 digit value between "01" and "31", depending on what day of the month it is. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on what day of the month it is.

$RV_MM

Takes on a 2 digit value between "01" and "12", depending on what month it is. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the current month.

$RV_YY

Takes on a 2 digit value of current year (eg: "03"). Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the current year.

$RV_HH

Takes on a 2 digit value between "00" and "23", indicating the hour of the current time. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the time of day.

$RV_NN

Takes on a 2 digit value between "00" and "59", indicating the minute of the current time. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the time of day.

$RV_SS

Takes on a value between "00" and "59", indicating the second of the current time. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the time of day.

$RV_MS

Takes on a value between "000" and "999", depending on the millisecond fraction of the current time.

Other Time Related RVs

The following $RVs are also available. They are pretty self-explanatory:

$RV_MONTHNAME, $RV_HOUR, $RV_MINUTE, $RV_SECOND, $RV_TimeStamp_Long, $RV_TimeStamp_Short, $RV_DateStamp_Long, $RV_DateStamp_Short $RV_MONTH, $RV_YEAR, $RV_DATE

eg. use this expression to create a date and time 'timestamp' :

$RV_YY$RV_MM$RV_DD$RV_HH$RV_NN$RV_SS.$RV_MS

 

Where can Result Variables be used

$RVs can be used anywhere in the VoiceGuide script. eg:

  • Specifying the 'trigger' and the destination modules in Paths leaving a module,
  • Filenames of sound files which are to be played or recorded,
  • What digits/dates/amounts are to be spoken to the caller in the Say Number module,
  • Looking up information in a database,
  • As parameters when calling other programs, web services, etc.
  • Evaluate Expression modules,
  • Send Email module: in destination Email address, Title, Message Body and Attachment Filename.

 

Global RVs

Global RV can be preset in VG.INI, in section [Scripts], using an expression that lists multiple RVs on one line, like this:

GlobalRV=[MyValue1]{23}[SomeOption]{yes}[SomeEmail]{admin@xyz.com}

These RVs will then be loaded and set when the VoiceGudie service starts and can be used in scripts. eg. If using example above then $RV[SomeOption] can be used in the scripts.

 

Notes

If a Result Variable is used in the script that has not yet been defined, it will be replaced with nothing (an empty string), not a digit zero.

Eg: If you use expression: C:\SoundFiles\Info$RV[InfoNumber].wav and the script has not yet defined $RV[InfoNumber] then the resulting string after the Result Variables are replaced will be: C:\SoundFiles\Info.wav

 

If $RV are used in Evaluate Exprressions module's comparison expressions it is usually best to use quotes around the RVs which may be empty.
Also, quotes should be used when using RVs in a VBScript in situations where replacement with an empty string could potentially lead to syntax errors unless quotes have been used.