Class: WebClient

WebClient

The OzWebClient class contains methods for connecting the webclient to Ozeki Phone System XE and disconnecting it from it. The WebClient class is the main communication interface between Ozeki Phone System XE and Javascript.

new WebClient()

#WEBCLIENT WebClient class
Source:
See:

Methods

checkWebphoneState(serverAddress, webphoneId, callback)

Returns the state of the specified webphone.
Parameters:
Name Type Description
serverAddress string The IP Address of the computer running Ozeki Phone System XE.
webphoneId string The ID of the webphone.
callback checkWebPhoneStateCallback The callback which handles the response initated from checkWebphoneState.
Source:
See:

connect(serverAddress, token, properties)

Connects the WebClient to Ozeki Phone System XE.
Parameters:
Name Type Argument Default Description
serverAddress string The IP Address of the computer running Ozeki Phone System XE.
token string The securityToken generated for this WebClient.
properties Object <optional>
{} Additional connection properties.
Source:
See:

createCall(dialedNumber, callType) → {Call}

Returns a new Call object with the specified target phone number.
Parameters:
Name Type Argument Default Description
dialedNumber string The target phone number.
callType CallType <optional>
CallType.AUDIO The type of the call.
Source:
See:
Returns:
A new Call object
Type
Call

disconnect()

Disconnects the WebClient from Ozeki Phone System XE
Source:
See:

getCallHistory(filters)

Initiates a call history query request to Ozeki Phone System XE. Can only be used if the connected client has the required privilege. The WebClient will fire the event onCallHistoryInfoReceived once the query result is received.
Parameters:
Name Type Description
filters Object The filter properties. Possible filter properties: pageNumber {number} (paginate option: retrieve the entries on the specified page) pageRows {number} (paginate option: retrieve the specified number of entries in one page) general {string} (general search query string) callerId {string} source {string} dialedNumber {string} destination {string} sessionState {SessionState}
Source:
See:

onCallHistoryInfoReceived(callback)

This event occurs when the result of the query initiated from the getCallHistory function has been received.
Parameters:
Name Type Description
callback onCallHistoryReceivedCallback The callback which receives the call history records.
Source:
See:

onClientStateChanged(callback)

This event occurs when the state of the client changes.
Parameters:
Name Type Description
callback onClientStateChangedCallback The callback which handles the clientStateChanged event.
Source:
See:

onConnectionStateChanged(callback)

This event occurs when the state of the connection changes.
Parameters:
Name Type Description
callback onConnectionStateChangedCallback The callback which handles the connectionStateChanged event.
Source:
See:

onErrorOccured(callback)

This event occurs if an error message has been received from Ozeki Phone System XE.
Parameters:
Name Type Description
callback onErrorOccuredCallback The callback which handles the error message.
Source:
See:

onExtensionInfoReceived(callback)

This event occurs when the WebClient receives information about an extension.
Parameters:
Name Type Description
callback onExtensionInfoReceivedCallback The callback which receives the created Extension class instance.
Source:

onExtensionRemoved(callback)

This event occurs when the WebClient receives information about an extension which has been removed.
Parameters:
Name Type Description
callback onExtensionRemovedCallback The callback which receives the ID of the removed extension.
Source:

onIncomingCall(callback)

This event occurs when the WebClient receives an incoming call.
Parameters:
Name Type Description
callback onIncomingCallCallback The callback which receives the created Call object.
Source:
See:

onSessionClosed(callback)

This event occurs when an active session has been closed.
Parameters:
Name Type Description
callback onSessionClosedCallback The callback which handles the session closed event.
Source:
See:

onSessionCreated(callback)

This event occurs if a new Session has been created e.g. a new session has started in Ozeki Phone System XE.
Parameters:
Name Type Description
callback onSessionCreatedCallback The callback which receives the created session.
Source:
See:

onUserInfoReceived(callback)

This event occurs when the WebClient receives information about a user.
Parameters:
Name Type Description
callback onUserInfoReceivedCallback The callback which receives the created User class instance.
Source:

onUserRemoved(callback)

This event occurs when the WebClient receives information about a user being removed from Ozeki Phone Sytem XE.
Parameters:
Name Type Description
callback onUserRemovedCallback The callback which handles the user removal.
Source:

onWebphoneStateReceived(callback)

This event occurs when the state of the webphone is received.
Parameters:
Name Type Description
callback onWebphoneStateReceivedCallback The callback which handles the webphoneStateReceived event.
Source:

setupCall(caller, callee)

Creates a call between two extensions configured in Ozeki Phone System XE.
Parameters:
Name Type Description
caller string The phone number of the caller.
callee string the phone number of the callee.
Source:
Throws:
Will throw an exception if the caller of callee parameters are not defined.