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's vgEngine trace files also contain details of all created/set $RVs.
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.
Note
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:\sound_files\info_$RV[InformationNumber].wav
and the script has not yet defined $RV[InformationNumber] then the resulting string after the Result Variables are replaced will be:
C:\sound_files\info_.wav
If Result Variables are used 'Comparison' type expressions in Evaluate Expression modules, 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.
Often Used Result Variables
$RV[module title]
Used to access the 'main' information associated 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_CIDNUMBER
Caller's Telephone Number.
On traditional analog telephone lines the CallerID information is usually sent between the first and the second ring.
Hence on analog systems the calls must be answered after second ring.
On VoIP and ISDN systems CallerID is provided at beginning of the call.
$RV_CIDNAME
Caller's Name (if available).
On traditional analog telephone lines the CallerID information is usually sent between the first and the second ring.
Hence on analog systems the calls must be answered after second ring.
On VoIP and ISDN systems CallerID is provided at beginning of the call.
$RV_DNIS
Telephone number called by the caller. Provided on VoIP and ISDN lines.
$RV_DNIS is often used to determine which script should handle the call.
eg: an Evaluate Expression module can be used to goto to different scripts based on $RV_DNIS value.
See here for DNIS Routing example.
$RV_DIALEDNUMBER
On outbound call this variable stores the telephone number which was dialed.
$RV_LINEID
Identification number of the line device which is handling this call. 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_PORT
Line Device's position is VoiceGuide's line status listing. The first line/port has $RV_PORT of 1, the second line/port has $RV_PORT of 2, etc.
Some Other Result Variables :
$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_CALLSTATE | Current state of call. |
$RV_STATUSDISPLAYED | What is currently displayed in the Line Status Monitor. |
$RV_CurrentModule | Title of the current module the script is in. |
$RV_PreviousModule | Title of the previous module, ie: from which module the script arrived at the current module. |
$RV_CRN | Call Reference Number as used by Dialogic (in hexadecimal format). |
$RV_CALLCOUNTER | Counter incremented for each call. |
$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_LastKeyPress | Last Key that was pressed, or “timeout” if a timeout event fired. |
$RV_EventList | Events which occurred during the call, including timestamps. |
$RV_EventListXml | Events which occurred during the call (XML Format) |
$RV_EventListJson | Events which occurred during the call (JSON format) |
$RV_CallFlowProgress | Events and state changes that occurred on the call. |
$RV_LINESINUSE | Number of lines currently busy on 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[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[ModuleTitle_RowCount] | |
$RV[ModuleTitle_ColIdx_RowIdx] | 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] | The last recorded voicemail message during this call. |
$RV[VoicemailMessageXXXX] | The last recorded voicemail message during this call. 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 this Result Variable. |
$RV[VmbId] | ID of the last voicemail box that was accessed (either logged into or message left for). |
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=[SomeOption]{true}[MyValue]{23}[SomeEmail]{admin@mydomain.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.
Current Date/Time Result Variables
$RV_WEEKDAY | Weekday. 1 to 7. 1 is Monday, 7 is Sunday. |
$RV_DD | Day. 2 digit value : 01 to 31 |
$RV_MM | Month. 2 digit value : 01 to 12 |
$RV_YY | Year. 2 digit year value |
$RV_HH | Hour. 2 digit value : 00 to 23 |
$RV_12HH | 12H Hour. 2 digit value : 01 to 12 |
$RV_NN | Minute. 2 digit value : 00 to 59. |
$RV_SS | Second. 2 digit value : 00 to 59 |
$RV_MS | Millisecond. 3 digit value : 000 to 999 |
$RV_AMPM | AM or PM |
$RV_UTCZ | UTC time. ISO 8601 Z (Zulu) time. eg: 2021-10-27T18:03:59Z |
$RV_UTCK | UTC time with local timezone offest. eg: 2021-10-27T18:03:59+11:00 |
$RV_MONTHNAME | January, February, etc. |
$RV_HOUR | Hour. 1 to 12 |
$RV_MINUTE | Minute: 0 to 59 |
$RV_SECOND | Second: 0 to 59 |
$RV_TimeStamp_Long | Localle based 'Long' timestamp |
$RV_TimeStamp_Short | Localle based 'Short' timestamp |
$RV_DateStamp_Long | Localle based 'Long' datestamp |
$RV_DateStamp_Short | Localle based 'Short' datestamp |
$RV_MONTH | January, February, etc. |
$RV_YEAR | 4 digit year |
$RV_DATE | Localle based default date/time stamp |
eg. you can use this expression to create a date and time 'timestamp' :
$RV_YY$RV_MM$RV_DD$RV_HH$RV_NN$RV_SS.$RV_MS
Script Branching (Goto/Gosub/Return) related Result Variables
These RVs are set when a Goto or Gosub branch is made to another script:
$RV[ScriptEnd_Time]
$RV[ScriptEnd_Goto_Script]
$RV[ScriptEnd_Goto_Module]
$RV[ScriptStart_Time]
$RV[ScriptStart_CalledFrom_Script]
$RV[ScriptStart_CalledFrom_Module]
SIP Headers
The headers of incoming SIP calls can be accessed using these $RVs:
$RV[sip_header_callid]
$RV[sip_header_contact_display]
$RV[sip_header_contact_uri]
$RV[sip_header_content_disposition]
$RV[sip_header_content_encoding]
$RV[sip_header_content_length]
$RV[sip_header_content_type]
$RV[sip_header_diversion_uri]
$RV[sip_header_event]
$RV[sip_header_expires]
$RV[sip_header_from]
$RV[sip_header_from_display]
$RV[sip_header_referred_by]
$RV[sip_header_refer_to]
$RV[sip_header_remove]
$RV[sip_header_replaces]
$RV[sip_header_request_uri]
$RV[sip_header_to]
$RV[sip_header_to_display]
Other SIP headers to retrieve can be set in VG.INI section [SIP] entry: MonitoredHeaders
eg:
[SIP]
MonitoredHeaders=User-Agent|Diversion
will result in these $RVs being created and holding the value of corresponding header:
$RV[sip_header_User-Agent]
$RV[sip_header_Diversion]
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. |
ACD Agent related Result Variables
$RV_ACD_AGENTID | ID of ACD agent to whom this call is connected to. |
$RV_ACD_AGENTNAME | Name of ACD agent to whom this call is connected to. |
$RV_ACD_AGENTPHONE | Telephone/Extension number of ACD agent to whom this call is connected to. |
$RV_ACD_AGENTSKILLS | Skills assigned to ACD agent to whom this call is connected to. |