BoostLingo

BoostLingo

Class that is used for accessing the boostlingo API as well as initiating voice/video calls

Constructor

new BoostLingo(authToken, optionsopt)

Create the Boostlingo instance

Parameters:
Name Type Attributes Description
authToken string

Boostlingo auth token retrieved from the server

options Object <optional>
Properties
Name Type Attributes Description
region string <optional>
logLevel string <optional>

Available levels are: trace | debug | info | warn | error (defaults to warn)

Fires:
  • BoostLingo#event:incomingCallNew
  • BoostLingo#event:incomingCallLost
  • BoostLingo#event:incomingCallAccepted
  • BoostLingo#event:incomingCallConnected

Extends

  • EventEmitter

Methods

(static) regions() → {Array.<string>}

Boostlingo region list

Returns:
Type
Array.<string>

(static) version() → {string}

Boostlingo library version

Returns:
Type
string

(protected) _attachTracks(localMedia, tracks)

Attaches tracks

Parameters:
Name Type Description
localMedia string
tracks any

(protected) _createTwilioDevice(twilioAccessToken, callInfo)

Creates Twilio device

Parameters:
Name Type Description
twilioAccessToken string
callInfo any

(protected) _interpreterRoleAccessCheck(allowedRoles) → {bool}

Interpreter role access check

Parameters:
Name Type Description
allowedRoles Array.<string>
Returns:
Type
bool

(protected) _joinRoom(roomId, token)

Joins room

Parameters:
Name Type Description
roomId string
token string

(protected) _makeCall(callReq, isVideo, remoteContainer, localContaineropt) → {Promise.<Call>}

Helper for the creation of a video or voice call

Parameters:
Name Type Attributes Description
callReq CallRequest
isVideo boolean
remoteContainer HTMLElement
localContainer HTMLElement <optional>
Returns:
Type
Promise.<Call>

(protected) _parseAuthToken(authToken) → {object}

Auth token parser

Parameters:
Name Type Description
authToken string
Returns:
Type
object

(protected) _requestorRoleAccessCheck(allowedRoles) → {bool}

Requestor role access check

Parameters:
Name Type Description
allowedRoles Array.<string>
Returns:
Type
bool

(protected) _resetIncomingCall()

Resets incoming call

disableVideo() → {Promise.<Object>}

Disables video for incoming call

Returns:
Type
Promise.<Object>

enableVideo() → {Promise.<Object>}

Enables video for incoming call

Returns:
Type
Promise.<Object>

getCallDetails(callId) → {Promise.<CallDetails>}

Used to get details on a call after the call has completed

Parameters:
Name Type Description
callId number
Returns:
Type
Promise.<CallDetails>

getCallDictionaries() → {Promise.<CallDictionaries>}

Retrieves the call dictionaries from the boostlingo API. Should be used for setting up language and service type lists, but also called from validateCallRequest caches the results so API is not hit every time.

Returns:
Type
Promise.<CallDictionaries>

getCurrentCall() → {Call}

Can be used to get the current (latest) call made through boostlingo

Returns:
Type
Call

getVideoLanguages() → {Promise.<Array.<Language>>}

Retrieves an ordered list of languages enabled in the video (VRI) policy. Helper for filtering and sorting the full list of languages. Uses the cached call dictionary.

Returns:
Type
Promise.<Array.<Language>>

getVoiceLanguages() → {Promise.<Array.<Language>>}

Retrieves an ordered list of languages enabled in the voice (OPI) policy. Helper for filtering and sorting the full list of languages. Uses the cached call dictionary.

Returns:
Type
Promise.<Array.<Language>>

goOffline() → {Promise.<Object>}

Goes offline

Returns:
Type
Promise.<Object>

goOnline() → {Promise.<Object>}

Goes online

Returns:
Type
Promise.<Object>

hangupCall() → {Promise.<Object>}

Hangs up incoming call

Returns:
Type
Promise.<Object>

makeVideoCall(callReq, remoteContainer, localContaineropt) → {Promise.<VideoCall>}

Used to make/place a VideoCall in boostlingo

Parameters:
Name Type Attributes Description
callReq CallRequest
remoteContainer HTMLElement

html element where remote video/audio html5 elements will be placed

localContainer HTMLElement <optional>

html element where local video/audio html5 elements will be placed

Returns:
Type
Promise.<VideoCall>

makeVoiceCall(callReq) → {Promise.<VoiceCall>}

Used to make/place a VoiceCall in boostlingo

Parameters:
Name Type Description
callReq CallRequest
Returns:
Type
Promise.<VoiceCall>

mute() → {Promise.<Object>}

Mutes incoming call

Returns:
Type
Promise.<Object>

pickCall() → {Promise.<Object>}

Picks incoming call

Returns:
Type
Promise.<Object>

registerInterpreterSignalRListeners(localMedia, remoteMedia) → {Promise.<Object>}

Registers interpreter SignalR listeners

Parameters:
Name Type Description
localMedia string
remoteMedia string
Returns:
Type
Promise.<Object>

startInterpreterSignalRConnection() → {Promise.<Object>}

Starts interpreter SignalR connection

Returns:
Type
Promise.<Object>

unmute() → {Promise.<Object>}

Unmutes incoming call

Returns:
Type
Promise.<Object>

validateCallReq(callReq, isVideo) → {Promise}

Validates the call request is appropriate to start a call. Can be called directly, but it is always called when making video/voice calls.

Parameters:
Name Type Description
callReq CallRequest
isVideo boolean
Returns:
Type
Promise