NotifyClient- Client
The NotifyClient API provides methods that enable you to use Notify telephony functionality, such as making and receiving calls from a web browser.
Several NotifyClient methods take a callback function as a parameter. Because NotifyClient method calls are made asynchronously, these methods can't return a value directly. Use the callback function to parse the returned data, such as by assigning variables or making other API calls.
Parent Topic:Client API reference
NotifyClient - Client(Object notifyConfig, Boolean initializeVendorClientLazily)
Instantiates a new Notify WebRTC Client object.
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| initializeVendorClientLazily | Boolean | Flag that indicates whether to use the autoSelectVendorCallback function passed in the setCallerId() method to automatically set the caller's associated vendor (notifyConfig.vendor does not need to be defined in the constructor).- false: Default. Do not use the autoSelectVendorCallback function to set the caller's vendor. The vendor must be set in the constructor. - true: Use the autoSelectVendorCallback function to define the vendor when the caller ID is set. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notifyConfig | Object | JSON object that contains the configuration settings for the Notify WebRTC Client. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notifyConfig.autoLoadScriptResources | Boolean | Flag that indicates how to load the core JS library needed by the vendor client.- false: Default. Use vendor specific codes to load the required vendor JS library \(enables backwards compatibility\). - true: Use notifyClient.js to load the core JS library. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notifyConfig.callerId | Number | Registered Notify number to use. Do not directly set this value. Use the method notifyClient.setCallerID\(\) to set this value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notifyConfig.forceRefreshToken | Boolean | Flag that indicates whether to auto-renew expired client tokens.- false: Do not automatically renew client tokens when they expire. - true: Default. Automatically renew client tokens when they expire. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notifyConfig.skipParentId | Boolean | Flag that indicates whether to immediately invoke the onIncoming caller for incoming calls.- false: Default. Do not immediately invoke the onIncoming event handler. - true: Immediately invoke the onIncoming event handler. By setting this flag, if there is another call, where the `| notifyConfig.vendor | Constant | Vendor to which the caller belongs.- SNC.Notify.Vendor.TWILIO\_DIRECT - SNC.Notify.Vendor.TWILIO \(older, deprecated Twilio driver\) | The following example shows how to create the NotifyClient constructor, register various event listeners, and initialize the client driver. NotifyClient - addEventListener(String event, Function fn)Registers an event handler to listen for changes in a Notify client. Using this method you can register multiple listeners. Each listener must be a separate method call.
This example shows how to register multiple listeners. This example shows how to de-register a listener. NotifyClient - call(Object identifier)Calls the specified phone number or the phone number associated with a specified user. Note: When checking the status of a call/connection, always compare against the constants provided by
This example demonstrates passing a phone number as the function parameter. This example demonstrates passing a user record sys_id as the function parameter. This example shows a button click handler. This example shows an event handler. NotifyClient - destroy()Kills the current Notify client, rendering it unusable.
NotifyClient - forwardCall(Object argument)Forwards an ongoing incoming or outgoing phone call to either a different phone number or a different WebRTC client.
This example demonstrates forwarding a call to a different phone number. The dtmf attribute allows you to send DTMF dial tones to the receiving number. This example demonstrates forwarding a call to a different Notify client. NotifyClient - getAvailableClients(Function callback)Returns a list of clients available to accept calls. This method excludes the current client from the list. The equivalent Notify-getAvailableClients() method does not filter any user.
NotifyClient - getParentId(String callId, Function callback)Returns the parent call identifier for a specified call identifier, if one exists. Depending on the telephony provider, there may be a delay before the parent call identifier is returned; therefore you must provide a callback function.
This example shows how to use this method to obtain the parent call identifier. This example shows the contents of the jsonObj parameter. NotifyClient - getStatus()Returns the normalized status of the current call.
This example shows how to obtain the status of the current Notify client. NotifyClient - hangupCall()End the current call.
This example how to hang up a call. NotifyClient - init()Initializes the client driver. For example, when using the Twilio client, it invokes the method Twilio.Device.setup(). Call this method after the user has interacted with the page. This initialization process is asynchronous, therefore, you must provide an ONLINE event handler. This handler is called when the setup process is complete and the system is ready to take or make calls.
This example shows how to initialize the Notify client. NotifyClient - mute(Boolean muted)Mute or unmute the current client.
This example shows how to send mute the current call. NotifyClient - pickupCall()Answers and connects to an incoming call from a WebRTC client. Call this method when there is a notification of an incoming call.
This example shows how to pickup a call. NotifyClient - sendDtmf(String digits)Send one or more DTMF-valid digits over the current call.
This example shows how to send DTMF signals to the current call. NotifyClient - setCallerId(String value, Function autoSelectVendorCallback)Sets the caller ID for the current client session. You can change or update the caller ID at any time however, the caller ID must belong to the same vendor.
This example shows how to set the caller ID. This example assumes that the vendor is set in the constructor. NotifyClient - setClientAvailable(Boolean available)Sets the availability of an active WebRTC client agent. This type of availability is different than an agent being in a call. In this case, an active WebRTC client may be connected and not on a call, but may not want to receive calls. Calling this method updates the Available field value on the Notify Client Connected Session [notify_client_session] record associated with this client session. You can get a list of available clients using the getAvailableClients() method.
|