The NotifyConferenceUtil API provides methods to manage Notify conference calls and SMS messages for various telephony service providers, such as Zoom and Webex.
Using the NotifyConferenceUtil API you can:
Create new conference calls
Add participants by phone number or user ID
Remove participants from a conference call
Mute participants in a conference call
Unmute participants in a conference call
Obtain the capabilities of a specified service provider
End a conference call
You can use this API in both scoped and global scripts. To use this API you must activate the Conference Notify plugin (com.snc.notify) which requires a separate subscription. For details on activating this plugin, see Activate Notify.
Instantiates a NotifyConferenceUtils object (constructor).
Name
Type
Description
None
function () {
var confGR = new GlideRecord('notify_conference_call');
confGR.get('76d3364d0b5133008e64aabcb4673a6d');
var confUtils = new NotifyConferenceUtils();
var actionResult = confUtils.addToConferenceByPhoneNumber("+917799555331", confGR)
if (actionResult.status)
gs.info('Participant has been added to conference');
else {
gs.info('join operation failed');
actionResult.warnMessages.forEach(function (msg) {
gs.info(msg);
});
actionResult.errorMessages.forEach(function (msg) {
gs.info(msg);
})
}
})();
Adds a participant to a specified conference call using their phone number to identify the participant.
Name
Type
Description
toNumber
String
Phone number of the participant to add to the conference call.
confGR
GlideRecord
GlideRecord of the conference call to which to add the specified participant.Table: Notify Conference Call \[notify\_conference\_call\]
Type
Description
Object
Results of the conference action.`.status`: Status of the conference action. - Data type: Boolean - Possible values: - true: Conference action succeeded - false: Conference action failed `.successMessages`: If *status* is true, success message\(s\), else empty. - Data type: Array of Strings `.warnMessages`: If *status* is false, any warning messages thrown during processing. - Data type: Array of Strings `.errorMessages`: If *status* is false, any error messages thrown during processing. - Data type: Array of Strings
The following code example shows how to call this method.
function () {
var confGR = new GlideRecord('notify_conference_call');
confGR.get('76d3364d0b5133008e64aabcb4673a6d');
var confUtils = new NotifyConferenceUtils();
var actionResult = confUtils.addToConferenceByPhoneNumber("+917799555331", confGR)
if (actionResult.status)
gs.info('Participant has been added to conference');
else {
gs.info('join operation failed');
actionResult.warnMessages.forEach(function (msg) {
gs.info(msg);
});
actionResult.errorMessages.forEach(function (msg) {
gs.info(msg);
})
}
})();
Adds a participant to the conference call referenced by the passed in GlideRecord using their unique user identifier.
Name
Type
Description
userId
String
Sys ID of the participant to add to the specified conference call.Table: User \[sys\_user\]
confGR
GlideRecord
GlideRecord of the conference call to add the specified participant. Table: Notify Conference Call \[notify\_conference\_call\]
Type
Description
Object
Results of the conference action.`.status`: Status of the conference action. - Data type: Boolean - Possible values: - true: Conference action succeeded - false: Conference action failed `.successMessages`: If *status* is true, success message\(s\), else empty. - Data type: Array of Strings `.warnMessages`: If *status* is false, any warning messages thrown during processing. - Data type: Array of Strings `.errorMessages`: If *status* is false, any error messages thrown during processing. - Data type: Array of Strings
The following code example shows how to call this method.
(function () {
var confGR = new GlideRecord('notify_conference_call');
confGR.get('76d3364d0b5133008e64aabcb4673a6d');
var confUtils = new NotifyConferenceUtils();
var actionResult = confUtils.addToConferenceByUserId(gs.getUserID(), confGR)
if (actionResult.status)
gs.info('Participant has been added to conference');
else {
gs.info('join operation failed');
actionResult.warnMessages.forEach(function (msg) {
gs.info(msg);
});
actionResult.errorMessages.forEach(function (msg) {
gs.info(msg);
})
}
})();
Performs the specified conference call action, such as starting/ending a conference call or joining, removing, muting, or unmuting participants from a conference call.
You can start a new conference call and add participants within a single call to this method or call the method multiple times to start the call and then manage participants separately. In addition, through the passed in data object, you can configure the method to:
Save pointers in the conference call record to the specific record (source record), such as an incident or problem, that is the topic of discussion for the conference call.
Allow/disallow multiple conference calls for a source record.
Automatically log the participants that were in the conference call in the "Work Notes" field of the source record.
Have a message read aloud when a participant answers an outgoing call from the conference.
Name
Type
Description
action
String
Defines the conference call action to perform.The following are the available conference call actions:
end: Terminates the conference call identified in data.confId.
join: Adds the participant specified in the data.items array to the conference call identified in data.confId.
kick: Removes the participant specified in the data.items array from the conference call identified in data.confId.
multiJoin: Adds the participants specified in the data.items array to the conference call identified in data.confId
multiKick: Removes the participants specified in the data.items array from the conference call identified in data.confId.
multiMute: Mutes the participants specified in the data.items array on the conference call identified in data.confId.
multiUnmute: Unmutes the participants specified in the data.items array from the conference call identified in data.confId.
mute: Mutes the participant specified in the data.items array on the conference call identified in data.confId.
selfJoin: Adds the currently logged in user to the conference call (no entry in data.items required.)
start: Starts the conference call identified in data.confId.
unmute: Unmutes the participant specified in the data.items array from the conference call identified in data.confId.
data
Object
Object that describes the conference call.
data.addToWorkNotes
Boolean
Flag that indicates whether to add information about the participants that were included in the conference call in the work notes field of the associated record. For this functionality to work, you must also specify values in the data.table and data.sysId parameters. These parameters identify the record in which to add the work notes.
Default: false
Actions for which this parameter is valid:
join
multiJoin
selfJoin
start
data.allowMulticonference
Boolean
Flag that indicates whether to allow multiple conference calls for a specific record at one time. For this functionality to work, you must also specify values in the data.table and data.sysId parameters. These parameters identify the record that is allowed to have multiple conference calls.
Default: false
Actions for which this parameter is valid:
start
data.confId
String
Sys_id of the conference call. Table: Notify Conference Call [notify_conference_call]
Actions for which this parameter is required:
end
join
multiJoin
selfJoin
Note: Participant actions such as mute, unmute, and kick don't require this parameter to be set as the method obtains this information from the Notify Conference Call Participant [notify_participant] table.
data.fromNumber
String
Service provider number to call into for the conference call. Locate this value in the Number or Phone number column of the Notify Phone Number \[notify\_number\] table. Actions for which this parameter is required: - start
data.isNewConference
Boolean
Flag that indicates whether this is a new or an existing conference call. Valid values: - true: New conference call - false: Existing conference call Default: false Actions for which this parameter is valid: - start
data.items
Array
Information for each participant to include in the conference call. Valid array values:
id: Sys_id of user; located in the User [sys_User] table.
Valid actions: join, multiJoin, start
notifyParticipantId: Sys ID of the Notify participant; located in the Notify Participant [notify_participant] table.
phoneNumber: Phone number of the participant. If this value is passed in conjunction with either the id or notifyParticipantId, this value supersedes the phone numbers in the user/participant record and is used to place the call.
Valid actions: join, multiJoin, start
email: Email address of the participant.
Valid actions: join, multiJoin, start
data.message
String
Message that is read aloud when a user answers the call, such as, "P1 incident has been created please login to instance." Actions for which this parameter is valid: - join - multiJoin - start
data.serviceProvider
String
Required. Name of conference service provider, such as Zoom or Webex. Actions for which this parameter is required: - all
data.sysId
String
Sys_id of the source record to associate with the conference call. For example, if a conference call is held to discuss a specific incident or problem, put the sys_id of the incident or problem record in this value. This sys_id is stored in the Source column of the NotifyConference Call [notify_conference_call] table and can later be tracked.
This parameter is used in conjunction with the data.Table, data.addToWorkNotes, and allowMulticonference parameters.
Actions for which this parameter is valid:
start
data.table
String
Table that contains the source record to associate with the conference call. A source record can be any record, such as an "incident" or "problem", that is the topic of discussion in the conference call. This table name is stored in the Table column of the NotifyConference Call [notify_conference_call] table and can be tracked.
This parameter is used in conjunction with the data.sysId, data.addToWorkNotes, and allowMulticonference parameters.
Actions for which this parameter is valid:
start
Type
Description
Object
Results of the conference action.`.status`: Status of the conference action. - Data type: Boolean - Possible values: - true: Conference action succeeded - false: Conference action failed `.successMessages`: If *status* is true, success message\(s\), else empty. - Data type: Array of Strings `.warnMessages`: If *status* is false, any warning messages thrown during processing. - Data type: Array of Strings `.errorMessages`: If *status* is false, any error messages thrown during processing. - Data type: Array of Strings
(function (confId) {
var confUtils = new NotifyConferenceUtils();
var data = confUtils.getConferenceInputDataTemplate();
data.table = 'incident';
data.sysId = '1234';
data.addToWorkNotes = false;
data.confId = confId;
data.message = 'p1 incident has been created';
data.fromNumber = 'twilio/Telephony driver number';
data.items.push({ id: 'user3SysId', phoneNumber: '+917799555332' });
data.items.push({ id: 'user4SysId', email: 'yln99518@gmail.com' });
var result = confUtils.doConferenceAction('start', data);
if (result.status) {
gs.info('Start conference action succeeded');
} else
gs.info('Start conference action failed');
result.errorMessages.forEach(function (msg) {
gs.info(msg);
});
result.warnMessages.forEach(function (msg) {
gs.info(msg);
});
result.successMessages.forEach(function (msg) {
gs.info(msg);
});
})('activeConfSysId');
Returns a JSON data template to use with the doConferenceAction() method. Using this template automatically structures the data object so that you don't have to manually create it.
Call this method prior to calling the doConferenceAction() method. For the desired conference call action, set the desired parameters within the template, and then pass the template in the doConferenceAction() call. For additional information on the valid parameters for each action, see doConferenceAction().
Note: This is a helper method. You can also manually construct this object and pass that object into the doConferenceAction() method and have the same outcome.
Name
Type
Description
None
Type
Description
data
Object that describes the conference call.
data.addToWorkNotes
Flag that indicates whether to add information about the participants that were included in the conference call in the work notes field of the associated record. For this functionality to work, you must also specify values in the data.table and data.sysId parameters. These parameters identify the record in which to add the work notes.
Default: false
Actions for which this parameter is valid:
join
multiJoin
selfJoin
start
data.allowMultconference
Flag that indicates whether to allow multiple conference calls for a specific record at one time. For this functionality to work, you must also specify values in the data.table and data.sysId parameters. These parameters identify the record that is allowed to have multiple conference calls.
Default: false
Actions for which this parameter is valid:
start
data.confId
Sys_id of the conference call. Table: Notify Conference Call [notify_conference_call]
Actions for which this parameter is required:
end
join
multiJoin
selfJoin
Note: Participant actions such as mute, unmute, and kick don't require this parameter to be set as the method obtains this information from the Notify Conference Call Participant [notify_participant] table.
data.fromNumber
Service provider number to call into for the conference call. Locate this value in the Number or Phone number column of the Notify Phone Number \[notify\_number\] table. Actions for which this parameter is required: - start
data.isNewConference
Flag that indicates whether this is a new or an existing conference call. Valid values: - true: New conference call - false: Existing conference call Default: false Actions for which this parameter is valid: - start
data.items
Information for each participant to include in the conference call. Valid array values:
id: Sys_id of user; located in the User [sys_User] table.
Valid actions: join, multiJoin, start
notifyParticipantId: Sys ID of the Notify participant; located in the Notify Participant [notify_participant] table.
phoneNumber: Phone number of the participant. If this value is passed in conjunction with either the id or notifyParticipantId, this value supersedes the phone numbers in the user/participant record and is used to place the call.
Valid actions: join, multiJoin, start
email: Email address of the participant.
Valid actions: join, multiJoin, start
data.message
Message that is read aloud when a user answers the call, such as, "P1 incident has been created please login to instance." Actions for which this parameter is valid: - join - multiJoin - start
data.serviceProvider
Required. Name of conference service provider, such as Zoom or Webex. Actions for which this parameter is required: - all
data.sysId
Sys_id of the source record to associate with the conference call. For example, if a conference call is held to discuss a specific incident or problem, put the sys_id of the incident or problem record in this value. This sys_id is stored in the Source column of the NotifyConference Call [notify_conference_call] table and can later be tracked.
This parameter is used in conjunction with the data.Table, data.addToWorkNotes, and allowMulticonference parameters.
Actions for which this parameter is valid:
start
data.table
Table that contains the source record to associate with the conference call. A source record can be any record, such as an "incident" or "problem", that is the topic of discussion in the conference call. This table name is stored in the Table column of the NotifyConference Call [notify_conference_call] table and can be tracked.
This parameter is used in conjunction with the data.sysId, data.addToWorkNotes, and allowMulticonference parameters.
Actions for which this parameter is valid:
start
(function (confId) {
var confUtils = new NotifyConferenceUtils();
var data = confUtils.getConferenceInputDataTemplate();
data.confId = confId;
var result = confUtils.doConferenceAction('end', data);
if (result.status) {
gs.info('Conference call has been ended');
} else
gs.info('End conference call action failed');
result.errorMessages.forEach(function (msg) {
gs.info(msg);
});
result.warnMessages.forEach(function (msg) {
gs.info(msg);
});
result.successMessages.forEach(function (msg) {
gs.info(msg);
});
})('activeConfSysId');
Returns the capabilities of all telephony service provider drivers in the instance.
Possible capabilities include:
archive: archives the conference after it ends
beepOnLeave: plays a "beep" tone when a participant leaves the conference call
beepOnJoin: plays a "beep" tone when a participant joins the conference call
end: ends the identified conference call
filesharing: allows file sharing between participants
join: adds a participant to a conference call
kick: removes a participant from a conference call
multiJoin: adds multiple participants to a conference call
multiKick: removes multiple participants from a conference call
muteOnJoin: mutes a participant when they initially join a conference call
multiUnmute: unmutes multiple participants for a conference call
record: records conference calls
recording: provides an on-screen indicator when the conference call is being recorded
screenSharing: allows participant screens to be shared with the group
selfJoin: adds the current logged in user to a conference call
speaking: provides an on-screen message as to who is currently speaking
start: starts the identified conference call
unmute: unmutes a participant in a conference call
Name
Type
Description
None
Type
Description
Object
Key-value pairs of the status of each driver capability.Valid values: - isSupported = 0: capability is not supported - isSupported = 1: capability is supported
List driver capabilities for all telephony service provider drivers in the instance.
(function () {
var confUtils = new NotifyConferenceUtils();
var providerToCapability = confUtils.getServiceProvidersCapabilites();
for (var provider in providerToCapability) {
gs.info('{0} supported capabilities \n\n', provider);
var capabilities = providerToCapability[provider]
for (var cap in capabilities)
if(confUtils.isActionSupported(capabilities[cap].isSupported))
gs.info('"{0}" action supported', cap);
else
gs.info("'{0}' action is not supported by this conference driver", cap);
}
})();
Output: The method returns a node similar to the following for each active telephony service provider within the instance.
Determines whether a Notify conference action is supported by a telephony service provider.
To use this method, you must first call the getServiceProviderCapabilities() method. This method returns an object that contains information about the availability of each possible Notify conference action for each service provider configured in your instance.
Value of the isSupported parameter returned by the getServiceProvidersCapabilities() method for a specific action and service provider.
Note: Although the isSupported value may appear to be a Boolean, it is actually a Number. Do not try and evaluate the capabilities as Boolean values. Use this method as the associated values may be expanded in future versions.
Type
Description
Boolean
Flag that indicates whether the telephony service provider supports the specified action.Valid values: - true: action is supported by the service provider - false: action is not supported by the service provider
(function () {
var confUtils = new NotifyConferenceUtils();
var providerToCapability = confUtils.getServiceProvidersCapabilites();
for (var provider in providerToCapability) {
gs.info('{0} supported capabilities \n\n', provider);
var capabilities = providerToCapability[provider]
for (var cap in capabilities)
if (confUtils.isActionSupported(capabilities[cap].isSupported))
gs.info('"{0}" action supported', cap);
else
gs.info("'{0}' action is not supported by this conference driver", cap);
}
})();
Removes the participant associated with the passed in GlideRecord from the current conference call.
Name
Type
Description
notifyParticipantGR
GlideRecord
GlideRecord object of the participant to remove from the conference call.Table: Notify Participant \[notify\_participant\]
Type
Description
Object
Results of the conference action.`.status`: Status of the conference action. - Data type: Boolean - Possible values: - true: Conference action succeeded - false: Conference action failed `.successMessages`: If *status* is true, success message\(s\), else empty. - Data type: Array of Strings `.warnMessages`: If *status* is false, any warning messages thrown during processing. - Data type: Array of Strings `.errorMessages`: If *status* is false, any error messages thrown during processing. - Data type: Array of Strings
The following code example shows how to call this method.
(function () {
var confUtils = new NotifyConferenceUtils();
var participantGR = new GlideRecord('notify_participant'); // Participant record contains conf call ID
participantGR.get('validParticipantSysId');
var actionResult = confUtils.kickByParticipantGR(participantGR);
if (actionResult.status)
gs.info('Participant has been kicked out of conference');
else {
gs.info('kick operation failed');
actionResult.warnMessages.forEach(function (msg) {
gs.info(msg);
});
actionResult.errorMessages.forEach(function (msg) {
gs.info(msg);
})
}
})()
Mutes the participant associated with the passed in GlideRecord on the current conference call.
Name
Type
Description
notifyParticipantGR
Object
GlideRecord object of the participant to mute.Table: Notify Participant \[notify\_participant\]
Type
Description
Object
Results of the conference action.`.status`: Status of the conference action. - Data type: Boolean - Possible values: - true: Conference action succeeded - false: Conference action failed `.successMessages`: If *status* is true, success message\(s\), else empty. - Data type: Array of Strings `.warnMessages`: If *status* is false, any warning messages thrown during processing. - Data type: Array of Strings `.errorMessages`: If *status* is false, any error messages thrown during processing. - Data type: Array of Strings
The following code example shows how to call this method.
(function () {
var confUtils = new NotifyConferenceUtils();
var participantGR = new GlideRecord('notify_participant');
participantGR.get('validSysId');
var actionResult = confUtils.muteByParticipantGR(participantGR);
if (actionResult.status)
gs.info('Participant has been muted');
else {
gs.info('mute operation failed');
actionResult.warnMessages.forEach(function (msg) {
gs.info(msg);
});
actionResult.errorMessages.forEach(function (msg) {
gs.info(msg);
})
}
})()
Unmutes the participant associated with the passed in GlideRecord on the current conference call.
Name
Type
Description
notifyParticipantGR
GlideRecord
GlideRecord object of the participant to unmute. These records are located in the Notify Participant [notify_participant] table.
Type
Description
Object
Results of the conference action.`.status`: Status of the conference action. - Data type: Boolean - Possible values: - true: Conference action succeeded - false: Conference action failed `.successMessages`: If *status* is true, success message\(s\), else empty. - Data type: Array of Strings `.warnMessages`: If *status* is false, any warning messages thrown during processing. - Data type: Array of Strings `.errorMessages`: If *status* is false, any error messages thrown during processing. - Data type: Array of Strings
(function () {
var confUtils = new NotifyConferenceUtils();
var participantGR = new GlideRecord('notify_participant');
participantGR.get('validSysId');
var actionResult = confUtils.unmuteByParticipantGR(participantGR);
if (actionResult.status)
gs.info('Participant has been Unmuted');
else {
gs.info('Unmute operation failed');
actionResult.warnMessages.forEach(function (msg) {
gs.info(msg);
});
actionResult.errorMessages.forEach(function (msg) {
gs.info(msg);
})
}
})();