Client class used to control platform functions. Can't be instantiatied directly (singleton), please use VoxImplant.getInstance to get the class instance.

Methods

acceptChatRoomInvite(room, pass)

void

Accept invitation to join chat room. See also VoxImplant.IMEvents.ChatRoomInfo

Parameters
  • room: String

    Room id

  • pass: String (optional)

    Password for room access

acceptSubscription(uri)

void

Authorize the user to let him see your presence and send you messages (IM). See also VoxImplant.IMEvents.SubscriptionRequest

Parameters
  • uri: String

    User id

addEventListener(event, handler)

void

Register handler for specified event

Parameters

addRosterItem(uri, name, group, message)

void

Add roster item (IM). See also VoxImplant.IMEvents.RosterItemChange

Parameters
  • uri: String

    User id

  • name: String

    Display name

  • group: String (optional)

    User group

  • message: String (optional)

    Intro message for the user

addRosterItemGroup(uri, group)

void

Add roster item group (IM). See also VoxImplant.IMEvents.RosterItemChange

Parameters
  • uri: String

    User id

  • group: String

    Group name

attachRecordingDevice(successCallback, failedCallback)

void

Enable microphone/camera if micRequired in VoxImplant.Config was set to false (WebRTC mode only)

Parameters
  • successCallback: Function (optional)

    Called if selected recording devices were attached successfully (WebRTC: has MediaStream object as its argument)

  • failedCallback: Function (optional)

    Called if selected recording devices couldn't be attached

audioOutputs()

Array

Get a list of all currently available audio playback devices

Returns
  • Array

audioSources()

Array

Get a list of all currently available audio sources / microphones

Returns
  • Array

banChatRoomUser(room, uri, reason)

void

Ban user from the chat room. See also VoxImplant.IMEvents.ChatRoomParticipantExit

Parameters
  • room: String

    Room id

  • uri: String

    User id

  • reason: String (optional)

    Reason

call(num, useVideo, customData, extraHeaders)

VoxImplant.Call

Create call

Parameters
  • num: String

    The number to call. For SIP compatibility reasons it should be a non-empty string even if the number itself is not used by a Voximplant cloud scenario.

  • useVideo: Boolean (optional)

    Tells if video should be supported for the call

  • customData: String (optional)

    Custom string associated with the call session. It can be later obtained from Call History using HTTP API

  • 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. IMPORTANT: Headers size limit is 200 bytes.

Returns

connect()

void

Connect to VoxImplant Cloud

connected()

Boolean

Check if connected to VoxImplant Cloud

Returns
  • Boolean

createChatRoom(pass, users)

String

Create multi-user chat room, join it and return room id. See also VoxImplant.IMEvents.ChatRoomCreated

Parameters
  • pass: String (optional)

    Password for room access

  • users: Array (optional)

    User ids of the invited users to the chat room

Returns
  • String

declineChatRoomInvite(room, uri, reason)

void

Decline invitation to join chat room. See also VoxImplant.IMEvents.ChatRoomInviteDeclined

Parameters
  • room: String

    Room id

  • uri: String

    User id (inviter)

  • reason: String (optional)

    User-supplied decline reason

detachRecordingDevice()

void

Disable microphone/camera if micRequired in VoxImplant.Config was set to false (WebRTC mode only)

disconnect()

void

Disconnect from VoxImplant Cloud

editChatRoomMessage(room, message_id, msg)

void
Parameters
  • room: String

    Room id

  • message_id: String

    Message id

  • msg: String

    New message content

editInstantMessage(uri, message_id, msg)

void

Edit message sent to user. See also VoxImplant.IMEvents.MessageModified

and VoxImplant.IMEvents.MessageNotModified
Parameters
  • uri: String

    User id

  • message_id: String

    Message id

  • msg: String

    New message content

getChatRoomHistory(room, message_id, direction, count)

void

Request chat room history. See also VoxImplant.IMEvents.ChatRoomHistoryReceived

Parameters
  • room: String

    Room id

  • message_id: String (optional)

    Message id (to get messages sent before/after the message)

  • direction: String (optional)

    False/true to get messages older/newer than the message with specified id

  • count: Number (optional)

    Number of messages

getInstantMessagingHistory(uri, message_id, direction, count)

void

Request instant messaging history in a conversation with particular user. See also VoxImplant.IMEvents.ChatHistoryReceived

Parameters
  • uri: String

    User id

  • message_id: String (optional)

    Message id (to get messages sent before/after the message)

  • direction: String (optional)

    False/true to get messages older/newer than the message with specified id

  • count: Number (optional)

    Number of messages

init(config)

void

Initialize SDK. SDKReady event will be dispatched after succesful SDK initialization. SDK can't be used until it's initialized

Parameters

inviteToChatRoom(room, uri, reason)

void

Invite user to join chat room. See also VoxImplant.IMEvents.ChatRoomInvitation

Parameters
  • room: String

    Room id

  • uri: String

    User id (invitee)

  • reason: String (optional)

    User-supplied reason for the invitation

isRTCsupported()

Boolean

Check if WebRTC support is available

Returns
  • Boolean

joinChatRoom(room, pass)

void

Join multi-user chat room. See also VoxImplant.IMEvents.ChatRoomInfo

Parameters
  • room: String

    Room id

  • pass: String (optional)

    Password for room access

leaveChatRoom(room, msg)

void

Leave multi-user chat room. See also VoxImplant.IMEvents.ChatRoomParticipantExit

Parameters
  • room: String

    Room id

  • msg: String (optional)

    Message for other participants

login(username, password, options)

void

Login into application

Parameters
  • username: String

    Fully-qualified username that includes Voximplant user, application and account names. The format is: "username@appname.accname.voximplant.com".

  • password: String

  • options: VoxImplant.LoginOptions (optional)

loginWithCode(username, code, options)

void

Login into application using 'code' auth method

Parameters
  • username: String

    Fully-qualified username that includes Voximplant user, application and account names. The format is: "username@appname.accname.voximplant.com".

  • code: String

  • options: VoxImplant.LoginOptions (optional)

loginWithOneTimeKey(username, hash, options)

void

Login into application using 'onetimekey' auth method

Hash should be calculated with the key received in AuthResult event. See "Automated Login" tutorial for details
Parameters
  • username: String

    Fully-qualified username that includes Voximplant user, application and account names. The format is: "username@appname.accname.voximplant.com".

  • hash: String

  • options: VoxImplant.LoginOptions (optional)

moveRosterItemGroup(uri, groupSrc, groupDst)

void

Move roster item group (IM). See also VoxImplant.IMEvents.RosterItemChange

Parameters
  • uri: String

    User id

  • groupSrc: String

    Group name (source)

  • groupDst: String

    Group name (destination)

playToneScript(script, loop)

void

Play ToneScript using WebAudio API

Parameters
  • script: String

    Tonescript string

  • loop: Boolean (optional)

    Loop playback if true

rejectSubscription(uri)

void

Don't let the user see your presence and send you messages (IM). See also VoxImplant.IMEvents.SubscriptionRequest

Parameters
  • uri: String

    User id

removeChatRoomMessage(room, message_id)

void

Remove message in the chat room. See also VoxImplant.IMEvents.ChatRoomMessageRemoved

Parameters
  • room: String

    Room id

  • message_id: String

    Message id

removeChatRoomUser(room, uri, reason)

void

Remove user from the chat room. See also VoxImplant.IMEvents.ChatRoomParticipantExit

Parameters
  • room: String

    Room id

  • uri: String

    User id

  • reason: String (optional)

    Reason

removeEventListener(event, handler)

void

Remove handler for specified event

Parameters

removeInstantMessage(uri, message_id)

void

Remove message sent to user. See also VoxImplant.IMEvents.MessageRemoved

Parameters
  • uri: String

    User id

  • message_id: String

    Message id

removeRosterItem(uri)

void

Remove roster item (IM). See also VoxImplant.IMEvents.RosterItemChange

Parameters
  • uri: String

    User id

removeRosterItemGroup(uri, group)

void

Remove roster item group (IM). See also VoxImplant.IMEvents.RosterItemChange

Parameters
  • uri: String

    User id

  • group: String

    Group name

renameRosterItem(uri, name)

void

Rename roster item (IM). See also VoxImplant.IMEvents.RosterItemChange

Parameters
  • uri: String

    User id

  • name: String

    New display name

requestOneTimeLoginKey(username)

void

Request a key for 'onetimekey' auth method

Server will send the key in AuthResult event with code 302
Parameters
  • username: String

    Fully-qualified username that includes Voximplant user, application and account names. The format is: "username@appname.accname.voximplant.com".

sendChatRoomMessage(room, msg)

String

Send message to chat room. See also VoxImplant.IMEvents.ChatRoomMessageReceived

Parameters
  • room: String

    Room id

  • msg: String

    Message for other participants

Returns
  • String

sendInstantMessage(uri, content)

String

Send message to user (IM). See also VoxImplant.IMEvents.MessageStatus

Parameters
  • uri: String

    User id

  • content: String

    Message content

Returns
  • String

sendVideo(flag)

void

Start/stop sending local video to remote party/parties

Parameters
  • flag: Boolean (optional)

    Start/stop - true/false

setCallActive(call, active)

void

Set active call

Parameters
  • call: VoxImplant.Call

    VoxImplant call instance

  • active: Boolean (optional)

    If true make call active, otherwise make call inactive

setChatRoomState(room, status)

void

Set chat room session state info. See also VoxImplant.IMEvents.ChatRoomStateUpdate

Parameters

setChatRoomSubject(room, subject)

void

Set new chat room subject. See also VoxImplant.IMEvents.ChatRoomSubjectChange

Parameters
  • room: String

    Room id

  • subject: String

    New subject

setChatState(uri, status)

void

Set chat session state info. See also VoxImplant.IMEvents.ChatStateUpdate

Parameters

setLocalVideoPosition(x, y)

void

Set local video position

Parameters
  • x: Number

    Horizontal position (px)

  • y: Number

    Vertical position (px)

setLocalVideoSize(width, height)

void

Set local video size

Parameters
  • width: Number

    Width in pixels

  • height: Number

    Height in pixels

setMessageStatus(uri, type, message_id)

void

Set message(s) status. See also VoxImplant.IMEvents.MessageStatus

Parameters

setOperatorACDStatus(status)

void

Set ACD status

Parameters

setPresenceStatus(status, msg)

void

Set presence. See also VoxImplant.IMEvents.PresenceUpdate

Parameters

setSwfColor(color)

void

Set background color of flash app (only for Flash mode)

Parameters
  • color: String

    Color in web format (i.e. #000000 for black)

setVideoBandwidth(bandwidth)

void

Set bandwidth limit for video calls. Currently supported by Chrome/Chromium. (WebRTC mode only). The limit will be applied for the next call.

Parameters
  • bandwidth: Number

    Bandwidth limit in kilobits per second (kbps)

setVideoSettings(settings, successCallback, failedCallback)

void

Set video settings globally. This settings will be used for the next call.

Parameters

showFlashSettingsPanel(panel)

void

Show flash settings panel

Parameters
  • panel: String (optional)

    Settings type - default/microphone/camera/etc as described in SecurityPanel class

showLocalVideo(flag)

void

Show/hide local video

Parameters
  • flag: Boolean (optional)

    Show/hide - true/false

stopPlayback()

void

Stop playing ToneScript using WebAudio API

transferCall(call1, call2)

void

Transfer call, depending on the result VoxImplant.CallEvents.TransferComplete or VoxImplant.CallEvents.TransferFailed event will be dispatched.

Parameters

unbanChatRoomUser(room, uri, reason)

void

Remove a ban on a user in the chat room. See also VoxImplant.IMEvents.ChatRoomNewParticipant

Parameters
  • room: String

    Room id

  • uri: String

    User id

  • reason: String (optional)

    Reason

useAudioSource(id, successCallback, failedCallback)

void

Use specified audio source , use audioSources to get the list of available audio sources

Parameters
  • id: Number|String

    Id of the audio source

  • successCallback: Function (optional)

    Called in WebRTC mode if audio source changed successfully (WebRTC: has MediaStream object as its argument)

  • failedCallback: Function (optional)

    Called in WebRTC mode if audio source couldn't changed successfully

useVideoSource(id, successCallback, failedCallback)

void

Use specified video source , use videoSources to get the list of available video sources

Parameters
  • id: Number|String

    Id of the video source

  • successCallback: Function (optional)

    Called in WebRTC mode if video source changed successfully (WebRTC: has MediaStream object as its argument)

  • failedCallback: Function (optional)

    Called in WebRTC mode if video source couldn't changed successfully

videoSources()

Array

Get a list of all currently available video sources / cameras

Returns
  • Array