Introduction
Telenia TVox Client SDK permits to connecting to TVox as user ad interact with it.
Exposed functionality is:
- sdk can act as webrtc device
- phone can be managed by TVox Client logged with same user
@telenia/tvox-client-sdk / Exports
To use sdk you must firstly instantiate Client class then you can interact using client instance attribute and events
var client = new TVox.Client({
url: 'https://<hostname or ip of TVox>'
})
.on("logged_in", function(user) {
// user parameter is same as client.user attribute
console.log(`user ${user.info.username} is logged`);
})
.on("logged_out", function(user) {
// user parameter is same as client.user attribute
console.log("user is logged out");
})
.on("login_in_progress", function(user, credential) {
// user parameter is same as client.user attribute
console.log("user login in progress");
})
.on("ready", function() {
console.log("client is ready to use");
// now we can use client attribute to interact with tvox
});
then must execute login method to start connection to TVox ad try to identify myself
client.login({username: "foo", password: "bar"})
.catch(function(error) {
console.error("Error on login", error);
})
.then(function() {
console.log("login is done");
});
@telenia/tvox-client-sdk / Exports / Call / Lookup
Class: Lookup
Call.Lookup
Hierarchy
EventEmitter<LookupEventMap>
↳ Lookup
Events
end
• Static end: string = "end"
Fired when lookup end
update_contact
• Static update_contact: string = "update_contact"
Fired when lookup update contact
update_display
• Static update_display: string = "update_display"
Fired when lookup update display data
Properties
_contact
• Optional _contact: Contact
display
• Readonly display: LookupDisplay = {}
Accessors
contact
• get contact(): undefined | Contact
Returns
undefined | Contact
result
• get result(): undefined | SUCCESS | MULTIPLE | ERROR | NONE
Returns
undefined | SUCCESS | MULTIPLE | ERROR | NONE
status
• get status(): "end" | "progress"
Returns
"end" | "progress"
Methods
addListener
▸ addListener<T>(event, fn, context?): Lookup
Type parameters
| Name | Type |
|---|---|
T |
extends "update_contact" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<LookupEventMap>[Extract<T, "update_contact" \ |
context? |
any |
Returns
Inherited from
EventEmitter.addListener
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "update_contact" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<LookupEventMap>[Extract<T, "update_contact" \ |
Returns
boolean
Inherited from
EventEmitter.emit
eventNames
▸ eventNames(): ("update_contact" | "update_display" | "end")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("update_contact" | "update_display" | "end")[]
Inherited from
EventEmitter.eventNames
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"update_contact" \ |
Returns
number
Inherited from
EventEmitter.listenerCount
listeners
▸ listeners<T>(event): (...args: ArgumentMap<LookupEventMap>[Extract<T, "update_contact" | "update_display" | "end">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "update_contact" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<LookupEventMap>[Extract<T, "update_contact" | "update_display" | "end">]) => void[]
Inherited from
EventEmitter.listeners
off
▸ off<T>(event, fn?, context?, once?): Lookup
Type parameters
| Name | Type |
|---|---|
T |
extends "update_contact" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<LookupEventMap>[Extract<T, "update_contact" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.off
on
▸ on<T>(event, fn, context?): Lookup
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "update_contact" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<LookupEventMap>[Extract<T, "update_contact" \ |
context? |
any |
Returns
Inherited from
EventEmitter.on
once
▸ once<T>(event, fn, context?): Lookup
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "update_contact" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<LookupEventMap>[Extract<T, "update_contact" \ |
context? |
any |
Returns
Inherited from
EventEmitter.once
removeAllListeners
▸ removeAllListeners(event?): Lookup
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"update_contact" \ |
Returns
Inherited from
EventEmitter.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): Lookup
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "update_contact" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<LookupEventMap>[Extract<T, "update_contact" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.removeListener
@telenia/tvox-client-sdk / Exports / Call
Class: Call
Call represent manager for every call instance
Type parameters
| Name | Type | Description |
|---|---|---|
T |
extends Device = any |
is DeviceSip or DeviceWebrtc |
E |
extends ValidEventTypes = any |
is interface of event emitted |
Hierarchy
EventEmitter<E>
↳ Call
↳↳ CallSip
↳↳ CallWebrtc
Properties
callId
• Readonly callId: string
data
• Readonly data: Object
direction
• Readonly direction: Direction
lookup
• Readonly lookup: Lookup
Accessors
duration
• get duration(): undefined | number
Returns
undefined | number
endTime
• get endTime(): undefined | Date
Returns
undefined | Date
features
• get features(): CallFeature[]
Returns
id
• get id(): string
unique identifier of call inside TVox for TVox version <= 22.1.0 is same as callId
Returns
string
lastUpdateMessageDate
• get lastUpdateMessageDate(): null | Date
Returns
null | Date
service
• get service(): undefined | { code: string ; description: string }
Returns
undefined | { code: string ; description: string }
startTime
• get startTime(): Date
Returns
Date
Methods
addListener
▸ addListener<T>(event, fn, context?): Call<T, E>
Type parameters
| Name | Type |
|---|---|
T |
extends string \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
EventListener<E, T> |
context? |
any |
Returns
Call<T, E>
Inherited from
EventEmitter.addListener
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends string \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
Parameters<EventListener<E, T>> |
Returns
boolean
Inherited from
EventEmitter.emit
eventNames
▸ eventNames(): EventNames<E>[]
Return an array listing the events for which the emitter has registered listeners.
Returns
EventNames<E>[]
Inherited from
EventEmitter.eventNames
hasFeature
▸ hasFeature(feature): boolean
utility function to check if call has feature
Parameters
| Name | Type |
|---|---|
feature |
CallFeature |
Returns
boolean
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
EventNames<E> |
Returns
number
Inherited from
EventEmitter.listenerCount
listeners
▸ listeners<T>(event): EventListener<E, T>[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends string \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
EventListener<E, T>[]
Inherited from
EventEmitter.listeners
off
▸ off<T>(event, fn?, context?, once?): Call<T, E>
Type parameters
| Name | Type |
|---|---|
T |
extends string \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
EventListener<E, T> |
context? |
any |
once? |
boolean |
Returns
Call<T, E>
Inherited from
EventEmitter.off
on
▸ on<T>(event, fn, context?): Call<T, E>
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends string \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
EventListener<E, T> |
context? |
any |
Returns
Call<T, E>
Inherited from
EventEmitter.on
once
▸ once<T>(event, fn, context?): Call<T, E>
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends string \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
EventListener<E, T> |
context? |
any |
Returns
Call<T, E>
Inherited from
EventEmitter.once
removeAllListeners
▸ removeAllListeners(event?): Call<T, E>
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
EventNames<E> |
Returns
Call<T, E>
Inherited from
EventEmitter.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): Call<T, E>
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends string \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
EventListener<E, T> |
context? |
any |
once? |
boolean |
Returns
Call<T, E>
Inherited from
EventEmitter.removeListener
@telenia/tvox-client-sdk / Exports / CallHistory / CallHistoryResult
Class: CallHistoryResult
CallHistory.CallHistoryResult
Hierarchy
↳ CallHistoryResult
Events
complete
• Static complete: string = "complete"
Fired when response complete
param
result.on("complete", function() {
console.log("result complete");
});
#### Inherited from
[SearchResult](#classessearchresultmd).[complete](#complete)
___
### data
• `Static` **data**: `string` = `"data"`
Fired when response return data
**`param`** T data received
**`param`** number indexed data
**`param`** total result to received
```javascript
result.on("data", function(data, index, tot) {
console.log("received " + index + " of " + tot + " data", data);
});
Inherited from
error
• Static error: string = "error"
Fired when response return error
param data received
result.on("error", function(error) {
console.log("error on receive result", error);
});
Inherited from
Properties
options
• Readonly options: CallHistoryRequest
Methods
addListener
▸ addListener<T>(event, fn, context?): CallHistoryResult
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<SearchResultEventMap<CallHistoryItem>>[Extract<T, "data" \ |
context? |
any |
Returns
Inherited from
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<SearchResultEventMap<CallHistoryItem>>[Extract<T, "data" \ |
Returns
boolean
Inherited from
eventNames
▸ eventNames(): ("data" | "error" | "complete")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("data" | "error" | "complete")[]
Inherited from
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"data" \ |
Returns
number
Inherited from
listeners
▸ listeners<T>(event): (...args: ArgumentMap<SearchResultEventMap<CallHistoryItem>>[Extract<T, "data" | "error" | "complete">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<SearchResultEventMap<CallHistoryItem>>[Extract<T, "data" | "error" | "complete">]) => void[]
Inherited from
off
▸ off<T>(event, fn?, context?, once?): CallHistoryResult
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<SearchResultEventMap<CallHistoryItem>>[Extract<T, "data" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
on
▸ on<T>(event, fn, context?): CallHistoryResult
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<SearchResultEventMap<CallHistoryItem>>[Extract<T, "data" \ |
context? |
any |
Returns
Inherited from
once
▸ once<T>(event, fn, context?): CallHistoryResult
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<SearchResultEventMap<CallHistoryItem>>[Extract<T, "data" \ |
context? |
any |
Returns
Inherited from
removeAllListeners
▸ removeAllListeners(event?): CallHistoryResult
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"data" \ |
Returns
Inherited from
SearchResult.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): CallHistoryResult
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<SearchResultEventMap<CallHistoryItem>>[Extract<T, "data" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
@telenia/tvox-client-sdk / Exports / CallSip
Class: CallSip
Hierarchy
↳ CallSip
Events
accepted
• Static accepted: string = "accepted"
Fired when the call is accepted
param
call.on("accepted", function() {
console.log("call accepted");
});
change_features
• Static change_features: string = "change_features"
Fired when feature change
param {@link Call.CallFeature[]} new features
param {@link Call.CallFeature[]} previousFeatures
call.on("change_features", function(features, previousFeatures) {
console.log("call change features", features, previousFeatures);
});
connecting
• Static connecting: string = "connecting"
Fired after server confirm call
param
call.on("connecting", function() {
console.log("call connecting");
});
ended
• Static ended: string = "ended"
Fired when the call is ended
param
call.on("ended", function() {
console.log("call ended");
});
hold
• Static hold: string = "hold"
Fired when the user puts call on hold.
param
call.on("hold", function() {
console.log("call hold");
});
newDTMF
• Static newDTMF: string = "newDTMF"
Fired for DTMF
param string|number dtmf managed
call.on("newDTMF", function(dtmf) {
console.log("call newDTMF", dtmf);
});
new_call_for_transfer
• Static new_call_for_transfer: string = "new_call_for_transfer"
Fired when dialForTransfer has done
param CallSipForTransfer callForTranseferInstance
call.on("new_call_for_transfer", function(callForTransfer) {
console.log("callForTransfer done");
});
progress
• Static progress: string = "progress"
Fired after server update call data
param
call.on("progress", function() {
console.log("call progress");
});
unhold
• Static unhold: string = "unhold"
Fired when the user resumes call from hold.
param
call.on("unhold", function() {
console.log("call unhold");
});
Properties
callId
• Readonly callId: string
Inherited from
data
• Readonly data: Object
Inherited from
direction
• Readonly direction: Direction
Inherited from
lookup
• Readonly lookup: Lookup
Inherited from
type
• Readonly type: LineType = C.LineType.SIP
Accessors
callSipForTransferInstance
• get callSipForTransferInstance(): undefined | CallSipForTransfer
Returns
undefined | CallSipForTransfer
duration
• get duration(): undefined | number
Returns
undefined | number
Inherited from
Call.duration
endTime
• get endTime(): undefined | Date
Returns
undefined | Date
Inherited from
Call.endTime
features
• get features(): CallFeature[]
Returns
Inherited from
Call.features
id
• get id(): string
unique identifier of call inside TVox for TVox version <= 22.1.0 is same as callId
Returns
string
Inherited from
Call.id
lastUpdateMessageDate
• get lastUpdateMessageDate(): null | Date
Returns
null | Date
Inherited from
Call.lastUpdateMessageDate
service
• get service(): undefined | { code: string ; description: string }
Returns
undefined | { code: string ; description: string }
Inherited from
Call.service
startTime
• get startTime(): Date
Returns
Date
Inherited from
Call.startTime
Methods
addListener
▸ addListener<T>(event, fn, context?): CallSip
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "progress" \ |
context? |
any |
Returns
Inherited from
answer
▸ answer(): Promise<boolean>
answer the incoming call. This method is available for incoming call only.
Returns
Promise<boolean>
dialForTransfer
▸ dialForTransfer(phoneNumber, param?): Promise<CallSipForTransfer>
On CallSip generated by generic sip device we can execute dial in purpose of future attendant transfer
Parameters
| Name | Type |
|---|---|
phoneNumber |
string |
param? |
DialParam |
Returns
Promise<CallSipForTransfer>
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<EventMap>[Extract<T, "progress" \ |
Returns
boolean
Inherited from
eventNames
▸ eventNames(): ("progress" | "connecting" | "accepted" | "ended" | "newDTMF" | "hold" | "unhold" | "change_features" | "new_call_for_transfer")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("progress" | "connecting" | "accepted" | "ended" | "newDTMF" | "hold" | "unhold" | "change_features" | "new_call_for_transfer")[]
Inherited from
hasFeature
▸ hasFeature(feature): boolean
utility function to check if call has feature
Parameters
| Name | Type |
|---|---|
feature |
CallFeature |
Returns
boolean
Inherited from
hold
▸ hold(): Promise<boolean>
puts the call on hold
Returns
Promise<boolean>
isDialForTransferEnabled
▸ isDialForTransferEnabled(): boolean
The purpose is for check if we can call method dialForTransfer CallSip
Returns
boolean
isEnded
▸ isEnded(): boolean
return true if the call is ended.
Returns
boolean
Overrides
Call.isEnded
isEstablished
▸ isEstablished(): boolean
return true if the call is established.
Returns
boolean
Overrides
Call.isEstablished
isInProgress
▸ isInProgress(): boolean
return true if the call is in progress state (not established and not ended).
Returns
boolean
Overrides
Call.isInProgress
isOnHold
▸ isOnHold(): boolean
return true if the call is on hold.
Returns
boolean
Overrides
Call.isOnHold
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"progress" \ |
Returns
number
Inherited from
listeners
▸ listeners<T>(event): (...args: ArgumentMap<EventMap>[Extract<T, "progress" | "connecting" | "accepted" | "ended" | "newDTMF" | "hold" | "unhold" | "change_features" | "new_call_for_transfer">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<EventMap>[Extract<T, "progress" | "connecting" | "accepted" | "ended" | "newDTMF" | "hold" | "unhold" | "change_features" | "new_call_for_transfer">]) => void[]
Inherited from
off
▸ off<T>(event, fn?, context?, once?): CallSip
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "progress" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
on
▸ on<T>(event, fn, context?): CallSip
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "progress" \ |
context? |
any |
Returns
Inherited from
once
▸ once<T>(event, fn, context?): CallSip
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "progress" \ |
context? |
any |
Returns
Inherited from
removeAllListeners
▸ removeAllListeners(event?): CallSip
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"progress" \ |
Returns
Inherited from
removeListener
▸ removeListener<T>(event, fn?, context?, once?): CallSip
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "progress" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
sendDTMF
▸ sendDTMF(tone): Promise<boolean>
send one or multiple DTMF tones
Parameters
| Name | Type |
|---|---|
tone |
string \ |
Returns
Promise<boolean>
terminate
▸ terminate(): Promise<boolean>
terminate current call
Returns
Promise<boolean>
transferToCall
▸ transferToCall(call): Promise<boolean>
transfer call to other sip call, this is like attended tranfer
Parameters
| Name | Type |
|---|---|
call |
CallSip |
Returns
Promise<boolean>
transferToNumber
▸ transferToNumber(number): Promise<boolean>
transfer call to phone number, this is like blind transfer. Calling the desired number on behalf of the caller, the original call then drops-off without waiting for the called number to be picked up
Parameters
| Name | Type |
|---|---|
number |
string |
Returns
Promise<boolean>
unhold
▸ unhold(): Promise<boolean>
resumes the call from hold
Returns
Promise<boolean>
@telenia/tvox-client-sdk / Exports / CallSipForTransfer
Class: CallSipForTransfer
Hierarchy
EventEmitter<EventMap>
↳ CallSipForTransfer
Constructors
constructor
• new CallSipForTransfer(device, _callSip)
Parameters
| Name | Type |
|---|---|
device |
DeviceSip |
_callSip |
CallSip |
Overrides
EventEmitter<CallSipForTransfer.EventMap>.constructor
Events
ended
• Static ended: string = "ended"
Fired when the callSipForTransfer is ended
param
callSipForTransfer.on("ended", function() {
console.log("call for transfer is ended");
});
Accessors
callSip
• get callSip(): CallSip
CallSip instance associated of this {@link CallSipForTransefer} instance
Returns
Methods
addListener
▸ addListener<T>(event, fn, context?): CallSipForTransfer
Type parameters
| Name | Type |
|---|---|
T |
extends "ended" |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "ended">]) => void |
context? |
any |
Returns
Inherited from
EventEmitter.addListener
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "ended" |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<EventMap>[Extract<T, "ended">] |
Returns
boolean
Inherited from
EventEmitter.emit
eventNames
▸ eventNames(): "ended"[]
Return an array listing the events for which the emitter has registered listeners.
Returns
"ended"[]
Inherited from
EventEmitter.eventNames
isEnded
▸ isEnded(): boolean
Returns
boolean
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"ended" |
Returns
number
Inherited from
EventEmitter.listenerCount
listeners
▸ listeners<T>(event): (...args: ArgumentMap<EventMap>[Extract<T, "ended">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "ended" |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<EventMap>[Extract<T, "ended">]) => void[]
Inherited from
EventEmitter.listeners
off
▸ off<T>(event, fn?, context?, once?): CallSipForTransfer
Type parameters
| Name | Type |
|---|---|
T |
extends "ended" |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "ended">]) => void |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.off
on
▸ on<T>(event, fn, context?): CallSipForTransfer
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "ended" |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "ended">]) => void |
context? |
any |
Returns
Inherited from
EventEmitter.on
once
▸ once<T>(event, fn, context?): CallSipForTransfer
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "ended" |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "ended">]) => void |
context? |
any |
Returns
Inherited from
EventEmitter.once
removeAllListeners
▸ removeAllListeners(event?): CallSipForTransfer
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"ended" |
Returns
Inherited from
EventEmitter.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): CallSipForTransfer
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "ended" |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "ended">]) => void |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.removeListener
terminate
▸ terminate(): Promise<boolean>
Returns
Promise<boolean>
transfer
▸ transfer(): Promise<boolean>
Returns
Promise<boolean>
@telenia/tvox-client-sdk / Exports / CallWebrtc / ConnectionManager
Class: ConnectionManager
CallWebrtc.ConnectionManager
Hierarchy
EventEmitter<{connection_error: (error:any) =>void;local_audio_level: (level:number) =>void;remote_audio_level: (level:number) =>void;state: (state:State) =>void;stats: (stats:StatsEvent) =>void}>
↳ ConnectionManager
Constructors
constructor
• new ConnectionManager(call)
Parameters
| Name | Type |
|---|---|
call |
CallWebrtc |
Overrides
EventEmitter<{ connection_error: (error: any) => void; state: (state: ConnectionManager.State) => void; local_audio_level: (level: number) => void; remote_audio_level: (level: number) => void; stats: (stats: TLink.StatsEvent) => void; }>.constructor
Methods
addListener
▸ addListener<T>(event, fn, context?): ConnectionManager
Type parameters
| Name | Type |
|---|---|
T |
extends "connection_error" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<{ connection_error: (error: any) => void ; local_audio_level: (level: number) => void ; remote_audio_level: (level: number) => void ; state: (state: State) => void ; stats: (stats: StatsEvent) => void }>[Extract<T, "connection_error" \ |
context? |
any |
Returns
Inherited from
EventEmitter.addListener
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "connection_error" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<{ connection_error: (error: any) => void ; local_audio_level: (level: number) => void ; remote_audio_level: (level: number) => void ; state: (state: State) => void ; stats: (stats: StatsEvent) => void }>[Extract<T, "connection_error" \ |
Returns
boolean
Inherited from
EventEmitter.emit
eventNames
▸ eventNames(): ("connection_error" | "state" | "local_audio_level" | "remote_audio_level" | "stats")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("connection_error" | "state" | "local_audio_level" | "remote_audio_level" | "stats")[]
Inherited from
EventEmitter.eventNames
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"connection_error" \ |
Returns
number
Inherited from
EventEmitter.listenerCount
listeners
▸ listeners<T>(event): (...args: ArgumentMap<{ connection_error: (error: any) => void ; local_audio_level: (level: number) => void ; remote_audio_level: (level: number) => void ; state: (state: State) => void ; stats: (stats: StatsEvent) => void }>[Extract<T, "connection_error" | "state" | "local_audio_level" | "remote_audio_level" | "stats">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "connection_error" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<{ connection_error: (error: any) => void ; local_audio_level: (level: number) => void ; remote_audio_level: (level: number) => void ; state: (state: State) => void ; stats: (stats: StatsEvent) => void }>[Extract<T, "connection_error" | "state" | "local_audio_level" | "remote_audio_level" | "stats">]) => void[]
Inherited from
EventEmitter.listeners
off
▸ off<T>(event, fn?, context?, once?): ConnectionManager
Type parameters
| Name | Type |
|---|---|
T |
extends "connection_error" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<{ connection_error: (error: any) => void ; local_audio_level: (level: number) => void ; remote_audio_level: (level: number) => void ; state: (state: State) => void ; stats: (stats: StatsEvent) => void }>[Extract<T, "connection_error" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.off
on
▸ on<T>(event, fn, context?): ConnectionManager
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "connection_error" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<{ connection_error: (error: any) => void ; local_audio_level: (level: number) => void ; remote_audio_level: (level: number) => void ; state: (state: State) => void ; stats: (stats: StatsEvent) => void }>[Extract<T, "connection_error" \ |
context? |
any |
Returns
Inherited from
EventEmitter.on
once
▸ once<T>(event, fn, context?): ConnectionManager
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "connection_error" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<{ connection_error: (error: any) => void ; local_audio_level: (level: number) => void ; remote_audio_level: (level: number) => void ; state: (state: State) => void ; stats: (stats: StatsEvent) => void }>[Extract<T, "connection_error" \ |
context? |
any |
Returns
Inherited from
EventEmitter.once
removeAllListeners
▸ removeAllListeners(event?): ConnectionManager
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"connection_error" \ |
Returns
Inherited from
EventEmitter.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): ConnectionManager
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "connection_error" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<{ connection_error: (error: any) => void ; local_audio_level: (level: number) => void ; remote_audio_level: (level: number) => void ; state: (state: State) => void ; stats: (stats: StatsEvent) => void }>[Extract<T, "connection_error" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.removeListener
startConnectionStats
▸ startConnectionStats(): void
Returns
void
startLocalAudioLevel
▸ startLocalAudioLevel(): void
Returns
void
startRemoteAudioLevel
▸ startRemoteAudioLevel(): void
Returns
void
stopConnectionStats
▸ stopConnectionStats(): void
Returns
void
stopLocalAudioLevel
▸ stopLocalAudioLevel(): void
Returns
void
stopRemoteAudioLevel
▸ stopRemoteAudioLevel(): void
Returns
void
@telenia/tvox-client-sdk / Exports / CallWebrtc
Class: CallWebrtc
Hierarchy
↳ CallWebrtc
Properties
callId
• Readonly callId: string
Inherited from
data
• Readonly data: Object
Inherited from
direction
• Readonly direction: Direction
Inherited from
lookup
• Readonly lookup: Lookup
Inherited from
type
• Readonly type: LineType = C.LineType.WEBRTC
Accessors
connectionManager
• get connectionManager(): ConnectionManager
Returns
duration
• get duration(): undefined | number
Returns
undefined | number
Inherited from
Call.duration
endTime
• get endTime(): undefined | Date
Returns
undefined | Date
Inherited from
Call.endTime
features
• get features(): CallFeature[]
Returns
Inherited from
Call.features
id
• get id(): string
unique identifier of call inside TVox for TVox version <= 22.1.0 is same as callId
Returns
string
Inherited from
Call.id
lastUpdateMessageDate
• get lastUpdateMessageDate(): null | Date
Returns
null | Date
Inherited from
Call.lastUpdateMessageDate
service
• get service(): undefined | { code: string ; description: string }
Returns
undefined | { code: string ; description: string }
Inherited from
Call.service
startTime
• get startTime(): Date
Returns
Date
Inherited from
Call.startTime
Methods
addListener
▸ addListener<T>(event, fn, context?): CallWebrtc
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "progress" \ |
context? |
any |
Returns
Inherited from
answerAudio
▸ answerAudio(): Promise<boolean>
answer the incoming call. This method is available for incoming call only.
Returns
Promise<boolean>
answerVideo
▸ answerVideo(videoContainer?): Promise<boolean>
answer the incoming call. This method is available for incoming call only.
Parameters
| Name | Type |
|---|---|
videoContainer? |
HTMLElement |
Returns
Promise<boolean>
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<EventMap>[Extract<T, "progress" \ |
Returns
boolean
Inherited from
eventNames
▸ eventNames(): ("progress" | "connecting" | "accepted" | "ended" | "newDTMF" | "hold" | "unhold" | "change_features")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("progress" | "connecting" | "accepted" | "ended" | "newDTMF" | "hold" | "unhold" | "change_features")[]
Inherited from
hasFeature
▸ hasFeature(feature): boolean
utility function to check if call has feature
Parameters
| Name | Type |
|---|---|
feature |
CallFeature |
Returns
boolean
Inherited from
hold
▸ hold(): Promise<boolean>
puts the call on hold
Returns
Promise<boolean>
isEnded
▸ isEnded(): boolean
return true if the call is ended.
Returns
boolean
Overrides
Call.isEnded
isEstablished
▸ isEstablished(): boolean
return true if the call is established.
Returns
boolean
Overrides
Call.isEstablished
isInProgress
▸ isInProgress(): boolean
return true if the call is in progress state (not established and not ended).
Returns
boolean
Overrides
Call.isInProgress
isOnHold
▸ isOnHold(): boolean
return true if the call is on hold.
Returns
boolean
Overrides
Call.isOnHold
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"progress" \ |
Returns
number
Inherited from
listeners
▸ listeners<T>(event): (...args: ArgumentMap<EventMap>[Extract<T, "progress" | "connecting" | "accepted" | "ended" | "newDTMF" | "hold" | "unhold" | "change_features">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<EventMap>[Extract<T, "progress" | "connecting" | "accepted" | "ended" | "newDTMF" | "hold" | "unhold" | "change_features">]) => void[]
Inherited from
mute
▸ mute(options): Promise<boolean>
Mutes the local audio and/or video.
Parameters
| Name | Type |
|---|---|
options |
MuteOptions |
Returns
Promise<boolean>
off
▸ off<T>(event, fn?, context?, once?): CallWebrtc
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "progress" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
on
▸ on<T>(event, fn, context?): CallWebrtc
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "progress" \ |
context? |
any |
Returns
Inherited from
once
▸ once<T>(event, fn, context?): CallWebrtc
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "progress" \ |
context? |
any |
Returns
Inherited from
removeAllListeners
▸ removeAllListeners(event?): CallWebrtc
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"progress" \ |
Returns
Inherited from
removeListener
▸ removeListener<T>(event, fn?, context?, once?): CallWebrtc
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "progress" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "progress" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
sendDTMF
▸ sendDTMF(tone, playTone?): Promise<boolean>
send one or multiple DTMF tones
Parameters
| Name | Type | Default value |
|---|---|---|
tone |
string \ |
number |
playTone |
boolean |
true |
Returns
Promise<boolean>
terminate
▸ terminate(): Promise<boolean>
terminate the current call
Returns
Promise<boolean>
transferToCall
▸ transferToCall(target): Promise<boolean>
transfer call to other call
Parameters
| Name | Type |
|---|---|
target |
Call<any, any> |
Returns
Promise<boolean>
transferToNunber
▸ transferToNunber(number, accessCode?, data?): Promise<boolean>
transfer call to phone number. Calling the desired number on behalf of the caller, the original call then drops-off without waiting for the called number to be picked up
Parameters
| Name | Type |
|---|---|
number |
string |
accessCode? |
string |
data? |
string[] |
Returns
Promise<boolean>
unhold
▸ unhold(): Promise<boolean>
resumes the call from hold
Returns
Promise<boolean>
unmute
▸ unmute(options): Promise<boolean>
Unmutes the local audio and/or video.
Parameters
| Name | Type |
|---|---|
options |
MuteOptions |
Returns
Promise<boolean>
@telenia/tvox-client-sdk / Exports / Client / ClientLogConfigurator
Class: ClientLogConfigurator
Client.ClientLogConfigurator
Hierarchy
↳ ClientLogConfigurator
Accessors
enabled
• get enabled(): boolean
Returns
boolean
• set enabled(enabled): void
Parameters
| Name | Type |
|---|---|
enabled |
boolean |
Returns
void
instanceIdLogged
• get instanceIdLogged(): boolean
Returns
boolean
Overrides
Log.LogConfigurator.instanceIdLogged
• set instanceIdLogged(instanceIdLogged): void
Parameters
| Name | Type |
|---|---|
instanceIdLogged |
boolean |
Returns
void
Overrides
Log.LogConfigurator.instanceIdLogged
logLevel
• get logLevel(): LogLevel
Returns
Overrides
Log.LogConfigurator.logLevel
• set logLevel(logLevel): void
Parameters
| Name | Type |
|---|---|
logLevel |
LogLevel |
Returns
void
Overrides
Log.LogConfigurator.logLevel
objectToJson
• get objectToJson(): boolean
Returns
boolean
Overrides
Log.LogConfigurator.objectToJson
• set objectToJson(objectToJson): void
Parameters
| Name | Type |
|---|---|
objectToJson |
boolean |
Returns
void
Overrides
Log.LogConfigurator.objectToJson
prefix
• get prefix(): string
Returns
string
Overrides
Log.LogConfigurator.prefix
• set prefix(prefix): void
Parameters
| Name | Type |
|---|---|
prefix |
string |
Returns
void
Overrides
Log.LogConfigurator.prefix
timestamp
• get timestamp(): boolean
Returns
boolean
Overrides
Log.LogConfigurator.timestamp
• set timestamp(timestamp): void
Parameters
| Name | Type |
|---|---|
timestamp |
boolean |
Returns
void
Overrides
Log.LogConfigurator.timestamp
Methods
disableNamespace
▸ Static disableNamespace(): string
disable and return previus enabled namespace
Returns
string
enableNamespace
▸ Static enableNamespace(namespace): void
enable namespace
Parameters
| Name | Type |
|---|---|
namespace |
string |
Returns
void
@telenia/tvox-client-sdk / Exports / Client
Class: Client
Client class represents a client access to TVox.
Hierarchy
EventEmitter<EventMap>
↳ Client
Constructors
constructor
• new Client(configuration)
Creates an instance of Client
Parameters
| Name | Type |
|---|---|
configuration |
ClientParameter |
Overrides
EventEmitter<Client.EventMap>.constructor
Events
logged_in
• Static logged_in: string = "logged_in"
Fired for a successfull login.
param User user is same as client.user
client.on("logged_in", function(user) {
console.log("user is logged in");
});
logged_out
• Static logged_out: string = "logged_out"
Fired for a successfull logout.
param User user is same as client.user
client.on("logged_out", function(user) {
console.log("user is logged out");
});
login_failed
• Static login_failed: string = "login_failed"
Fired after a login is failed
param LoginError
param User user is same as client.user
code attribute value of error can be
- 401 Wrong credential
- 403 Password expired
- 497 User not enable to login from internet
- 498 User not enable to use TVox Client
any value greater or equal to 500 is consider internal server error and must be notified to Telenia Customer Service
client.on("login_failed", function(error, user) {
console.log("user login failed", error);
});
login_in_progress
• Static login_in_progress: string = "login_in_progress"
Fired after a login il called
param User user is same as client.user
param BasicCredential or BerearCredential credential used
client.on("login_in_progress", function(user, credential) {
console.log("user is trying to login", credential);
});
ready
• Static ready: string = "ready"
Fired after login ad user initalization is done
Properties
configuration
• Readonly configuration: ClientParameter
parameter used to instantiate client
phone
• Readonly phone: Phone
manage phone
transport
• Readonly transport: Transport
transport messages with TVox
user
• Readonly user: User
manage user data
Accessors
instanceId
• get instanceId(): string
identification of Client instance
Returns
string
logConfigurator
• get logConfigurator(): ClientLogConfigurator
client log configurator
Returns
state
• get state(): ClientState
current state of this client instance
Returns
Methods
addListener
▸ addListener<T>(event, fn, context?): Client
Type parameters
| Name | Type |
|---|---|
T |
extends "ready" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "ready" \ |
context? |
any |
Returns
Inherited from
EventEmitter.addListener
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "ready" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<EventMap>[Extract<T, "ready" \ |
Returns
boolean
Inherited from
EventEmitter.emit
eventNames
▸ eventNames(): ("ready" | "logged_in" | "logged_out" | "login_in_progress" | "login_failed")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("ready" | "logged_in" | "logged_out" | "login_in_progress" | "login_failed")[]
Inherited from
EventEmitter.eventNames
isLogged
▸ isLogged(): boolean
check if this instance is logged
Returns
boolean
true if this client is logged
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"ready" \ |
Returns
number
Inherited from
EventEmitter.listenerCount
listeners
▸ listeners<T>(event): (...args: ArgumentMap<EventMap>[Extract<T, "ready" | "logged_in" | "logged_out" | "login_in_progress" | "login_failed">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "ready" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<EventMap>[Extract<T, "ready" | "logged_in" | "logged_out" | "login_in_progress" | "login_failed">]) => void[]
Inherited from
EventEmitter.listeners
login
▸ login(credential): Promise<void>
Parameters
| Name | Type | Description |
|---|---|---|
credential |
Credential |
credential to use |
Returns
Promise<void>
// login with BasicCredential
client.login({username: "foo", password: "bar"}).then(() => {
console.log("login ok");
}, (err) => {
console.error("login failed", err);
});
// login with BerearCredential
client.login({token: "aabbcc"}).then(() => {
console.log("login ok");
}, (err) => {
console.error("login failed", err);
});
// login with ExternalSessionIdCredential
client.login({externalSessionId: "aabbcc"}).then(() => {
console.log("login ok");
}, (err) => {
console.error("login failed", err);
});
logout
▸ logout(reason?, note?): Promise<boolean>
run logout
Parameters
| Name | Type | Description |
|---|---|---|
reason? |
string |
set reason for logout, example "end of shift" |
note? |
string |
optional additional note of logout |
Returns
Promise<boolean>
a promise resolved when the logout is done
off
▸ off<T>(event, fn?, context?, once?): Client
Type parameters
| Name | Type |
|---|---|
T |
extends "ready" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "ready" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.off
on
▸ on<T>(event, fn, context?): Client
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "ready" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "ready" \ |
context? |
any |
Returns
Inherited from
EventEmitter.on
once
▸ once<T>(event, fn, context?): Client
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "ready" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "ready" \ |
context? |
any |
Returns
Inherited from
EventEmitter.once
removeAllListeners
▸ removeAllListeners(event?): Client
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"ready" \ |
Returns
Inherited from
EventEmitter.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): Client
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "ready" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "ready" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.removeListener
@telenia/tvox-client-sdk / Exports / Contact / SearchContactResult
Class: SearchContactResult
Contact.SearchContactResult
represent result of searchContact methods.
Hierarchy
↳ SearchContactResult
Events
complete
• Static complete: string = "complete"
Fired when response complete
param
result.on("complete", function() {
console.log("result complete");
});
#### Inherited from
[SearchResult](#classessearchresultmd).[complete](#complete)
___
### data
• `Static` **data**: `string` = `"data"`
Fired when response return data
**`param`** T data received
**`param`** number indexed data
**`param`** total result to received
```javascript
result.on("data", function(data, index, tot) {
console.log("received " + index + " of " + tot + " data", data);
});
Inherited from
error
• Static error: string = "error"
Fired when response return error
param data received
result.on("error", function(error) {
console.log("error on receive result", error);
});
Inherited from
Properties
requestOptions
• Readonly requestOptions: SearchContactOptions
Methods
addListener
▸ addListener<T>(event, fn, context?): SearchContactResult
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<SearchResultEventMap<Contact>>[Extract<T, "data" \ |
context? |
any |
Returns
Inherited from
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<SearchResultEventMap<Contact>>[Extract<T, "data" \ |
Returns
boolean
Inherited from
eventNames
▸ eventNames(): ("data" | "error" | "complete")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("data" | "error" | "complete")[]
Inherited from
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"data" \ |
Returns
number
Inherited from
listeners
▸ listeners<T>(event): (...args: ArgumentMap<SearchResultEventMap<Contact>>[Extract<T, "data" | "error" | "complete">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<SearchResultEventMap<Contact>>[Extract<T, "data" | "error" | "complete">]) => void[]
Inherited from
off
▸ off<T>(event, fn?, context?, once?): SearchContactResult
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<SearchResultEventMap<Contact>>[Extract<T, "data" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
on
▸ on<T>(event, fn, context?): SearchContactResult
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<SearchResultEventMap<Contact>>[Extract<T, "data" \ |
context? |
any |
Returns
Inherited from
once
▸ once<T>(event, fn, context?): SearchContactResult
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<SearchResultEventMap<Contact>>[Extract<T, "data" \ |
context? |
any |
Returns
Inherited from
removeAllListeners
▸ removeAllListeners(event?): SearchContactResult
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"data" \ |
Returns
Inherited from
SearchResult.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): SearchContactResult
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<SearchResultEventMap<Contact>>[Extract<T, "data" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
@telenia/tvox-client-sdk / Exports / Contact
Class: Contact
Hierarchy
Contact
Properties
id
• Readonly id: string
subtype
• Readonly subtype: null | SERVICE | USER | SHORT_NUMBER | ORGANIZATION = null
type
• Readonly type: Type
@telenia/tvox-client-sdk / Exports / DeviceSip
Class: DeviceSip
Implements
Properties
exten
• Readonly exten: string
label
• Readonly label: string
type
• Readonly type: LineType = C.LineType.SIP
Methods
dial
▸ dial(phoneNumber, param?): Promise<void>
run dial
Parameters
| Name | Type |
|---|---|
phoneNumber |
string |
param? |
DialParam |
Returns
Promise<void>
a promise resolved if call is placed
@telenia/tvox-client-sdk / Exports / DeviceWebrtc / Configuration
Class: Configuration
DeviceWebrtc.Configuration
Constructors
constructor
• new Configuration(device)
Parameters
| Name | Type |
|---|---|
device |
DeviceWebrtc |
Accessors
media
• get media(): WebrtDeviceManager
Returns
WebrtDeviceManager
options
• get options(): Options
Returns
@telenia/tvox-client-sdk / Exports / DeviceWebrtc / Configuration / Options
Class: Options
DeviceWebrtc.Configuration.Options
Constructors
constructor
• new Options(config)
Parameters
| Name | Type |
|---|---|
config |
WebrtcConfig |
Accessors
connectionTimeout
• get connectionTimeout(): undefined | number
Returns
undefined | number
• set connectionTimeout(connectionTimeout): void
Parameters
| Name | Type |
|---|---|
connectionTimeout |
undefined \ |
Returns
void
deadStreamTimeout
• get deadStreamTimeout(): undefined | number
Returns
undefined | number
• set deadStreamTimeout(deadStreamTimeout): void
Parameters
| Name | Type |
|---|---|
deadStreamTimeout |
undefined \ |
Returns
void
iceGatherPolicy
• get iceGatherPolicy(): undefined | ("host" | "srflx" | "relay")[]
Returns
undefined | ("host" | "srflx" | "relay")[]
• set iceGatherPolicy(iceGatherPolicy): void
Parameters
| Name | Type |
|---|---|
iceGatherPolicy |
undefined \ |
Returns
void
iceServers
• get iceServers(): undefined | IceServer[]
Returns
undefined | IceServer[]
• set iceServers(iceServers): void
Parameters
| Name | Type |
|---|---|
iceServers |
undefined \ |
Returns
void
immediateRingback
• get immediateRingback(): undefined | boolean
Returns
undefined | boolean
• set immediateRingback(immediateRingback): void
Parameters
| Name | Type |
|---|---|
immediateRingback |
undefined \ |
Returns
void
mediaConfiguration
• get mediaConfiguration(): undefined | MediaConfiguration
Returns
undefined | MediaConfiguration
trickleIcePolicy
• get trickleIcePolicy(): undefined | NotSupported | FullTrickle | HalfTrickle
Returns
undefined | NotSupported | FullTrickle | HalfTrickle
• set trickleIcePolicy(trickleIcePolicy): void
Parameters
| Name | Type |
|---|---|
trickleIcePolicy |
undefined \ |
Returns
void
@telenia/tvox-client-sdk / Exports / DeviceWebrtc
Class: DeviceWebrtc
Implements
Properties
configuration
• Readonly configuration: Configuration
exten
• Readonly exten: string
label
• Readonly label: string
type
• Readonly type: LineType = C.LineType.WEBRTC
Methods
dialAudio
▸ dialAudio(phoneNumber, param?): Promise<void>
run dialAudio
Parameters
| Name | Type |
|---|---|
phoneNumber |
string |
param? |
DialParam |
Returns
Promise<void>
a promise resolved if call is placed
dialVideo
▸ dialVideo(phoneNumber, param?, videoContainer?): Promise<void>
run dialVideo
Parameters
| Name | Type |
|---|---|
phoneNumber |
string |
param? |
DialParam |
videoContainer? |
HTMLElement |
Returns
Promise<void>
a promise resolved if call is placed
@telenia/tvox-client-sdk / Exports / ExternalItemContact
Class: ExternalItemContact
Hierarchy
↳ ExternalItemContact
Properties
data
• Readonly data: ExternalContact
Inherited from
Contact.data
id
• Readonly id: string
Inherited from
subtype
• Readonly subtype: null | SERVICE | USER | SHORT_NUMBER | ORGANIZATION = null
Inherited from
type
• Readonly type: Type
Inherited from
@telenia/tvox-client-sdk / Exports / ExternalOrganizationContact
Class: ExternalOrganizationContact
Hierarchy
↳ ExternalOrganizationContact
Properties
data
• Readonly data: ExternalOrganizationContact
Inherited from
Contact.data
id
• Readonly id: string
Inherited from
subtype
• Readonly subtype: null | SERVICE | USER | SHORT_NUMBER | ORGANIZATION = null
Inherited from
type
• Readonly type: Type
Inherited from
@telenia/tvox-client-sdk / Exports / InternalServiceContact
Class: InternalServiceContact
Hierarchy
↳ InternalServiceContact
Properties
data
• Readonly data: ServiceContact
Inherited from
Contact.data
id
• Readonly id: string
Inherited from
subtype
• Readonly subtype: null | SERVICE | USER | SHORT_NUMBER | ORGANIZATION = null
Inherited from
type
• Readonly type: Type
Inherited from
@telenia/tvox-client-sdk / Exports / InternalShortNumberContact
Class: InternalShortNumberContact
Hierarchy
↳ InternalShortNumberContact
Properties
data
• Readonly data: ShortNumberContact
Inherited from
Contact.data
id
• Readonly id: string
Inherited from
subtype
• Readonly subtype: null | SERVICE | USER | SHORT_NUMBER | ORGANIZATION = null
Inherited from
type
• Readonly type: Type
Inherited from
@telenia/tvox-client-sdk / Exports / InternalUserContact
Class: InternalUserContact
Hierarchy
↳ InternalUserContact
Properties
data
• Readonly data: UserContact
Inherited from
Contact.data
id
• Readonly id: string
Inherited from
subtype
• Readonly subtype: null | SERVICE | USER | SHORT_NUMBER | ORGANIZATION = null
Inherited from
type
• Readonly type: Type
Inherited from
@telenia/tvox-client-sdk / Exports / Log / LogConfigurator
Class: LogConfigurator
Log.LogConfigurator
Hierarchy
LogConfigurator
Accessors
instanceIdLogged
• Abstract get instanceIdLogged(): boolean
enabled to log identification of Client instance on every log line
Returns
boolean
logLevel
• Abstract get logLevel(): LogLevel
get current log level
Returns
objectToJson
• Abstract get objectToJson(): boolean
do JSON.stringify of logged args instead of direct print
Returns
boolean
prefix
• Abstract get prefix(): string
prefix added to every log line
Returns
string
timestamp
• Abstract get timestamp(): boolean
enabled to print timestamp on every log line
Returns
boolean
@telenia/tvox-client-sdk / Exports / Log
Class: Log
Accessors
config
• get config(): LogConfigurator
Returns
Methods
debug
▸ debug(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
error
▸ error(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
fatal
▸ fatal(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
info
▸ info(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
log
▸ log(level, ...args): void
Parameters
| Name | Type |
|---|---|
level |
LogLevel |
...args |
any[] |
Returns
void
logWithTimestamp
▸ logWithTimestamp(level, timestamp, ...args): void
log args with timestamp as prefix
Parameters
| Name | Type |
|---|---|
level |
LogLevel |
timestamp |
Date |
...args |
any[] |
Returns
void
verbose
▸ verbose(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
warn
▸ warn(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
debug
▸ Static debug(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
error
▸ Static error(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
fatal
▸ Static fatal(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
info
▸ Static info(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
of
▸ Static of(pkg, client?): Log
create instance of Log that log with pkg prefix
Parameters
| Name | Type |
|---|---|
pkg |
string |
client? |
Client |
Returns
verbose
▸ Static verbose(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
warn
▸ Static warn(...args): void
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Returns
void
@telenia/tvox-client-sdk / Exports / PersonalContact
Class: PersonalContact
Hierarchy
↳ PersonalContact
Properties
data
• Readonly data: PersonalContact
Inherited from
Contact.data
id
• Readonly id: string
Inherited from
subtype
• Readonly subtype: null | SERVICE | USER | SHORT_NUMBER | ORGANIZATION = null
Inherited from
type
• Readonly type: Type
Inherited from
@telenia/tvox-client-sdk / Exports / Phone
Class: Phone
A Phone represents place to manage phone activity
Hierarchy
EventEmitter<EventMap>
↳ Phone
Events
device_change
• Static device_change: string = "device_change"
Fired when device to use is changed
param DeviceSip or DeviceWebrtc
param DeviceSip or DeviceWebrtc
client.phone.on("device_change", function(newDevice, oldDevice) {
console.log("device change", oldDevice, newDevice);
});
newcall
• Static newcall: string = "newcall"
Fired when new call is incoming or outgoing
param CallSip or CallWebrtc call to manage
client.phone.on("newcall", function(call) {
console.log("new call is placed", call);
});
tvoxclient_state_change
• Static tvoxclient_state_change: string = "tvoxclient_state_change"
Fired when TVox Client state change
param Phone.TVoxClientState
param Phone.TVoxClientDetail}
client.phone.on("tvoxclient_state_change", function(state, detail) {
console.log("TVox Client state change", state, detail);
});
Properties
availableDevice
• Readonly availableDevice: (DeviceSip | DeviceWebrtc)[] = []
Accessors
device
• get device(): null | DeviceSip | DeviceWebrtc
Returns
null | DeviceSip | DeviceWebrtc
managedByTVoxClient
• get managedByTVoxClient(): boolean
phone managed by TVox Client
Returns
boolean
• set managedByTVoxClient(managedByTVoxClient): void
phone managed by TVox Client
Parameters
| Name | Type |
|---|---|
managedByTVoxClient |
boolean |
Returns
void
state
• get state(): Status
Returns
tvoxClientState
• get tvoxClientState(): TVoxClientState
Returns
tvoxClientStateDetail
• get tvoxClientStateDetail(): TVoxClientDetail
Returns
Methods
addListener
▸ addListener<T>(event, fn, context?): Phone
Type parameters
| Name | Type |
|---|---|
T |
extends "newcall" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "newcall" \ |
context? |
any |
Returns
Inherited from
EventEmitter.addListener
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "newcall" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<EventMap>[Extract<T, "newcall" \ |
Returns
boolean
Inherited from
EventEmitter.emit
eventNames
▸ eventNames(): ("newcall" | "tvoxclient_state_change" | "device_change")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("newcall" | "tvoxclient_state_change" | "device_change")[]
Inherited from
EventEmitter.eventNames
getCall
▸ getCall(id): null | CallSip | CallWebrtc
get calll instance by callid
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
call id to retrive |
Returns
null | CallSip | CallWebrtc
null if callid is not available
handleChannelNotification
▸ handleChannelNotification(data): Promise<void>
Parameters
| Name | Type |
|---|---|
data |
CallInfo |
Returns
Promise<void>
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"newcall" \ |
Returns
number
Inherited from
EventEmitter.listenerCount
listeners
▸ listeners<T>(event): (...args: ArgumentMap<EventMap>[Extract<T, "newcall" | "tvoxclient_state_change" | "device_change">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "newcall" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<EventMap>[Extract<T, "newcall" | "tvoxclient_state_change" | "device_change">]) => void[]
Inherited from
EventEmitter.listeners
off
▸ off<T>(event, fn?, context?, once?): Phone
Type parameters
| Name | Type |
|---|---|
T |
extends "newcall" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "newcall" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.off
on
▸ on<T>(event, fn, context?): Phone
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "newcall" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "newcall" \ |
context? |
any |
Returns
Inherited from
EventEmitter.on
once
▸ once<T>(event, fn, context?): Phone
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "newcall" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "newcall" \ |
context? |
any |
Returns
Inherited from
EventEmitter.once
removeAllListeners
▸ removeAllListeners(event?): Phone
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"newcall" \ |
Returns
Inherited from
EventEmitter.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): Phone
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "newcall" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "newcall" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.removeListener
useDevice
▸ useDevice(device): Promise<boolean>
run useDevice to set current device to use this method must be called after client initialization
Parameters
| Name | Type | Description |
|---|---|---|
device |
DeviceSip \ |
DeviceWebrtc |
Returns
Promise<boolean>
a promise resolved true if device is ready to use
@telenia/tvox-client-sdk / Exports / SearchResult
Class: SearchResult
Type parameters
| Name |
|---|
T |
Hierarchy
EventEmitter<SearchResultEventMap<T>>
↳ SearchResult
Events
complete
• Static complete: string = "complete"
Fired when response complete
param
result.on("complete", function() {
console.log("result complete");
});
___
### data
• `Static` **data**: `string` = `"data"`
Fired when response return data
**`param`** T data received
**`param`** number indexed data
**`param`** total result to received
```javascript
result.on("data", function(data, index, tot) {
console.log("received " + index + " of " + tot + " data", data);
});
error
• Static error: string = "error"
Fired when response return error
param data received
result.on("error", function(error) {
console.log("error on receive result", error);
});
Methods
addListener
▸ addListener<T>(event, fn, context?): SearchResult<T>
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<SearchResultEventMap<T>>[Extract<T, "data" \ |
context? |
any |
Returns
SearchResult<T>
Inherited from
EventEmitter.addListener
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<SearchResultEventMap<T>>[Extract<T, "data" \ |
Returns
boolean
Inherited from
EventEmitter.emit
eventNames
▸ eventNames(): ("data" | "error" | "complete")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("data" | "error" | "complete")[]
Inherited from
EventEmitter.eventNames
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"data" \ |
Returns
number
Inherited from
EventEmitter.listenerCount
listeners
▸ listeners<T>(event): (...args: ArgumentMap<SearchResultEventMap<T>>[Extract<T, "data" | "error" | "complete">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<SearchResultEventMap<T>>[Extract<T, "data" | "error" | "complete">]) => void[]
Inherited from
EventEmitter.listeners
off
▸ off<T>(event, fn?, context?, once?): SearchResult<T>
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<SearchResultEventMap<T>>[Extract<T, "data" \ |
context? |
any |
once? |
boolean |
Returns
SearchResult<T>
Inherited from
EventEmitter.off
on
▸ on<T>(event, fn, context?): SearchResult<T>
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<SearchResultEventMap<T>>[Extract<T, "data" \ |
context? |
any |
Returns
SearchResult<T>
Inherited from
EventEmitter.on
once
▸ once<T>(event, fn, context?): SearchResult<T>
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<SearchResultEventMap<T>>[Extract<T, "data" \ |
context? |
any |
Returns
SearchResult<T>
Inherited from
EventEmitter.once
removeAllListeners
▸ removeAllListeners(event?): SearchResult<T>
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"data" \ |
Returns
SearchResult<T>
Inherited from
EventEmitter.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): SearchResult<T>
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "data" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<SearchResultEventMap<T>>[Extract<T, "data" \ |
context? |
any |
once? |
boolean |
Returns
SearchResult<T>
Inherited from
EventEmitter.removeListener
@telenia/tvox-client-sdk / Exports / Transport
Class: Transport
A Transport represents place to manage communication to TVox
Hierarchy
EventEmitter<EventMap>
↳ Transport
Events
connect
• Static connect: string = "connect"
Fired for each transport connection.
param
client.transport.on("connect", function(user) {
console.log("transport connected");
});
disconnect
• Static disconnect: string = "disconnect"
Fired for each transport disconnect.
param
client.transport.on("disconnect", function(user) {
console.log("transport disconnected");
});
Accessors
state
• get state(): Status
Returns
Methods
addListener
▸ addListener<T>(event, fn, context?): Transport
Type parameters
| Name | Type |
|---|---|
T |
extends "connect" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "connect" \ |
context? |
any |
Returns
Inherited from
EventEmitter.addListener
connect
▸ connect(): void
run connect
Returns
void
a promise resolved when connect is done
disconnect
▸ disconnect(): void
run disconnect
Returns
void
a promise resolved when disconnect is done
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "connect" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<EventMap>[Extract<T, "connect" \ |
Returns
boolean
Inherited from
EventEmitter.emit
eventNames
▸ eventNames(): ("connect" | "disconnect")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("connect" | "disconnect")[]
Inherited from
EventEmitter.eventNames
isConnected
▸ isConnected(): boolean
Returns
boolean
true if transport is connected
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"connect" \ |
Returns
number
Inherited from
EventEmitter.listenerCount
listeners
▸ listeners<T>(event): (...args: ArgumentMap<EventMap>[Extract<T, "connect" | "disconnect">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "connect" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<EventMap>[Extract<T, "connect" | "disconnect">]) => void[]
Inherited from
EventEmitter.listeners
off
▸ off<T>(event, fn?, context?, once?): Transport
Type parameters
| Name | Type |
|---|---|
T |
extends "connect" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "connect" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.off
on
▸ on<T>(event, fn, context?): Transport
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "connect" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "connect" \ |
context? |
any |
Returns
Inherited from
EventEmitter.on
once
▸ once<T>(event, fn, context?): Transport
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "connect" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "connect" \ |
context? |
any |
Returns
Inherited from
EventEmitter.once
removeAllListeners
▸ removeAllListeners(event?): Transport
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"connect" \ |
Returns
Inherited from
EventEmitter.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): Transport
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "connect" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "connect" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.removeListener
@telenia/tvox-client-sdk / Exports / User / Profile
Class: Profile
User.Profile
Constructors
constructor
• new Profile(id, label, type)
Parameters
| Name | Type |
|---|---|
id |
number |
label |
string |
type |
ProfileType |
Properties
id
• id: number
label
• label: string
type
• type: ProfileType
@telenia/tvox-client-sdk / Exports / User
Class: User
A User represents place to manage user activity
Hierarchy
EventEmitter<EventMap>
↳ User
Events
error_no_profile
• Static error_no_profile: string = "error_no_profile"
Fired after error on useDevice
param
client.on("error_no_profile", function() {
console.log("user logged use wrong profile");
});
error_no_profile_available
• Static error_no_profile_available: string = "error_no_profile_available"
Fired for error on profile available
param
client.on("error_no_profile_available", function() {
console.log("user logged has any available profile");
});
profile_added
• Static profile_added: string = "profile_added"
Fired after TVox notify that one profile is added
param User.Profile profile selected
client.on("profile_added", function(profile) {
console.log("new profile is added to availableProfile");
});
profile_removed
• Static profile_removed: string = "profile_removed"
Fired after TVox notify that one profile is removed
param User.Profile profile selected
client.on("profile_removed", function(profile) {
console.log("profile is removed from availableProfile");
});
profile_selected
• Static profile_selected: string = "profile_selected"
Fired after succesful useProfile
param User.Profile profile selected
client.on("profile_selected", function(profile) {
console.log("user logged select profile");
});
Properties
availableProfile
• Readonly availableProfile: Profile[] = []
profile available to user, for select one use method useProfile
info
• Readonly info: Data = {}
current user info
Accessors
state
• get state(): State
current state of this client instance
Returns
Methods
addListener
▸ addListener<T>(event, fn, context?): User
Type parameters
| Name | Type |
|---|---|
T |
extends "error_no_profile" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "error_no_profile" \ |
context? |
any |
Returns
Inherited from
EventEmitter.addListener
emit
▸ emit<T>(event, ...args): boolean
Calls each of the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "error_no_profile" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
...args |
ArgumentMap<EventMap>[Extract<T, "error_no_profile" \ |
Returns
boolean
Inherited from
EventEmitter.emit
eventNames
▸ eventNames(): ("error_no_profile" | "error_no_profile_available" | "profile_selected" | "profile_removed" | "profile_added")[]
Return an array listing the events for which the emitter has registered listeners.
Returns
("error_no_profile" | "error_no_profile_available" | "profile_selected" | "profile_removed" | "profile_added")[]
Inherited from
EventEmitter.eventNames
getCallHistory
▸ getCallHistory(options): Promise<CallHistoryResult>
get call history
Parameters
| Name | Type |
|---|---|
options |
CallHistoryRequest |
Returns
Promise<CallHistoryResult>
a promise resolved when get call history is done
client.user.getCallHistory({pageNumber: 1, pageSize: "20"})
.catch(function(error) {
console.error("Error on searchContact", error);
})
.then(function(result) {
result
.on("data", function(data, index, total){
console.log("searchContact - result - DATA", data);
})
.on("error", function(error) {
console.error("searchContact - result - ERROR", error);
})
.on("complete", function() {
console.log("searchContact - result - COMPLETE");
});
});
getContact
▸ getContact(id): Promise<null | Contact>
run getContact
Parameters
| Name | Type |
|---|---|
id |
string |
Returns
Promise<null | Contact>
a promise resolved when getContact is done
client.user.getContact("0009922b-f9b4-409c-bca4-e476e34b1553")
.catch(function(error) {
console.error("getContact - error", error);
})
.then(function(result) {
console.log("getContact - response", result);
});
listenerCount
▸ listenerCount(event): number
Return the number of listeners listening to a given event.
Parameters
| Name | Type |
|---|---|
event |
"error_no_profile" \ |
Returns
number
Inherited from
EventEmitter.listenerCount
listeners
▸ listeners<T>(event): (...args: ArgumentMap<EventMap>[Extract<T, "error_no_profile" | "error_no_profile_available" | "profile_selected" | "profile_removed" | "profile_added">]) => void[]
Return the listeners registered for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "error_no_profile" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
Returns
(...args: ArgumentMap<EventMap>[Extract<T, "error_no_profile" | "error_no_profile_available" | "profile_selected" | "profile_removed" | "profile_added">]) => void[]
Inherited from
EventEmitter.listeners
off
▸ off<T>(event, fn?, context?, once?): User
Type parameters
| Name | Type |
|---|---|
T |
extends "error_no_profile" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "error_no_profile" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.off
on
▸ on<T>(event, fn, context?): User
Add a listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "error_no_profile" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "error_no_profile" \ |
context? |
any |
Returns
Inherited from
EventEmitter.on
once
▸ once<T>(event, fn, context?): User
Add a one-time listener for a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "error_no_profile" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn |
(...args: ArgumentMap<EventMap>[Extract<T, "error_no_profile" \ |
context? |
any |
Returns
Inherited from
EventEmitter.once
removeAllListeners
▸ removeAllListeners(event?): User
Remove all listeners, or those of the specified event.
Parameters
| Name | Type |
|---|---|
event? |
"error_no_profile" \ |
Returns
Inherited from
EventEmitter.removeAllListeners
removeListener
▸ removeListener<T>(event, fn?, context?, once?): User
Remove the listeners of a given event.
Type parameters
| Name | Type |
|---|---|
T |
extends "error_no_profile" \ |
Parameters
| Name | Type |
|---|---|
event |
T |
fn? |
(...args: ArgumentMap<EventMap>[Extract<T, "error_no_profile" \ |
context? |
any |
once? |
boolean |
Returns
Inherited from
EventEmitter.removeListener
searchContact
▸ searchContact(options): Promise<SearchContactResult>
search addressbook contacts
Parameters
| Name | Type |
|---|---|
options |
SearchContactOptions |
Returns
Promise<SearchContactResult>
a promise resolved when search is done
client.user.searchContact({toSearch: "john woo", pageNumber: 1, pageSize: "20"})
.catch(function(error) {
console.error("searchContact - ERROR", error);
})
.then(function(result) {
result
.on("data", function(data, index, total){
console.log("searchContact - result - DATA", data);
})
.on("error", function(error) {
console.error("searchContact - result - ERROR");
})
.on("complete", function() {
console.log("searchContact - result - COMPLETE");
});
});
useProfile
▸ useProfile(profile?): Promise<void>
tell server what profile to use. If param is null or undefined it select one from User.availableProfile by this logic:
- availableProfile[0] if availableProfile.length = 1
- first User.ProfileType.UC profile
- first User.ProfileType.AG profile
If passed profile is unavailable or any of previous step can select one it change User.state to User.State.ERROR_NO_PROFILE If availableProfile.length = 0 it change User.state to User.State.ERROR_NO_PROFILE_AVAILABLE
Parameters
| Name | Type |
|---|---|
profile? |
Profile |
Returns
Promise<void>
@telenia/tvox-client-sdk / Exports / Call / CallFeature
Enumeration: CallFeature
Call.CallFeature
Enumeration Members
ACCEPT
• ACCEPT
ANSWER
• ANSWER
ATXFER_CANCEL
• ATXFER_CANCEL
CANCEL
• CANCEL
CONFERENCE
• CONFERENCE
DIAL
• DIAL
DIAL_ATXFER
• DIAL_ATXFER
GENERATE_DTMF
• GENERATE_DTMF
HOLD
• HOLD
MONITOR_START
• MONITOR_START
REJECT
• REJECT
SETCALLDATA
• SETCALLDATA
TRANSFER_ATTENDED
• TRANSFER_ATTENDED
TRANSFER_BLIND
• TRANSFER_BLIND
UNHOLD
• UNHOLD
@telenia/tvox-client-sdk / Exports / Call / Direction
Enumeration: Direction
Call.Direction
Enumeration Members
INBOUND
• INBOUND
OUTBOUND
• OUTBOUND
@telenia/tvox-client-sdk / Exports / Call / LookupResult
Enumeration: LookupResult
Call.LookupResult
Enumeration Members
ERROR
• ERROR
error on lookup
MULTIPLE
• MULTIPLE
lookup result is multiple
NONE
• NONE
no result on lookup
SUCCESS
• SUCCESS
success - we found an unique result to identify contact on lookup
@telenia/tvox-client-sdk / Exports / CallHistory / CallHistoryDevStatus
Enumeration: CallHistoryDevStatus
CallHistory.CallHistoryDevStatus
Values:
- TRASF - transfer
- TRASF_CANCEL - transfer and caller hangup
- TRASF_ANSWER - transfer with success
- TRASF_VM - transfer to voicemail and caller rec a message
- TRASF_VM_NO - transfer to voicemail and caller hangup without a message
- RETURN - call return to caller
Enumeration Members
RETURN
• RETURN
call return to caller
TRASF
• TRASF
transfer
TRASF_ANSWER
• TRASF_ANSWER
transfer with success
TRASF_CANCEL
• TRASF_CANCEL
transfer and caller hangup
TRASF_VM
• TRASF_VM
transfer to voicemail and caller rec a message
TRASF_VM_NO
• TRASF_VM_NO
transfer to voicemail and caller hangup without a message
@telenia/tvox-client-sdk / Exports / CallHistory / CallHistoryDialStatus
Enumeration: CallHistoryDialStatus
CallHistory.CallHistoryDialStatus
call status
Values:
- CHANUNAVAIL - Channel unavailable.
- CONGESTION - Congestion
- NOANSWER - No answer
- BUSY - Busy call
- ANSWER - Answered
- CANCEL - Call is cancelled by caller
- ERROR - generic error
- NON_PRESENTE
- ALWAYS - unconditionally foward
- ENABLE_FROM_PHONE - foward enable by phone
- PICKUPED - pickuped call
- PICKUPER - user pickup call
- TVOX_NO_PERMISSION - user can not call number
- DONTCALL - DND
- REJECTED - call rejected from called user
Enumeration Members
ALWAYS
• ALWAYS
unconditionally foward
ANSWER
• ANSWER
Answered
BUSY
• BUSY
Busy call
CANCEL
• CANCEL
Call is cancelled by caller
CHANUNAVAIL
• CHANUNAVAIL
Channel unavailable.
CONGESTION
• CONGESTION
Congestion
DONTCALL
• DONTCALL
DND
ENABLE_FROM_PHONE
• ENABLE_FROM_PHONE
foward enable by phone
ERROR
• ERROR
generic error
NOANSWER
• NOANSWER
No answer
NON_PRESENTE
• NON_PRESENTE
PICKUPED
• PICKUPED
pickuped call
PICKUPER
• PICKUPER
user pickup call
REJECTED
• REJECTED
call rejected from called user
TVOX_NO_PERMISSION
• TVOX_NO_PERMISSION
user can not call number
@telenia/tvox-client-sdk / Exports / CallHistory / CallHistoryType
Enumeration: CallHistoryType
CallHistory.CallHistoryType
Enumeration Members
INBOUND
• INBOUND
OUTBOUND
• OUTBOUND
@telenia/tvox-client-sdk / Exports / CallHistory / TransportType
Enumeration: TransportType
CallHistory.TransportType
Enumeration Members
FAX
• FAX
PHONE
• PHONE
SMS
• SMS
VOICEMAIL
• VOICEMAIL
@telenia/tvox-client-sdk / Exports / CallWebrtc / ConnectionManager / State
Enumeration: State
CallWebrtc.ConnectionManager.State
Enumeration Members
Closed
• Closed
Closing
• Closing
Connected
• Connected
Connecting
• Connecting
Failed
• Failed
Failing
• Failing
Initializing
• Initializing
New
• New
@telenia/tvox-client-sdk / Exports / Client / ClientState
Enumeration: ClientState
Client.ClientState
Enumeration Members
LOGIN_FAILED
• LOGIN_FAILED
login is requested and is failed
LOGIN_IN_PROGRESS
• LOGIN_IN_PROGRESS
login is in progress
LOGIN_REQUIRED
• LOGIN_REQUIRED
login is required
READY
• READY
ready to use
@telenia/tvox-client-sdk / Exports / Contact / AddressBookContactAddressType
Enumeration: AddressBookContactAddressType
Contact.AddressBookContactAddressType
Enumeration Members
MAIN
• MAIN
OTHER
• OTHER
@telenia/tvox-client-sdk / Exports / Contact / AddressBookContactMailType
Enumeration: AddressBookContactMailType
Contact.AddressBookContactMailType
Enumeration Members
INTERNET_HOME
• INTERNET_HOME
INTERNET_WORK
• INTERNET_WORK
@telenia/tvox-client-sdk / Exports / Contact / AddressBookContactNumberType
Enumeration: AddressBookContactNumberType
Contact.AddressBookContactNumberType
Enumeration Members
CELL
• CELL
CELL_HOME
• CELL_HOME
CELL_WORK
• CELL_WORK
FAX
• FAX
FAX_HOME
• FAX_HOME
FAX_WORK
• FAX_WORK
HOME
• HOME
MAIN
• MAIN
OTHER
• OTHER
WORK
• WORK
@telenia/tvox-client-sdk / Exports / Contact / AddressBookContactWebType
Enumeration: AddressBookContactWebType
Contact.AddressBookContactWebType
Enumeration Members
HOME
• HOME
WORK
• WORK
@telenia/tvox-client-sdk / Exports / Contact / ExternalSubType
Enumeration: ExternalSubType
Contact.ExternalSubType
Enumeration Members
ORGANIZATION
• ORGANIZATION
@telenia/tvox-client-sdk / Exports / Contact / InternalSubType
Enumeration: InternalSubType
Contact.InternalSubType
Enumeration Members
SERVICE
• SERVICE
SHORT_NUMBER
• SHORT_NUMBER
USER
• USER
@telenia/tvox-client-sdk / Exports / Contact / Type
Enumeration: Type
Contact.Type
Enumeration Members
EXTERNAL
• EXTERNAL
INTERNAL
• INTERNAL
PERSONAL
• PERSONAL
@telenia/tvox-client-sdk / Exports / Log / LogLevel
Enumeration: LogLevel
Log.LogLevel
Enumeration Members
Debug
• Debug
Error
• Error
Fatal
• Fatal
Info
• Info
None
• None
Verbose
• Verbose
Warn
• Warn
@telenia/tvox-client-sdk / Exports / Phone / Status
Enumeration: Status
Phone.Status
Enumeration Members
ERROR_NO_DEVICE
• ERROR_NO_DEVICE
ERROR_NO_DEVICE_AVAILABLE
• ERROR_NO_DEVICE_AVAILABLE
READY
• READY
@telenia/tvox-client-sdk / Exports / Phone / TVoxClientPlatform
Enumeration: TVoxClientPlatform
Phone.TVoxClientPlatform
Enumeration Members
APPLICATION
• APPLICATION
BROWSER
• BROWSER
@telenia/tvox-client-sdk / Exports / Phone / TVoxClientState
Enumeration: TVoxClientState
Phone.TVoxClientState
Enumeration Members
ACTIVATING
• ACTIVATING
ACTIVE
• ACTIVE
DISCONNETING
• DISCONNETING
INACTIVE
• INACTIVE
UNKNOWN
• UNKNOWN
@telenia/tvox-client-sdk / Exports / Transport / Status
Enumeration: Status
Transport.Status
Enumeration Members
CONNECTED
• CONNECTED
DISCONNECTED
• DISCONNECTED
@telenia/tvox-client-sdk / Exports / User / ProfileType
Enumeration: ProfileType
User.ProfileType
Enumeration Members
AG
• AG
contact center agent profile
AG_EXTERNAL
• AG_EXTERNAL
external agent profile
AG_REMOTE
• AG_REMOTE
remote agent profile
TQM
• TQM
telenia queue manager profile
UC
• UC
unify communication common profile
@telenia/tvox-client-sdk / Exports / User / State
Enumeration: State
User.State
Enumeration Members
ERROR_NO_PROFILE
• ERROR_NO_PROFILE
ERROR_NO_PROFILE_AVAILABLE
• ERROR_NO_PROFILE_AVAILABLE
LOGGED
• LOGGED
NOTLOGGED
• NOTLOGGED
@telenia/tvox-client-sdk / Exports / Call / LookupDisplay
Interface: LookupDisplay
Call.LookupDisplay
Properties
company
• Optional company: string
name
• Optional name: string
number
• Optional number: string
@telenia/tvox-client-sdk / Exports / Call / LookupEventMap
Interface: LookupEventMap
Call.LookupEventMap
Methods
end
▸ end(): void
Returns
void
update_contact
▸ update_contact(contact, lookup): void
Parameters
| Name | Type |
|---|---|
contact |
Contact |
lookup |
Lookup |
Returns
void
update_display
▸ update_display(display, lookup): void
Parameters
| Name | Type |
|---|---|
display |
LookupDisplay |
lookup |
Lookup |
Returns
void
@telenia/tvox-client-sdk / Exports / CallHistory / CallHistoryItem
Interface: CallHistoryItem
CallHistory.CallHistoryItem
Properties
devStatuses
• Optional devStatuses: CallHistoryDevStatus[]
returns the devStatuses
dialStatuses
• Optional dialStatuses: CallHistoryDialStatus[]
returns the dialStatuses
transportType
• Optional transportType: PHONE | VOICEMAIL | FAX | SMS
returns the transportType
type
• Optional type: INBOUND | OUTBOUND
returns the type
@telenia/tvox-client-sdk / Exports / CallHistory / CallHistoryRequest
Interface: CallHistoryRequest
CallHistory.CallHistoryRequest
Properties
pageNumber
• pageNumber: number
pageSize
• pageSize: number
@telenia/tvox-client-sdk / Exports / CallSip / EventMap
Interface: EventMap
CallSip.EventMap
Methods
accepted
▸ accepted(): void
Returns
void
change_features
▸ change_features(features, previousFeatures): void
Parameters
| Name | Type |
|---|---|
features |
CallFeature[] |
previousFeatures |
CallFeature[] |
Returns
void
connecting
▸ connecting(): void
Returns
void
ended
▸ ended(): void
Returns
void
hold
▸ hold(): void
Returns
void
newDTMF
▸ newDTMF(tone): void
Parameters
| Name | Type |
|---|---|
tone |
string \ |
Returns
void
new_call_for_transfer
▸ new_call_for_transfer(call): void
Parameters
| Name | Type |
|---|---|
call |
CallSipForTransfer |
Returns
void
progress
▸ progress(): void
Returns
void
unhold
▸ unhold(): void
Returns
void
@telenia/tvox-client-sdk / Exports / CallSipForTransfer / EventMap
Interface: EventMap
CallSipForTransfer.EventMap
Methods
ended
▸ ended(call): void
Parameters
| Name | Type |
|---|---|
call |
CallSipForTransfer |
Returns
void
@telenia/tvox-client-sdk / Exports / CallWebrtc / EventMap
Interface: EventMap
CallWebrtc.EventMap
Methods
accepted
▸ accepted(): void
Returns
void
change_features
▸ change_features(features, previousFeatures): void
Parameters
| Name | Type |
|---|---|
features |
CallFeature[] |
previousFeatures |
CallFeature[] |
Returns
void
connecting
▸ connecting(): void
Returns
void
ended
▸ ended(): void
Returns
void
hold
▸ hold(): void
Returns
void
newDTMF
▸ newDTMF(tone): void
Parameters
| Name | Type |
|---|---|
tone |
string \ |
Returns
void
progress
▸ progress(): void
Returns
void
unhold
▸ unhold(): void
Returns
void
@telenia/tvox-client-sdk / Exports / CallWebrtc / MuteOptions
Interface: MuteOptions
CallWebrtc.MuteOptions
Properties
audio
• Optional audio: boolean
video
• Optional video: boolean
@telenia/tvox-client-sdk / Exports / Client / BasicCredential
Interface: BasicCredential
Client.BasicCredential
Standard authentication (also called token authentication)
Properties
password
• password: string
username
• username: string
@telenia/tvox-client-sdk / Exports / Client / BerearCredential
Interface: BerearCredential
Client.BerearCredential
Bearer authentication (also called token authentication) involves security tokens called bearer tokens that must be valid for TVox
Properties
token
• token: string
@telenia/tvox-client-sdk / Exports / Client / ClientParameter
Interface: ClientParameter
Client.ClientParameter
Properties
log
• Optional log: LogConfig
log configuration
phoneManagedByTVoxClient
• phoneManagedByTVoxClient: boolean
Set phone is managed by TVox Client
default false
url
• url: string
Url of WebApi Server
required
@telenia/tvox-client-sdk / Exports / Client / EventMap
Interface: EventMap
Client.EventMap
Methods
logged_in
▸ logged_in(user): void
Parameters
| Name | Type |
|---|---|
user |
User |
Returns
void
logged_out
▸ logged_out(user): void
Parameters
| Name | Type |
|---|---|
user |
User |
Returns
void
login_failed
▸ login_failed(error, user): void
Parameters
| Name | Type |
|---|---|
error |
LoginError |
user |
User |
Returns
void
login_in_progress
▸ login_in_progress(user, credential): void
Parameters
| Name | Type |
|---|---|
user |
User |
credential |
Credential |
Returns
void
ready
▸ ready(): void
Returns
void
@telenia/tvox-client-sdk / Exports / Client / ExternalSessionIdCredential
Interface: ExternalSessionIdCredential
Client.ExternalSessionIdCredential
Authentication that involve sessionId or custom data validated outside of TVox
Properties
externalSessionId
• externalSessionId: string
@telenia/tvox-client-sdk / Exports / Client / LoginError
Interface: LoginError
Client.LoginError
Structure for error received by login method or login_failed event
Properties
code
• code: number
exceptionName
• exceptionName: string
message
• message: string
@telenia/tvox-client-sdk / Exports / Contact / AddressBookCategory
Interface: AddressBookCategory
Contact.AddressBookCategory
Properties
value
• Optional value: string
@telenia/tvox-client-sdk / Exports / Contact / AddressBookContact
Interface: AddressBookContact
Contact.AddressBookContact
Hierarchy
AddressBookContact
Properties
addresses
• Optional addresses: AddressBookContactAddress[]
returns the addresses
categories
• Optional categories: AddressBookCategory[]
returns the categories
department
• Optional department: string
returns the department
display
• Optional display: string
returns the display
emails
• Optional emails: AddressBookContactMail[]
returns the emails
note
• Optional note: string
returns the note
numbers
• Optional numbers: AddressBookContactNumber[]
returns the numbers
site
• Optional site: string
returns the site
webLinks
• Optional webLinks: AddressBookContactWeb[]
returns the webLinks
@telenia/tvox-client-sdk / Exports / Contact / AddressBookContactAddress
Interface: AddressBookContactAddress
Contact.AddressBookContactAddress
Properties
cap
• Optional cap: string
city
• Optional city: string
country
• Optional country: string
district
• Optional district: string
street
• Optional street: string
type
@telenia/tvox-client-sdk / Exports / Contact / AddressBookContactMail
Interface: AddressBookContactMail
Contact.AddressBookContactMail
Properties
type
• Optional type: INTERNET_WORK | INTERNET_HOME
returns the type
value
• Optional value: string
returns the value
@telenia/tvox-client-sdk / Exports / Contact / AddressBookContactNumber
Interface: AddressBookContactNumber
Contact.AddressBookContactNumber
Properties
type
• Optional type: FAX | HOME | CELL | WORK | CELL_WORK | FAX_WORK | FAX_HOME | CELL_HOME | MAIN | OTHER
returns the type
value
• Optional value: string
returns the value
@telenia/tvox-client-sdk / Exports / Contact / AddressBookContactWeb
Interface: AddressBookContactWeb
Contact.AddressBookContactWeb
Properties
type
returns the type
value
• Optional value: string
returns the value
@telenia/tvox-client-sdk / Exports / Contact / ExternalContact
Interface: ExternalContact
Contact.ExternalContact
Hierarchy
↳ ExternalContact
Properties
addresses
• Optional addresses: AddressBookContactAddress[]
returns the addresses
Inherited from
categories
• Optional categories: AddressBookCategory[]
returns the categories
Inherited from
company
• Optional company: string
returns the company
customFields
• Optional customFields: Object
returns the customFields
Index signature
▪ [index: string]: string
customerCode
• Optional customerCode: string
customer's code
returns the customerCode
department
• Optional department: string
returns the department
Inherited from
display
• Optional display: string
returns the display
Inherited from
emails
• Optional emails: AddressBookContactMail[]
returns the emails
Inherited from
memberof
• Optional memberof: string
returns the memberof
name
• Optional name: string
returns the name
note
• Optional note: string
returns the note
Inherited from
numbers
• Optional numbers: AddressBookContactNumber[]
returns the numbers
Inherited from
otherName
• Optional otherName: string
returns the otherName
role
• Optional role: string
returns the role
site
• Optional site: string
returns the site
Inherited from
surname
• Optional surname: string
returns the surname
vip
• Optional vip: boolean
returns the vip
webLinks
• Optional webLinks: AddressBookContactWeb[]
returns the webLinks
Inherited from
@telenia/tvox-client-sdk / Exports / Contact / ExternalOrganizationContact
Interface: ExternalOrganizationContact
Contact.ExternalOrganizationContact
Hierarchy
↳ ExternalOrganizationContact
Properties
addresses
• Optional addresses: AddressBookContactAddress[]
returns the addresses
Inherited from
categories
• Optional categories: AddressBookCategory[]
returns the categories
Inherited from
company
• Optional company: string
returns the company
customFields
• Optional customFields: Object
returns the customFields
Index signature
▪ [index: string]: string
department
• Optional department: string
returns the department
Inherited from
display
• Optional display: string
returns the display
Inherited from
emails
• Optional emails: AddressBookContactMail[]
returns the emails
Inherited from
name
• Optional name: string
returns the name
note
• Optional note: string
returns the note
Inherited from
numbers
• Optional numbers: AddressBookContactNumber[]
returns the numbers
Inherited from
otherName
• Optional otherName: string
returns the otherName
role
• Optional role: string
returns the role
site
• Optional site: string
returns the site
Inherited from
surname
• Optional surname: string
returns the surname
vip
• Optional vip: boolean
returns the vip
webLinks
• Optional webLinks: AddressBookContactWeb[]
returns the webLinks
Inherited from
@telenia/tvox-client-sdk / Exports / Contact / GetContactOptions
Interface: GetContactOptions
Contact.GetContactOptions
@telenia/tvox-client-sdk / Exports / Contact / PersonalContact
Interface: PersonalContact
Contact.PersonalContact
Hierarchy
↳ PersonalContact
Properties
addresses
• Optional addresses: AddressBookContactAddress[]
returns the addresses
Inherited from
categories
• Optional categories: AddressBookCategory[]
returns the categories
Inherited from
department
• Optional department: string
returns the department
Inherited from
display
• Optional display: string
returns the display
Inherited from
emails
• Optional emails: AddressBookContactMail[]
returns the emails
Inherited from
name
• Optional name: string
returns the name
note
• Optional note: string
returns the note
Inherited from
numbers
• Optional numbers: AddressBookContactNumber[]
returns the numbers
Inherited from
otherName
• Optional otherName: string
returns the otherName
site
• Optional site: string
returns the site
Inherited from
surname
• Optional surname: string
returns the surname
webLinks
• Optional webLinks: AddressBookContactWeb[]
returns the webLinks
Inherited from
@telenia/tvox-client-sdk / Exports / Contact / SearchContactOptions
Interface: SearchContactOptions
Contact.SearchContactOptions
Properties
pageNumber
• pageNumber: number
pageSize
• pageSize: number
searchMethods
• searchMethods: "startWith" | "contains"
set with method to use for search
toSearch
• toSearch: string
type
• Optional type: INTERNAL | EXTERNAL | PERSONAL
@telenia/tvox-client-sdk / Exports / Contact / ServiceContact
Interface: ServiceContact
Contact.ServiceContact
Hierarchy
↳ ServiceContact
Properties
addresses
• Optional addresses: AddressBookContactAddress[]
returns the addresses
Inherited from
categories
• Optional categories: AddressBookCategory[]
returns the categories
Inherited from
code
• Optional code: string
returns the code
department
• Optional department: string
returns the department
Inherited from
display
• Optional display: string
returns the display
Inherited from
emails
• Optional emails: AddressBookContactMail[]
returns the emails
Inherited from
note
• Optional note: string
returns the note
Inherited from
numbers
• Optional numbers: AddressBookContactNumber[]
returns the numbers
Inherited from
site
• Optional site: string
returns the site
Inherited from
webLinks
• Optional webLinks: AddressBookContactWeb[]
returns the webLinks
Inherited from
@telenia/tvox-client-sdk / Exports / Contact / ShortNumberContact
Interface: ShortNumberContact
Contact.ShortNumberContact
Hierarchy
↳ ShortNumberContact
Properties
addresses
• Optional addresses: AddressBookContactAddress[]
returns the addresses
Inherited from
categories
• Optional categories: AddressBookCategory[]
returns the categories
Inherited from
department
• Optional department: string
returns the department
Inherited from
display
• Optional display: string
returns the display
Inherited from
emails
• Optional emails: AddressBookContactMail[]
returns the emails
Inherited from
note
• Optional note: string
returns the note
Inherited from
numbers
• Optional numbers: AddressBookContactNumber[]
returns the numbers
Inherited from
site
• Optional site: string
returns the site
Inherited from
webLinks
• Optional webLinks: AddressBookContactWeb[]
returns the webLinks
Inherited from
@telenia/tvox-client-sdk / Exports / Contact / UserContact
Interface: UserContact
Contact.UserContact
Hierarchy
↳ UserContact
Properties
addresses
• Optional addresses: AddressBookContactAddress[]
returns the addresses
Inherited from
categories
• Optional categories: AddressBookCategory[]
returns the categories
Inherited from
customFields
• Optional customFields: Object
returns the customFields
Index signature
▪ [index: string]: string
department
• Optional department: string
returns the department
Inherited from
display
• Optional display: string
returns the display
Inherited from
emails
• Optional emails: AddressBookContactMail[]
returns the emails
Inherited from
name
• Optional name: string
returns the name
note
• Optional note: string
returns the note
Inherited from
numbers
• Optional numbers: AddressBookContactNumber[]
returns the numbers
Inherited from
site
• Optional site: string
returns the site
Inherited from
surname
• Optional surname: string
returns the surname
username
• Optional username: string
returns the username
webLinks
• Optional webLinks: AddressBookContactWeb[]
returns the webLinks
Inherited from
@telenia/tvox-client-sdk / Exports / Device / DialParam
Interface: DialParam
Device.DialParam
Properties
accessCode
• Optional accessCode: string
contact
• Optional contact: Contact
note1
• Optional note1: string
note2
• Optional note2: string
privateCall
• Optional privateCall: boolean
serviceCode
• Optional serviceCode: string
@telenia/tvox-client-sdk / Exports / Device
Interface: Device
Implemented by
@telenia/tvox-client-sdk / Exports / Log / LogConfig
Interface: LogConfig
Log.LogConfig
Properties
enabled
• Optional enabled: boolean
enable logging
default true
logLevel
• Optional logLevel: Verbose | Debug | Info | Warn | Error | Fatal | None
minimun log level (included)
default Level.debug
objectToJson
• Optional objectToJson: boolean
log plain object as json object
default false
timestamp
• Optional timestamp: boolean
log timestamp
default true
@telenia/tvox-client-sdk / Exports / Phone / EventMap
Interface: EventMap
Phone.EventMap
Methods
device_change
▸ device_change(newDevice, oldDevice): void
Parameters
| Name | Type |
|---|---|
newDevice |
null \ |
oldDevice |
null \ |
Returns
void
newcall
▸ newcall(call): void
Parameters
| Name | Type |
|---|---|
call |
CallSip \ |
Returns
void
tvoxclient_state_change
▸ tvoxclient_state_change(state, detail): void
Parameters
| Name | Type |
|---|---|
state |
TVoxClientState |
detail |
TVoxClientDetail |
Returns
void
@telenia/tvox-client-sdk / Exports / Phone / TVoxClientDetail
Interface: TVoxClientDetail
Phone.TVoxClientDetail
Properties
lastUpdate
• lastUpdate: Date
platform
• Optional platform: BROWSER | APPLICATION
userAgent
• Optional userAgent: string
@telenia/tvox-client-sdk / Exports / Transport / EventMap
Interface: EventMap
Transport.EventMap
Methods
connect
▸ connect(): void
Returns
void
disconnect
▸ disconnect(): void
Returns
void
@telenia/tvox-client-sdk / Exports / User / Data
Interface: Data
User.Data
Properties
name
• Optional name: String
profile
• Optional profile: Profile
surname
• Optional surname: String
username
• Optional username: String
@telenia/tvox-client-sdk / Exports / User / EventMap
Interface: EventMap
User.EventMap
Methods
error_no_profile
▸ error_no_profile(): void
Returns
void
error_no_profile_available
▸ error_no_profile_available(): void
Returns
void
profile_added
▸ profile_added(profile): void
Parameters
| Name | Type |
|---|---|
profile |
Profile |
Returns
void
profile_removed
▸ profile_removed(profile): void
Parameters
| Name | Type |
|---|---|
profile |
Profile |
Returns
void
profile_selected
▸ profile_selected(profile): void
Parameters
| Name | Type |
|---|---|
profile |
Profile |
Returns
void
@telenia/tvox-client-sdk / Exports
@telenia/tvox-client-sdk
Namespaces
- Call
- CallHistory
- CallSip
- CallSipForTransfer
- CallWebrtc
- Client
- Contact
- Device
- DeviceWebrtc
- Log
- Phone
- Transport
- User
Classes
- Call
- CallSip
- CallSipForTransfer
- CallWebrtc
- Client
- Contact
- DeviceSip
- DeviceWebrtc
- ExternalItemContact
- ExternalOrganizationContact
- InternalServiceContact
- InternalShortNumberContact
- InternalUserContact
- Log
- PersonalContact
- Phone
- SearchResult
- Transport
- User
Interfaces
@telenia/tvox-client-sdk / Exports / Call
Namespace: Call
Enumerations
Classes
Interfaces
@telenia/tvox-client-sdk / Exports / CallHistory
Namespace: CallHistory
Enumerations
Classes
Interfaces
@telenia/tvox-client-sdk / Exports / CallSip
Namespace: CallSip
Interfaces
@telenia/tvox-client-sdk / Exports / CallSipForTransfer
Namespace: CallSipForTransfer
Interfaces
@telenia/tvox-client-sdk / Exports / CallWebrtc / ConnectionManager
Namespace: ConnectionManager
CallWebrtc.ConnectionManager
Enumerations
@telenia/tvox-client-sdk / Exports / CallWebrtc
Namespace: CallWebrtc
Namespaces
Classes
Interfaces
@telenia/tvox-client-sdk / Exports / Client
Namespace: Client
Enumerations
Classes
Interfaces
Type Aliases
Credential
Ƭ Credential: BasicCredential | BerearCredential | ExternalSessionIdCredential
Type of allowed credential
@telenia/tvox-client-sdk / Exports / Contact
Namespace: Contact
Enumerations
- AddressBookContactAddressType
- AddressBookContactMailType
- AddressBookContactNumberType
- AddressBookContactWebType
- ExternalSubType
- InternalSubType
- Type
Classes
Interfaces
- AddressBookCategory
- AddressBookContact
- AddressBookContactAddress
- AddressBookContactMail
- AddressBookContactNumber
- AddressBookContactWeb
- ExternalContact
- ExternalOrganizationContact
- GetContactOptions
- PersonalContact
- SearchContactOptions
- ServiceContact
- ShortNumberContact
- UserContact
@telenia/tvox-client-sdk / Exports / Device
Namespace: Device
Interfaces
@telenia/tvox-client-sdk / Exports / DeviceWebrtc / Configuration
Namespace: Configuration
DeviceWebrtc.Configuration
Classes
@telenia/tvox-client-sdk / Exports / DeviceWebrtc
Namespace: DeviceWebrtc
Namespaces
Classes
@telenia/tvox-client-sdk / Exports / Log
Namespace: Log
Enumerations
Classes
Interfaces
@telenia/tvox-client-sdk / Exports / Phone
Namespace: Phone
Enumerations
Interfaces
@telenia/tvox-client-sdk / Exports / Transport
Namespace: Transport
Enumerations
Interfaces
@telenia/tvox-client-sdk / Exports / User
Namespace: User
Enumerations
Classes
Interfaces
Example
Download the example here.
Login with TVox credentials to start client and manage calls.
client.js: Contains the javascript logic of the test client
client.html: Contains the graphical management of the test client
Edit the client.js file and enter your domain on line 4

Once you have entered your domain, access the test client via your browser

Login form, where you can enter the username and password of the user to log in During login, the progress of the login procedure is shown.
Once the user is logged in correctly, the following interface is presented:

By pressing the "logout" button the currently logged in user is logged out.
Profile Information In this section, you can see the current profile in use with id, label and type. It is possibile to have all available profiles for the current logged user, and you can choose a different profile to use.

Call Section
In order to make a call, you need to type a number on the input box, and then press the "dial" button at this point, the graphics are redrawn showing the information of the call and the buttons for actions on that call. The information shows the direction of the call, the number and the contact lookup. Action buttons are controlled (shown / hidden) depending on the call features in place.

Addressbook Section
Ability to search the phonebook with text or number, by pressing the search button, allows you to search for contacts that satisfy the search for the text entered. The search is made for page 1 of size 10 (the result of the search in the address book is logged in the console)
History Section
Ability to consult the call history by pressing the "Load call history" button A paged request is made for page 1 of size 10 (the result of the request made is logged in the console)
Download
Download the library here.
Changelog
[1.6.0] - 2025-12-16
Added
- autoanwser on incoming call for agent profile
[1.5.1] - 2025-05-21
Added
- ability to manage call recording
[1.5.0] - 2025-01-09
New major release for compatibility with TVox >= 24.3
Added
- login with JWT (https://jwt.io/)
- improvements on logging management
- ability to send feedback
- extended call events
- ability to set ready/not ready for agents
- notify calls on queue
- local media device management for webrtc
- activity code management
Fixed
- mute/unmute on webrtc call
- addressbook search by phone number
[1.4.3] - 2023-12-21
Fixed
- expose callData valorized with setCallData methods
[1.4.2] - 2023-12-19
Fixed
- on call ended callData is not always set
[1.4.1] - 2023-12-15
Added
- sdk is now release under IIFE and UMD module pattern to reach differente use cases
- after login it expose previous active call on event "newcall" with previousConnected detail in it
Fixed
- user phone channel status and presence status is now always exposed
[1.4.0] - 2023-11-28
New minor release for compatibility with TVox >= 24
All feature is same as 1.3.2
[1.3.2] - 2023-11-28
Added
- expose accessToken
- possibility to call setCallData on call
[1.3.1]
Added
- expose callData from call
[1.3.0]
Added
- expose user phone channel status and presence status
[1.2.4]
Changed
- throttling of useProfile and useDevice to save server resources
[1.2.3]
Fixed
- no ring of incoming call on managed device
[1.2.2]
Added
- fix service description of involved calls
[1.2.1]
Added
- event device_change when device to use is changed
[1.2.0]
Changed
- sdk can act as full webrtc device
- phone can be managed by TVox Client logged with same user
[1.1.4]
Fixed
- Fixing lookup.display.number not set for outbound call
[1.1.3]
Added
- Adding attribute duration, id, callId on Call object
[1.1.2]
Added
- Enabled attendant transfer for generic sip device
- method "dialForTransfer" on CallSip to execute dial in purpose of future attendant transfer
- method "isDialForTransferEnabled" on CallSip that indicates if it is possibile to invoce "dialForTransfer" method
- accessor "callSipForTransferInstance" on CallSip that identify the callSip purposable for the future attendant transfer
- method "transfer" on CallSipForTransferInstance to merge the call with the purposable call
- method "terminate" on CallSipForTransferInstance to drop the purposable call for future attendant transfer and return to the initial call
- event "ended" on CallSipForTransferInstance when the purposable for attendant transfer is ended (example, when the consulted doesn't answer)
[1.1.1]
Added
- Login with external session id
- permitted multi tab usage
[1.1.0]
Added
- Manage user profile
[1.0.0]
First release.