@ohos-ports/genesys-cloud-streaming-client 20.1.0-beta.1
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 +47 -0
- package/dist/cjs/alerting-leader.d.ts +29 -0
- package/dist/cjs/alerting-leader.js +163 -0
- package/dist/cjs/client.d.ts +84 -0
- package/dist/cjs/client.js +680 -0
- package/dist/cjs/connection-manager.d.ts +18 -0
- package/dist/cjs/connection-manager.js +120 -0
- package/dist/cjs/connection-transfer.d.ts +7 -0
- package/dist/cjs/connection-transfer.js +20 -0
- package/dist/cjs/http-client.d.ts +18 -0
- package/dist/cjs/http-client.js +230 -0
- package/dist/cjs/index.d.ts +10 -0
- package/dist/cjs/index.js +31 -0
- package/dist/cjs/messenger.d.ts +37 -0
- package/dist/cjs/messenger.js +54 -0
- package/dist/cjs/notifications.d.ts +94 -0
- package/dist/cjs/notifications.js +495 -0
- package/dist/cjs/ping.d.ts +21 -0
- package/dist/cjs/ping.js +60 -0
- package/dist/cjs/polyfills.d.ts +0 -0
- package/dist/cjs/polyfills.js +6 -0
- package/dist/cjs/server-monitor.d.ts +16 -0
- package/dist/cjs/server-monitor.js +44 -0
- package/dist/cjs/stanza-definitions/webrtc-signaling.d.ts +29 -0
- package/dist/cjs/stanza-definitions/webrtc-signaling.js +113 -0
- package/dist/cjs/stanza-definitions/xep0051.d.ts +19 -0
- package/dist/cjs/stanza-definitions/xep0051.js +28 -0
- package/dist/cjs/stats-formatter.d.ts +6 -0
- package/dist/cjs/stats-formatter.js +63 -0
- package/dist/cjs/types/genesys-cloud-media-session.d.ts +64 -0
- package/dist/cjs/types/genesys-cloud-media-session.js +353 -0
- package/dist/cjs/types/interfaces.d.ts +310 -0
- package/dist/cjs/types/interfaces.js +22 -0
- package/dist/cjs/types/libs.d.ts +32 -0
- package/dist/cjs/types/libs.js +1 -0
- package/dist/cjs/types/media-session.d.ts +76 -0
- package/dist/cjs/types/media-session.js +2 -0
- package/dist/cjs/types/named-agent.d.ts +13 -0
- package/dist/cjs/types/named-agent.js +2 -0
- package/dist/cjs/types/offline-error.d.ts +2 -0
- package/dist/cjs/types/offline-error.js +5 -0
- package/dist/cjs/types/sasl-error.d.ts +8 -0
- package/dist/cjs/types/sasl-error.js +12 -0
- package/dist/cjs/types/stanza-media-session.d.ts +56 -0
- package/dist/cjs/types/stanza-media-session.js +255 -0
- package/dist/cjs/types/streaming-client-extension.d.ts +14 -0
- package/dist/cjs/types/streaming-client-extension.js +2 -0
- package/dist/cjs/types/timeout-error.d.ts +3 -0
- package/dist/cjs/types/timeout-error.js +9 -0
- package/dist/cjs/types/user-cancelled-error.d.ts +2 -0
- package/dist/cjs/types/user-cancelled-error.js +5 -0
- package/dist/cjs/utils.d.ts +34 -0
- package/dist/cjs/utils.js +202 -0
- package/dist/cjs/webrtc.d.ts +126 -0
- package/dist/cjs/webrtc.js +891 -0
- package/dist/deploy-info.json +21 -0
- package/dist/es/alerting-leader.d.ts +29 -0
- package/dist/es/alerting-leader.js +177 -0
- package/dist/es/client.d.ts +84 -0
- package/dist/es/client.js +699 -0
- package/dist/es/connection-manager.d.ts +18 -0
- package/dist/es/connection-manager.js +124 -0
- package/dist/es/connection-transfer.d.ts +7 -0
- package/dist/es/connection-transfer.js +16 -0
- package/dist/es/http-client.d.ts +18 -0
- package/dist/es/http-client.js +194 -0
- package/dist/es/index.bundle.js +39629 -0
- package/dist/es/index.d.ts +10 -0
- package/dist/es/index.js +10 -0
- package/dist/es/messenger.d.ts +37 -0
- package/dist/es/messenger.js +62 -0
- package/dist/es/notifications.d.ts +94 -0
- package/dist/es/notifications.js +507 -0
- package/dist/es/ping.d.ts +21 -0
- package/dist/es/ping.js +68 -0
- package/dist/es/polyfills.d.ts +0 -0
- package/dist/es/polyfills.js +6 -0
- package/dist/es/server-monitor.d.ts +16 -0
- package/dist/es/server-monitor.js +41 -0
- package/dist/es/stanza-definitions/webrtc-signaling.d.ts +29 -0
- package/dist/es/stanza-definitions/webrtc-signaling.js +110 -0
- package/dist/es/stanza-definitions/xep0051.d.ts +19 -0
- package/dist/es/stanza-definitions/xep0051.js +25 -0
- package/dist/es/stats-formatter.d.ts +6 -0
- package/dist/es/stats-formatter.js +54 -0
- package/dist/es/types/genesys-cloud-media-session.d.ts +64 -0
- package/dist/es/types/genesys-cloud-media-session.js +379 -0
- package/dist/es/types/interfaces.d.ts +310 -0
- package/dist/es/types/interfaces.js +19 -0
- package/dist/es/types/libs.d.ts +32 -0
- package/dist/es/types/libs.js +1 -0
- package/dist/es/types/media-session.d.ts +76 -0
- package/dist/es/types/media-session.js +1 -0
- package/dist/es/types/named-agent.d.ts +13 -0
- package/dist/es/types/named-agent.js +1 -0
- package/dist/es/types/offline-error.d.ts +2 -0
- package/dist/es/types/offline-error.js +2 -0
- package/dist/es/types/sasl-error.d.ts +8 -0
- package/dist/es/types/sasl-error.js +9 -0
- package/dist/es/types/stanza-media-session.d.ts +56 -0
- package/dist/es/types/stanza-media-session.js +264 -0
- package/dist/es/types/streaming-client-extension.d.ts +14 -0
- package/dist/es/types/streaming-client-extension.js +1 -0
- package/dist/es/types/timeout-error.d.ts +3 -0
- package/dist/es/types/timeout-error.js +5 -0
- package/dist/es/types/user-cancelled-error.d.ts +2 -0
- package/dist/es/types/user-cancelled-error.js +2 -0
- package/dist/es/utils.d.ts +34 -0
- package/dist/es/utils.js +192 -0
- package/dist/es/webrtc.d.ts +126 -0
- package/dist/es/webrtc.js +917 -0
- package/dist/manifest.json +19 -0
- package/dist/npm/CHANGELOG.md +637 -0
- package/dist/npm/README.md +47 -0
- package/dist/npm/alerting-leader.d.ts +29 -0
- package/dist/npm/alerting-leader.js +163 -0
- package/dist/npm/client.d.ts +84 -0
- package/dist/npm/client.js +680 -0
- package/dist/npm/connection-manager.d.ts +18 -0
- package/dist/npm/connection-manager.js +120 -0
- package/dist/npm/connection-transfer.d.ts +7 -0
- package/dist/npm/connection-transfer.js +20 -0
- package/dist/npm/http-client.d.ts +18 -0
- package/dist/npm/http-client.js +230 -0
- package/dist/npm/index.d.ts +10 -0
- package/dist/npm/index.js +31 -0
- package/dist/npm/messenger.d.ts +37 -0
- package/dist/npm/messenger.js +54 -0
- package/dist/npm/module.js +10 -0
- package/dist/npm/notifications.d.ts +94 -0
- package/dist/npm/notifications.js +495 -0
- package/dist/npm/ping.d.ts +21 -0
- package/dist/npm/ping.js +60 -0
- package/dist/npm/polyfills.d.ts +0 -0
- package/dist/npm/polyfills.js +6 -0
- package/dist/npm/server-monitor.d.ts +16 -0
- package/dist/npm/server-monitor.js +44 -0
- package/dist/npm/stanza-definitions/webrtc-signaling.d.ts +29 -0
- package/dist/npm/stanza-definitions/webrtc-signaling.js +113 -0
- package/dist/npm/stanza-definitions/xep0051.d.ts +19 -0
- package/dist/npm/stanza-definitions/xep0051.js +28 -0
- package/dist/npm/stats-formatter.d.ts +6 -0
- package/dist/npm/stats-formatter.js +63 -0
- package/dist/npm/types/genesys-cloud-media-session.d.ts +64 -0
- package/dist/npm/types/genesys-cloud-media-session.js +353 -0
- package/dist/npm/types/interfaces.d.ts +310 -0
- package/dist/npm/types/interfaces.js +22 -0
- package/dist/npm/types/libs.d.ts +32 -0
- package/dist/npm/types/libs.js +1 -0
- package/dist/npm/types/media-session.d.ts +76 -0
- package/dist/npm/types/media-session.js +2 -0
- package/dist/npm/types/named-agent.d.ts +13 -0
- package/dist/npm/types/named-agent.js +2 -0
- package/dist/npm/types/offline-error.d.ts +2 -0
- package/dist/npm/types/offline-error.js +5 -0
- package/dist/npm/types/sasl-error.d.ts +8 -0
- package/dist/npm/types/sasl-error.js +12 -0
- package/dist/npm/types/stanza-media-session.d.ts +56 -0
- package/dist/npm/types/stanza-media-session.js +255 -0
- package/dist/npm/types/streaming-client-extension.d.ts +14 -0
- package/dist/npm/types/streaming-client-extension.js +2 -0
- package/dist/npm/types/timeout-error.d.ts +3 -0
- package/dist/npm/types/timeout-error.js +9 -0
- package/dist/npm/types/user-cancelled-error.d.ts +2 -0
- package/dist/npm/types/user-cancelled-error.js +5 -0
- package/dist/npm/utils.d.ts +34 -0
- package/dist/npm/utils.js +207 -0
- package/dist/npm/webrtc.d.ts +126 -0
- package/dist/npm/webrtc.js +893 -0
- package/dist/streaming-client.browser.js +2 -0
- package/dist/streaming-client.browser.js.LICENSE.txt +12 -0
- package/dist/v20/streaming-client.browser.js +2 -0
- package/dist/v20/streaming-client.browser.js.LICENSE.txt +12 -0
- package/dist/v20.1.0/streaming-client.browser.js +2 -0
- package/dist/v20.1.0/streaming-client.browser.js.LICENSE.txt +12 -0
- package/package.json +132 -0
package/dist/es/utils.js
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { TimeoutError } from './types/timeout-error';
|
|
11
|
+
import { StreamingClientErrorTypes } from './types/interfaces';
|
|
12
|
+
export class StreamingClientError extends Error {
|
|
13
|
+
constructor(type, messageOrError, details) {
|
|
14
|
+
let message;
|
|
15
|
+
if (messageOrError instanceof Error) {
|
|
16
|
+
message = messageOrError.message;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
message = messageOrError;
|
|
20
|
+
}
|
|
21
|
+
super(message);
|
|
22
|
+
if (messageOrError instanceof Error) {
|
|
23
|
+
this.name = messageOrError.name;
|
|
24
|
+
}
|
|
25
|
+
this.type = type !== null && type !== void 0 ? type : StreamingClientErrorTypes.generic;
|
|
26
|
+
this.details = details;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export class StreamingSubscriptionError extends Error {
|
|
30
|
+
constructor(message, topic, operation, details) {
|
|
31
|
+
super(message);
|
|
32
|
+
this.topic = topic;
|
|
33
|
+
this.operation = operation;
|
|
34
|
+
this.name = 'StreamingSubscriptionError';
|
|
35
|
+
this.missingPermissions = details === null || details === void 0 ? void 0 : details.missingPermissions;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/* istanbul ignore next */
|
|
39
|
+
export function timeoutPromise(fn, timeoutMs, msg, details) {
|
|
40
|
+
return new Promise(function (resolve, reject) {
|
|
41
|
+
const timeout = setTimeout(function () {
|
|
42
|
+
const err = new TimeoutError(`Timeout: ${msg}`);
|
|
43
|
+
err.details = details;
|
|
44
|
+
reject(err);
|
|
45
|
+
}, timeoutMs);
|
|
46
|
+
const done = function (resolvedValue) {
|
|
47
|
+
clearTimeout(timeout);
|
|
48
|
+
resolve(resolvedValue);
|
|
49
|
+
};
|
|
50
|
+
fn(done, reject);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export function delay(ms) {
|
|
54
|
+
return new Promise((resolve) => {
|
|
55
|
+
setTimeout(resolve, ms);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export function splitIntoIndividualTopics(topicString) {
|
|
59
|
+
const topics = [];
|
|
60
|
+
if (topicString.includes('?')) {
|
|
61
|
+
const split = topicString.split('?');
|
|
62
|
+
const prefix = split[0];
|
|
63
|
+
const postfixes = split[1] && split[1].split('&');
|
|
64
|
+
if (postfixes && postfixes.length) {
|
|
65
|
+
postfixes.forEach(postfix => {
|
|
66
|
+
topics.push(`${prefix}.${postfix}`);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
topics.push(topicString);
|
|
72
|
+
}
|
|
73
|
+
return topics;
|
|
74
|
+
}
|
|
75
|
+
export const isAcdJid = function (jid) {
|
|
76
|
+
return jid.startsWith('acd-') && !isSoftphoneJid(jid);
|
|
77
|
+
};
|
|
78
|
+
export const isScreenRecordingJid = function (jid) {
|
|
79
|
+
return jid.startsWith('screenrecording-') && !isSoftphoneJid(jid);
|
|
80
|
+
};
|
|
81
|
+
export const isLiveScreenMonitoringJid = function (jid) {
|
|
82
|
+
return jid.startsWith('livemonitor-') && !isSoftphoneJid(jid);
|
|
83
|
+
};
|
|
84
|
+
export const isSoftphoneJid = function (jid) {
|
|
85
|
+
if (!jid) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return !!jid.match(/.*@.*gjoll.*/i);
|
|
89
|
+
};
|
|
90
|
+
export const isVideoJid = function (jid) {
|
|
91
|
+
return !!(jid && jid.match(/@conference/) && !isAcdJid(jid));
|
|
92
|
+
};
|
|
93
|
+
export function retryPromise(promiseFn,
|
|
94
|
+
// if a number is returned, that's how long we will wait before retrying (in milliseconds)
|
|
95
|
+
retryFn, retryInterval = 15000, logger = console) {
|
|
96
|
+
let timeout;
|
|
97
|
+
let cancel;
|
|
98
|
+
let complete;
|
|
99
|
+
let tryPromiseFn;
|
|
100
|
+
let _hasCompleted = false;
|
|
101
|
+
const promise = new Promise((resolve, reject) => {
|
|
102
|
+
tryPromiseFn = () => __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
try {
|
|
104
|
+
const val = yield promiseFn();
|
|
105
|
+
complete(val);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
let timeToWait = retryInterval;
|
|
109
|
+
const retryValue = retryFn(error);
|
|
110
|
+
if (Number.isInteger(retryValue)) {
|
|
111
|
+
timeToWait = retryValue;
|
|
112
|
+
}
|
|
113
|
+
if (retryValue !== false) {
|
|
114
|
+
logger.debug('Retrying promise', error);
|
|
115
|
+
timeout = setTimeout(tryPromiseFn, timeToWait);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
cancel(error);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
complete = (value) => {
|
|
123
|
+
clearTimeout(timeout);
|
|
124
|
+
_hasCompleted = true;
|
|
125
|
+
resolve(value);
|
|
126
|
+
};
|
|
127
|
+
cancel = (reason) => {
|
|
128
|
+
clearTimeout(timeout);
|
|
129
|
+
_hasCompleted = true;
|
|
130
|
+
reject(reason);
|
|
131
|
+
};
|
|
132
|
+
tryPromiseFn();
|
|
133
|
+
});
|
|
134
|
+
return {
|
|
135
|
+
promise,
|
|
136
|
+
cancel,
|
|
137
|
+
complete,
|
|
138
|
+
_id: globalThis.crypto.randomUUID(),
|
|
139
|
+
hasCompleted: () => _hasCompleted
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
// from https://stackoverflow.com/questions/38552003/how-to-decode-jwt-token-in-javascript
|
|
143
|
+
export const parseJwt = (token) => {
|
|
144
|
+
const base64Url = token.split('.')[1];
|
|
145
|
+
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
|
146
|
+
const jsonPayload = decodeURIComponent(window.atob(base64).split('').map(function (c) {
|
|
147
|
+
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
|
148
|
+
}).join(''));
|
|
149
|
+
return JSON.parse(jsonPayload);
|
|
150
|
+
};
|
|
151
|
+
export function calculatePayloadSize(trace) {
|
|
152
|
+
const str = JSON.stringify(trace);
|
|
153
|
+
// http://stackoverflow.com/questions/5515869/string-length-in-bytes-in-javascript
|
|
154
|
+
// Matches only the 10.. bytes that are non-initial characters in a multi-byte sequence.
|
|
155
|
+
const m = encodeURIComponent(str).match(/%[89ABab]/g);
|
|
156
|
+
return str.length + (m ? m.length : 0);
|
|
157
|
+
}
|
|
158
|
+
export function getUfragFromSdp(sdp) {
|
|
159
|
+
if (!sdp) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
const regex = /a=ice-ufrag:(\S+)/;
|
|
163
|
+
const match = sdp.match(regex);
|
|
164
|
+
return match ? match[1] : null;
|
|
165
|
+
}
|
|
166
|
+
export function getIcePwdFromSdp(sdp) {
|
|
167
|
+
if (!sdp) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
const regex = /a=ice-pwd:(\S+)/;
|
|
171
|
+
const match = sdp.match(regex);
|
|
172
|
+
return match ? match[1] : null;
|
|
173
|
+
}
|
|
174
|
+
export function iceIsDifferent(sdp1, sdp2) {
|
|
175
|
+
return getUfragFromSdp(sdp1) !== getUfragFromSdp(sdp2) || getIcePwdFromSdp(sdp1) !== getIcePwdFromSdp(sdp2);
|
|
176
|
+
}
|
|
177
|
+
// unsed, but handy. no test coverage until used
|
|
178
|
+
// function mergeOptions (destination, provided) {
|
|
179
|
+
// for (var key in provided) {
|
|
180
|
+
// let value = provided[key];
|
|
181
|
+
// if (value instanceof Object) {
|
|
182
|
+
// if (!destination[key]) {
|
|
183
|
+
// destination[key] = {};
|
|
184
|
+
// }
|
|
185
|
+
// mergeOptions(destination[key], value);
|
|
186
|
+
// } else {
|
|
187
|
+
// destination[key] = provided[key];
|
|
188
|
+
// }
|
|
189
|
+
// }
|
|
190
|
+
//
|
|
191
|
+
// return destination;
|
|
192
|
+
// }
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { IQ } from 'stanza/protocol';
|
|
4
|
+
import { LRUCache } from 'lru-cache';
|
|
5
|
+
import { SessionManager } from 'stanza/jingle';
|
|
6
|
+
import { SessionOpts } from 'stanza/jingle/Session';
|
|
7
|
+
import { Client } from './client';
|
|
8
|
+
import { ExtendedRTCIceServer, IClientOptions, SessionTypes, IPendingSession, StreamingClientExtension, NRProxyStat, InsightAction } from './types/interfaces';
|
|
9
|
+
import { NamedAgent } from './types/named-agent';
|
|
10
|
+
import { StanzaMediaSession } from './types/stanza-media-session';
|
|
11
|
+
import { IMediaSession } from './types/media-session';
|
|
12
|
+
import Logger from 'genesys-cloud-client-logger';
|
|
13
|
+
export interface InitRtcSessionOptions {
|
|
14
|
+
stream?: MediaStream;
|
|
15
|
+
provideVideo?: boolean;
|
|
16
|
+
provideAudio?: boolean;
|
|
17
|
+
mediaPurpose?: string;
|
|
18
|
+
jid?: string;
|
|
19
|
+
conversationId?: string;
|
|
20
|
+
sourceCommunicationId?: string;
|
|
21
|
+
videoGuest?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare class WebrtcExtension extends EventEmitter implements StreamingClientExtension {
|
|
24
|
+
client: Client;
|
|
25
|
+
ignoredSessions: LRUCache<string, boolean, unknown>;
|
|
26
|
+
private earlyIceCandidates;
|
|
27
|
+
logger: Logger;
|
|
28
|
+
pendingSessions: {
|
|
29
|
+
[sessionId: string]: IPendingSession;
|
|
30
|
+
};
|
|
31
|
+
config: {
|
|
32
|
+
allowIPv6: boolean;
|
|
33
|
+
optOutOfWebrtcStatsTelemetry?: boolean;
|
|
34
|
+
};
|
|
35
|
+
private statsArr;
|
|
36
|
+
private throttleSendStatsInterval;
|
|
37
|
+
private currentMaxStatSize;
|
|
38
|
+
private statsSizeDecreaseAmount;
|
|
39
|
+
private statBuffer;
|
|
40
|
+
private throttledSendStats;
|
|
41
|
+
private discoRetries;
|
|
42
|
+
private refreshIceServersRetryPromise;
|
|
43
|
+
private refreshIceServersTimer;
|
|
44
|
+
private iceServers;
|
|
45
|
+
private stanzaInstance?;
|
|
46
|
+
private stanzaSessions;
|
|
47
|
+
private webrtcSessions;
|
|
48
|
+
private reinviteCache;
|
|
49
|
+
private sessionsMap;
|
|
50
|
+
get jid(): string | undefined;
|
|
51
|
+
constructor(client: Client, clientOptions: IClientOptions);
|
|
52
|
+
private onOnlineStatusChange;
|
|
53
|
+
handleStanzaInstanceChange(stanzaInstance: NamedAgent): Promise<void>;
|
|
54
|
+
configureNewStanzaInstance(stanzaInstance: NamedAgent): Promise<void>;
|
|
55
|
+
private configureStanzaIceServers;
|
|
56
|
+
private handleGenesysOffer;
|
|
57
|
+
private applyEarlyIceCandidates;
|
|
58
|
+
private handleGenesysRenegotiate;
|
|
59
|
+
private handleGenesysIceCandidate;
|
|
60
|
+
private handleGenesysTerminate;
|
|
61
|
+
private getSessionById;
|
|
62
|
+
sendIq(iq: IQ): Promise<any>;
|
|
63
|
+
handleMessage(msg: any): Promise<void>;
|
|
64
|
+
handleGenesysWebrtcStanza(iq: IQ): Promise<boolean | void>;
|
|
65
|
+
prepareSession(options: SessionOpts): StanzaMediaSession | undefined;
|
|
66
|
+
proxyStatsForSession(session: IMediaSession): void;
|
|
67
|
+
addStatToQueue<T extends {
|
|
68
|
+
_eventType: string;
|
|
69
|
+
}>(stat: InsightAction<T>): void;
|
|
70
|
+
getLogDetailsForPendingSessionId(sessionId: string): {
|
|
71
|
+
conversationId?: string;
|
|
72
|
+
sessionId: string;
|
|
73
|
+
sessionType?: SessionTypes;
|
|
74
|
+
};
|
|
75
|
+
sendStatsImmediately(): void;
|
|
76
|
+
sendStats(): Promise<void>;
|
|
77
|
+
addEventListeners(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Stanza Handlers
|
|
80
|
+
*/
|
|
81
|
+
private handlePropose;
|
|
82
|
+
private handleRetract;
|
|
83
|
+
/**
|
|
84
|
+
* Inform the client that another client has already taken care of the pendingSession
|
|
85
|
+
*/
|
|
86
|
+
private handledIncomingRtcSession;
|
|
87
|
+
/**
|
|
88
|
+
* Exposed Api
|
|
89
|
+
*/
|
|
90
|
+
initiateRtcSession(opts: InitRtcSessionOptions): Promise<any>;
|
|
91
|
+
acceptRtcSession(sessionId: string): Promise<void>;
|
|
92
|
+
rejectRtcSession(sessionId: string, ignore?: boolean): Promise<void>;
|
|
93
|
+
rtcSessionAccepted(sessionId: string): Promise<void>;
|
|
94
|
+
notifyScreenShareStart(session: IMediaSession): Promise<void>;
|
|
95
|
+
notifyScreenShareStop(session: IMediaSession): Promise<void>;
|
|
96
|
+
cancelRtcSession(sessionId: string): Promise<void>;
|
|
97
|
+
refreshIceServers(): Promise<ExtendedRTCIceServer[]>;
|
|
98
|
+
_refreshIceServers(stanzaInstance?: NamedAgent): Promise<ExtendedRTCIceServer[]>;
|
|
99
|
+
setIceServers(iceServers: any[], stanzaInstance: NamedAgent): void;
|
|
100
|
+
getIceTransportPolicy(): RTCIceTransportPolicy | undefined;
|
|
101
|
+
setIceTransportPolicy(policy: 'relay' | 'all', stanzaInstance: NamedAgent): void;
|
|
102
|
+
getSessionTypeByJid(jid: string): SessionTypes;
|
|
103
|
+
getSessionManager(): SessionManager | undefined;
|
|
104
|
+
getAllSessions(): IMediaSession[];
|
|
105
|
+
proxyNRStat(stat: NRProxyStat): void;
|
|
106
|
+
get expose(): WebrtcExtensionAPI;
|
|
107
|
+
}
|
|
108
|
+
export interface WebrtcExtensionAPI {
|
|
109
|
+
on: (event: string, handler: (...args: any) => void) => void;
|
|
110
|
+
once: (event: string, handler: (...args: any) => void) => void;
|
|
111
|
+
off: (event: string, handler: (...args: any) => void) => void;
|
|
112
|
+
removeAllListeners(event?: string | symbol): void;
|
|
113
|
+
removeListener(event: string | symbol, listener: (...args: any[]) => void): void;
|
|
114
|
+
refreshIceServers(): Promise<any[]>;
|
|
115
|
+
acceptRtcSession(sessionId: string): void;
|
|
116
|
+
rejectRtcSession(sessionId: string, ignore?: boolean): void;
|
|
117
|
+
cancelRtcSession(sessionId: string): void;
|
|
118
|
+
rtcSessionAccepted(sessionId: string): void;
|
|
119
|
+
initiateRtcSession(opts: InitRtcSessionOptions): Promise<void>;
|
|
120
|
+
notifyScreenShareStart(session: IMediaSession): void;
|
|
121
|
+
notifyScreenShareStop(session: IMediaSession): void;
|
|
122
|
+
getSessionTypeByJid(jid: string): SessionTypes;
|
|
123
|
+
getSessionManager: () => SessionManager | undefined;
|
|
124
|
+
getAllSessions: () => IMediaSession[];
|
|
125
|
+
proxyNRStat: (stat: NRProxyStat) => void;
|
|
126
|
+
}
|