The NotifyJsTelephonyDriver API provides methods that you can use to obtain information about the capabilities of the associated telephony driver.

It is a scripted extension point that can only be used when its object is returned by another method, such as NotifyUtil - getTelephonyDriverFromNotifyNumber(). You cannot call this API directly. The calling method associates a specific driver to the interface, abstracting the details of determining the driver. Each of the available drivers implement the same interface, which is defined by the NotifyJsTelephonyDriver API.

In the following code example, the getTelephonyDriverFromNotifyNumber() method returns an implementation of this API, with the driver interface being determined by the passed in telephone number, such as TwilioNotifyJsTelephonyDriver.
getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      return {
        driverName: driver.getName(),
        supportsCall: driver.supportsCall(),
        supportsSMS: driver.supportsSms()
      } 
    }
} 

To see which drivers are associated with the NotifyJsTelephonyDriver extension point, navigate to System Extension Points>global.NotifyJsTelephonyDriver. All associated driver implementations appear in the Implementations tab.

For additional information on scripted extension points, see Using extension points to extend application functionality point.

To use this API you must activate the Notify (com.snc.notify) plugin. To activate specific driver implementations, such as Twillo, you must activate their specific plugin.

NotifyJsTelephonyDriver - call(Object notifyPhoneNumber, String phoneNumber)

Calls a specified telephone number.

Table 1. Parameters
Name Type Description
notifyPhoneNumber NotifyPhoneNumber - Global NotifyPhoneNumber record that contains the Notify phone number from which to make the call.

Table: Notify Phone Number [notify_number] table.

toPhoneNumber String Telephone number to call.

Format: E.164

Table 2. Returns
Type Description
None

NotifyJsTelephonyDriver - getCapabilities()

Returns a list of the capabilities of the telephony driver.

Table 3. Parameters
Name Type Description
None
Table 4. Returns
Type Description
None

Example

This example returns the capabilities of the associated telephony driver.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      return {
       capabilities: driver.getCapabilities()
      } 
    }
} 

NotifyJsTelephonyDriver - getMaxSizeForBulkSms(String phoneNumber)

Returns the maximum number of telephone numbers to which the telephony driver associated with the passed in Notify telephone number can send an SMS message to at one time.

Table 5. Parameters
Name Type Description
phoneNumber String Notify telephone number to check for the maximum number of telephone numbers that the associated driver is able to send to in one bulk SMS message.
Table 6. Returns
Type Description
Number Maximum number of telephone numbers that an SMS message can be sent to in a single bulk SMS delivery.

Example

This example returns the maximum number of telephone numbers that can be sent to in a single bulk SMS message for the associated telephony driver.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
       return {
       maxSmsNumbers: driver.getMaxSizeForBulkSMS(notifyNumber)
      }       
    }
} 

NotifyJsTelephonyDriver - getPhoneNumber(String phoneNumber)

Returns the Notify phone number record for the specified phone number.

Returns null if the specified phone number is not found in the Notify Phone Number [notify_number] table.

Table 7. Parameters
Name Type Description
None
Table 8. Returns
Type Description
NotifyPhoneNumberAPI Notify phone number record associated with the specified telephone number.

Example

This example obtains the telephony driver and returns the associated Notify phone number record for a specified phone number.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      return {
       phoneNumberRecord: driver.getPhoneNumber(notifyNumber)
      } 
    }
} 

NotifyJsTelephonyDriver - getPhoneNumbers()

Returns a list of all Notify telephone numbers associated with the current telephony driver.

Table 9. Parameters
Name Type Description
None
Table 10. Returns
Type Description
String Comma-separated list of all Notify telephone numbers associated with the current driver.

Example

This example obtains the telephony driver and returns the list of Notify phone numbers associated with the current telephony driver.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      return {
       phoneNumbers: driver.getPhoneNumbers()
      } 
    }
} 

NotifyJsTelephonyDriver - isActive()

Checks whether the current telephony driver is active.

Table 11. Parameters
Name Type Description
None
Table 12. Returns
Type Description
Boolean

Flag that indicates whether the current telephony driver is active.

Valid values:
  • true: Driver is active.
  • false: Driver is inactive.

Example

This example obtains the telephony driver and returns whether the current telephony driver is active.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      return {
        active: driver.isActive()
      } 
    }
} 

NotifyJsTelephonyDriver - kick(GlideRecord participantRecord)

Removes the specified caller from the current Notify conference call.

Table 13. Parameters
Name Type Description
participantRecord GlideRecord - Global GlideRecord object containing the Notify Participant [notify_participant] record of the caller to remove from the conference call.
Table 14. Returns
Type Description
String Only returned if error. Error message that describes why the caller was not removed from the call.

Example

This example mutes the associated caller in the current conference call.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      var notifyParticipantGr = new GlideRecord('notify_participant');
      notifyParticipantGr.get('active participant sys id');
    
      if (notifyParticipantGr.isValid) {
        driver.kick(notifyParticipantGr)
    }
} 

NotifyJsTelephonyDriver - mute(GlideRecord participantRecord)

Mutes the specified caller in the current Notify conference call.

Table 15. Parameters
Name Type Description
participantRecord GlideRecord - Global GlideRecord object containing the Notify Participant [notify_participant] record of the caller to mute in the conference call.
Table 16. Returns
Type Description
String Only returned if error. Error message that describes why the caller was not muted.

Example

This example mutes the associated caller in the current conference call.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      var notifyParticipantGr = new GlideRecord('notify_participant');
      notifyParticipantGr.get('active participant sys id');
    
      if (notifyParticipantGr.isValid) {
        driver.mute(notifyParticipantGr)
    }
} 

NotifyJsTelephonyDriver - sendAutonomousBulkSms(Object notifyPhoneNumber, Array toPhoneNumber, String message, GlideRecord source)

Sends the specified Short Message Service (SMS) message to the specified list of telephone numbers.

In addition, you can optionally associate the Incident record that caused the SMS message to be generated with the SMS message.

Table 18. Returns
Type Description
None

Example

This example shows how to send an autonomous bulk SMS.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {

    }
} 

NotifyJsTelephonyDriver - sendSMS(NotifyPhoneNumber notifyPhoneNumber, String toPhoneNumber, String messageBody)

Sends a specified Short Message Service (SMS) message to a specified telephone number.

Table 19. Parameters
Name Type Description
notifyPhoneNumber NotifyPhoneNumber - Global Notify phone number record that contains the telephone number that is sending the SMS message.

Table: Notify Phone Number [notify_number]

toPhoneNumber String Phone number to send the SMS message to.

Format: E.164 compliant

message String Text to send in the SMS message.
Table 20. Returns
Type Description
None

NotifyJsTelephonyDriver - supportsAutonomousBulkSms(String phoneNumber)

Checks whether the specified Notify telephone number is capable of handling autonomous bulk Short Message Service (SMS) messages.

Table 21. Parameters
Name Type Description
None
Table 22. Returns
Type Description
Boolean

Flag that indicates whether the specified Notify telephone number supports autonomous bulk SMS.

Valid values:
  • true: Supports autonomous bulk SMS.
  • false: Does not support autonomous bulk SMS.

Example

This example obtains the telephony driver and returns whether the driver supports autonomous bulk SMS.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      return {
        supportsBulkSMS: driver.supportsAutonomousBulkSms(notifyNumber)
      } 
    }
} 

NotifyJsTelephonyDriver - supportsCall()

Checks whether the current telephony driver is capable of handling telephone calls.

Table 23. Parameters
Name Type Description
None
Table 24. Returns
Type Description
Boolean

Flag that indicates whether the current telephony driver supports telephone calls.

Valid values:
  • true: Driver supports telephone calls.
  • false: Driver does not support telephone calls.

Example

This example obtains the telephony driver and returns whether the driver supports telephone calls.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      return {
        supportsCall: driver.supportsCall()
      } 
    }
} 

NotifyJsTelephonyDriver - supportsCallOverWebRtc()

Checks whether the specified Notify telephone number is capable of calls to a browser using WebRTC (Real-Time Communications.)

Table 25. Parameters
Name Type Description
None
Table 26. Returns
Type Description
Boolean

Flag that indicates whether the specified Notify telephone number supports browser calls using WebRTC.

Valid values:
  • true: Supports WebRTC.
  • false: Does not support WebRTC.

Example

This example obtains the telephony driver and returns whether the driver supports browser calls using WebRTC.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      return {
        supportsWebRTC: driver.supportsCallOverWebRtc(notifyNumber)
      } 
    }
} 

NotifyJsTelephonyDriver - supportsSMS()

Checks whether the current telephony driver is capable of handling Short Message Service (SMS) messages.

Table 27. Parameters
Name Type Description
None
Table 28. Returns
Type Description
Boolean

Flag that indicates whether the current telephony driver supports SMS.

Valid values:
  • true: Driver supports SMS.
  • false: Driver does not support SMS.

Example

This example obtains the telephony driver and returns whether the driver supports SMS.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      return {
        supportsSMS: driver.supportsSMS()
      } 
    }
} 

NotifyJsTelephonyDriver - unmute(GlideRecord participantRecord)

Unmutes the specified caller in the current Notify conference call.

Table 29. Parameters
Name Type Description
participantRecord GlideRecord - Global GlideRecord object containing the Notify Participant [notify_participant] record of the caller to mute in the conference call.
Table 30. Returns
Type Description
String Only returned if error. Error message that describes why the caller was not muted.

Example

This example mutes the associated caller in the current conference call.

getDriverDetails('<notify_number>'); 

function getDriverDetails(notifyNumber) {
  var nUtil = new NotifyUtil();
  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))
    return;
  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);
    if (driver) {
      var notifyParticipantGr = new GlideRecord('notify_participant');
      notifyParticipantGr.get('active participant sys id');
    
      if (notifyParticipantGr.isValid) {
        driver.unmute(notifyParticipantGr)
    }
}