@signalwire/js 1.3.0-dev.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/esm/common/src/BaseSession.d.ts +8 -13
- package/dist/esm/common/src/BaseSession.js +33 -46
- package/dist/esm/common/src/BrowserSession.d.ts +20 -57
- package/dist/esm/common/src/BrowserSession.js +91 -359
- package/dist/esm/common/src/messages/Verto.d.ts +1 -10
- package/dist/esm/common/src/messages/Verto.js +1 -16
- package/dist/esm/common/src/messages/verto/Login.d.ts +1 -13
- package/dist/esm/common/src/messages/verto/Login.js +2 -5
- package/dist/esm/common/src/services/BroadcastHandler.js +3 -2
- package/dist/esm/common/src/services/Connection.d.ts +2 -2
- package/dist/esm/common/src/services/Handler.d.ts +8 -9
- package/dist/esm/common/src/services/Handler.js +38 -41
- package/dist/esm/common/src/util/constants/index.d.ts +0 -1
- package/dist/esm/common/src/util/constants/index.js +0 -1
- package/dist/esm/common/src/util/helpers.d.ts +10 -3
- package/dist/esm/common/src/util/helpers.js +11 -6
- package/dist/esm/common/src/util/interfaces.d.ts +56 -21
- package/dist/esm/common/src/util/interfaces.js +1 -0
- package/dist/esm/common/src/util/logger.js +1 -4
- package/dist/esm/common/src/util/webrtc/index.d.ts +2 -7
- package/dist/esm/common/src/util/webrtc/index.js +2 -63
- package/dist/esm/common/src/webrtc/BaseCall.d.ts +79 -0
- package/dist/esm/common/src/webrtc/BaseCall.js +711 -0
- package/dist/esm/common/src/webrtc/Call.d.ts +5 -5
- package/dist/esm/common/src/webrtc/Call.js +15 -34
- package/dist/esm/common/src/webrtc/CantinaAuth.d.ts +14 -9
- package/dist/esm/common/src/webrtc/CantinaAuth.js +18 -24
- package/dist/esm/common/src/webrtc/LayoutHandler.d.ts +3 -0
- package/dist/esm/common/src/webrtc/LayoutHandler.js +36 -0
- package/dist/esm/common/src/webrtc/Peer.d.ts +23 -0
- package/dist/esm/common/src/webrtc/Peer.js +169 -0
- package/dist/esm/common/src/webrtc/VertoHandler.d.ts +11 -2
- package/dist/esm/common/src/webrtc/VertoHandler.js +187 -147
- package/dist/esm/common/src/webrtc/constants.d.ts +12 -27
- package/dist/esm/common/src/webrtc/constants.js +11 -33
- package/dist/esm/common/src/webrtc/helpers.d.ts +25 -19
- package/dist/esm/common/src/webrtc/helpers.js +190 -162
- package/dist/esm/common/src/webrtc/interfaces.d.ts +52 -209
- package/dist/esm/common/src/webrtc/interfaces.js +1 -0
- package/dist/esm/js/index.d.ts +1 -3
- package/dist/esm/js/index.js +2 -2
- package/dist/esm/js/src/SignalWire.d.ts +2 -0
- package/dist/esm/js/src/SignalWire.js +13 -0
- package/dist/esm/js/src/Verto.d.ts +2 -8
- package/dist/esm/js/src/Verto.js +14 -50
- package/dist/index.min.js +2 -6
- package/dist/index.min.js.LICENSE.txt +5 -0
- package/package.json +24 -19
- package/dist/esm/common/src/webrtc/ChatChannelHandler.d.ts +0 -5
- package/dist/esm/common/src/webrtc/ChatChannelHandler.js +0 -22
- package/dist/esm/common/src/webrtc/Conference.d.ts +0 -15
- package/dist/esm/common/src/webrtc/Conference.js +0 -68
- package/dist/esm/common/src/webrtc/ConferenceListChannelHandler.d.ts +0 -5
- package/dist/esm/common/src/webrtc/ConferenceListChannelHandler.js +0 -77
- package/dist/esm/common/src/webrtc/InfoChannelHandler.d.ts +0 -7
- package/dist/esm/common/src/webrtc/InfoChannelHandler.js +0 -85
- package/dist/esm/common/src/webrtc/LaChannelHandler.d.ts +0 -5
- package/dist/esm/common/src/webrtc/LaChannelHandler.js +0 -58
- package/dist/esm/common/src/webrtc/ModChannelHandler.d.ts +0 -71
- package/dist/esm/common/src/webrtc/ModChannelHandler.js +0 -267
- package/dist/esm/common/src/webrtc/RTCPeer.d.ts +0 -51
- package/dist/esm/common/src/webrtc/RTCPeer.js +0 -556
- package/dist/esm/common/src/webrtc/WebRTCCall.d.ts +0 -182
- package/dist/esm/common/src/webrtc/WebRTCCall.js +0 -784
- package/dist/esm/common/src/webrtc/deviceHelpers.d.ts +0 -18
- package/dist/esm/common/src/webrtc/deviceHelpers.js +0 -113
- package/dist/esm/common/src/webrtc/sdpHelpers.d.ts +0 -3
- package/dist/esm/common/src/webrtc/sdpHelpers.js +0 -56
|
@@ -9,164 +9,204 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import logger from '../util/logger';
|
|
11
11
|
import Call from './Call';
|
|
12
|
+
import { checkSubscribeResponse } from './helpers';
|
|
12
13
|
import { Result } from '../messages/Verto';
|
|
13
14
|
import { SwEvent } from '../util/constants';
|
|
14
|
-
import { VertoMethod,
|
|
15
|
-
import { trigger } from '../services/Handler';
|
|
16
|
-
import { State } from './constants';
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return logger.debug('Verto pvtData with invalid or unknown callID.', pvtData);
|
|
15
|
+
import { VertoMethod, NOTIFICATION_TYPE } from './constants';
|
|
16
|
+
import { trigger, deRegister } from '../services/Handler';
|
|
17
|
+
import { State, ConferenceAction } from './constants';
|
|
18
|
+
import { MCULayoutEventHandler } from './LayoutHandler';
|
|
19
|
+
class VertoHandler {
|
|
20
|
+
constructor(session) {
|
|
21
|
+
this.session = session;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
switch (action) {
|
|
28
|
-
case 'conference-liveArray-join':
|
|
29
|
-
yield call.conferenceJoinHandler(pvtData);
|
|
30
|
-
break;
|
|
31
|
-
case 'conference-liveArray-part':
|
|
32
|
-
yield call.conferencePartHandler(pvtData);
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
const _handleSessionEvent = (session, eventData) => {
|
|
37
|
-
const { contentType, callID } = eventData;
|
|
38
|
-
if (!callID || !session.calls.hasOwnProperty(callID)) {
|
|
39
|
-
return logger.debug('Unhandled session event:', eventData);
|
|
40
|
-
}
|
|
41
|
-
const call = session.calls[callID];
|
|
42
|
-
switch (contentType) {
|
|
43
|
-
case 'layout-info':
|
|
44
|
-
case 'layer-info':
|
|
45
|
-
call.updateLayouts(eventData);
|
|
46
|
-
break;
|
|
47
|
-
case 'logo-info':
|
|
48
|
-
call.updateLogo(eventData);
|
|
49
|
-
break;
|
|
50
|
-
case 'caption-info':
|
|
51
|
-
call.handleCaptionInfo(eventData);
|
|
52
|
-
break;
|
|
53
|
-
case 'conference-info':
|
|
54
|
-
call.handleConferenceInfo(eventData);
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const _buildCall = (session, params, attach, nodeId) => {
|
|
59
|
-
let remoteCallerName = params.caller_id_name;
|
|
60
|
-
let remoteCallerNumber = params.caller_id_number;
|
|
61
|
-
let callerName = params.callee_id_name;
|
|
62
|
-
let callerNumber = params.callee_id_number;
|
|
63
|
-
if (params.display_direction === Direction.Inbound) {
|
|
64
|
-
remoteCallerName = params.callee_id_name;
|
|
65
|
-
remoteCallerNumber = params.callee_id_number;
|
|
66
|
-
callerName = params.caller_id_name;
|
|
67
|
-
callerNumber = params.caller_id_number;
|
|
68
|
-
}
|
|
69
|
-
const call = new Call(session, {
|
|
70
|
-
id: params.callID,
|
|
71
|
-
remoteSdp: params.sdp,
|
|
72
|
-
destinationNumber: params.callee_id_number,
|
|
73
|
-
remoteCallerName,
|
|
74
|
-
remoteCallerNumber,
|
|
75
|
-
callerName,
|
|
76
|
-
callerNumber,
|
|
77
|
-
attach,
|
|
78
|
-
secondSource: /;second-source$/.test(params.callee_id_number),
|
|
79
|
-
screenShare: /;screen$/.test(params.callee_id_number),
|
|
80
|
-
shakenCheck: params.shaken_check || '',
|
|
81
|
-
shakenResult: params.shaken_result || '',
|
|
82
|
-
});
|
|
83
|
-
const hasAudioLine = params.sdp.indexOf('m=audio') !== -1;
|
|
84
|
-
if (!hasAudioLine) {
|
|
85
|
-
call.options.audio = false;
|
|
86
|
-
call.options.micId = null;
|
|
87
|
-
call.options.micLabel = null;
|
|
88
|
-
}
|
|
89
|
-
const hasVideoLine = params.sdp.indexOf('m=video') !== -1;
|
|
90
|
-
if (!hasVideoLine) {
|
|
91
|
-
call.options.video = false;
|
|
92
|
-
call.options.camId = null;
|
|
93
|
-
call.options.camLabel = null;
|
|
94
|
-
}
|
|
95
|
-
call.nodeId = nodeId;
|
|
96
|
-
call.isDirect = checkIsDirectCall(params);
|
|
97
|
-
return call;
|
|
98
|
-
};
|
|
99
|
-
export default (session, msg) => {
|
|
100
|
-
const { id, method, nodeId, params } = msg;
|
|
101
|
-
const { callID, eventChannel, eventType } = params;
|
|
102
|
-
if (eventType === 'channelPvtData') {
|
|
103
|
-
params.pvtData.nodeId = nodeId;
|
|
104
|
-
return _handlePvtEvent(session, params.pvtData);
|
|
105
|
-
}
|
|
106
|
-
if (eventChannel === session.sessionid || eventChannel === session.relayProtocol) {
|
|
107
|
-
return _handleSessionEvent(session, params.eventData);
|
|
108
|
-
}
|
|
109
|
-
if (callID && session.calls.hasOwnProperty(callID)) {
|
|
110
|
-
trigger(callID, params, method);
|
|
111
|
-
if (method !== VertoMethod.Attach) {
|
|
112
|
-
const msg = new Result(id, method);
|
|
113
|
-
msg.targetNodeId = nodeId;
|
|
114
|
-
session.execute(msg);
|
|
23
|
+
_ack(id, method) {
|
|
24
|
+
const msg = new Result(id, method);
|
|
25
|
+
if (this.nodeId) {
|
|
26
|
+
msg.targetNodeId = this.nodeId;
|
|
115
27
|
}
|
|
116
|
-
|
|
28
|
+
this.session.execute(msg);
|
|
117
29
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
session.purge();
|
|
126
|
-
return session.disconnect();
|
|
127
|
-
case VertoMethod.Invite: {
|
|
128
|
-
const call = _buildCall(session, params, attach, nodeId);
|
|
129
|
-
call.setState(State.Ringing);
|
|
130
|
-
const msg = new Result(id, method);
|
|
131
|
-
msg.targetNodeId = nodeId;
|
|
132
|
-
return session.execute(msg);
|
|
133
|
-
}
|
|
134
|
-
case VertoMethod.Attach: {
|
|
135
|
-
const call = _buildCall(session, params, attach, nodeId);
|
|
136
|
-
return trigger(call.id, params, method);
|
|
30
|
+
handleMessage(msg) {
|
|
31
|
+
const { session } = this;
|
|
32
|
+
const { id, method, params } = msg;
|
|
33
|
+
const { callID, eventChannel, eventType } = params;
|
|
34
|
+
const attach = method === VertoMethod.Attach;
|
|
35
|
+
if (eventType === 'channelPvtData') {
|
|
36
|
+
return this._handlePvtEvent(params.pvtData);
|
|
137
37
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
38
|
+
if (callID && session.calls.hasOwnProperty(callID)) {
|
|
39
|
+
if (attach) {
|
|
40
|
+
session.calls[callID].hangup({}, false);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
session.calls[callID].handleMessage(msg);
|
|
44
|
+
this._ack(id, method);
|
|
142
45
|
return;
|
|
143
46
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
47
|
+
}
|
|
48
|
+
const _buildCall = () => {
|
|
49
|
+
const call = new Call(session, {
|
|
50
|
+
id: callID,
|
|
51
|
+
remoteSdp: params.sdp,
|
|
52
|
+
destinationNumber: params.callee_id_number,
|
|
53
|
+
remoteCallerName: params.caller_id_name,
|
|
54
|
+
remoteCallerNumber: params.caller_id_number,
|
|
55
|
+
callerName: params.callee_id_name,
|
|
56
|
+
callerNumber: params.callee_id_number,
|
|
57
|
+
attach
|
|
58
|
+
});
|
|
59
|
+
call.nodeId = this.nodeId;
|
|
60
|
+
return call;
|
|
61
|
+
};
|
|
62
|
+
switch (method) {
|
|
63
|
+
case VertoMethod.Punt:
|
|
64
|
+
session.disconnect();
|
|
65
|
+
break;
|
|
66
|
+
case VertoMethod.Invite: {
|
|
67
|
+
const call = _buildCall();
|
|
68
|
+
call.setState(State.Ringing);
|
|
69
|
+
this._ack(id, method);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
case VertoMethod.Attach: {
|
|
73
|
+
const call = _buildCall();
|
|
74
|
+
if (this.session.autoRecoverCalls) {
|
|
75
|
+
call.answer();
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
call.setState(State.Recovering);
|
|
150
79
|
}
|
|
151
|
-
|
|
80
|
+
call.handleMessage(msg);
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case VertoMethod.Event:
|
|
84
|
+
case 'webrtc.event':
|
|
85
|
+
if (!eventChannel) {
|
|
86
|
+
logger.error('Verto received an unknown event:', params);
|
|
152
87
|
return;
|
|
153
88
|
}
|
|
89
|
+
const protocol = session.relayProtocol;
|
|
90
|
+
const firstValue = eventChannel.split('.')[0];
|
|
91
|
+
if (session._existsSubscription(protocol, eventChannel)) {
|
|
92
|
+
trigger(protocol, params, eventChannel);
|
|
93
|
+
}
|
|
94
|
+
else if (eventChannel === session.sessionid) {
|
|
95
|
+
this._handleSessionEvent(params.eventData);
|
|
96
|
+
}
|
|
97
|
+
else if (session._existsSubscription(protocol, firstValue)) {
|
|
98
|
+
trigger(protocol, params, firstValue);
|
|
99
|
+
}
|
|
100
|
+
else if (session.calls.hasOwnProperty(eventChannel)) {
|
|
101
|
+
session.calls[eventChannel].handleMessage(msg);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
trigger(SwEvent.Notification, params, session.uuid);
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
case VertoMethod.Info:
|
|
108
|
+
params.type = NOTIFICATION_TYPE.generic;
|
|
109
|
+
trigger(SwEvent.Notification, params, session.uuid);
|
|
110
|
+
break;
|
|
111
|
+
case VertoMethod.ClientReady:
|
|
112
|
+
params.type = NOTIFICATION_TYPE.vertoClientReady;
|
|
113
|
+
trigger(SwEvent.Notification, params, session.uuid);
|
|
114
|
+
break;
|
|
115
|
+
default:
|
|
116
|
+
logger.warn('Verto message unknown method:', msg);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
_retrieveCallId(packet, laChannel) {
|
|
120
|
+
const callIds = Object.keys(this.session.calls);
|
|
121
|
+
if (packet.action === 'bootObj') {
|
|
122
|
+
const me = packet.data.find((pr) => callIds.includes(pr[0]));
|
|
123
|
+
if (me instanceof Array) {
|
|
124
|
+
return me[0];
|
|
154
125
|
}
|
|
155
|
-
params.type = Notification.Generic;
|
|
156
|
-
return trigger(SwEvent.Notification, params, session.uuid);
|
|
157
126
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
case VertoMethod.ClientReady:
|
|
162
|
-
params.type = Notification.VertoClientReady;
|
|
163
|
-
return trigger(SwEvent.Notification, params, session.uuid);
|
|
164
|
-
case VertoMethod.Announce:
|
|
165
|
-
params.type = Notification.Announce;
|
|
166
|
-
return trigger(SwEvent.Notification, params, session.uuid);
|
|
167
|
-
default:
|
|
168
|
-
logger.debug('Unknown Verto method:', method, params);
|
|
169
|
-
params.type = method;
|
|
170
|
-
return trigger(SwEvent.Notification, params, session.uuid);
|
|
127
|
+
else {
|
|
128
|
+
return callIds.find((id) => this.session.calls[id].channels.includes(laChannel));
|
|
129
|
+
}
|
|
171
130
|
}
|
|
172
|
-
|
|
131
|
+
_handlePvtEvent(pvtData) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
const { session } = this;
|
|
134
|
+
const protocol = session.relayProtocol;
|
|
135
|
+
const { action, laChannel, laName, chatChannel, infoChannel, modChannel, conferenceMemberID, role, callID } = pvtData;
|
|
136
|
+
switch (action) {
|
|
137
|
+
case 'conference-liveArray-join': {
|
|
138
|
+
const _liveArrayBootstrap = () => {
|
|
139
|
+
session.vertoBroadcast({ nodeId: this.nodeId, channel: laChannel, data: { liveArray: { command: 'bootstrap', context: laChannel, name: laName } } });
|
|
140
|
+
};
|
|
141
|
+
const tmp = {
|
|
142
|
+
nodeId: this.nodeId,
|
|
143
|
+
channels: [laChannel],
|
|
144
|
+
handler: ({ data: packet }) => {
|
|
145
|
+
const id = callID || this._retrieveCallId(packet, laChannel);
|
|
146
|
+
if (id && session.calls.hasOwnProperty(id)) {
|
|
147
|
+
const call = session.calls[id];
|
|
148
|
+
call._addChannel(laChannel);
|
|
149
|
+
call.extension = laName;
|
|
150
|
+
call.handleConferenceUpdate(packet, pvtData)
|
|
151
|
+
.then(error => {
|
|
152
|
+
if (error === 'INVALID_PACKET') {
|
|
153
|
+
_liveArrayBootstrap();
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
const result = yield session.vertoSubscribe(tmp)
|
|
160
|
+
.catch(error => {
|
|
161
|
+
logger.error('liveArray subscription error:', error);
|
|
162
|
+
});
|
|
163
|
+
if (checkSubscribeResponse(result, laChannel)) {
|
|
164
|
+
_liveArrayBootstrap();
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case 'conference-liveArray-part': {
|
|
169
|
+
let call = null;
|
|
170
|
+
if (laChannel && session._existsSubscription(protocol, laChannel)) {
|
|
171
|
+
const { callId = null } = session.subscriptions[protocol][laChannel];
|
|
172
|
+
call = session.calls[callId] || null;
|
|
173
|
+
if (callId !== null) {
|
|
174
|
+
const notification = { type: NOTIFICATION_TYPE.conferenceUpdate, action: ConferenceAction.Leave, conferenceName: laName, participantId: Number(conferenceMemberID), role };
|
|
175
|
+
if (!trigger(SwEvent.Notification, notification, callId, false)) {
|
|
176
|
+
trigger(SwEvent.Notification, notification, session.uuid);
|
|
177
|
+
}
|
|
178
|
+
if (call === null) {
|
|
179
|
+
deRegister(SwEvent.Notification, null, callId);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const channels = [laChannel, chatChannel, infoChannel, modChannel];
|
|
184
|
+
session.vertoUnsubscribe({ nodeId: this.nodeId, channels })
|
|
185
|
+
.then(({ unsubscribedChannels = [] }) => {
|
|
186
|
+
if (call) {
|
|
187
|
+
call.channels = call.channels.filter(c => !unsubscribedChannels.includes(c));
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
.catch(error => {
|
|
191
|
+
logger.error('liveArray unsubscribe error:', error);
|
|
192
|
+
});
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
_handleSessionEvent(eventData) {
|
|
199
|
+
switch (eventData.contentType) {
|
|
200
|
+
case 'layout-info':
|
|
201
|
+
case 'layer-info':
|
|
202
|
+
MCULayoutEventHandler(this.session, eventData);
|
|
203
|
+
break;
|
|
204
|
+
case 'logo-info': {
|
|
205
|
+
const notification = { type: NOTIFICATION_TYPE.conferenceUpdate, action: ConferenceAction.LogoInfo, logo: eventData.logoURL };
|
|
206
|
+
trigger(SwEvent.Notification, notification, this.session.uuid);
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
export default VertoHandler;
|
|
@@ -22,30 +22,18 @@ export declare enum VertoMethod {
|
|
|
22
22
|
Unsubscribe = "verto.unsubscribe",
|
|
23
23
|
ClientReady = "verto.clientReady",
|
|
24
24
|
Modify = "verto.modify",
|
|
25
|
-
MediaParams = "verto.mediaParams"
|
|
26
|
-
Prompt = "verto.prompt",
|
|
27
|
-
JsApi = "jsapi",
|
|
28
|
-
Stats = "verto.stats",
|
|
29
|
-
Ping = "verto.ping",
|
|
30
|
-
Announce = "verto.announce"
|
|
31
|
-
}
|
|
32
|
-
export declare enum Notification {
|
|
33
|
-
Generic = "event",
|
|
34
|
-
ParticipantData = "participantData",
|
|
35
|
-
ConferenceUpdate = "conferenceUpdate",
|
|
36
|
-
CallUpdate = "callUpdate",
|
|
37
|
-
VertoClientReady = "vertoClientReady",
|
|
38
|
-
UserMediaError = "userMediaError",
|
|
39
|
-
RefreshToken = "refreshToken",
|
|
40
|
-
Prompt = "prompt",
|
|
41
|
-
Announce = "announce",
|
|
42
|
-
DeviceUpdated = "deviceUpdated",
|
|
43
|
-
MediaParams = "mediaParams",
|
|
44
|
-
ConferenceListBootstrap = "conferenceListBootstrap",
|
|
45
|
-
ConferenceListAdd = "conferenceListAdd",
|
|
46
|
-
ConferenceListModify = "conferenceListModify",
|
|
47
|
-
ConferenceListDelete = "conferenceListDelete"
|
|
25
|
+
MediaParams = "verto.mediaParams"
|
|
48
26
|
}
|
|
27
|
+
export declare const NOTIFICATION_TYPE: {
|
|
28
|
+
generic: string;
|
|
29
|
+
"verto.display": string;
|
|
30
|
+
"verto.attach": string;
|
|
31
|
+
conferenceUpdate: string;
|
|
32
|
+
callUpdate: string;
|
|
33
|
+
vertoClientReady: string;
|
|
34
|
+
userMediaError: string;
|
|
35
|
+
refreshToken: string;
|
|
36
|
+
};
|
|
49
37
|
export declare const DEFAULT_CALL_OPTIONS: CallOptions;
|
|
50
38
|
export declare enum State {
|
|
51
39
|
New = 0,
|
|
@@ -78,10 +66,7 @@ export declare enum ConferenceAction {
|
|
|
78
66
|
LogoInfo = "logoInfo",
|
|
79
67
|
LayoutInfo = "layoutInfo",
|
|
80
68
|
LayoutList = "layoutList",
|
|
81
|
-
ModCmdResponse = "modCommandResponse"
|
|
82
|
-
ConferenceInfo = "conferenceInfo",
|
|
83
|
-
CaptionInfo = "captionInfo",
|
|
84
|
-
MemberTalkState = "memberTalkState"
|
|
69
|
+
ModCmdResponse = "modCommandResponse"
|
|
85
70
|
}
|
|
86
71
|
export declare enum DeviceType {
|
|
87
72
|
Video = "videoinput",
|
|
@@ -25,30 +25,17 @@ export var VertoMethod;
|
|
|
25
25
|
VertoMethod["ClientReady"] = "verto.clientReady";
|
|
26
26
|
VertoMethod["Modify"] = "verto.modify";
|
|
27
27
|
VertoMethod["MediaParams"] = "verto.mediaParams";
|
|
28
|
-
VertoMethod["Prompt"] = "verto.prompt";
|
|
29
|
-
VertoMethod["JsApi"] = "jsapi";
|
|
30
|
-
VertoMethod["Stats"] = "verto.stats";
|
|
31
|
-
VertoMethod["Ping"] = "verto.ping";
|
|
32
|
-
VertoMethod["Announce"] = "verto.announce";
|
|
33
28
|
})(VertoMethod || (VertoMethod = {}));
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Notification["Announce"] = "announce";
|
|
45
|
-
Notification["DeviceUpdated"] = "deviceUpdated";
|
|
46
|
-
Notification["MediaParams"] = "mediaParams";
|
|
47
|
-
Notification["ConferenceListBootstrap"] = "conferenceListBootstrap";
|
|
48
|
-
Notification["ConferenceListAdd"] = "conferenceListAdd";
|
|
49
|
-
Notification["ConferenceListModify"] = "conferenceListModify";
|
|
50
|
-
Notification["ConferenceListDelete"] = "conferenceListDelete";
|
|
51
|
-
})(Notification || (Notification = {}));
|
|
29
|
+
export const NOTIFICATION_TYPE = {
|
|
30
|
+
generic: 'event',
|
|
31
|
+
[VertoMethod.Display]: 'participantData',
|
|
32
|
+
[VertoMethod.Attach]: 'participantData',
|
|
33
|
+
conferenceUpdate: 'conferenceUpdate',
|
|
34
|
+
callUpdate: 'callUpdate',
|
|
35
|
+
vertoClientReady: 'vertoClientReady',
|
|
36
|
+
userMediaError: 'userMediaError',
|
|
37
|
+
refreshToken: 'refreshToken',
|
|
38
|
+
};
|
|
52
39
|
export const DEFAULT_CALL_OPTIONS = {
|
|
53
40
|
destinationNumber: '',
|
|
54
41
|
remoteCallerName: 'Outbound Call',
|
|
@@ -56,17 +43,11 @@ export const DEFAULT_CALL_OPTIONS = {
|
|
|
56
43
|
callerName: '',
|
|
57
44
|
callerNumber: '',
|
|
58
45
|
audio: true,
|
|
59
|
-
video:
|
|
46
|
+
video: false,
|
|
60
47
|
useStereo: false,
|
|
61
48
|
attach: false,
|
|
62
49
|
screenShare: false,
|
|
63
|
-
secondSource: false,
|
|
64
50
|
userVariables: {},
|
|
65
|
-
requestTimeout: 10 * 1000,
|
|
66
|
-
experimental: false,
|
|
67
|
-
autoApplyMediaParams: true,
|
|
68
|
-
iceGatheringTimeout: 2 * 1000,
|
|
69
|
-
maxIceGatheringTimeout: 5 * 1000,
|
|
70
51
|
};
|
|
71
52
|
export var State;
|
|
72
53
|
(function (State) {
|
|
@@ -103,9 +84,6 @@ export var ConferenceAction;
|
|
|
103
84
|
ConferenceAction["LayoutInfo"] = "layoutInfo";
|
|
104
85
|
ConferenceAction["LayoutList"] = "layoutList";
|
|
105
86
|
ConferenceAction["ModCmdResponse"] = "modCommandResponse";
|
|
106
|
-
ConferenceAction["ConferenceInfo"] = "conferenceInfo";
|
|
107
|
-
ConferenceAction["CaptionInfo"] = "captionInfo";
|
|
108
|
-
ConferenceAction["MemberTalkState"] = "memberTalkState";
|
|
109
87
|
})(ConferenceAction || (ConferenceAction = {}));
|
|
110
88
|
export var DeviceType;
|
|
111
89
|
(function (DeviceType) {
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
import { CallOptions
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare
|
|
1
|
+
import { CallOptions } from './interfaces';
|
|
2
|
+
declare const getUserMedia: (constraints: MediaStreamConstraints) => Promise<MediaStream | null>;
|
|
3
|
+
declare const getDevices: (kind?: string, fullList?: boolean) => Promise<MediaDeviceInfo[]>;
|
|
4
|
+
declare const scanResolutions: (deviceId: string) => Promise<any[]>;
|
|
5
|
+
declare const getMediaConstraints: (options: CallOptions) => Promise<MediaStreamConstraints>;
|
|
6
|
+
declare const assureDeviceId: (id: string, label: string, kind: MediaDeviceInfo['kind']) => Promise<string>;
|
|
7
|
+
declare const removeUnsupportedConstraints: (constraints: MediaTrackConstraints) => void;
|
|
8
|
+
declare const checkDeviceIdConstraints: (id: string, label: string, kind: MediaDeviceInfo['kind'], constraints: MediaTrackConstraints) => Promise<MediaTrackConstraints>;
|
|
9
|
+
declare const sdpStereoHack: (sdp: string) => string;
|
|
10
|
+
declare const sdpMediaOrderHack: (answer: string, localOffer: string) => string;
|
|
11
|
+
declare const checkSubscribeResponse: (response: any, channel: string) => boolean;
|
|
12
|
+
type DestructuredResult = {
|
|
6
13
|
subscribed: string[];
|
|
7
14
|
alreadySubscribed: string[];
|
|
8
15
|
unauthorized: string[];
|
|
9
16
|
unsubscribed: string[];
|
|
10
17
|
notSubscribed: string[];
|
|
11
18
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
export {};
|
|
19
|
+
declare const destructSubscribeResponse: (response: any) => DestructuredResult;
|
|
20
|
+
declare const enableAudioTracks: (stream: MediaStream) => void;
|
|
21
|
+
declare const disableAudioTracks: (stream: MediaStream) => void;
|
|
22
|
+
declare const toggleAudioTracks: (stream: MediaStream) => void;
|
|
23
|
+
declare const enableVideoTracks: (stream: MediaStream) => void;
|
|
24
|
+
declare const disableVideoTracks: (stream: MediaStream) => void;
|
|
25
|
+
declare const toggleVideoTracks: (stream: MediaStream) => void;
|
|
26
|
+
declare const sdpBitrateHack: (sdp: string, max: number, min: number, start: number) => string;
|
|
27
|
+
interface FilterIceServersOptions {
|
|
28
|
+
disableUdpIceServers: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare const filterIceServers: (servers: RTCIceServer[], options?: FilterIceServersOptions) => RTCIceServer[];
|
|
31
|
+
export { getUserMedia, getDevices, scanResolutions, getMediaConstraints, assureDeviceId, removeUnsupportedConstraints, checkDeviceIdConstraints, sdpStereoHack, sdpMediaOrderHack, sdpBitrateHack, checkSubscribeResponse, destructSubscribeResponse, enableAudioTracks, disableAudioTracks, toggleAudioTracks, enableVideoTracks, disableVideoTracks, toggleVideoTracks, filterIceServers };
|