<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## create

The SDK creation factory. Create an instance of the SDK by calling this factory with the desired configurations.
The SDK instance will be refered as 'api' throughout the rest of the documentation content.

**Parameters**

-   `config` **[config][1]** The configuration object.

**Examples**

```javascript
// Instantiate the SDK.
import { create } from 'kandy'
const client = create({
    authentication: { ... },
    logs: { ... },
    ...
});
// Use the SDK's API.
client.on( ... );
```

Returns **[api][2]** The SDK instance.

## config

The configuration object. This object defines what different configuration
values you can use when instantiating the SDK using the [create][3] function.

### config.logs

Configuration options for the Logs feature.

The SDK will log information about the operations it is performing. The
   amount of information will depend on how the Logs feature is configured.

The format of logs can also be customized by providing a
   [LogHandler][4]. This function will receive a
   [LogEntry][5] which it can handle as it sees fit. By
   default, the SDK will log information to the console. For more
   information, see the [Logs feature][6] description.

**Parameters**

-   `logs` **[Object][7]** Logs configs.
    -   `logs.logLevel` **[string][8]** Log level to be set. See [logger.levels][9]. (optional, default `'debug'`)
    -   `logs.handler` **[logger.LogHandler][10]?** The function to receive log entries from the
           SDK. If not provided, a default handler will be used that logs entries
           to the console.
    -   `logs.enableFcsLogs` **[boolean][11]** Enable the detailed call logger
           for v3.X. Requires log level debug. (optional, default `true`)
    -   `logs.logActions` **([Object][7] \| [boolean][11])** Options specifically for action logs when
           logLevel is at DEBUG+ levels. Set this to false to not output action logs. (optional, default `false`)
        -   `logs.logActions.handler` **[logger.LogHandler][10]?** The function to receive action
               log entries from the SDK. If not provided, a default handler will be used
               that logs actions to the console.
        -   `logs.logActions.actionOnly` **[boolean][11]** Only output information
               about the action itself. Omits the SDK context for when it occurred. (optional, default `false`)
        -   `logs.logActions.collapsed` **[boolean][11]** Whether logs should be
               minimized when initially output. The full log is still output and can be
               inspected on the console. (optional, default `false`)
        -   `logs.logActions.diff` **[boolean][11]** Include a diff of what SDK
               context was changed by the action. (optional, default `false`)
        -   `logs.logActions.level` **[string][8]** Log level to be set
               on the action logs (optional, default `'debug'`)
        -   `logs.logActions.exposePayloads` **[boolean][11]** Allow action payloads
               to be exposed in the logs, potentially displaying sensitive information. (optional, default `true`)

### config.authentication

Configuration options for the Authentication feature.

**Parameters**

-   `authentication` **[Object][7]** Authentication configs.
    -   `authentication.subscription` **[Object][7]** 
        -   `authentication.subscription.server` **[string][8]** Hostname of the server to be used for subscription requests.
        -   `authentication.subscription.protocol` **[string][8]** Protocol to be used for subscription requests. (optional, default `'https'`)
        -   `authentication.subscription.port` **[Number][12]** Port to be used for subscription requests. (optional, default `443`)
        -   `authentication.subscription.expires` **[Number][12]** Time duration, in seconds, until a subscription should expire. (optional, default `3600`)
        -   `authentication.subscription.service` **[Array][13]?** Services to subscribe to for notifications. Default value is ['call', 'IM', 'presence'].
        -   `authentication.subscription.localization` **[string][8]**  (optional, default `English_US`)
        -   `authentication.subscription.useTurn` **[Boolean][11]**  (optional, default `true`)
        -   `authentication.subscription.notificationType` **[string][8]**  (optional, default `Websocket`)
    -   `authentication.websocket` **[Object][7]** 
        -   `authentication.websocket.server` **[string][8]** Hostname of the server to be used for websocket notifications.
        -   `authentication.websocket.protocol` **[string][8]** Protocol to be used for websocket notifications. (optional, default `'wss'`)
        -   `authentication.websocket.port` **[Number][12]** Port to be used for websocket notifications. (optional, default `443`)
    -   `authentication.earlyRefreshMargin` **[Number][12]**  (optional, default `300`)

### config.call

Configuration options for the call feature.

**Parameters**

-   `call` **[Object][7]** The call configuration object.
    -   `call.callDefaults` **[Object][7]?** Default options to be used when making/answering a call.
        -   `call.callDefaults.isAudioEnabled` **[boolean][11]** Specifies whether audio is enabled or not. (optional, default `true`)
        -   `call.callDefaults.isVideoEnabled` **[boolean][11]** Specifies whether video is enabled or not. (optional, default `true`)
        -   `call.callDefaults.sendInitialVideo` **[boolean][11]** Specifies whether to send an inital video stream or not. (optional, default `false`)
        -   `call.callDefaults.remoteVideoContainer` **[Object][7]?** Specifies the container where video (coming from remote party) is rendered.
        -   `call.callDefaults.localVideoContainer` **[Object][7]?** Specifies the container where video (coming from local party) is rendered.
    -   `call.chromeExtensionId` **[string][8]?** ID of the screenshare extension being used for screenshare of Google Chrome.
    -   `call.recordCallStats` **[boolean][11]** Whether to enable the recording of call statistics as part of app's local storage. (optional, default `false`)
    -   `call.earlyMedia` **[boolean][11]** Whether to use early media (e.g. for playing incoming tones) as part of an outgoing call. (optional, default `false`)
    -   `call.callAuditTimer` **[number][12]** Audit time value for calls, as a positive number in milliseconds. (optional, default `30000`)
    -   `call.activeCallTimeoutMS` **[number][12]** Timeout for an existing ringing call before it gets terminated, as a positive number in milliseconds. (optional, default `120000`)
    -   `call.ringingFeedback` **[boolean][11]?** When enabled, inform Spidr that RingingFeedback is supported.
    -   `call.codecsToReplace` **[string][8]?** Specifies alternative audio/video codecs to use for a given call. It has been deprecated so pipeline parameter should be used instead.
    -   `call.videoInactiveOnHold` **[boolean][11]** Sets the video as "inactive" instead of "sendonly" when holding a call. (optional, default `false`)
    -   `call.forceDisableMediaOnHold` **[boolean][11]** Disables any type of media (e.g. Comfort Noise) from transmitting when call is held locally. (optional, default `false`)
    -   `call.iceCandidateCollectionTimeoutInterval` **[number][12]** When provided (in milliseconds), ice candidate collection is assumed to be completed if at least one candidate is received within the interval. (optional, default `3000`)
    -   `call.relayCandidateCollectionTimeoutCycle` **[boolean][11]** When enabled, iceCandidateCollectionTimeoutInterval is restarted until receiving first relay candidate. If the provided cycle limit is reached, ice candidate collection assumed to be completed. (optional, default `false`)
    -   `call.recordCallStats` **[boolean][11]** When enabled, call statistics are recorded in app's localstorage after the call is terminated. (optional, default `false`)
    -   `call.callConstraints` **[Object][7]?** Custom RTCPeerConnection constraints to use for calls. Will cause errors if malformed.
        -   `call.callConstraints.chrome` **[Object][7]?** Custom constraints to be used on Google Chrome.
        -   `call.callConstraints.firefox` **[Object][7]?** Custom constraints to be used on Mozilla Firefox.
    -   `call.bundlePolicy` **[string][8]** The bundle policy to use for peer connections. Value can be fcs.SDP_CONSTANTS.BUNDLE_POLICY.MAX_COMPAT, fcs.SDP_CONSTANTS.BUNDLE_POLICY.MAX_BUNDLE, fcs.SDP_CONSTANTS.BUNDLE_POLICY.BALANCED or fcs.SDP_CONSTANTS.BUNDLE_POLICY.DISABLED. The DISABLED option means that bundle group lines will be removed from every SDP. (optional, default `'DISABLED'`)
    -   `call.opusConfig` **[Object][7]?** Bandwidth controls to add for Opus audio codec.
        -   `call.opusConfig.maxPlaybackRate` **[number][12]?** Maximum playback rate, in bits per second. Must be a positive value between 8000 and 48000.
        -   `call.opusConfig.maxAverageBitrate` **[number][12]?** A bitrate encoding value between 6000 and 510000 bits per second.
        -   `call.opusConfig.fec` **[number][12]?** Specifies whether Forward Error Correction is enabled or not. When enabled, FEC provides robustness against packet loss. Acceptable values can only be 0 or 1.
        -   `call.opusConfig.dtx` **[number][12]?** Specifies whether Discontinuous Transmission mode is enabled or not. When enabled, DTX reduces the bitrate during silence or background noise. Acceptable values can only be 0 or 1.
        -   `call.opusConfig.ptime` **[number][12]?** Packet (i.e. frame) duration in milliseconds. Frames will be combined into packets to achieve the maximum of 120 ms duration. A positive value between 2.5 and 120.
    -   `call.webrtcLogCollectionInterval` **[number][12]** Interval at which to collect WebRTC logs for calls, in milliseconds. (optional, default `3000`)
    -   `call.useRelay` **[boolean][11]** Whether we should force connection through the relay candidates (i.e. TURN server). Mostly used for testing. (optional, default `false`)
    -   `call.trickleIceSupport` **[string][8]** Whether we should advertise and use Trickle ICE. Accepted value is one of: 'none', 'half' or 'full'. (optional, default `'none'`)
    -   `call.continuity` **[boolean][11]** Whether an existing voice call can be persisted, as a mobile phone moves between circuit switched and packet switched domains (e.g. GSM to WiFi). (optional, default `false`)
    -   `call.resyncOnConnect` **[boolean][11]** Whether all active calls should be resynched upon connecting or reconnecting to the websocket (requires Kandy Link 4.7.1+). (optional, default `false`)

### config.connectivity

Configuration options for the Connectivity feature.
The SDK can only use keepalive as the connectivity check.

Keep Alive: The client sends "keepalive" messages (to the server) on the websocket at regular intervals. This lets the server know that the client is still connected, and that it should "keep the connection alive".

For more information on keepalive see here: [https://en.wikipedia.org/wiki/Keepalive][14]

**Parameters**

-   `connectivity` **[Object][7]** Connectivity configs.
    -   `connectivity.pingInterval` **[Number][12]** Time in between websocket ping attempts (milliseconds). (optional, default `30000`)
    -   `connectivity.reconnectLimit` **[Number][12]** Number of failed reconnect attempts before reporting an error. Can be set to 0 to not limit reconnection attempts. (optional, default `5`)
    -   `connectivity.reconnectDelay` **[Number][12]** Base time between websocket reconnect attempts (milliseconds). (optional, default `5000`)
    -   `connectivity.reconnectTimeMultiplier` **[Number][12]** Reconnect delay multiplier for subsequent attempts. The reconnect delay time will be multiplied by this after each failed reconnect attempt to increase the delay between attempts. eg. 5000ms then 10000ms then 20000ms delay if value is 2. (optional, default `1`)
    -   `connectivity.reconnectTimeLimit` **[Number][12]** Maximum time delay between reconnect attempts (milliseconds). Used in conjunction with the reconnect time multiplier to prevent overly long delays between reconnection attempts. (optional, default `640000`)
    -   `connectivity.autoReconnect` **[Boolean][11]** Flag to determine whether the SDK will attempt to automatically reconnect after connectivity disruptions. (optional, default `true`)
    -   `connectivity.maxMissedPings` **[Number][12]** Maximum pings sent (without receiving a response) before reporting an error. (optional, default `3`)
    -   `connectivity.checkConnectivity` **[Boolean][11]** Flag to determine whether the SDK should check connectivity. (optional, default `true`)
    -   `connectivity.webSocketOAuthMode` **[string][8]** query will send the bearer access token to authenticate the websocket and none will not send it. (optional, default `query`)

### config.notifications

Configuration options for the notification feature.

**Parameters**

-   `notifications` **[Object][7]** The notifications configuration object.
    -   `notifications.idCacheLength` **[number][12]** Default amount of event ids to remember for de-duplication purposes. (optional, default `100`)
    -   `notifications.incomingCallNotificationMode` **[string][8]** Communication channel mode used for incoming call notifications. Supported values are 'any-channel' or 'push-channel-only'. (optional, default `'any-channel'`)
    -   `notifications.pushRegistration` **[Object][7]?** Object describing the server to use for push services.
        -   `notifications.pushRegistration.server` **[string][8]?** Hostname for the push registration server.
        -   `notifications.pushRegistration.port` **[string][8]?** Port for the push registration server.
        -   `notifications.pushRegistration.protocol` **[string][8]?** Protocol for the push registration server.
        -   `notifications.pushRegistration.version` **[string][8]?** Version for the push registration server.

## call:error

An error has occurred with a call.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.callId` **[string][8]** The id of the call.
    -   `params.error` **[api.BasicError][15]** The Basic error object.

## call:forward

A call has successfully been forwarded.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.callId` **[string][8]** The Id of the call.

## call:join

Calls have been successfully joined.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.callId` **[string][8]** The ID of the new, joined call.
    -   `params.joinedCalls` **[Array][13]** The two calls that were joined together.

## call:mediaStateChange

A call's media state has changed.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.callId` **[string][8]** The Id of the call.
    -   `params.mediaState` **[string][8]** New media state of the call.

## call:receive

A new incoming call has been received.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.callId` **[string][8]** The Id of the call.

**Examples**

```javascript
client.on('call:receive', function(callId) {
    // We have received a call, prompt the user to respond.
    promptUser(client.call.getById(callId));
});
```

## call:screenshareChange

Screensharing has been started turned on or off.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.callId` **[string][8]** The Id of the call.

## call:start

An outgoing call has successfully started.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.callId` **[string][8]** The Id of the call.

## call:stateChange

A call's state has changed.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.callId` **[string][8]** The Id of the call.
    -   `params.state` **[string][8]** New state of the call.
    -   `params.transition` **[Object][7]** Information about the state change.
        -   `params.transition.code` **[number][12]** Code representing the reason for the state change.
        -   `params.transition.reasonText` **[string][8]** Explanation of the status code.
        -   `params.transition.oldState` **[string][8]** The previous state of the call.

**Examples**

```javascript
client.on('call:stateChange', function(params) {
    // We are now in call with another user, so update our app to show it.
    if(params.state === client.call.states.IN_CALL) {
        renderCall(client.call.getById(params.callId));
    }
});
```

## devices:change

Available media devices have been changed.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.devices` **[Object][7]** The devices, seperated by device type.

## devices:defaultsChange

A change has been made to default devices used for calls.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.devices` **[Object][7]** The devices now set as default.

## media:initialize

Media support has been checked.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.result` **[Object][7]** Results of initializing media.
        -   `params.result.error` **[boolean][11]** Whether the initiazation was successful or not.
        -   `params.result.code` **[number][12]** A unqiue code describing the result scenario.
        -   `params.result.message` **[string][8]** Human readable message of the result.

## videoPreview:change

The status of previewing local video has changed.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.displaying` **[boolean][11]** Whether the local video preview is being displayed or not.

## videoPreview:error

An error has occurred when changing local video preview status.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.error` **[api.BasicError][15]** Information about the error.

## api

The 'api' is the type returned by the create function.
It contains various top-level functions that pertain to SDK global instance
as well as several nested namespaces that pertain to various features (e.g. call, contacts, presence, etc).

### getVersion

Returns the current version of the API.

### destroy

Destroys the SDK, and removes its state, rendering the SDK unusable.
Useful when a user logs out and their call data needs to be destroyed.
The SDK must be recreated to be usable again.
The destroy command is async, and will happen on the next tick
  so as not to interfere with any ongoing events.

**Examples**

```javascript
// Instantiate the SDK.
import { create } from 'kandy'
const config = {
    authentication: { ... },
    logs: { ... },
    ...
}
let client = create(config);
client.on( ... )
// Use the SDK
...
// Destroy the SDK, then recreate on the next step
client.destroy()
client = create(config)
client.on( ... )
```

### getConfig

Gets the current configuration Object. This is the object that is initially set as part of SDK creation using 'create' function.

Returns **[Object][7]** A configuration Object.

### updateConfig

Update values in the global Config section of the store. The values pertain to the SDK configuration.

**Parameters**

-   `newConfigValues` **[Object][7]** Key-value pairs that will be placed into the store. See [config][16] for details on what key-value pairs are available for use.

### on

Add an event listener for the specified event type. The event is emitted by the SDK instance.

**Parameters**

-   `type` **[string][8]** The event type for which to add the listener.
-   `listener` **[Function][17]** The listener for the event type. The parameters of the listener depend on the event type.

**Examples**

```javascript
// Listen for events of a specific type emitted by the SDK.
client.on('dummy:event', function (params) {
   // Handle the event.
})
```

-   Throws **[Error][18]** Invalid event type

### off

Removes an event listener for the specified event type. The event is emitted by the SDK instance.

**Parameters**

-   `type` **[string][8]** The event type for which to remote the listener.
-   `listener` **[Function][17]** The listener to remove.


-   Throws **[Error][18]** Invalid event type

### subscribe

Adds a global event listener to SDK instance.

**Parameters**

-   `listener` **[Function][17]** The event listener to add. The parameters are (type, ...args), where args depend on the event type.


-   Throws **[Error][18]** Listener not a function

### unsubscribe

Removes a global event listener from SDK instance.

**Parameters**

-   `listener` **[Function][17]** The event listener to remove.


-   Throws **[Error][18]** Listener not a function

### connect

Connect with user credentials to any backend services that the SDK instance deals with.

**Parameters**

-   `credentials` **[Object][7]** The credentials object.
    -   `credentials.username` **[string][8]** The username including the application's domain.
    -   `credentials.password` **[string][8]** The user's password.
    -   `credentials.authname` **[string][8]?** The user's authorization name.
-   `options` **[Object][7]?** The options object for non-credential options.
    -   `options.forceLogOut` **[boolean][11]?** Force the oldest connection to log out if too many simultaneous connections. Link only.
    -   `options.clientCorrelator` **[string][8]?** Unique ID for the client. This is used by the platform to identify an instance of the application used by the specific device.

**Examples**

```javascript
client.connect({
  username: 'alfred@example.com',
  password: '********'
  authname: '********'
}, {
  forceLogOut: true
});
```

**Meta**

-   **deprecated**: Since version 4.19.0. Please see [setCredentials][19] and [subscribe][20] for new method of connecting.


### connect

Connect by providing an access token to any backend services that the SDK instance deals with.
You can optionally provide a refresh token and the SDK will automatically get new access tokens.

**Parameters**

-   `credentials` **[Object][7]** The credentials object.
    -   `credentials.username` **[string][8]** The username without the application's domain.
    -   `credentials.accessToken` **[string][8]** An access token for the user with the provided user Id.
    -   `credentials.refreshToken` **[string][8]?** A refresh token for the same user.
    -   `credentials.expires` **[number][12]?** The time in seconds until the access token will expire.
-   `options` **[Object][7]?** The options object for non-credential options.
    -   `options.clientCorrelator` **[string][8]?** Unique ID for the client. This is used by the platform to identify an instance of the application used by the specific device.

**Examples**

```javascript
client.connect({
  username: 'alfred@example.com',
  accessToken: 'AT0V1fswAiJadokx1iJMQdG04pRf',
  refreshToken: 'RTG9SV3QAoJaeUSEQCZAHqrhde1yT',
  expires: 3600
});
```

**Meta**

-   **deprecated**: Since version 4.19.0. Please see [setCredentials][19] and [subscribe][20] for new method of connecting.


### connect

Connect by providing a refresh token, to any backend services that the SDK instance deals with.

**Parameters**

-   `credentials` **[Object][7]** The credentials object.
    -   `credentials.username` **[string][8]** The username without the application's domain.
    -   `credentials.refreshToken` **[string][8]** A refresh token for the same user.
    -   `credentials.expires` **[number][12]?** The time in seconds until the access token will expire.
-   `options` **[Object][7]?** The options object for non-credential options.
    -   `options.clientCorrelator` **[string][8]?** Unique ID for the client. This is used by the platform to identify an instance of the application used by the specific device.

**Examples**

```javascript
client.connect({
  username: 'alfred@example.com',
  refreshToken: 'RTG9SV3QAoJaeUSEQCZAHqrhde1yT'
  expires: 3600
});
```

**Meta**

-   **deprecated**: Since version 4.19.0. Please see [setCredentials][19] and [subscribe][20] for new method of connecting.


### connect

Connect by providing an OAuth token, to any backend services that the SDK instance deals with.

**Parameters**

-   `credentials` **[Object][7]** The credentials object.
    -   `credentials.username` **[string][8]** The username without the application's domain.
    -   `credentials.oauthToken` **[string][8]** An OAuth token provided by an outside service.
-   `options` **[Object][7]?** The options object for non-credential options.
    -   `options.clientCorrelator` **[string][8]?** Unique ID for the client. This is used by the platform to identify an instance of the application used by the specific device.

**Examples**

```javascript
client.connect({
  username: 'alfred@example.com',
  oauthToken: 'RTG9SV3QAoJaeUSEQCZAHqrhde1yT'
});
```

**Meta**

-   **deprecated**: Since version 4.19.0. Please see [setCredentials][19] and [subscribe][20] for new method of connecting.


### disconnect

Disconnects from the backend. This will close the websocket and you will stop receiving events.

**Meta**

-   **deprecated**: Since version 4.19.0. Please see [unsubscribe][21] for new method of disconnecting.


### updateToken

If you're authenticating with tokens that expire and have not provided a refresh token to the `connect` function, you can update your access token with `updateToken` before it expires to stay connected.

**Parameters**

-   `credentials` **[Object][7]** The credentials object.
    -   `credentials.accessToken` **[string][8]** The new access token.
    -   `credentials.username` **[string][8]** The username without the application's domain.
    -   `credentials.accessToken` **[string][8]** An access token for the user with the provided user Id.
-   `credentials` **[Object][7]** The credentials object.

### updateToken

If you're authenticating with tokens that expire and have not provided a refresh token to the `connect` function, you can update your access token with `updateToken` before it expires to stay connected.

**Parameters**

-   `credentials` **[Object][7]** The credentials object.
    -   `credentials.username` **[string][8]** The username without the application's domain.
    -   `credentials.oauthToken` **[string][8]** An OAuth token provided by an outside service.

**Examples**

```javascript
client.updateToken({
  username: 'alfred@example.com',
  oauthToken: 'RTG9SV3QAoJaeUSEQCZAHqrhde1yT'
});
```

### getUserInfo

Retrieves information about the current user.

Returns **[Object][7]** user The user data.

Returns **[string][8]** user.username The username of the current user. Note that this username can take different encoded forms.
                                It's not meant to be displayed to a user.

Returns **[string][8]** user.token The current access token.

### getConnection

Get the connection state.

Returns **[Object][7]** connection The connection state.

Returns **[boolean][11]** connection.isConnected Whether the authenticated user is currently connected.

Returns **[boolean][11]** connection.isPending Whether the authenticated user's connection is currently pending.

Returns **[Object][7]** connection.error The error object if an error occurred.

Returns **[string][8]** connection.error.message The error message.

Returns **[string][8]** connection.error.stack The stack trace of the error.

### getServices

Retrieves the services that the user is subscribed for.

Returns **[Array][13]** A list of subscribed-to services.

### subscriptionStates

Possible subscription states of the user.

**Properties**

-   `FULL` **[string][8]** All requested feature subscriptions exist.
-   `PARTIAL` **[string][8]** Some feature subscriptions exist.
-   `NONE` **[string][8]** No feature subscriptions exist.

### disconnectReasons

Possible reasons for disconnecting.

**Properties**

-   `GONE` **[string][8]** Connection was terminated by the server
-   `LOST_CONNECTION` **[string][8]** Internet connection was lost

### setCredentials

Sets the user credentials necessary to make requests to the platform.

**Parameters**

-   `credentials` **[Object][7]** The credentials object.
    -   `credentials.username` **[string][8]** The username including the application's domain.
    -   `credentials.password` **[string][8]** The user's password.
    -   `credentials.authname` **[string][8]?** The user's authorization name.

**Examples**

```javascript
client.setCredentials({
  username: 'alfred@example.com',
  password: '********'
  authname: '********'
});
```

### BasicError

The Basic Error object. Provides information about an error that occurred in the SDK.

Type: [Object][7]

**Properties**

-   `code` **[string][8]** The code of the error. If no code is known, this will be 'NO_CODE'.
-   `message` **[string][8]** A human-readable message to describe the error. If no message is known, this will be 'An error occurred'.

## AudioBridge

The audio bridge feature allows multiple audio calls to be bridged together
for a local three-way call.

Audio bridge functions are all part of the 'audioBridge' namespace.

### create

Creates a local bridge that can be used to join audio calls.

Returns **[string][8]** ID used to identify the bridge.

### close

Closes an existing audio bridge.

**Parameters**

-   `bridgeId` **[string][8]** Identifier for the bridge to act on.

### addCall

Adds a call to the specified local audio bridge.

**Parameters**

-   `bridgeId` **[string][8]** Identifier for the bridge to act on.
-   `callId` **[string][8]** Identifier for the call to add.

### removeCall

Remove a specified call from the local audio bridge.

**Parameters**

-   `bridgeId` **[string][8]** Identifier for the bridge to act on.
-   `callId` **[string][8]** Identifier for the call to remove.

### mute

Mute the local audio for all of the calls on the bridge.

**Parameters**

-   `bridgeId` **[string][8]** Identifier for the bridge to act on.

### unmute

Unmute the local audio for all of the calls on the bridge.

**Parameters**

-   `bridgeId` **[string][8]** Identifier for the bridge to act on.

### silence

Silence the remote audio for all of the calls on the bridge.

**Parameters**

-   `bridgeId` **[string][8]** Identifier for the bridge to act on.

### unsilence

Un-silence the remote audio for all of the calls on the bridge.

**Parameters**

-   `bridgeId` **[string][8]** Identifier for the bridge to act on.

### getAll

Retrieve information about audio bridges.

Returns **[Array][13]** List of active audio bridges.

### getBridgeCalls

Retrieve all calls currently part of an audio bridge.

**Parameters**

-   `bridgeId` **[string][8]** The ID of the bridge whose calls we wish to retrieve

Returns **[Array][13]** List of calls currently part of the specified audio bridge.

## callHistory

The 'call.history' namespace is used to retrieve and inspect the authenticated
users call logs.

Functions below are all part of this namespace.

### fetch

Fetches the list of call logs and stores them locally. The API
[CallHistory.get][22] can then be used to get
the logs from local state after it has been updated.

**Parameters**

-   `amount` **[number][12]** The number of records to retrieve. (optional, default `50`)
-   `offset` **[number][12]** Starting offset for records to retrieve. (optional, default `0`)

### remove

Deletes the specified call log.

**Parameters**

-   `recordId` **[number][12]** The ID of the call log to be removed.

### clear

Deletes all call logs.

### get

Gets the list of call logs cached locally. The event
`callHistory:changed` is used to indicate the local state of logs
has been updated.

**Examples**

```javascript
client.on('callHistory:change', function() {
    // Get all call logs when they've been updated.
    let callLogs = client.call.history.get();
});
```

Returns **[Array][13]** A list of call log records, ordered by latest first.

### getCache

Gets the cached call history data and returns stringified data.

The data is provided in a format that can be used directly with the
   [call.history.setCache][23] API. This allows an
   application to persist the information across SDK instances when the
   backend environment does not support the CallHistory feature.

Returns **[string][8]** A stringified list of call log records from the cache, ordered by latest first.

### setCache

Sets the cached call history data, expects stringified data as it will be parsed.

The data can be retreived from the [   call.history.getCache][24] API. This allows an
   application to persist the information across SDK instances when the
   backend environment does not support the CallHistory feature.

**Parameters**

-   `data` **[string][8]** The stringified call history data to store in the cache.

## Calls

The Calls feature is used to make audio and video calls to and from
SIP users and PSTN phones.

Call functions are all part of the 'call' namespace.

Whenever 'user' is mentioned as input parameter within this API, it needs to be provided in the user@domain format.

### getAll

Retrieves the state of calls made during the current session.

**Examples**

```javascript
let calls = client.call.getAll();
let currentCalls = calls.filter(call => {
    return call.state === client.call.states.IN_CALL;
});
```

Returns **[Array][13]** Call objects.

### getById

Retrieves a call from state with a specific call ID.

**Parameters**

-   `callId` **[string][8]** The ID of the call to retrieve.

Returns **[Object][7]** A call object.

### changeInputDevices

Changes camera and microphone for the specified call.
The call will use the current selected default devices.

**Parameters**

-   `callId` **[string][8]** The ID of the call to act upon.

### changeSpeaker

Changes speaker used for call audio output.
Supported on browser's that support HTMLMediaElement.setSinkId().

**Parameters**

-   `speakerId` **[string][8]** ID of the speaker to use for call audio.

### states

States of a call.

**Properties**

-   `IN_CALL` **[string][8]** The call is on-going.
-   `RINGING` **[string][8]** The call has been established and is waiting for a user response.
-   `ENDED` **[string][8]** The call has been terminated.
-   `ON_HOLD` **[string][8]** The call has been put on hold locally.
-   `ON_REMOTE_HOLD` **[string][8]** The call has been put on hold remotely.

**Examples**

```javascript
client.on('call:stateChange', function(callInfo) {
     if(callInfo.state === client.call.states.ENDED) {
         // Call has ended.
     }
});
```

### mediaStates

State of the media connection within a call.

**Properties**

-   `NEW` **[string][8]** A new media connection process has started.
-   `CHECKING` **[string][8]** Media is searching for a connection.
-   `CONNECTED` **[string][8]** Media has found a connection, but may still be searching for a better connection to use.
-   `COMLETED` **[string][8]** Media has finished searching and been established. Audio/video should now be flowing on the call.
-   `FAILED` **[string][8]** Media was not able to find a connection. Audio/video will not flow.
-   `DISCONNECTED` **[string][8]** The media connection has lost its connection and is trying to recover.
-   `CLOSED` **[string][8]** The media connection has shut down.

### make

Start an outgoing call.

**Parameters**

-   `callee` **[string][8]** Full user ID of the call recipient.
-   `options` **[Object][7]?** Call options.
    -   `options.from` **[string][8]?** Sets the display name of the caller to be sent alongside the username of the user.
    -   `options.isVideoEnabled` **[boolean][11]** Whether to enable video during the call. If false, you cannot start video mid-call. (optional, default `true`)
    -   `options.contact` **[Object][7]?** Object containing firstName and lastName of caller.
    -   `options.sendInitialVideo` **[boolean][11]** Whether to start the call sending the local video stream. (optional, default `false`)
    -   `options.isAudioEnabled` **[boolean][11]** Whether to enable audio during the call. Setting this to false will disable audio for the call. (optional, default `true`)
    -   `options.webrtcdtls` **[boolean][11]** Whether to enable DTLS for WebRTC calls. (optional, default `true`)
    -   `options.videoResolution` **[Object][7]?** The object to configure the local video resolution.
        -   `options.videoResolution.height` **[number][12]?** The height in pixels of the local video.
        -   `options.videoResolution.width` **[number][12]?** The width in pixels of the local video.
    -   `options.customParameters` **[Array][13]&lt;{name: [string][8], value: [string][8]}>?** Custom SIP header parameters for the SIP backend.
    -   `options.remoteVideoContainer` **[HTMLElement][25]?** The HTML element to use as a container for the remote video.
    -   `options.localVideoContainer` **[HTMLElement][25]?** The HTML element to use as a container for the local video.
    -   `options.normalizeAddress` **[boolean][11]** Whether to enable normalization of callee address. (optional, default `false`)

**Examples**

```javascript
let remoteContainer = document.getElementById('remote-container');
// Start a video call that only shows the remote media (not local).
let callId = client.call.make('sampleUser@example.com', {
    isVideoEnabled: true,
    sendInitialVideo: true,
    remoteVideoContainer: remoteContainer,
    customParameters: [
      {
        "name": "X-GPS",
        "value": "42.686032,23.344565"
      }
    ]
});
```

Returns **[string][8]** Id of the outgoing call.

### answer

Answer an incoming call.

**Parameters**

-   `callId` **[string][8]** The ID of the call to answer.
-   `options` **[Object][7]?** Call options.
    -   `options.isVideoEnabled` **[boolean][11]?** Whether to enable video during the call. If false, you cannot start video mid-call.
    -   `options.sendInitialVideo` **[boolean][11]?** Whether to start the call sending the local video stream.
    -   `options.isAudioEnabled` **[boolean][11]** Whether to enable audio during the call. Setting this to false will disable audio for the call. (optional, default `true`)
    -   `options.videoResolution` **[Object][7]?** The object to configure the local video resolution.
        -   `options.videoResolution.height` **[number][12]?** The height in pixels of the local video.
        -   `options.videoResolution.width` **[number][12]?** The width in pixels of the local video.
    -   `options.localVideoContainer` **[HTMLElement][25]?** The HTML element to use as a container for the local video.
    -   `options.remoteVideoContainer` **[HTMLElement][25]?** The HTML element to use as a container for the remote video.

### ignore

Ignore an incoming call.

**Parameters**

-   `callId` **[string][8]** The ID of the call to ignore.

### reject

Reject an incoming call.

**Parameters**

-   `callId` **[string][8]** The ID of the call to reject.

### end

End an on-going call.

**Parameters**

-   `callId` **[string][8]** Id of the call to end.

### mute

Mute the local audio stream on an ongoing call.

**Parameters**

-   `callId` **[string][8]** The ID of the call being acted on.

### unmute

Unmute the local audio stream on an ongoing call.

**Parameters**

-   `callId` **[string][8]** The ID of the call being acted on.

### silence

Silence the remote audio on an ongoing call.

**Parameters**

-   `callId` **[string][8]** The ID of the call being acted on.

### unsilence

Un-silence the remote audio on an ongoing call.

**Parameters**

-   `callId` **[string][8]** The ID of the call being acted on.

### getCustomParameters

Retrieves a call's customParameters.

**Parameters**

-   `callId` **[string][8]** The ID of the call to retrieve custom parameters.

Returns **[Array][13]&lt;{name: [string][8], value: [string][8]}>** Custom parameters of the call.

### setCustomParameters

Set custom parameters on an ongoing call.

**Parameters**

-   `callId` **[string][8]** The ID of the call being acted on.
-   `customParameters` **[Array][13]&lt;{name: [string][8], value: [string][8]}>** Custom parameters for the call.

**Examples**

```javascript
// Set custom parameters for call.
client.call.setCustomParameters(
   callId,
   [
     { "name": "X-GPS",
       "value": "42.686032,23.344565"
     }
   ]
});
```

### startVideo

Start local video stream for an ongoing call.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.
-   `options` **[Object][7]?** Options for the video stream.
    -   `options.videoResolution` **[Object][7]?** The video resolution configuation object.
        -   `options.videoResolution.height` **[number][12]?** The height of the outoing video in pixels.
        -   `options.videoResolution.width` **[number][12]?** The width of the outoing video in pixels.

### stopVideo

Stop local video for an ongoing call.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.

### hold

Put an ongoing call on hold.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.

### unhold

Return a held call to ongoing.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.

### startScreenshare

Starts sharing a screen over a call.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.
-   `options` **[Object][7]** 
    -   `options.mediaSourceId` **[string][8]** Id of the media screen to share.
    -   `options.height` **[Number][12]** The height of the video stream to send. (optional, default `768`)
    -   `options.width` **[Number][12]** The width of the video stream to send. (optional, default `1024`)
    -   `options.frameRate` **[Number][12]** The number of frames per second to request. (optional, default `15`)

### stopScreenshare

Stops sharing a screen over a call.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.

### sendDTMF

Send a DTMF tone over a call.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.
-   `tone` **[number][12]** DTMF tone to send. Valid values are [0,1,2,3,4,5,6,7,8,9,#].

### sendCustomParameters

Explicitly send the current custom parameters for a call.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.

### forwardCall

Forward an incoming call to another user.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.
-   `destination` **[string][8]** The user to forward the call to.

### directTransfer

Transfer a call to another user.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.
-   `destination` **[string][8]** The user to transfer the call to.

### consultativeTransfer

Transfer a call to another user.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.
-   `destinationCallId` **[string][8]** The callId to transfer the call to.

### join

Join two calls (both must be on hold and audio only). The joined call can be referenced via callId.

**Parameters**

-   `callId` **[string][8]** Id of the call being acted on.
-   `destinationCallId` **[string][8]** The callId to join the call with.

## clickToCall

The clickToCall namespace is used to bridge a call between two specified devices

### make

Attempts to establish a call between two specified devices

**Parameters**

-   `caller` **[string][8]** A string representing the person making the call
-   `callee` **[string][8]** A string representing the person receiving the call

Returns **[string][8]** callId A unique id representing the call

### get

Gets all local clickToCall calls

Returns **[Array][13]** A list of clickToCall records, ordered by earliest requestTime

## connection

The 'connection' namespace is used to connect and maintain connections between
the SDK and one or more backend servers.

### getSocketState

Get the state of the websocket.

**Parameters**

-   `platform` **[string][8]** Backend platform for which to request the websocket's state. (optional, default `'link'`)

### enableConnectivityChecking

Enables or disables connectivity checking.

**Parameters**

-   `enable` **[boolean][11]** Enable connectivity checking.

## contacts

The 'contacts' namespace allows users to store personal contacts to their account.

### add

Add a contact to a user's personal address book.
Will trigger the `contacts:new` event.

**Parameters**

-   `contact` **[Object][7]** The contact object.
    -   `contact.primaryContact` **[string][8]** The primary userId for the contact
    -   `contact.contactId` **[string][8]** The contact's unique contact ID
    -   `contact.firstName` **[string][8]?** The contact's first name
    -   `contact.lastName` **[string][8]?** The contact's last name
    -   `contact.photoUrl` **[string][8]?** The URL address identifying location of user's picture
    -   `contact.emailAddress` **[string][8]?** The contact's email address
    -   `contact.homePhone` **[string][8]?** The contact's home phone number
    -   `contact.workPhone` **[string][8]?** The contact's business phone number
    -   `contact.mobilePhone` **[string][8]?** The contact's mobile phone number
    -   `contact.conferenceURL` **[string][8]?** Conference URL and access code for this user's address book entry
    -   `contact.fax` **[string][8]?** The user's fax number
    -   `contact.pager` **[string][8]?** The user's pager number
    -   `contact.groupList` **[string][8]?** The name of the contact list for which to add this contact to ("friends" by default)
    -   `contact.friendStatus` **[boolean][11]?** Indicates whether or not the contact is a friend of the user

### get

Retrieves local information about a contact.

**Parameters**

-   `contactId` **[string][8]** The unique contact ID of the contact.

Returns **[Object][7]** Contact information.

### getAll

Retrieves local information about all contacts.

Returns **[Array][13]** List of contact information.

### refresh

Refreshes the local information about contacts. This will get new contacts from the platform.
Will trigger the `contacts:change` event.

### remove

Remove a contact from a personal address book.
Will trigger the `contacts:change` event.

**Parameters**

-   `id` **[string][8]** The Id of the contact that will be removed.

### update

Update a contact from the user's personal address book.
Will trigger the `contacts:change` event.

**Parameters**

-   `contact` **[Object][7]** The contact object.
    -   `contact.primaryContact` **[string][8]** The primary userId for the contact
    -   `contact.contactId` **[string][8]** The contact's unique contact ID
    -   `contact.firstName` **[string][8]?** The contact's first name
    -   `contact.lastName` **[string][8]?** The contact's last name
    -   `contact.photoUrl` **[string][8]?** The URL address identifying location of user's picture
    -   `contact.emailAddress` **[string][8]?** The contact's email address
    -   `contact.homePhone` **[string][8]?** The contact's home phone number
    -   `contact.workPhone` **[string][8]?** The contact's business phone number
    -   `contact.mobilePhone` **[string][8]?** The contact's mobile phone number
    -   `contact.conferenceURL` **[string][8]?** Conference URL and access code for this user's address book entry
    -   `contact.fax` **[string][8]?** The user's fax number
    -   `contact.pager` **[string][8]?** The user's pager number
    -   `contact.groupList` **[string][8]?** The name of the contact list for which to add this contact to ("friends" by default)
    -   `contact.friendStatus` **[boolean][11]?** Indicates whether or not the contact is a friend of the user

### fetch

Fetch a contact from the user's personal address book.
Will trigger the `contacts:change` event.

**Parameters**

-   `contactId` **[string][8]** The unique contact ID of the contact.

## conversation

The messaging feature revolves around a 'conversation' namespace. It is responsible to store the conversations
and its messages, and return conversation objects when requested.

See the "Conversation" and "Message" sections of the documentation for more details.

Messaging functions are all part of the 'conversation' namespace. Ex: client.conversation.get('id').

### fetch

Attempts to retrieve a list of conversations that the current user is a part of.
These conversations can then be retrieved from the store using get().

**Parameters**

-   `options` **[Object][7]?** An optional configuration object to query for more specific results.
    If no object is passed, all threads will be retrieved.
    -   `options.touched` **[string][8]?** The unix timestamp in seconds representing the date from which
         to return any threads that have changed. Can also pass the string literal "lastcheck", resulting in
         the back-end making use of the most recent date value provided in a previous request
    -   `options.type` **[string][8]?** Limit results to one of: "internal", "sms", "group" or "unknown".
    -   `options.thread` **([string][8] \| [number][12])?** Limit results to one thread specified by its thread handle.

### get

Get a conversation object matching the user IDs provided in the 'destination' parameter.
If successful, the event 'conversations:change' will be emitted.
Multi-user conversations have a destination comprised of multiple user IDs.

**Parameters**

-   `destination` **[Array][13]** An array of destinations for messages created in this conversation.
    These will be a user's sip address.
-   `options` **[Object][7]?** An optional configuration object to query for more specific results.
    If this object is not passed, the function will query for "im" conversations associated with those destinations.
    -   `options.type` **[string][8]?** The type of conversation to retrieve. Can be one of "im", "sms" or "other".

Returns **[conversation.Conversation][26]** A Conversation object matching the passed destination, otherwise undefined is returned.

### create

Create and return a new conversation object. Any messages being sent through this conversation
object will be sent to the destinations provided

**Parameters**

-   `recipient` **[Array][13]** An array of destinations for messages created in this conversation. These will be a user's sip address.
-   `type` **[string][8]** The type of conversation to create. Can be one of "im", "sms", "group" or "other"
-   `options`  

Returns **[Object][7]** a Conversation object

### Conversation

A Conversation object represents a conversation between either two users, or a
user and a group. A Conversation can create messages via the conversation's
[createMessage()][27] function.

Type: [Object][7]

**Properties**

-   `destination` **[string][8]** The Id of the remote user with which the current user is having a conversation.
-   `lastReceived` **[number][12]** The timestamp (milliseconds since epoch) of when a message was last received in this conversation.

#### createMessage

Create and return a message object. You must specify the part. If this is a simple text message, provide a `text` part as demonstrated in the example.

**Parameters**

-   `part` **[Object][7]** The part to add to the message.
    -   `part.type` **[string][8]** The type of part. Can be "text", "json", "file".
    -   `part.text` **[string][8]?** The text of the part. Must be a part of type "text".
    -   `part.json` **[Object][7]?** The json of the part. Must be a part of type "json".
    -   `part.file` **File?** The file of the part. Must be a part of type "file".

**Examples**

```javascript
conversation.createMessage({type: 'text', text: 'This is the message'});
```

Returns **[conversation.Message][28]** The newly created Message object.

#### clearMessages

Clears all messages in this conversation from local state.

#### getMessages

Get the messages associated with this conversation.

Returns **[Array][13]&lt;[Object][7]>** messages An array containing the conversation's messages.

Returns **[Function][17]** messages.markRead Marks the message as read.

Returns **[Function][17]** messages.forward Forward the message to another user.

Returns **[string][8]** messages.messageId The Id of the message.

Returns **[string][8]** messages.sender The user Id of the user who sent the message.

Returns **[number][12]** messages.timestamp The time at which the message was sent.

Returns **[boolean][11]** messages.read Whether the message has been marked as read.

Returns **[boolean][11]** messages.isPending Whether the message has finished being sent to the server.

Returns **[Array][13]** messages.parts The parts of the message.

#### getMessage

Get a specific message from this conversation.

**Parameters**

-   `messageId` **[string][8]** ID of the message to retrieve.

Returns **[Object][7]** A message object.

#### subscribe

Subscribe to this conversations messages array.

**Parameters**

-   `subscriber` **[Function][17]** A subscriber function to be triggered when the messages array of this conversation is updated.
    -   `subscriber.destination` **[string][8]** The conversation participants.
    -   `subscriber.messageId` **[string][8]** The ID of the message that caused the event.

Returns **[Function][17]** The unsubscribe function.

#### fetchMessages

Allows the user to fetch messages associated with a specific conversation from the server.
When the operation is complete, a NEW_MESSAGE event will be emitted.
Messages can then be retrieved using getMessages.

**Parameters**

-   `amount` **[number][12]** An amount of messages to fetch. (optional, default `50`)

### Message

A Message object is a means by which a sender can deliver information to a recipient.

Creating and sending a message:

A message object can be obtained through the [Conversation.createMessage][27] API on an existing conversation.

Messages have Parts which represent pieces of a message, such as a text part, a json object part or a file part.
Once all the desired parts have been added to the message using the [Message.addPart][29] function,
the message can then be sent using the [Message.send][30] function.

Once the sender sends a message, this message is saved in sender's state as an object.
Similarly, once the recipient gets a message, this message is saved in recipient's state.

Retrieving a delivered message:

Once a message is delivered successfully, it can be
obtained through the [Conversation.getMessages][31] or [Conversation.getMessage][32] API on an existing conversation.

Below are the properties pertaining to the message object, returned by Conversation.getMessage(s) APIs, for either sender or recipient.

Type: [Object][7]

**Properties**

-   `timestamp` **[number][12]** A Unix timestamp in seconds marking the time when the message was created by sender.
-   `parts` **[Array][13]&lt;conversation.Part>** An array of Part Objects.
-   `sender` **[string][8]** The primary contact address of the sender.
-   `destination` **[Array][13]&lt;[string][8]>** An array of primary contact addresses associated with various destinations to which the message is meant to be delivered.
-   `messageId` **[string][8]** The unique id of the message. The message object (stored in sender's state) has a different id
    than the one associated with the message object stored in recipient's state.
-   `type` **[string][8]** The type of message that was sent. See [conversation.chatTypes][33] for valid types.
    This property applies only to message objects stored in sender's state.

#### send

Sends the message.

#### addPart

Add an additional part to a message.

**Parameters**

-   `part` **[Object][7]** The part to add to the message.
    -   `part.type` **[string][8]** The type of part. Can be "text", "json", "file", or "location".
    -   `part.text` **[string][8]?** The text of the part. Must be a part of type "text".
    -   `part.json` **[Object][7]?** The json of the part. Must be a part of type "json".
    -   `part.file` **File?** The file of the part. Must be a part of type "file".

## DEVICE_ERROR

An error occurred while performing a device operation.

Type: [string][8]

**Parameters**

-   `params` **[Object][7]** 
    -   `params.error` **[api.BasicError][15]** The Basic error object.

## getDevices

Retrieves the available media devices for use.

## logger

The SDK has an internal logging system for providing information about its
   behaviour. The SDK will generate logs, at different levels for different
   types of information, which are routed to a
   "[Log Handler][4]" for consumption. An application
   can provide their own Log Handler (see
   [config.logs][34]) to customize how the logs are
   handled, or allow the default Log Handler to print the logs to the
   console.

The SDK's default Log Handler is merely a thin wrapper around the browser's
   console API (ie. `window.console`). It receives the log generated by the
   SDK, called a "[Log Entry][5]", formats a
   human-readable message with it, then uses the console to log it at the
   appropriate level. This is important to be aware of, since your browser's
   console may affect how you see the SDK's default log messages. Since the
   default Log Handler uses the console's levels, the browser may filter
   which messages are shown depending on which levels it has configured. For
   a user that understands console log levels, this can be helpful for
   filtering the logs to only the relevant information. But it can equally
   be a hindrance by hiding the more detailed log messages (at the 'debug'
   level), since browser can have this level hidden by default. For this
   reason, we recommend providing a custom Log Handler to the SDK that is
   better suited for your application and its users.

### levels

Possible levels for the SDK logger.

The SDK will provide [Log Entries][5] to the
   [Log Handler][4] for all logs at or above the set
   log level. 'debug' is considered the lowest level and 'silent' the
   highest level. For example, if the current level is 'info', then the
   [Log Handler][4] will receive
   [Log Entries][5] for logs at 'info', 'warn', and
   'error', but not for the 'debug' level.

**Properties**

-   `SILENT` **[string][8]** Nothing will be logged.
-   `ERROR` **[string][8]** Unhandled error information will be logged. If
       the SDK encounters an issue it cannot resolve, the error will be included
       in the logs. This likely points to an issue with the SDK itself or an
       issue with how the SDK is being used.
-   `WARN` **[string][8]** Warning messages for the application developer will
       be logged. If the SDK encounters an issue that it can recover and continue,
       a warning about the issue will be included in the logs. These logs point
       to issues that need to be handled by the application. For example, providing
       an invalid configuration to the SDK will cause a warning log that explains
       the issue.
-   `INFO` **[string][8]** General information about the SDK's operations will
       be logged, outlining how the SDK is handling the operations. Reading through
       these logs should provide a high-level view of what the SDK is doing,
       and why it is doing it.
-   `DEBUG` **[string][8]** Detailed information about the SDK's operations,
       meant for debugging issues, will be logged. Specific information and relevant
       operation data are provided for understanding the scenario that the SDK
       was in during the operation.

### LogEntry

A LogEntry object is the data that the SDK compiles when information is
   logged. It contains both the logged information and meta-info about when
   and who logged it.

A [LogHandler][4] provided to the SDK (see
   [config.logs][34]) will need to handle LogEntry
   objects.

Type: [Object][7]

**Properties**

-   `timestamp` **[number][12]** When the log was created, based on UNIX epoch.
-   `method` **[string][8]** The log function that was used to create the log.
-   `level` **[string][8]** The level of severity the log.
-   `target` **[Object][7]** The subject that the log is about.
    -   `target.type` **[string][8]** The type of the target. This is also
           used as part of the name of the Logger.
    -   `target.id` **[string][8]?** A unique identifer for the target.
    -   `target.name` **[string][8]** A combination of the target type and ID. If no
           id was provided, this will be the same as the type.
-   `messages` **[Array][13]** The logged information, given to the Logger
       method as parameters.
-   `timer` **[Object][7]?** Timing data, if the log method was a timer method.

**Examples**

```javascript
function defaultLogHandler (logEntry) {
  // Compile the meta info of the log for a prefix.
  const { timestamp, level, target } = logEntry
  let { method } = logEntry
  const logInfo = `${timestamp} - ${target.type} - ${level}`

  // Assume that the first message parameter is a string.
  const [log, ...extra] = logEntry.messages

  // For the timer methods, don't actually use the console methods.
  //    The Logger already did the timing, so simply log out the info.
  if (['time', 'timeLog', 'timeEnd'].includes(method)) {
    method = 'debug'
  }

  console[method](`${logInfo} - ${log}`, ...extra)
}
```

### LogHandler

A LogHandler can be used to customize how the SDK should log information. By
   default, the SDK will log information to the console, but a LogHandler can
   be configured to change this behaviour.

A LogHandler can be provided to the SDK as part of its configuration (see
   [config.logs][34]). The SDK will then provide this
   function with the logged information.

Type: [Function][17]

**Parameters**

-   `LogEntry` **[Object][7]** The LogEntry to be logged.

**Examples**

```javascript
// Define a custom function to handle logs.
function logHandler (logEntry) {
  // Compile the meta info of the log for a prefix.
  const { timestamp, level, target } = logEntry
  let { method } = logEntry
  const logInfo = `${timestamp} - ${target.type} - ${level}`

  // Assume that the first message parameter is a string.
  const [log, ...extra] = logEntry.messages

  // For the timer methods, don't actually use the console methods.
  //    The Logger already did the timing, so simply log out the info.
  if (['time', 'timeLog', 'timeEnd'].includes(method)) {
    method = 'debug'
  }

  console[method](`${logInfo} - ${log}`, ...extra)
}

// Provide the LogHandler as part of the SDK configurations.
const configs = { ... }
configs.logs.handler = logHandler
const client = create(configs)
```

## Media

The SDK's media features are used to control WebRTC Media Devices.

Media functions are all part of the 'media' namespace.

## notification

The 'notification' namespace allows user to register/deregister for/from push notifications as well as
enabling/disabling the processing of websocket notifications.

### process

Provides an external notification to the system for processing.

**Parameters**

-   `notification` **[Object][7]** 
-   `channel` **[string][8]?** The channel that the notification came from.

### registerApplePush

Registers with Apple push notification service. Once registration is successful, the application will be able to receive
standard and/or voip push notifications. It can then send these notifications to the SDK with [api.notifications.process][35]
in order for the SDK to process them.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.services` **[Array][13]&lt;[string][8]>** Array of services for which we wish to receive notifications.
    -   `params.voipDeviceToken` **[string][8]** The voip device token used for voip push on iOS.
                                                 This token is required if registering for call service notifications on iOS.
    -   `params.standardDeviceToken` **[string][8]** The standardDevice token used for standard push on iOS .
                                                     This token is required when registering for non-call service notifications.
    -   `params.bundleId` **[string][8]** The bundleId to identify the application receiving the push notification.
    -   `params.clientCorrelator` **[string][8]** Unique identifier for a client device.
    -   `params.realm` **[string][8]** The realm used by the push registration service to identify and
                                       establish a connection with the service gateway.
    -   `params.isProduction` **[boolean][11]** If true, push notification will be sent to production.
                                               If false, push notification will be sent to sandbox.

Returns **[Promise][36]** When successful,  the information of the registration.
                  Promise will reject with error object otherwise.

### registerAndroidPush

Registers with Google push notification service. Once registration is successful, the application will be able to receive
standard and/or voip push notifications. It can then send these notifications to the SDK with [api.notifications.process][35]
in order for the SDK to process them.

**Parameters**

-   `params` **[Object][7]** 
    -   `params.services` **[Array][13]&lt;[string][8]>** Array of services to register for.
    -   `params.deviceToken` **[string][8]** The device token used for standard push on Android. This token is required
                                             when registering for all related services notifications.
    -   `params.bundleId` **[string][8]** The bundleId to identify the application receiving the push notification.
    -   `params.clientCorrelator` **[string][8]** Unique identifier for a client device.
    -   `params.realm` **[string][8]** The realm used by the push registration service to identify
                                       and establish a connection with the service gateway.

Returns **[Promise][36]** When successful,  the information of the registration.
                  Promise will reject with error object otherwise.

### unregisterApplePush

Unregister Apple push notifications.

**Parameters**

-   `registrationInfo` **[string][8]** The data returned from the push registration

Returns **[Promise][36]** When successful, the promise will resolve with undefined.
                  Promise will reject with error object otherwise.

### unregisterAndroidPush

Unregister Android push notifications.

**Parameters**

-   `registrationInfo` **[string][8]** The data returned from the push registration

Returns **[Promise][36]** When successful, the promise will resolve with undefined.
                  Promise will reject with error object otherwise.

### enableWebsocket

Enables, or disables, the processing of websocket notifications.

**Parameters**

-   `enable` **[boolean][11]** Whether the websocket channel should be enabled.

## presence

The 'presence' namespace provides an interface for an application to set the
   User's presence information and to track other Users' presence
   information.

Presence information is persisted by the server. When the SDK is initialized,
   there will be no information available. Presence information will become
   available either by using [presence.fetch][37] or by subscribing for
   updates about other Users, using [presence.subscribe][38].

Available presence information can be retrieved using [presence.get][39] or
   [presence.getAll][40].

### statuses

Possible status values.

**Properties**

-   `OPEN` **[string][8]** 
-   `CLOSED` **[string][8]** 

**Examples**

```javascript
const { statuses, activities } = client.presence
// Use the values when updating presence.
client.presence.update(statuses.OPEN, activities.AVAILABLE)
```

### activities

Possible activity values.

**Properties**

-   `AVAILABLE` **[string][8]** 
-   `IDLE` **[string][8]** 
-   `AWAY` **[string][8]** 
-   `LUNCH` **[string][8]** 
-   `BUSY` **[string][8]** 
-   `VACATION` **[string][8]** 
-   `ON_THE_PHONE` **[string][8]** 
-   `UNKNOWN` **[string][8]** 

### PresenceStatus

The PresenceStatus type defines the user's current status in terms of the user's availability to
communicate/respond to other users in the network.
An instance of this type can be obtained by invoking the [presence.get][39] function.

Reporting when a user is on the phone is enabled (by default), which means that presence update notifications
will be sent whenever a user is in a call, as well as when the call has ended.
This is a user preference enabled or disabled on server side, and it can only be changed on the server side.

The status is set to [open][41] as soon as a user subscribes for the presence service.

Type: [Object][7]

**Properties**

-   `userId` **[string][8]** The unique identifier for the user associated with this presence status.
-   `status` **[string][8]** The current status the user has set for themselves. For supported values see [presence.statuses][41].
-   `activity` **[string][8]** The current activity of the user.
         For supported values see [presence.activities][42].
-   `note` **[string][8]** Additional message acompanying the status & activity.
-   `loading` **[boolean][11]** Whether the presence information has been loaded or is in the process of loading.

### update

Updates the presence information for the current user.

See [presence.statuses][41] and [presence.activities][42] for valid
   values.

The SDK will emit a
   [presence:selfChange][43] event
   when the operation completes. The updated presence information is
   available and can be retrieved with [presence.getSelf][44].

Other users subscribed for this user's presence will receive a
   [presence:change][45] event.

**Parameters**

-   `status` **[string][8]** The status of the presence state.
-   `activity` **[string][8]** The activity to be shown as presence state
-   `note` **[string][8]?** An additional note to be provided when the activity is `presence.activities.ACTIVITIES_OTHER`.

### get

Retrieves the presence information for specified users, if available.

**Parameters**

-   `user` **([Array][13]&lt;[string][8]> | [string][8])** A User ID or an array of User IDs.

Returns **([Array][13]&lt;[Object][7]> | [Object][7])** List of user presence information.

### getAll

Retrieves the presence information for all available users.

Returns **[Array][13]&lt;[Object][7]>** List of user presence information.

### getSelf

Retrieves the presence information for the current user.

This information is set using the [presence.update][46] API.

Returns **[Object][7]** Presence information for the current user.

### fetch

Fetches presence information for the given users. This will refresh the
   available information with any new information from the server.

Available presence information an be retrieved using the
   [presence.get][39] or [presence.getAll][40] APIs.

**Parameters**

-   `user` **([Array][13]&lt;[string][8]> | [string][8])** A User ID or an array of User IDs.

### subscribe

Subscribe to another User's presence updates.

When the User updates their presence information, the SDK will emit a
   [presence:change][45] event.

**Parameters**

-   `users` **([Array][13]&lt;[string][8]> | [string][8])** A User ID or an array of User IDs.

### unsubscribe

Unsubscribe from another User's presence updates.

**Parameters**

-   `users` **([Array][13]&lt;[string][8]> | [string][8])** A User ID or an array of User IDs.

## promptUserMedia

Prompt the user for permission to use their audio and/or video devices.

**Parameters**

-   `options` **[Object][7]?** 
    -   `options.video` **[boolean][11]?** Whether to get permission for video.
    -   `options.audio` **[boolean][11]?** Whether to get permission for audio.

## sdpHandlers

A set of [SdpHandlerFunction][47]s for manipulating SDP information.
These handlers are used to customize low-level call behaviour for very specific
environments and/or scenarios.

Note that SDP handlers are exposed on the entry point of the SDK. They can be added during
initialization of the SDK using the [config.call.sdpHandlers][48] configuration
parameter. They can also be set after the SDK's creation by using the
[call.setSdpHandlers][49] function.

**Examples**

```javascript
import { create, sdpHandlers } from 'kandy';
const codecRemover = sdpHandlers.createCodecRemover(['VP8', 'VP9'])
const client = create({
  call: {
    sdpHandlers: [ codecRemover, <Your-SDP-Handler-Function>, ...]
  }
})
```

```javascript
// Through the Call API post-instantiation
client.call.setSdpHandlers([ codecRemover, <Your-SDP-Handler-Function>, ...])
```

### CodecSelector

An object that represents a selector to match codecs of an RTP map in SDP.

Type: [Object][7]

**Properties**

-   `name` **[string][8]** The name of the codec.
-   `fmtpParams` **[Array][13]&lt;[string][8]>** An array of strings to match against the "a=fmtp" format parameters for the corresponding codec.
                                         All of the elements in the array must be contained in the "a=fmtp" attribute in order to be a match.

### createCodecRemover

This function creates an SDP handler that will remove codecs matching the selectors specified for SDP offers and answers.

In some scenarios it's necessary to remove certain codecs being offered by the SDK to remote parties. For example, some legacy call services limit the SDP
length (usually to 4KB) and will reject calls that have SDP size above this amount.

While creating an SDP handler would allow a user to perform this type of manipulation, it is a non-trivial task that requires in-depth knowledge of WebRTC SDP.

To facilitate this common task, the createCodecRemover function creates a codec removal handler that can be used for this purpose. Applications can use this codec
removal handler in combination with the [call.getAvailableCodecs][50] function in order to build logic to determine the best codecs to use
for their application.

**Parameters**

-   `codecs` **([Array][13]&lt;CodecSelector> | [Array][13]&lt;[string][8]>)** A list of codec selectors to remove from the SDP. If passing a list of strings, they will be converted into
                                                         codec selectors that correspond to those names without any extra FMTP parameters.

**Examples**

```javascript
import { create, sdpHandlers } from 'kandy';

const codecRemover = sdpHandlers.createCodecRemover([
  // Remove all VP8 and VP9 codecs.
  'VP8',
  'VP9',

  // Remove all H264 codecs with the specified FMTP parameters.
  {
    name: 'H264',
    fmtpParams: ['profile-level-id=4d0032', 'packetization-mode=1']
  }
])

const client = create({
  call: {
    sdpHandlers: [codecRemover]
  }
})
```

Returns **call.SdpHandlerFunction** The resulting SDP handler that will remove the codec.

## setDefaultDevices

Sets the selected devices as the default devices.
They will be used for audio output for future calls.
Changing speaker is supported on browser's that support HTMLMediaElement.setSinkId().

**Parameters**

-   `devices` **[Object][7]** 
    -   `devices.camera` **[string][8]?** The ID of the camera to set as default.
    -   `devices.microphone` **[string][8]?** The ID of the microphone to set as default.
    -   `devices.speaker` **[string][8]?** The ID of the speaker to set as default.

**Examples**

```javascript
// Set only the default microphone and camera.
client.media.setDefaultDevices({
    camera: 'abc123...',
    microphone: 'def456...'
});
```

## sip

The SIP Events feature allows an application to communicate with a SIP network integrated
     with their Kandy Link instance. The SIP network may generate custom events intended
     for an application, which can be handled with the SDK's `sip` namespace.

Usage of SIP Events is dependent on your Kandy Link instance. The types of SIP Events can
   be different based on configurations and components, often being part of a custom
   solution. As such, the SIP Events feature is presented in a generic manner to be
   flexible for any possible events.

An example of a common SIP event is "SIP presence". When a user is connected to a SIP phone,
   the network may generate "phone presence" events when the user starts and ends a call
   (eg. 'On Call', 'Available'). Applications can subscribe to receive these events for
   specific users.

A SIP event may either be solicited or unsolicited. Solicited events, such as the "presence"
   example above, requires the application to subscribe for the event. See the
   [sip.subscribe API][51] for more information about solicited events.
   Unsolicited events have no prerequisites for being received.

### subscribe

Creates a subscription for a SIP event.

A subscription is required to receive SIP notifications for solicited events. Before
   creating a SIP subscription, the service for the event type must have been
   provisioned as part of the user subscription using the [services.subscribe][20]
   API.

Only one SIP subscription per event type can exist at a time. A subscription can
   watch for events from multiple users at once. Users can be added to or removed
   from a subscription using the [sip.update][52] API at any time.

The SDK will emit a [sip:subscriptionChange][53]
   event when the operations completes. The [sip.getDetails][54] API can be used
   to retrieve the current information about a subscription.

The SDK will emit a [sip:eventsChange][55] event when
   a SIP event is received.

**Parameters**

-   `eventType` **[string][8]** The name of the SIP event.
-   `subscribeUserList` **[Array][13]&lt;[string][8]>** The list of users to receive events about.
-   `clientCorrelator` **[string][8]** Unique identifier for a client device.
-   `customParameters` **[Array][13]&lt;call.CustomParameter>?** Custom SIP header parameters for the SIP backend.

**Examples**

```javascript
// Provision the service for the specific SIP event during user subscription.
//   This is required before a SIP subscription for the event can be created.
const services = ['call', 'event:presence', ...]
client.services.subscribe(services)

// Subscribe to receive SIP presence events from two users.
client.sip.subscribe('event:presence', ['userOne@example.com', 'userTwo@example.com'], 'clientId123')

// Subscribe for SIP events with a custom parameter.
const customParameters = [{
   name: 'X-nt-GUID',
   value: 'GUID123abc'
}]
client.sip.subscribe('event:presence', subscribeUserList, 'clientId123', customParameters)
```

### update

Updates an existing SIP event subscription.

Allows for adding or removing users from the subscription, and for changing the
   custom parameters of the subscription.

The SDK will emit a [sip:subscriptionChange][53]
   event when the operations completes. The [sip.getDetails][54] API can be used
   to retrieve the current information about a subscription.

**Parameters**

-   `eventType` **[string][8]** The name of the SIP event.
-   `userLists` **[Object][7]** 
    -   `userLists.subscribeUserList` **[Array][13]&lt;[string][8]>** List of users to add to the subscription.
    -   `userLists.unsubscribeUserList` **[Array][13]&lt;[string][8]>** List of users to remove from the subscription. If all users are removed, the event subscription will be deleted.
-   `customParameters` **[Array][13]&lt;call.CustomParameter>?** Custom SIP header parameters for the SIP backend.

**Examples**

```javascript
// Add a user to an existing subscription.
const userLists = {
   subscribedUserList: ['userThree@example.com']
}
client.sip.update('event:presence', userLists)

// Simultaneously add and remove users from the subscription.
const userLists = {
   subscribedUserList: ['userThree@example.com'],
   unsubscribeUserList: ['userOne@example.com']
}
client.sip.update('event:presence', userLists)
```

### unsubscribe

Deletes an existing SIP event subscription.

The SDK will emit a [sip:subscriptionChange][53]
   event when the operations completes.

Subscription details will no longer be available using the [sip.getDetails][54]
   API after it has been unsubscribed from.

**Parameters**

-   `eventType` **[string][8]** The name of the SIP event.

**Examples**

```javascript
// Delete a SIP subscription.
client.sip.unsubscribe('event:presence')
```

### getDetails

Retrieve information about a SIP event subscription.

The SDK will track which users are included as part of the subscription and
   previous notifications received. Each subscription will include a unique ID.

**Parameters**

-   `eventType` **[string][8]?** The name of a SIP event. If not provided, will retrieve
       information for all SIP subscriptions.

**Examples**

```javascript
// Retrieve information about a single SIP subscription.
const { subscribedUsers, notifications } = client.sip.getDetails('event:presence')

// Retrieve information about all current SIP subscriptions.
const subscriptions = client.sip.getDetails()
const { subscribedUsers, notifications } = subscriptions['event:presence']
```

Returns **[Object][7]** SIP subscription information. If `eventType` was not provided, will
   return an object namespaced by event types.

## startPreviewVideo

Starts the local video stream and displays it to the user.

**Parameters**

-   `videoContainer` **[HTMLElement][25]?** The container to use for local video.

**Examples**

````javascript
``` javascript
 var container = document.getElementById('local-video');
 client.media.startPreviewVideo(container);
```
````

## stopPreviewVideo

Stops the local video stream created in `startPreviewVideo`.

## user

The 'user' namespace allows access to user information for users within the same domain.

### User

The User data object.

Type: [Object][7]

**Properties**

-   `userId` **user.UserID** The User ID of the user.
-   `emailAddress` **[string][8]** The email address of the user.
-   `firstName` **[string][8]** The first name of the user.
-   `lastName` **[string][8]** The last name of the user.
-   `photoURL` **[string][8]** The URL to get the photo of the user.
-   `buddy` **[string][8]** Whether the user is a "buddy". Values can be "true" or "false".

### fetch

Fetches information about a User.

The SDK will emit a [users:change][56]
   event after the operation completes. The User's information will then
   be available.

Information about an available User can be retrieved using the
   [user.get][57] API.

**Parameters**

-   `userId` **[string][8]** The User ID of the user.

### fetchSelfInfo

Fetches information about the current User from directory.
Compared to [user.fetch][58] API, this API retrieves additional user related information.

The SDK will emit a [users:change][56]
   event after the operation completes. The User's information will then
   be available.

Information about an available User can be retrieved using the
   [user.get][57] API.

### get

Retrieves information about a User, if available.

See the [user.fetch][58] and [user.search][59] APIs for details about
   making Users' information available.

**Parameters**

-   `userId` **user.UserID** The User ID of the user.

Returns **[user.User][60]** The User object for the specified user.

### getAll

Retrieves information about all available Users.

See the [user.fetch][58] and [user.search][59] APIs for details about
   making Users' information available.

Returns **[Array][13]&lt;[user.User][60]>** An array of all the User objects.

### search

Searches the domain's directory for Users.

Directory searching only supports one filter. If multiple filters are provided, only one of the filters will be used for the search.
A search with no filters provided will return all users.

The SDK will emit a [directory:change][61]
   event after the operation completes. The search results will be
   provided as part of the event, and will also be available using the
   [user.get][57] and [user.getAll][62] APIs.

**Parameters**

-   `filters` **[Object][7]** The filter options for the search.
    -   `filters.userId` **user.UserID?** Matches the User ID of the user.
    -   `filters.name` **[string][8]?** Matches the firstName or lastName.
    -   `filters.firstName` **[string][8]?** Matches the firstName.
    -   `filters.lastName` **[string][8]?** Matches the lastName.
    -   `filters.userName` **[string][8]?** Matches the userName.
    -   `filters.phoneNumber` **[string][8]?** Matches the phoneNumber.

## voicemail

The 'voicemail' namespace is used to retrieve and view
voicemail indicators.

Voicemail functions are all part of this namespace.

### fetch

Attempts to retrieve voicemail information from the server.

A [voicemail:change][63] event is
   emitted upon completion.

### get

Returns voicemail data from the store.

[1]: #config

[2]: #api

[3]: #create

[4]: #loggerloghandler

[5]: #loggerlogentry

[6]: #logger

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[9]: #loggerlevels

[10]: #loggerloghandler

[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

[14]: https://en.wikipedia.org/wiki/Keepalive

[15]: #apibasicerror

[16]: #config

[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function

[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error

[19]: #apisetcredentials

[20]: services.subscribe

[21]: services.unsubscribe

[22]: #callhistoryget

[23]: callHistory.setCache

[24]: callHistory.getCache

[25]: https://developer.mozilla.org/docs/Web/HTML/Element

[26]: #conversationconversation

[27]: #conversationconversationcreatemessage

[28]: #conversationmessage

[29]: #conversationmessageaddpart

[30]: #conversationmessagesend

[31]: #conversationconversationgetmessages

[32]: #conversationconversationgetmessage

[33]: conversation.chatTypes

[34]: #configconfiglogs

[35]: api.notifications.process

[36]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise

[37]: #presencefetch

[38]: #presencesubscribe

[39]: #presenceget

[40]: #presencegetall

[41]: #presencestatuses

[42]: #presenceactivities

[43]: #presenceeventpresenceselfchange

[44]: #presencegetself

[45]: #presenceeventpresencechange

[46]: #presenceupdate

[47]: call.SdpHandlerFunction

[48]: #configconfigcall

[49]: call.setSdpHandlers

[50]: call.getAvailableCodecs

[51]: #sipsubscribe

[52]: #sipupdate

[53]: #sipeventsipsubscriptionchange

[54]: #sipgetdetails

[55]: #sipeventsipeventschange

[56]: #usereventuserschange

[57]: #userget

[58]: #userfetch

[59]: #usersearch

[60]: #useruser

[61]: #usereventdirectorychange

[62]: #usergetall

[63]: #voicemaileventvoicemailchange
