Skip to main content

Class Reference

Methods

Getters and Setters

MethodDescription
getAutoGainControl() : booleanGet the current status of the WebRTC AGC.
getEchoCancel() : booleanGet the current status of the WebRTC echo canceller.
getNoiseSuppression() : booleanGet the current status of the WebRTC noise supressor.
getTimers() : objectGet current active session timers.
setDebug() : objectEnable SDK debug messages to console.log().
setAutoGainControl(
    toggle
) : object
Set WebRTC AGC.
Valid values: true, false.
setEchoCancel(
    toggle
) : object
Set WebRTC Echo Canceling.
Valid values: true, false.
setNoiseSuppression(
    toggle
) : object
Set WebRTC Noise Suppression.
Valid values: true, false.
setPredialTone(toggle) : objectSet call pre-dialing tones.
Valid values: true, false.
init(
    domain,
    username,
    token,
    regfree
) : object
Initialise the Web SDK and the relevant SIP Stack elements.
domain - The Cloudonix domain name
username - The Cloudonix domain subscriber MSISDN
token - Either a subscriber password or RegFree Token
regfree - Enable RegFree operations (default: false)
setCredentials(
    domain,
    username,
    password
) : object
Set the SDK for credentials based operations (SIP username/password usage).
domain - The Cloudonix domain name
username - The Cloudonix domain subscriber MSISDN
password - Either a subscriber password
setRegFree(
    domain,
    username,
    apikey
) : object
Set the SDK for RegFreeDialing based operations (Single Time Token). More information can be obtained at RegFree Dialing Overview.
domain - The Cloudonix domain name
username - The Cloudonix domain subscriber MSISDN
apikey - The Cloudonix assigned apikey for RegFree dialing
setRegFreeToken(
    domain,
    username,
    regfreeToken
) : object
Set the SDK for RegFreeDialing based operations (Single Time Token). More information can be obtained at RegFree Dialing Overview.
domain - The Cloudonix domain name
username - The Cloudonix domain subscriber MSISDN
regfreeToken - The Cloudonix provided single time token for RegfreeDialing
destroySipStack() : objectStop the Web SDK and destroy any active connection.

Operations

MethodDescription
sipRegister()SIP REGISTER using the credentials, provided to the SDK, via the setCredentials or init method.
sipSendDtmfTone(
    tone
)
Send a DTMF tone on the line, during a connected call.
tone may be any value between 0 and 9 or * or #.
sipStartCall(
    destination,
    myMetadata
)
Start a call to the destination provided. myMetaData may be provided as an array of key/value pair objects.
sipStopCall()Stop and terminate the current active call.
sipToggleMute()Mute/Unmute the microphone.
sipUnRegister()Unregister the SDK from the Cloudonix platform (user goes offline).
startRingbackTone()Start the ringback tone (the ringtone played while dialing).
stopRingbackTone()Stop the ringback tone (the ringtone played while dialing).
startRingTone()Start a ringing tone (indicating an inbound call).
stopRingTone()Stop a ringing tone (indicating an inbound call).

Stack Events

MethodDescription
onBrowserPermissionsAccepted(callback)The stack was approved to access the microphone.
onBrowserPermissionsRefused(callback)The stack was refused to access the microphone and will be terminated.
onBrowserPermissionsRequested(callback)The stack had initiated a browser permissions request.
onFailedToStart(callback)The stack failed to start.
onFailedToStop(callback)The stack failed to stop.
onNewSessionStarting(callback)A new session is starting (normally, a new call).
onStarted(callback)The stack was fully started and ready for work.
onStarting(callback)The stack is starting and is still not ready for work.
onStopped(callback)The stack was stopped and is no longer available.
onStopping(callback)The stack is stopping and is no longer available.

Session Events

MethodDescription
onLocalAudioAdded(callback)Triggered when local audio is added to the session.
onLocalAudioRemoved(callback)Triggered when local audio is removed from the session.
onLocalHoldFailed(callback)Triggered when an attempt to put the local side on hold fails.
onLocalHoldSuccess(callback)Triggered when the local side is successfully put on hold.
onLocalMuteFailed(callback)Triggered when an attempt to mute the local audio fails.
onLocalMuteToggle(callback)Triggered when the local audio mute state is toggled.
onLocalUnholdFailed(callback)Triggered when an attempt to take the local side off hold fails.
onLocalUnholdSuccess(callback)Triggered when the local side is successfully taken off hold.
onRemoteAudioAdded(callback)Triggered when remote audio is added to the session.
onRemoteAudioRemoved(callback)Triggered when remote audio is removed from the session.
onRemoteHoldStarted(callback)Triggered when the remote side puts the call on hold.
onRemoteHoldStopped(callback)Triggered when the remote side takes the call off hold.
onSessionConnected(callback)Triggered when the session is fully established and connected.
onSessionConnecting(callback)Triggered when the session is in the process of connecting.
onSessionEarlyMedia(callback)Triggered when early media is received before the call is fully established.
onSessionNewSession(callback)Triggered when a new session is created.
onSessionRegister(callback)Triggered when a registration request is sent.
onSessionRegistered(callback)Triggered when the registration is successful.
onSessionResponseReceived(callback)Triggered when a SIP response is received for the session.
onSessionTerminated(callback)Triggered when the session is terminated.
onSessionTerminating(callback)Triggered when the session is in the process of terminating.
onSessionTransferAccepted(callback)Triggered when a transfer request is accepted.
onSessionTransferFailed(callback)Triggered when a transfer attempt fails.
onSessionTransferNotification(callback)Triggered when a transfer notification is received.
onSessionTransferRequested(callback)Triggered when a transfer is requested.
onSessionTransferStarted(callback)Triggered when a transfer process has started.
onSessionUnregister(callback)Triggered when an unregistration request is sent.
onSessionUnregistered(callback)Triggered when the unregistration is successful.