Functions

VoxEngine.addEventListener(appevent, handler)

void

Add handler for specific event generated by application in specific state

Parameters
  • appevent: Function

    Event class (i.e. AppEvents.CallAlerting)

  • handler: Function

    Handler function. A single parameter is passed - object with event information

VoxEngine.callConference(conferenceId, callerid, displayName, headers)

Call

Make a call to system-wide conference

Parameters
  • conferenceId: String

    Id of the conference

  • callerid: String (optional)

    CallerId

  • displayName: String (optional)

    Optional printable name of callerid

  • headers: Object (optional)

    Optional SIP headers to be passed with call to conference

Returns

VoxEngine.callPSTN(number, callerid)

Call

Start outgoing call to specified PSTN number

Parameters
  • number: String

    PSTN number to sart call to in international (E.164 format)

  • callerid: String (optional)

    Caller ID that will be displayed to called user. Can be only one of the phone numbers that were bought in the VoxImplant. If not specified, default system Caller ID is used

Returns

VoxEngine.callSIP(to, callerid, displayName, password, authUser, extraHeaders, video, outProxy)

Call

Start outgoing call to external SIP system

Parameters
  • to: String

    SIP URI to make call to

  • callerid: String

    CallerID that will be displayed to called user

  • displayName: String (optional)

    Name of calling user, that will be displayed to called user

  • password: String (optional)

    Password for SIP Authentication

  • authUser: String (optional)

    Username for SIP Authentication. If not specified, callerid is used as username for authentication

  • extraHeaders: Object (optional)

    Optional custom parameters (SIP headers) that should be passed with call (INVITE) message. Parameter names must start with "X-" to be processed by application

  • video: Boolean (optional)

    Specifies if call should have video support. Please note that price for audio-only and video calls is different!

  • outProxy: String (optional)

    Specifies outbound proxy

Returns

VoxEngine.callUser(username, callerid, displayName, extraHeaders, video)

Call

Start outgoing call to specified user

Parameters
  • username: String

    Name of the user to call

  • callerid: String

    CallerID that will be displayed to called user

  • displayName: String (optional)

    Name of calling user, that will be displayed to called user

  • extraHeaders: Object (optional)

    Optional custom parameters (SIP headers) that should be passed with call (INVITE) message. Parameter names must start with "X-" to be processed by application

  • video: Boolean (optional)

    Specifies if call should have video support. Please note that price for audio-only and video calls is different!

Returns

VoxEngine.callUserDirect(incomingCall, username, callerid, displayName, extraHeaders)

Call

Start outgoing call to specified user in P2P mode

Parameters
  • incomingCall: Call

    Incoming call that needs to be forwarded

  • username: String

    Name of the user to call

  • callerid: String

    CallerID that will be displayed to called user

  • displayName: String (optional)

    Name of calling user, that will be displayed to called user

  • extraHeaders: Object (optional)

    Optional custom parameters (SIP headers) that should be passed with call (INVITE) message. Parameter names must start with "X-" to be processed by application

Returns

VoxEngine.customData(cData)

void

Set or get custom string associated with call session. It can be later obtained from Call History using HTTP API.

Parameters
  • cData: String|undefined

    Custom session data to set

VoxEngine.easyProcess(call1, call2, onEstablishedCallback, newReInvite)

void

Adds all default event listeners to pass signaling information between two calls

Parameters
  • call1: Call

    Incoming alerting call

  • call2: Call

    Newly created outgoing call

  • onEstablishedCallback: Function (optional)

    Function to be called once call is established. Both call1 and call2 are passed to this function as parameters

  • newReInvite: Boolean (optional)

    Specifies new reinvite scheme for websdk v4

VoxEngine.forwardCallToPSTN(numberTransform, onEstablishedCallback)

void

Helper function to forward incoming call to PSTN.

Parameters
  • numberTransform: Function (optional)

    Optional function used to transform dialed number to international format. This function accepts dialed number and must return phone number in E.164 format

  • onEstablishedCallback: Function (optional)

    Optional function that is invoked after call is established. Both calls (incoming and outgoing) are passed to this function

VoxEngine.forwardCallToSIP(onEstablishedCallback, video)

void

Helper function to forward incoming call to dialed SIP URI.

Parameters
  • onEstablishedCallback: Function (optional)

    Optional function that is invoked after call is established. Both calls (incoming and outgoing) are passed to this function

  • video: Boolean (optional)

    Specifies if call should have video support. Please note that price for audio-only and video calls is different!

VoxEngine.forwardCallToUser(onEstablishedCallback, video, newReInvite)

void

Helper function to forward incoming call to user of current application. Dialed number is interpreted as username.

Parameters
  • onEstablishedCallback: Function (optional)

    Optional function that is invoked after call is established. Both calls (incoming and outgoing) are passed to this function

  • video: Boolean (optional)

    Specifies if call should have video support. Please note that price for audio-only and video calls is different!

  • newReInvite: Boolean (optional)

    Specifies new reinvite scheme for websdk v4

VoxEngine.forwardCallToUserDirect(onEstablishedCallback, newReInvite)

void

Helper function to forward incoming call to user of current application. Dialed number is interpreted as username. Call is forwarded in P2P mode, so audio playback and recording will not make any effect.

Parameters
  • onEstablishedCallback: Function (optional)

    Optional function that is invoked after call is established. Both calls (incoming and outgoing) are passed to this function

  • newReInvite: Boolean (optional)

    Specifies new reinvite scheme for websdk v4

VoxEngine.playSoundAndHangup(fileURL)

void

Helper function to play sound to incoming call

Parameters
  • fileURL: String

    URL of audio (mp3) file to play

VoxEngine.removeEventListener(appevent, handler)

void

Remove handler for specific event generated by application

Parameters
  • appevent: Function

    Event class (i.e. AppEvents.CallAlerting)

  • handler: Function (optional)

    Handler function. If not specified, all event listeners are removed

VoxEngine.sendMediaBetween(mediaUnit1, mediaUnit2)

void

Start sending media from mediaUnit1 to mediaUnit2 and vice versa

Is a shortcut for
mediaUnit1.sendMediaTo(mediaUnit2); mediaUnit2.sendMediaTo(mediaUnit1);
Parameters

VoxEngine.stopMediaBetween(call1, call2)

void

Stop sending media from call1 to call2 and vice versa

Is a shortcut for
call1.stopMediaTo(call2); call2.stopMediaTo(call1);
Parameters
  • call1: Call

    First call

  • call2: Call

    Second call

VoxEngine.terminate()

void

Terminates current call control session