- Contents
Interaction Scripter Developer's Guide
ChatObject.SubObjectChangeHandler Callback Property
Definition
Read Yes
Write Yes
Compatibility
This functionality is only available with scripts for Interaction Connect. It is not available in Scripter .Net client.
Syntax
ChatObject.subObjectChangeHandler(TypeId, CallID, ChangeId)
Input Parameters
- TypeId
-
TypeId is an integer that represents the type of sub-object.
2
Call Object
19
Chat Object
20
Conference Object
70
Generic Object
- CallID
-
The Id of the sub-object.
- ChangeId
-
An integer that represents the type of change that occurred in a conference object.
80
A party call changed. This indicates that something changed about the call. For example, placing a call on hold changes the call.
82
A party was deallocated (destroyed). Two minutes have passed since the call was disconnected, and it is being removed from the conference.
83
The call was just added to the conference.
84
The call was just removed from the conference (e.g. transferred to another queue).
Value Assigned
- Function Pointer
-
A function pointer is the address in memory where a user-defined function is loaded. Function pointers pass the address of a user-defined function to another function declared within an application. In a script, the function pointer is simply the name of the function. For example, if your code contains a function named "foo", the function pointer would also be named "foo". When defining your custom function, you may define the following arguments in the function. e.g.: function foo(Type ID, CallID, ChangeID).
Example
The messages property of the chatObject returns an array of messages of that chatInteraction after the chatObject had been initialized. The SubObjectChangeHandler can be an assigned callback that gets alerted with new messages when the chat Interaction receives new messages.
function chatInitialized(){
if(chatObject.messages !== undefined)
{ renderChatBox(chatObject.messages); chatObject.SubObjectChangeHandler = messagesChanged; }
}
function messagesChanged()
{ renderChatBox(chatObject.messages); }
Each message is an object with the following properties:
chatMember.displayName
chatMember.chatMemberType
chatMember.interactionId
chatMember.userId
messageType
text
timestamp