cxWebphone

cxWebphone

ConnexCS Webphone SDK Connector

Example

var phone = cxWebphone('myId', 'https://webphone.mydomain.com');

Methods

(inner) _init(ID) → {string}

Source:

Initalize the component (into an iframe).

Example
var phone = cxWebphone('myId', 'https://webphone.mydomain.com');
Parameters:
Name Type Description
ID string

of the container

Returns:

Webphone Root URL

Type
string

(inner) answer() → {Promise}

Source:

Answer an incoming call

Example
phone.answer();
Returns:
Type
Promise

(inner) call(destination) → {Promise}

Source:

Start a call with destination

Example
phone.call('123456789');
Parameters:
Name Type Description
destination string

The destination endpoint that wish to call

Returns:
Type
Promise

(inner) config(Config) → {Promise}

Source:

Pass config data to the component

Example
phone.config();
Parameters:
Name Type Description
Config Object

Object

Returns:
Type
Promise

(inner) hangup() → {Promise}

Source:

Hangup a call

Example
phone.hangup();
Returns:
Type
Promise

(inner) mute() → {Promise}

Source:

Mute the local media of a call

Example
phone.mute();
Returns:
Type
Promise

(inner) on(name, callback)

Source:

Add Event Listener

Example
phone.on('session-ringing', myRingingFunction);
    phone.on('session-answered', myAnsweredFunction);
    phone.on('register-registered', myRegistrationFunction);
    phone.on('register-unregistered', myUnregisterFunction);
Parameters:
Name Type Description
name 'session-idle' | 'session-initial' | 'session-establising' | 'session-established' | 'session-terminating' | 'session-terminated' | 'register-initial' | 'register-registered' | 'register-unregistered' | 'register-terminated' | 'cdr'

Event Name

callback requestCallback

Function to handle event

(inner) provision(Provision, Validation) → {Promise}

Source:

Provision a new User

Example
phone.provision({ email: 'joe@blogs.com'});
Parameters:
Name Type Description
Provision Object

Object

Validation function

Callback

Returns:
Type
Promise

(inner) register(dataopt) → {Promise}

Source:

Perform a SIP Registration

Examples

Standalone Example.

    phone.register({
       displayName: '',
       cli: null,
       username: '',
       password: '',
       wsServer:'',
       realm: ''
    });

Provision Example.

    phone.register();
Parameters:
Name Type Attributes Description
data object <optional>

Optional Object to be used for Standalone mode, leave empty when provisioning

Properties
Name Type Description
displayName string

Friendly name

cli string

From Number

username string

Authentication Username

password string

Authentication Password

wsServer string

Server Address

realm string

Realm

Returns:
Type
Promise

(inner) reject() → {Promise}

Source:

Reject an incoming call

Example
phone.reject();
Returns:
Type
Promise

(inner) sendDTMF(tone) → {Promise}

Source:

Send a (RFC 4733) DTMF event to the active call.

Example
phone.sendDTMF(tone);
Parameters:
Name Type Description
tone string

The tone that you want to send to the active call when a button is pressed (digits: 0-9, symbols: # *)

Returns:
Type
Promise

(inner) unmute() → {Promise}

Source:

Unmute the local media of a call

Example
phone.unmute();
Returns:
Type
Promise

(inner) unregister() → {Promise}

Source:

SIP Unregsiter

Example
phone.unregister();
Returns:
Type
Promise