new Session()
#SESSION
Session class
Methods
-
blindTransfer(transferor, phoneNumber)
-
Uses blind transfer to transfer the call to another party. Can only be used if the connected client has the required privilege.
Parameters:
Name Type Description transferor
string The transferor number. Must be either the caller ID or the callee ID. phoneNumber
string The target party. Throws:
Will throw an exception if the transferor is not the caller ID or the callee ID, or if the phoneNumber was not specified. -
close()
-
Closes the session, terminating the call. Can only be used if the connected client has the required privilege.
- Source:
- See:
-
closeWithHangup()
-
Closes the session by calling HANGUP. Can only be used if the connected client has the required privilege.
-
forward(phoneNumber)
-
Forwards the session to another party. Can only be used if the connected client has the required privilege.
Parameters:
Name Type Description phoneNumber
string The target party. - Source:
- See:
Throws:
Will throw an exception if the phoneNumber was not specified. -
hangup()
-
Calls HANGUP on the session, terminating the call. Can only be used if the connected client has the required privilege.
- Source:
- See:
-
hold()
-
Holds both call parties. Can only be used if the connected client has the required privilege.
- Source:
- See:
-
onSessionStateChanged(callback)
-
This event occurs when the state of an active session has changed.
Parameters:
Name Type Description callback
onSessionStateChangedCallback The callback which handles the session state change. -
sendDtmf(key, phoneNumber)
-
Sends a DTMF signal to one of the call parties. Can only be used if the connected client has the required privilege.
Parameters:
Name Type Description key
char The DTMF signal e.g. 0, 1, 2,..., 9, *, #. phoneNumber
string The call party which will receive the DTMF signal. Must be either the caller ID or the callee ID. - Source:
- See:
Throws:
Will throw an exception if the transferor is not the caller ID or the callee ID, or if the key was not specified. -
startListen()
-
Starts a listening session e.g. lets you listen to the ongoing call. Can only be used if the connected client has the required privilege.
-
stopListen()
-
Stops the current listening session. Can only be used if the connected client has the required privilege.
-
unhold()
-
Unholds both call parties. Can only be used if the connected client has the required privilege.
- Source:
- See: