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
Property | Description |
---|---|
masterSessionId | The master session ID of the session |
sessionId | The session ID of the session. |
sessionState | The current state of the session. |
startTime | The start time of the session represented by a string. |
talkDuration | The talk duration of the session represented by a string. |
stateDuration | The state duration of the session represented by a string. |
caller | The ID of the caller. |
callee | The ID of the callee. |
callerDisplayName | The display name of the caller. |
calleeDisplayName | The display name of the callee. |
callerCallLegId | The call leg ID of the caller. |
calleeCallLegId | The call leg ID of the callee. |
source | The source ID of the session. |
sourceType | The source type of the session. |
destination | The destination ID of the session. |
destinationType | The destination type of the session. |
dialedNumber | The dialed number of the session. |
Methods
Method | Description |
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
Event | Description |
onSessionStateChanged | This 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