- Contents
Interaction Scripter Developer's Guide
IS_Action_Disconnect
Definition
This call control action provides the ability to disconnect either the
current call that is on the current users queue, or by passing in a valid
callid
of a call, it will disconnect that call. IS_Action_Disconnect
does not generate an error if the party hangs up before this action is
called. This action disconnects an agent from the call specified by the
callid
attribute. The current or active call of the current
campaign in the queue is assumed to be the target of this action if the
callid
attribute is not set. 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).
Attributes
The IS_Action_Disconnect element accepts callid
as an optional
attribute:
- [callid]
-
Optional. The
callid
to which this action applies (e.g. "89900001"). Dialer scripts use the current Dialercallid
by default.A "debug mode" error is logged for non-Dialer scripts if thecallid
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_Disconnect() { IS_Action_Disconnect.callback = function(error) { if (error) { console.error("IS_Action_Disconnect failed."); } else { console.log("IS_Action_Disconnect succeeded."); } } }
Example 1
This example paints a "Disconnect" button that allows the agent to disconnect a call.
<body>
<input type=button name="IS_Action_Disconnect" value="Disconnect">
</body>
Example 2
The "Disconnect" button in this example invokes a user-defined "Disconnect" script function to disconnect a call. When the button is clicked, the actual element that fires the event is a <meta> element in the non-visible <head> section of the document. The <meta> element in the <head> section of the HTML page instantiates the action as a non-visual object.
<head> <meta name="IS_Action_Disconnect"> <script language=javascript> function Disconnect() { IS_Action_Disconnect.click(); } </script> </head>
<body> <input type=button value="Disconnect" onclick='Disconnect();"> </body>
Example 3
This example passes the callid of the call to disconnect.
<head> <meta name="IS_Action_Disconnect"> <script language="javascript"> function IS_DisconnectCall(p_page, p_CallId) { if (p_CallId != null) { IS_Action_Disconnect.callid = p_CallId; } IS_Action_Disconnect.click(); if (p_page != null) location.href = p_page; } </script> </head>
<body> <input type=button value="Disconnect Call" onclick="IS_DisconnectCall(null,IS_ATTR_CallId.value);"> </body>