Feedback

  • Contents
 

IS_Action_PlayWav

Definition

This call control action provides the ability to play a wave file to the call.  Since the web page is hosted in Scripter, wave files can be loaded from the local machine without security issues, since the pages have access to the local file system on the workstation. Usage of this function requires a conference resource. Ensure conference resources have been allocated on the CIC Server. Without these resources, PlayWav will not function. Scripter will recognize click events from any HTML element whose name has an associated action documented in this API (e.g.: "IS_Action_CallComplete"). If the script needs to associate several buttons with the same action, then define the action using a meta element and call the click event on the meta element from the button(s).

NOTE: For custom scripts in Scripter Connect, the wav file specified for the IS_Action_PlayWav action must be located in the Resource Path directory on the CIC server (I3\IC\Resources by default).

Attributes

The IS_Action_PlayWav element has the following attributes:

file

Fully qualified path to a wave audio file. Scripts can optionally stream audio files from the ODS server by specifying http or https URI's.

[callid]

Optional. The CallId to which this action applies (e.g. "89900001"). Dialer scripts use the current Dialer CallId by default.  A "debug mode" error is logged for non-Dialer scripts if the CallId attribute is not specified.

[callback]

The callback property ensures that this action executes asynchronously in Interaction Connect. Starting with 2018 R3, all Interaction Scripter actions (IS_Actions) provide a callback property for use in Connect scripts only. In the example below, statements inside the highlighted callback function block execute only after the action completes. The callback will return an error if the action fails. See Writing custom scripts for Interaction Connect or Scripter .NET.

Here's how to use the .callback property in a script for Interaction Connect:

function IS_Action_PlayWav() {
  IS_Action_PlayWav.file = "\\\\cic2\\recordings\\disclaimer.wav";

  IS_Action_PlayWav.callback = function(error) {     if (error) {       console.error("IS_Action_PlayWav failed.");     } else {       console.log("IS_Action_PlayWav succeeded.");     }   } }

Example 1

This example creates a button that plays a wave audio file. Note that extra backslashes must be added to the .wav filename, since Telephony Services escapes (removes) backslashes.

<html>
<head>
    <meta name="IS_Action_PlayWav">
    <script language="javascript">
        function PlayDisclaimer() {
            IS_Action_PlayWav.file = "\\\\cic2\\recordings\\disclaimer.wav";
            IS_Action_PlayWav.click();
        }
    </script>
</head>
<body>     <button onclick="PlayDisclaimer();">Play Disclaimer</button> </body> </html>

Example 2

<head>
    <meta name="IS_Action_PlayWav">
    <script language="javascript">
        function IS_PlayWaveFileToCall(p_WaveFilePath, p_page) {
            IS_Action_PlayWav.file = p_WaveFilePath;
            IS_Action_PlayWav.click();
            if (p_page != null) location.href = p_page;
        }
    </script>
</head>
<body>     <input type=button value="Place Wave" onclick="IS_PlayWaveFileToCall(‘C:\Temp\PartyOn.wav');"> </body>