{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":854,"path":"api-reference/server-api-reference/NotifyJsTelephonyDriverAPI.md","title":"NotifyJsTelephonyDriver - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# NotifyJsTelephonyDriver- Global\n\nThe NotifyJsTelephonyDriver API provides methods that you can use to obtain information about the capabilities of the associated telephony driver.\n\nIt 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.\n\nIn 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.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      return {\n        driverName: driver.getName(),\n        supportsCall: driver.supportsCall(),\n        supportsSMS: driver.supportsSms()\n      } \n    }\n} \n```\n\nTo see which drivers are associated with the NotifyJsTelephonyDriver extension point, navigate to **System Extension Points**&gt;**global.NotifyJsTelephonyDriver**. All associated driver implementations appear in the **Implementations** tab.\n\nFor additional information on scripted extension points, see [Using extension points to extend application functionality point](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/web-services/extension-points.md).\n\nTo 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.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## NotifyJsTelephonyDriver - call\\(Object notifyPhoneNumber, String phoneNumber\\)\n\nCalls a specified telephone number.\n\n<table id=\"table_xcn_24y_qmb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nnotifyPhoneNumber\n\n</td><td>\n\n[NotifyPhoneNumber - Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_NotifyPhoneNumberAPI.md)\n\n</td><td>\n\nNotifyPhoneNumber record that contains the Notify phone number from which to make the call.Table: Notify Phone Number \\[notify\\_number\\] table.\n\n</td></tr><tr><td>\n\ntoPhoneNumber\n\n</td><td>\n\nString\n\n</td><td>\n\nTelephone number to call.Format: E.164\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\n## NotifyJsTelephonyDriver - getCapabilities\\(\\)\n\nReturns a list of the capabilities of the telephony driver.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|None| |\n\nThis example returns the capabilities of the associated telephony driver.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      return {\n       capabilities: driver.getCapabilities()\n      } \n    }\n} \n```\n\n## NotifyJsTelephonyDriver - getMaxSizeForBulkSms\\(String phoneNumber\\)\n\nReturns 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.\n\n|Name|Type|Description|\n|----|----|-----------|\n|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.|\n\n|Type|Description|\n|----|-----------|\n|Number|Maximum number of telephone numbers that an SMS message can be sent to in a single bulk SMS delivery.|\n\nThis example returns the maximum number of telephone numbers that can be sent to in a single bulk SMS message for the associated telephony driver.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n       return {\n       maxSmsNumbers: driver.getMaxSizeForBulkSMS(notifyNumber)\n      }       \n    }\n} \n```\n\n## NotifyJsTelephonyDriver - getPhoneNumber\\(String phoneNumber\\)\n\nReturns the Notify phone number record for the specified phone number.\n\nReturns null if the specified phone number is not found in the Notify Phone Number \\[notify\\_number\\] table.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|NotifyPhoneNumberAPI|Notify phone number record associated with the specified telephone number.|\n\nThis example obtains the telephony driver and returns the associated Notify phone number record for a specified phone number.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      return {\n       phoneNumberRecord: driver.getPhoneNumber(notifyNumber)\n      } \n    }\n} \n```\n\n## NotifyJsTelephonyDriver - getPhoneNumbers\\(\\)\n\nReturns a list of all Notify telephone numbers associated with the current telephony driver.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Comma-separated list of all Notify telephone numbers associated with the current driver.|\n\nThis example obtains the telephony driver and returns the list of Notify phone numbers associated with the current telephony driver.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      return {\n       phoneNumbers: driver.getPhoneNumbers()\n      } \n    }\n} \n```\n\n## NotifyJsTelephonyDriver - isActive\\(\\)\n\nChecks whether the current telephony driver is active.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_iry_t5p_qmb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the current telephony driver is active.\n\n Valid values:\n\n-   true: Driver is active.\n-   false: Driver is inactive.\n\n</td></tr></tbody>\n</table>This example obtains the telephony driver and returns whether the current telephony driver is active.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      return {\n        active: driver.isActive()\n      } \n    }\n} \n```\n\n## NotifyJsTelephonyDriver - kick\\(GlideRecord participantRecord\\)\n\nRemoves the specified caller from the current Notify conference call.\n\n|Name|Type|Description|\n|----|----|-----------|\n|participantRecord|[GlideRecord - Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideRecordAPI.md)|GlideRecord object containing the Notify Participant \\[notify\\_participant\\] record of the caller to remove from the conference call.|\n\n|Type|Description|\n|----|-----------|\n|String|Only returned if error. Error message that describes why the caller was not removed from the call.|\n\nThis example mutes the associated caller in the current conference call.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      var notifyParticipantGr = new GlideRecord('notify_participant');\n      notifyParticipantGr.get('active participant sys id');\n    \n      if (notifyParticipantGr.isValid) {\n        driver.kick(notifyParticipantGr)\n    }\n} \n```\n\n## NotifyJsTelephonyDriver - mute\\(GlideRecord participantRecord\\)\n\nMutes the specified caller in the current Notify conference call.\n\n|Name|Type|Description|\n|----|----|-----------|\n|participantRecord|[GlideRecord - Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideRecordAPI.md)|GlideRecord object containing the Notify Participant \\[notify\\_participant\\] record of the caller to mute in the conference call.|\n\n|Type|Description|\n|----|-----------|\n|String|Only returned if error. Error message that describes why the caller was not muted.|\n\nThis example mutes the associated caller in the current conference call.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      var notifyParticipantGr = new GlideRecord('notify_participant');\n      notifyParticipantGr.get('active participant sys id');\n    \n      if (notifyParticipantGr.isValid) {\n        driver.mute(notifyParticipantGr)\n    }\n} \n```\n\n## NotifyJsTelephonyDriver - sendAutonomousBulkSms\\(Object notifyPhoneNumber, Array toPhoneNumber, String message, GlideRecord source\\)\n\nSends the specified Short Message Service \\(SMS\\) message to the specified list of telephone numbers.\n\nIn addition, you can optionally associate the Incident record that caused the SMS message to be generated with the SMS message.\n\n<table id=\"table_rwk_xvx_qmb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nString\n\n</td><td>\n\nMessage to send.\n\n</td></tr><tr><td>\n\nnotifyPhoneNumber\n\n</td><td>\n\n[NotifyPhoneNumber - Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_NotifyPhoneNumberAPI.md)\n\n</td><td>\n\nRecord that contains the phone number that is sending the bulk SMS message.\n\n</td></tr><tr><td>\n\nsource\n\n</td><td>\n\n[GlideRecord - Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideRecordAPI.md)\n\n</td><td>\n\nOptional. Incident GlideRecord to store in the Source field of the associated SMS message record in the Notify Message \\[notify message\\] table. This links the Incident record that caused the SMS message to be generated to that SMS message.Default: None. If this parameter is not passed in, this information is not tracked.\n\n</td></tr><tr><td>\n\ntoPhoneNumbers\n\n</td><td>\n\nArray\n\n</td><td>\n\nList of telephone numbers of the devices to receive the SMS message.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nThis example shows how to send an autonomous bulk SMS.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n\n    }\n} \n```\n\n## NotifyJsTelephonyDriver - sendSMS\\(NotifyPhoneNumber notifyPhoneNumber, String toPhoneNumber, String messageBody\\)\n\nSends a specified Short Message Service \\(SMS\\) message to a specified telephone number.\n\n<table id=\"table_ohm_jdr_qmb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nnotifyPhoneNumber\n\n</td><td>\n\n[NotifyPhoneNumber - Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_NotifyPhoneNumberAPI.md)\n\n</td><td>\n\nNotify phone number record that contains the telephone number that is sending the SMS message. Table: Notify Phone Number \\[notify\\_number\\]\n\n</td></tr><tr><td>\n\ntoPhoneNumber\n\n</td><td>\n\nString\n\n</td><td>\n\nPhone number to send the SMS message to. Format: E.164 compliant\n\n</td></tr><tr><td>\n\nmessage\n\n</td><td>\n\nString\n\n</td><td>\n\nText to send in the SMS message.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\n## NotifyJsTelephonyDriver - supportsAutonomousBulkSms\\(String phoneNumber\\)\n\nChecks whether the specified Notify telephone number is capable of handling autonomous bulk Short Message Service \\(SMS\\) messages.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_vlw_3nq_qmb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the specified Notify telephone number supports autonomous bulk SMS.\n\n Valid values:\n\n-   true: Supports autonomous bulk SMS.\n-   false: Does not support autonomous bulk SMS.\n\n</td></tr></tbody>\n</table>This example obtains the telephony driver and returns whether the driver supports autonomous bulk SMS.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      return {\n        supportsBulkSMS: driver.supportsAutonomousBulkSms(notifyNumber)\n      } \n    }\n} \n```\n\n## NotifyJsTelephonyDriver - supportsCall\\(\\)\n\nChecks whether the current telephony driver is capable of handling telephone calls.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_acf_3lq_qmb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the current telephony driver supports telephone calls.\n\n Valid values:\n\n-   true: Driver supports telephone calls.\n-   false: Driver does not support telephone calls.\n\n</td></tr></tbody>\n</table>This example obtains the telephony driver and returns whether the driver supports telephone calls.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      return {\n        supportsCall: driver.supportsCall()\n      } \n    }\n} \n```\n\n## NotifyJsTelephonyDriver - supportsCallOverWebRtc\\(\\)\n\nChecks whether the specified Notify telephone number is capable of calls to a browser using WebRTC \\(Real-Time Communications.\\)\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_wgy_kcs_qmb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the specified Notify telephone number supports browser calls using WebRTC.\n\n Valid values:\n\n-   true: Supports WebRTC.\n-   false: Does not support WebRTC.\n\n</td></tr></tbody>\n</table>This example obtains the telephony driver and returns whether the driver supports browser calls using WebRTC.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      return {\n        supportsWebRTC: driver.supportsCallOverWebRtc(notifyNumber)\n      } \n    }\n} \n```\n\n## NotifyJsTelephonyDriver - supportsSMS\\(\\)\n\nChecks whether the current telephony driver is capable of handling Short Message Service \\(SMS\\) messages.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_wnl_cmq_qmb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the current telephony driver supports SMS.\n\n Valid values:\n\n-   true: Driver supports SMS.\n-   false: Driver does not support SMS.\n\n</td></tr></tbody>\n</table>This example obtains the telephony driver and returns whether the driver supports SMS.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      return {\n        supportsSMS: driver.supportsSMS()\n      } \n    }\n} \n```\n\n## NotifyJsTelephonyDriver - unmute\\(GlideRecord participantRecord\\)\n\nUnmutes the specified caller in the current Notify conference call.\n\n|Name|Type|Description|\n|----|----|-----------|\n|participantRecord|[GlideRecord - Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideRecordAPI.md)|GlideRecord object containing the Notify Participant \\[notify\\_participant\\] record of the caller to mute in the conference call.|\n\n|Type|Description|\n|----|-----------|\n|String|Only returned if error. Error message that describes why the caller was not muted.|\n\nThis example mutes the associated caller in the current conference call.\n\n```\ngetDriverDetails('<notify_number>'); \n\nfunction getDriverDetails(notifyNumber) {\n  var nUtil = new NotifyUtil();\n  if (!notifyNumber || !nUtil.validateOutboundNotifyNumber(notifyNumber))\n    return;\n  var driver = nUtil.getTelephonyDriverFromNotifyNumber(notifyNumber);\n    if (driver) {\n      var notifyParticipantGr = new GlideRecord('notify_participant');\n      notifyParticipantGr.get('active participant sys id');\n    \n      if (notifyParticipantGr.isValid) {\n        driver.unmute(notifyParticipantGr)\n    }\n} \n```\n\n"}}