Session class

The Session class represents a session of an ongoing call in the system. The Session class provides session modification functions such as hold(), unhold(), etc. which can only be used if the connected webclient has the required privileges. This class contains methods and events for manipulate sessions. This class is internal, therefore there is no need to call the constructor of this class directly. You will receive a Session class object if you subscribe to the OzWebClient.onSessionCreated() event.

Properties

PropertyDescription
masterSessionId The master session ID of the session
sessionIdThe session ID of the session.
sessionStateThe current state of the session.
startTimeThe start time of the session represented by a string.
talkDurationThe talk duration of the session represented by a string.
stateDurationThe state duration of the session represented by a string.
callerThe ID of the caller.
calleeThe ID of the callee.
callerDisplayNameThe display name of the caller.
calleeDisplayNameThe display name of the callee.
callerCallLegIdThe call leg ID of the caller.
calleeCallLegIdThe call leg ID of the callee.
sourceThe source ID of the session.
sourceTypeThe source type of the session.
destinationThe destination ID of the session.
destinationTypeThe destination type of the session.
dialedNumberThe dialed number of the session.

Methods

MethodDescription
blindTransfer(transferor, phoneNumber)Uses blind transfer to transfer the call to another party. *
close()Closes the session, terminating the call. *
closeWithHangup()Closes the session by calling HANGUP. *
forward(phoneNumber)Forwards the session to another party. *
hangup()Calls HANGUP on the session, terminating the call.*
hold()Holds both call parties. *
sendDtmf(key, phoneNumber)Sends a DTMF signal to one of the call parties. *
startListen()Starts a listening session e.g. lets you listen to the ongoing call. *
stopListen() Stops the current listening session. *
unhold()Unholds both call parties. *

* Can only be used if the connected webclient has the required privilege.

Events

EventDescription
onSessionStateChangedThis event occurs when the state of an active session has changed.

Enumerations

Session states:

  • RINGING: 'Ringing'
  • INCALL: 'InCall'
  • CALLEEONHOLD: 'CalleeOnHold'
  • CALLERONHOLD: 'CallerOnHold'
  • ONHOLD: 'OnHold'
  • ONHOLDINACTIVE: 'OnHoldInactive'
  • TRANSFERREQUESTED: 'TransferRequested'
  • TRANSFERRING: 'Transferring'
  • TRANSFERCOMPLETED: 'TransferCompleted'
  • TRANSFERFAILED: 'TransferFailed'
  • CALLERHUNGUP: 'CallerHungUp'
  • CALLEEHUNGUP: 'CalleeHungUp'
  • REDIRECTED: 'Redirected'
  • NOTFOUND: 'NotFound'
  • BUSY: 'Busy'
  • CANCELLED: 'Cancelled'
  • NOTANSWERED: 'NotAnswered'
  • ERROR: 'Error'
  • ABORTED: 'Aborted'

If you have any questions or need assistance, please contact us at  info@ozekiphone.com

More information