BrowserCall JavaScript Documentation

This is a constructor for the widget. As an input parameter it takes an object with following properties: durationpositionlocalization and jsSipConfig.
 
The 
duration property determines time of the animation in milliseconds (the default value is 200).
 
The 
position value determines the position of the widget on a page (its value can be “left”, “right”, “top” or “bottom”).
 
The 
library value meant that the widget will used as a SIP library. In this case you should write your own widget and configure it, as it shown on the code snippet.
 
The 
localization contains an object with text, which determines the status of a call.

TeniosC2CWidget.init({
    duration: 200,
    position: 'right', // left | right | top | bottom | library
    //This property is fixed. Do not change it.
    widgetDomain: 'https://portal.tevox.com',
    localization: {
        browser_call: 'Browser Call',
        calling: 'Calling',
        failed: 'Failed',
        connected: 'Connected'
    },
    //This property is fixed. Do not change it.
    jsSipConfig: {
        sipAccountUsername: click2call,
        webRTCGatewayDomain: 'tevox.com',
        wsServerUri: 'wss://rtc.tenios.com:7443',
        callerPassword: 'click2call',
        destinationUsername: '5000',
    //Copy the webRtcSourceToken form the portal page
        webRtcSourceToken: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
        }
    //This configuration object is optional.
    callbacks: {
        onAccepted: function(e){
            console.debug("onAccepted");
        },
        onProgress: function(e){
            console.debug("onProgress");
        },
        onFailed: function(e){
            console.debug("onProgress");
        },
        onEnded: function(e){
            console.debug("onProgress");
        }
    },
    //This properties is mandatory. Use your own CSS selectors.
    selfStreamElem: '.self-streaming-element',
    remoteStreamElem: '.remote-streaming-element',
    callButton: '.call-button',
    cancelButton: '.cancel-button'
});

 

The selfStreamElem and remoteStreamElem properties are CSS selectors of the audio HTML tags. They are used for audio streaming. For example, you can use these tags:

<audio autoplay="" hidden="true"class="self-streaming"></audio> 
<audio autoplay="" hidden="true" class="remote-streaming"></audio>

 
 The callButton and cancelButton properties are CSS selectors of the Call and Cancel. For example: 

<button type="button" class="call-button">Call</button> 
<button type="button" class=" cancel-button">Cancel</button>

 
 jsSipConfig and widgetDomain are mandatory properties and you must not change them.
Before you call TeniosC2CWidget.init() method be sure that the streaming elements and buttons are rendered in the DOM.
 
If you want to use our widget as a library be sure that your website is served over the HTTPS protocol.

TOP