Notify Client - Global

The Notify Client API allows you use Notify telephony functionality, such as making and receiving calls, from a web browser.

Several Notify Client methods take a callback function as a parameter. Because Notify Client calls are made asynchronously, these methods cannot return a value directly. Use the callback function to parse the returned data, such as by assigning variables or making other API calls.

Notify Client - call(Object identifier)

Call a specified phone number or the phone number associated with a specified user.

Table 1. Parameters
Name Type Description
identifier Object Enter a JSON object that provides either the phone number to call or the sys_id of a user record to get the phone number from.
Note: If you provide both a phone number and user sys_id, only the phone number is used.
Table 2. Returns
Type Description
void

This example demonstrates passing a phone number as the function parameter.

notifyClient.call({
    phoneNumber: "+18001112223"
});

This example demonstrates passing a user record sys_id as the function parameter.

notifyClient.call({
    userId: "6816f79cc0a8016401c5a33be04be441"
});

Notify Client - Client(Object notifyConfig)

Instantiate a new Notify WebRTC Client object.

Table 3. Parameters
Name Type Description
notifyConfig Object The configuration settings for the Notify WebRTC Client, as a JSON object.

var notifyConfig = {
    vendor: SNC.Notify.Vendor.TWILIO,
    callerId: 'xyz',
    autoReconnect: true,
    onReady: function() {},
    onOffline: function() {},
    onError: function( message ) {},
    onConnect: function( status ) {},
    onDisconnect: function() {},
    onIncoming: function( {from, to, callSid} ) {},
    onOutgoing: function( callSid ) {},
    onAccept: function() {},
    onMute: function() {},
    onUnmute: function() {},
    onCancel: function() {}
};

$j(function() {
    notifyClient = new SNC.Notify.Client(notifyConfig);
    notifyClient.init();
});

NotifyClient - forwardCall(Object argument)

Forward the current call to a different phone number or Notify client session.

Table 4. Parameters
Name Type Description
argument Object A JavaScript object detailing the number or Notify client to forward the call to.
Table 5. Returns
Type Description
void

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.

var arg = {
    type: "number",
    id: "+17012345678",
    dtmf: "1234"
}
client.forwardCall(arg);

This example demonstrates forwarding a call to a different Notify client.

var arg = {
    type: "userId",
    id: "6816f79cc0a8016401c5a33be04be441"
}
client.forwardCall(arg);

Notify Client - hangupCall()

End the current call.

Table 6. Parameters
Name Type Description
None
Table 7. Returns
Type Description
void

This example demonstrates mapping a client function to an interface button using jQuery.

$j("#pickupCallBtn").on("click", function() {
    notifyClient.hangupCall();
});

Notify Client - mute(Boolean muted)

Mute or unmute the current client.

Additional information about the method that does not belong in the short description.

Table 8. Parameters
Name Type Description
muted Boolean Set this value to true to mute the current client, false to unmute.
Table 9. Returns
Type Description
void


      
    

Notify Client - pickupCall()

Brief description of the method.

Additional information about the method that does not belong in the short description.

Table 10. Parameters
Name Type Description
None
Table 11. Returns
Type Description
void

NotifyClient - sendDtmf(String digits)

Send one or more DTMF-valid digits over the current call.

Table 12. Parameters
Name Type Description
digits String One or more DTMF-valid digits.
Table 13. Returns
Type Description
void