@webex/plugin-meetings 3.11.0 → 3.12.0-llmrefactor.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.
Files changed (294) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +197 -0
  3. package/dist/aiEnableRequest/index.js.map +1 -0
  4. package/dist/aiEnableRequest/utils.js +36 -0
  5. package/dist/aiEnableRequest/utils.js.map +1 -0
  6. package/dist/annotation/index.js +58 -13
  7. package/dist/annotation/index.js.map +1 -1
  8. package/dist/breakouts/breakout.js +8 -3
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/events.js +29 -14
  11. package/dist/breakouts/events.js.map +1 -1
  12. package/dist/breakouts/index.js +124 -7
  13. package/dist/breakouts/index.js.map +1 -1
  14. package/dist/common/errors/webex-errors.js +49 -5
  15. package/dist/common/errors/webex-errors.js.map +1 -1
  16. package/dist/config.js +8 -3
  17. package/dist/config.js.map +1 -1
  18. package/dist/constants.js +60 -11
  19. package/dist/constants.js.map +1 -1
  20. package/dist/controls-options-manager/constants.js +11 -1
  21. package/dist/controls-options-manager/constants.js.map +1 -1
  22. package/dist/controls-options-manager/index.js +67 -29
  23. package/dist/controls-options-manager/index.js.map +1 -1
  24. package/dist/controls-options-manager/util.js +91 -0
  25. package/dist/controls-options-manager/util.js.map +1 -1
  26. package/dist/hashTree/constants.js +16 -2
  27. package/dist/hashTree/constants.js.map +1 -1
  28. package/dist/hashTree/hashTree.js +18 -0
  29. package/dist/hashTree/hashTree.js.map +1 -1
  30. package/dist/hashTree/hashTreeParser.js +1655 -538
  31. package/dist/hashTree/hashTreeParser.js.map +1 -1
  32. package/dist/hashTree/types.js +4 -2
  33. package/dist/hashTree/types.js.map +1 -1
  34. package/dist/hashTree/utils.js +52 -0
  35. package/dist/hashTree/utils.js.map +1 -1
  36. package/dist/index.js +18 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/interceptors/constant.js +12 -0
  39. package/dist/interceptors/constant.js.map +1 -0
  40. package/dist/interceptors/dataChannelAuthToken.js +332 -0
  41. package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
  42. package/dist/interceptors/index.js +7 -0
  43. package/dist/interceptors/index.js.map +1 -1
  44. package/dist/interceptors/locusRetry.js +23 -8
  45. package/dist/interceptors/locusRetry.js.map +1 -1
  46. package/dist/interceptors/utils.js +27 -0
  47. package/dist/interceptors/utils.js.map +1 -0
  48. package/dist/interpretation/index.js +11 -2
  49. package/dist/interpretation/index.js.map +1 -1
  50. package/dist/interpretation/interpretation.types.js +7 -0
  51. package/dist/interpretation/interpretation.types.js.map +1 -0
  52. package/dist/interpretation/siLanguage.js +1 -1
  53. package/dist/locus-info/controlsUtils.js +9 -4
  54. package/dist/locus-info/controlsUtils.js.map +1 -1
  55. package/dist/locus-info/index.js +914 -212
  56. package/dist/locus-info/index.js.map +1 -1
  57. package/dist/locus-info/infoUtils.js +36 -5
  58. package/dist/locus-info/infoUtils.js.map +1 -1
  59. package/dist/locus-info/selfUtils.js +1 -0
  60. package/dist/locus-info/selfUtils.js.map +1 -1
  61. package/dist/locus-info/types.js +19 -0
  62. package/dist/locus-info/types.js.map +1 -1
  63. package/dist/media/MediaConnectionAwaiter.js +72 -3
  64. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  65. package/dist/media/index.js +8 -2
  66. package/dist/media/index.js.map +1 -1
  67. package/dist/media/properties.js +8 -7
  68. package/dist/media/properties.js.map +1 -1
  69. package/dist/meeting/in-meeting-actions.js +11 -1
  70. package/dist/meeting/in-meeting-actions.js.map +1 -1
  71. package/dist/meeting/index.js +2287 -1118
  72. package/dist/meeting/index.js.map +1 -1
  73. package/dist/meeting/locusMediaRequest.js +229 -82
  74. package/dist/meeting/locusMediaRequest.js.map +1 -1
  75. package/dist/meeting/muteState.js +10 -1
  76. package/dist/meeting/muteState.js.map +1 -1
  77. package/dist/meeting/request.js +55 -2
  78. package/dist/meeting/request.js.map +1 -1
  79. package/dist/meeting/request.type.js.map +1 -1
  80. package/dist/meeting/util.js +168 -5
  81. package/dist/meeting/util.js.map +1 -1
  82. package/dist/meeting-info/meeting-info-v2.js +2 -2
  83. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  84. package/dist/meetings/index.js +369 -162
  85. package/dist/meetings/index.js.map +1 -1
  86. package/dist/meetings/meetings.types.js +6 -1
  87. package/dist/meetings/meetings.types.js.map +1 -1
  88. package/dist/meetings/request.js +39 -0
  89. package/dist/meetings/request.js.map +1 -1
  90. package/dist/meetings/util.js +116 -18
  91. package/dist/meetings/util.js.map +1 -1
  92. package/dist/member/index.js +20 -0
  93. package/dist/member/index.js.map +1 -1
  94. package/dist/member/types.js.map +1 -1
  95. package/dist/member/util.js +40 -0
  96. package/dist/member/util.js.map +1 -1
  97. package/dist/members/index.js +101 -43
  98. package/dist/members/index.js.map +1 -1
  99. package/dist/members/util.js +8 -1
  100. package/dist/members/util.js.map +1 -1
  101. package/dist/metrics/constants.js +12 -1
  102. package/dist/metrics/constants.js.map +1 -1
  103. package/dist/multistream/codec/constants.js +63 -0
  104. package/dist/multistream/codec/constants.js.map +1 -0
  105. package/dist/multistream/mediaRequestManager.js +64 -68
  106. package/dist/multistream/mediaRequestManager.js.map +1 -1
  107. package/dist/multistream/receiveSlot.js +9 -0
  108. package/dist/multistream/receiveSlot.js.map +1 -1
  109. package/dist/multistream/remoteMediaManager.js +11 -0
  110. package/dist/multistream/remoteMediaManager.js.map +1 -1
  111. package/dist/multistream/sendSlotManager.js +116 -2
  112. package/dist/multistream/sendSlotManager.js.map +1 -1
  113. package/dist/reachability/clusterReachability.js.map +1 -1
  114. package/dist/reachability/index.js +139 -93
  115. package/dist/reachability/index.js.map +1 -1
  116. package/dist/reachability/reachability.types.js +2 -0
  117. package/dist/reachability/reachability.types.js.map +1 -1
  118. package/dist/reachability/util.js +45 -0
  119. package/dist/reachability/util.js.map +1 -1
  120. package/dist/reactions/reactions.type.js.map +1 -1
  121. package/dist/reconnection-manager/index.js +0 -1
  122. package/dist/reconnection-manager/index.js.map +1 -1
  123. package/dist/recording-controller/index.js +1 -3
  124. package/dist/recording-controller/index.js.map +1 -1
  125. package/dist/roap/turnDiscovery.js +8 -1
  126. package/dist/roap/turnDiscovery.js.map +1 -1
  127. package/dist/types/aiEnableRequest/index.d.ts +5 -0
  128. package/dist/types/aiEnableRequest/utils.d.ts +2 -0
  129. package/dist/types/annotation/index.d.ts +19 -0
  130. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  131. package/dist/types/config.d.ts +6 -2
  132. package/dist/types/constants.d.ts +35 -1
  133. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  134. package/dist/types/controls-options-manager/index.d.ts +16 -0
  135. package/dist/types/hashTree/constants.d.ts +3 -0
  136. package/dist/types/hashTree/hashTree.d.ts +7 -0
  137. package/dist/types/hashTree/hashTreeParser.d.ts +315 -30
  138. package/dist/types/hashTree/types.d.ts +3 -0
  139. package/dist/types/hashTree/utils.d.ts +24 -0
  140. package/dist/types/index.d.ts +4 -0
  141. package/dist/types/interceptors/constant.d.ts +5 -0
  142. package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
  143. package/dist/types/interceptors/index.d.ts +2 -1
  144. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  145. package/dist/types/interceptors/utils.d.ts +1 -0
  146. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  147. package/dist/types/locus-info/index.d.ts +126 -15
  148. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  149. package/dist/types/locus-info/types.d.ts +28 -1
  150. package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
  151. package/dist/types/media/properties.d.ts +8 -3
  152. package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
  153. package/dist/types/meeting/index.d.ts +271 -16
  154. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  155. package/dist/types/meeting/request.d.ts +17 -1
  156. package/dist/types/meeting/request.type.d.ts +5 -0
  157. package/dist/types/meeting/util.d.ts +40 -0
  158. package/dist/types/meetings/index.d.ts +42 -20
  159. package/dist/types/meetings/meetings.types.d.ts +15 -0
  160. package/dist/types/meetings/request.d.ts +14 -0
  161. package/dist/types/member/index.d.ts +2 -0
  162. package/dist/types/member/types.d.ts +1 -0
  163. package/dist/types/member/util.d.ts +14 -0
  164. package/dist/types/members/index.d.ts +15 -2
  165. package/dist/types/members/util.d.ts +1 -5
  166. package/dist/types/metrics/constants.d.ts +11 -0
  167. package/dist/types/multistream/codec/constants.d.ts +7 -0
  168. package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
  169. package/dist/types/multistream/sendSlotManager.d.ts +23 -1
  170. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  171. package/dist/types/reachability/index.d.ts +10 -3
  172. package/dist/types/reachability/reachability.types.d.ts +7 -0
  173. package/dist/types/reachability/util.d.ts +17 -0
  174. package/dist/types/reactions/reactions.type.d.ts +4 -0
  175. package/dist/types/webinar/utils.d.ts +6 -0
  176. package/dist/webinar/index.js +611 -164
  177. package/dist/webinar/index.js.map +1 -1
  178. package/dist/webinar/utils.js +25 -0
  179. package/dist/webinar/utils.js.map +1 -0
  180. package/package.json +24 -23
  181. package/src/aiEnableRequest/README.md +84 -0
  182. package/src/aiEnableRequest/index.ts +186 -0
  183. package/src/aiEnableRequest/utils.ts +25 -0
  184. package/src/annotation/index.ts +62 -12
  185. package/src/breakouts/breakout.ts +3 -1
  186. package/src/breakouts/events.ts +33 -11
  187. package/src/breakouts/index.ts +143 -3
  188. package/src/common/errors/webex-errors.ts +50 -3
  189. package/src/config.ts +6 -2
  190. package/src/constants.ts +49 -3
  191. package/src/controls-options-manager/constants.ts +14 -1
  192. package/src/controls-options-manager/index.ts +87 -28
  193. package/src/controls-options-manager/util.ts +81 -1
  194. package/src/hashTree/constants.ts +17 -0
  195. package/src/hashTree/hashTree.ts +17 -0
  196. package/src/hashTree/hashTreeParser.ts +1482 -361
  197. package/src/hashTree/types.ts +4 -0
  198. package/src/hashTree/utils.ts +45 -0
  199. package/src/index.ts +14 -1
  200. package/src/interceptors/constant.ts +6 -0
  201. package/src/interceptors/dataChannelAuthToken.ts +217 -0
  202. package/src/interceptors/index.ts +2 -1
  203. package/src/interceptors/locusRetry.ts +25 -4
  204. package/src/interceptors/utils.ts +16 -0
  205. package/src/interpretation/index.ts +29 -11
  206. package/src/interpretation/interpretation.types.ts +11 -0
  207. package/src/locus-info/controlsUtils.ts +14 -1
  208. package/src/locus-info/index.ts +976 -203
  209. package/src/locus-info/infoUtils.ts +41 -6
  210. package/src/locus-info/selfUtils.ts +1 -0
  211. package/src/locus-info/types.ts +33 -1
  212. package/src/media/MediaConnectionAwaiter.ts +62 -5
  213. package/src/media/index.ts +10 -1
  214. package/src/media/properties.ts +11 -4
  215. package/src/meeting/in-meeting-actions.ts +20 -0
  216. package/src/meeting/index.ts +1258 -222
  217. package/src/meeting/locusMediaRequest.ts +106 -6
  218. package/src/meeting/muteState.ts +10 -1
  219. package/src/meeting/request.ts +53 -0
  220. package/src/meeting/request.type.ts +6 -0
  221. package/src/meeting/util.ts +207 -7
  222. package/src/meeting-info/meeting-info-v2.ts +4 -2
  223. package/src/meetings/index.ts +319 -117
  224. package/src/meetings/meetings.types.ts +19 -0
  225. package/src/meetings/request.ts +43 -0
  226. package/src/meetings/util.ts +117 -4
  227. package/src/member/index.ts +20 -0
  228. package/src/member/types.ts +1 -0
  229. package/src/member/util.ts +41 -0
  230. package/src/members/index.ts +70 -7
  231. package/src/members/util.ts +12 -4
  232. package/src/metrics/constants.ts +12 -0
  233. package/src/multistream/codec/constants.ts +58 -0
  234. package/src/multistream/mediaRequestManager.ts +117 -76
  235. package/src/multistream/receiveSlot.ts +18 -0
  236. package/src/multistream/remoteMediaManager.ts +13 -0
  237. package/src/multistream/sendSlotManager.ts +97 -3
  238. package/src/reachability/clusterReachability.ts +3 -2
  239. package/src/reachability/index.ts +56 -16
  240. package/src/reachability/reachability.types.ts +11 -0
  241. package/src/reachability/util.ts +36 -0
  242. package/src/reactions/reactions.type.ts +4 -0
  243. package/src/reconnection-manager/index.ts +0 -1
  244. package/src/recording-controller/index.ts +1 -2
  245. package/src/roap/turnDiscovery.ts +9 -1
  246. package/src/webinar/index.ts +415 -11
  247. package/src/webinar/utils.ts +16 -0
  248. package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
  249. package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
  250. package/test/unit/spec/annotation/index.ts +228 -134
  251. package/test/unit/spec/breakouts/breakout.ts +9 -3
  252. package/test/unit/spec/breakouts/events.ts +120 -2
  253. package/test/unit/spec/breakouts/index.ts +305 -18
  254. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  255. package/test/unit/spec/controls-options-manager/index.js +244 -29
  256. package/test/unit/spec/controls-options-manager/util.js +165 -0
  257. package/test/unit/spec/hashTree/hashTree.ts +66 -0
  258. package/test/unit/spec/hashTree/hashTreeParser.ts +4528 -171
  259. package/test/unit/spec/hashTree/utils.ts +125 -1
  260. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +388 -0
  261. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  262. package/test/unit/spec/interceptors/utils.ts +75 -0
  263. package/test/unit/spec/interpretation/index.ts +26 -4
  264. package/test/unit/spec/locus-info/controlsUtils.js +200 -56
  265. package/test/unit/spec/locus-info/index.js +1861 -149
  266. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  267. package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
  268. package/test/unit/spec/media/index.ts +92 -0
  269. package/test/unit/spec/media/properties.ts +35 -26
  270. package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
  271. package/test/unit/spec/meeting/index.js +3694 -450
  272. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  273. package/test/unit/spec/meeting/muteState.js +81 -0
  274. package/test/unit/spec/meeting/request.js +82 -0
  275. package/test/unit/spec/meeting/utils.js +595 -27
  276. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  277. package/test/unit/spec/meetings/index.js +1138 -86
  278. package/test/unit/spec/meetings/request.js +141 -0
  279. package/test/unit/spec/meetings/utils.js +402 -51
  280. package/test/unit/spec/member/index.js +35 -4
  281. package/test/unit/spec/member/util.js +154 -27
  282. package/test/unit/spec/members/index.js +216 -0
  283. package/test/unit/spec/members/request.js +37 -1
  284. package/test/unit/spec/members/utils.js +63 -0
  285. package/test/unit/spec/multistream/mediaRequestManager.ts +503 -122
  286. package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
  287. package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
  288. package/test/unit/spec/reachability/index.ts +151 -46
  289. package/test/unit/spec/reachability/util.ts +31 -0
  290. package/test/unit/spec/reconnection-manager/index.js +4 -8
  291. package/test/unit/spec/recording-controller/index.js +9 -8
  292. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  293. package/test/unit/spec/webinar/index.ts +1087 -167
  294. package/test/unit/spec/webinar/utils.ts +39 -0
@@ -1,11 +1,13 @@
1
1
  /* eslint-disable valid-jsdoc */
2
2
  import {defer} from 'lodash';
3
- import {Defer, transferEvents} from '@webex/common';
3
+ import {Defer} from '@webex/common';
4
4
  import {EventEmitter} from 'events';
5
5
  import {WebexPlugin} from '@webex/webex-core';
6
6
  import {MEDIA, HTTP_VERBS, ROAP} from '../constants';
7
7
  import LoggerProxy from '../common/logs/logger-proxy';
8
8
  import {ClientMediaPreferences} from '../reachability/reachability.types';
9
+ import Metrics from '../metrics';
10
+ import BEHAVIORAL_METRICS from '../metrics/constants';
9
11
 
10
12
  export type MediaRequestType = 'RoapMessage' | 'LocalMute';
11
13
  export type RequestResult = any;
@@ -37,13 +39,13 @@ export type Request = RoapRequest | LocalMuteRequest;
37
39
  class InternalRequestInfo {
38
40
  public readonly request: Request;
39
41
  private pendingPromises: Defer[];
40
- private sendRequestFn: (request: Request) => Promise<RequestResult>;
42
+ private sendRequestFn: (request: Request, selfUrlRetryCount: number) => Promise<RequestResult>;
41
43
 
42
44
  /** Constructor */
43
45
  constructor(
44
46
  request: Request,
45
47
  pendingPromise: Defer,
46
- sendRequestFn: (request: Request) => Promise<RequestResult>
48
+ sendRequestFn: (request: Request, selfUrlRetryCount: number) => Promise<RequestResult>
47
49
  ) {
48
50
  this.request = request;
49
51
  this.pendingPromises = [pendingPromise];
@@ -69,7 +71,7 @@ class InternalRequestInfo {
69
71
  * is completed (no matter if it succeeded or failed).
70
72
  */
71
73
  public execute(): Promise<void> {
72
- return this.sendRequestFn(this.request)
74
+ return this.sendRequestFn(this.request, 0)
73
75
  .then((result) => {
74
76
  // resolve all the pending promises associated with this request
75
77
  this.pendingPromises.forEach((d) => d.resolve(result));
@@ -91,8 +93,12 @@ export type Config = {
91
93
  correlationId: string;
92
94
  meetingId: string;
93
95
  preferTranscoding: boolean;
96
+ getCurrentSelfUrl: () => string | undefined;
97
+ waitForSelfUrlChange: () => Promise<void>;
94
98
  };
95
99
 
100
+ const MAX_SELF_URL_RETRY_COUNT = 2;
101
+
96
102
  /**
97
103
  * Returns true if the request is triggering confluence creation in the server
98
104
  */
@@ -194,7 +200,13 @@ export class LocusMediaRequest extends WebexPlugin {
194
200
  /**
195
201
  * Prepares the uri and body for the media request to be sent to Locus
196
202
  */
197
- private sendHttpRequest(request: Request) {
203
+ private async sendHttpRequest(request: Request, selfUrlRetryCount = 0) {
204
+ // Resolve selfUrl lazily at send time. Locus rotates it on session
205
+ // transitions (breakout end, move-to, lobby admit) and the value
206
+ // captured upstream in roap/index.ts may be stale by the time we
207
+ // leave the queue. Persist the resolved URL on the request so a
208
+ // retry can detect a further rotation.
209
+ request.selfUrl = this.getCurrentSelfUrl(request);
198
210
  const uri = `${request.selfUrl}/${MEDIA}`;
199
211
 
200
212
  const {audioMuted, videoMuted} = this.getLatestMuteState();
@@ -263,7 +275,21 @@ export class LocusMediaRequest extends WebexPlugin {
263
275
 
264
276
  return result;
265
277
  })
266
- .catch((e) => {
278
+ .catch(async (e) => {
279
+ if (
280
+ (e?.statusCode === 409 || e?.statusCode === 403) &&
281
+ (await this.shouldRetryOnSelfUrlChange(request, selfUrlRetryCount))
282
+ ) {
283
+ // In-flight race: selfUrl rotated after we left the queue but
284
+ // before Locus rejected the request. Re-send; getCurrentSelfUrl
285
+ // will pick up the new URL. The returned promise replaces the
286
+ // rejection, so the caller's pendingPromise resolves correctly.
287
+ // Advance the retry count here so the guard in
288
+ // shouldRetryOnSelfUrlChange eventually stops after
289
+ // MAX_SELF_URL_RETRY_COUNT attempts.
290
+ return this.sendHttpRequest(request, selfUrlRetryCount + 1);
291
+ }
292
+
267
293
  if (
268
294
  isRequestAffectingConfluenceState(request) &&
269
295
  this.confluenceState === 'creation in progress'
@@ -301,6 +327,80 @@ export class LocusMediaRequest extends WebexPlugin {
301
327
  return promise;
302
328
  }
303
329
 
330
+ /**
331
+ * Returns the latest selfUrl for this meeting, falling back to the value
332
+ * captured when the request was enqueued.
333
+ */
334
+ private getCurrentSelfUrl(request: Request): string {
335
+ const currentSelfUrl = this.config.getCurrentSelfUrl();
336
+
337
+ if (currentSelfUrl && currentSelfUrl !== request.selfUrl) {
338
+ LoggerProxy.logger.info(
339
+ `Meeting:LocusMediaRequest#getCurrentSelfUrl --> resolved updated selfUrl, using ${currentSelfUrl}`
340
+ );
341
+
342
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY, {
343
+ correlation_id: this.config.correlationId,
344
+ reason: 'selfUrlUpdatedBeforeMediaRequest',
345
+ });
346
+
347
+ return currentSelfUrl;
348
+ }
349
+
350
+ return request.selfUrl;
351
+ }
352
+
353
+ /**
354
+ * Decides whether a 409 warrants a retry against the meeting's latest
355
+ * selfUrl.
356
+ */
357
+ private async shouldRetryOnSelfUrlChange(
358
+ request: Request,
359
+ selfUrlRetryCount: number
360
+ ): Promise<boolean> {
361
+ if (selfUrlRetryCount >= MAX_SELF_URL_RETRY_COUNT) {
362
+ return false;
363
+ }
364
+
365
+ const roapMessageType =
366
+ request.type === 'RoapMessage' ? request.roapMessage?.messageType : undefined;
367
+
368
+ const currentSelfUrl = this.getCurrentSelfUrl(request);
369
+
370
+ if (!currentSelfUrl || currentSelfUrl === request.selfUrl) {
371
+ await this.config.waitForSelfUrlChange();
372
+
373
+ const latestSelfUrl = this.getCurrentSelfUrl(request);
374
+
375
+ if (!latestSelfUrl || latestSelfUrl === request.selfUrl) {
376
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY, {
377
+ correlation_id: this.config.correlationId,
378
+ reason: 'selfUrlNotChangedAfterWait',
379
+ retryAttempt: selfUrlRetryCount,
380
+ roapMessageType,
381
+ });
382
+ LoggerProxy.logger.info(
383
+ 'Meeting:LocusMediaRequest#sendHttpRequest --> 409 conflict, no new selfUrl even after waiting'
384
+ );
385
+
386
+ return false;
387
+ }
388
+
389
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY, {
390
+ correlation_id: this.config.correlationId,
391
+ reason: 'selfUrlChangedAfterWait',
392
+ retryAttempt: selfUrlRetryCount,
393
+ roapMessageType,
394
+ });
395
+ }
396
+
397
+ LoggerProxy.logger.info(
398
+ `Meeting:LocusMediaRequest#sendHttpRequest --> 409 conflict, retrying ${request.type} with updated selfUrl`
399
+ );
400
+
401
+ return true;
402
+ }
403
+
304
404
  /**
305
405
  * Sends a media request to Locus
306
406
  */
@@ -375,7 +375,16 @@ export class MuteState {
375
375
  }
376
376
  if (muted !== undefined) {
377
377
  this.state.server.remoteMute = muted;
378
- this.muteLocalStream(meeting, muted, 'remotelyMuted');
378
+ // BO->Main may replay a stale remoteMute=false from the locus cache.
379
+ // Only enforce the mute on muted=true (also locking client.localMute so a later stale
380
+ // false can't flip isMuted()), and never touch the stream on muted=false — the
381
+ // legitimate server-driven unmute path is LOCAL_UNMUTE_REQUIRED. Always sync client
382
+ // intent back so other participants' tiles still show the mute icon.
383
+ if (muted) {
384
+ this.state.client.localMute = true;
385
+ this.muteLocalStream(meeting, true, 'remotelyMuted');
386
+ }
387
+ this.applyClientStateToServer(meeting);
379
388
  }
380
389
  }
381
390
 
@@ -26,6 +26,7 @@ import {
26
26
  SEND_DTMF_ENDPOINT,
27
27
  _SLIDES_,
28
28
  ANNOTATION,
29
+ INTERPRETATION,
29
30
  } from '../constants';
30
31
  import {
31
32
  SendReactionOptions,
@@ -33,6 +34,7 @@ import {
33
34
  ToggleReactionsOptions,
34
35
  PostMeetingDataConsentOptions,
35
36
  SynchronizeVideoLayout,
37
+ fetchDataChannelTokenOptions,
36
38
  } from './request.type';
37
39
  import MeetingUtil from './util';
38
40
  import {AnnotationInfo} from '../annotation/annotation.types';
@@ -134,6 +136,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
134
136
  locale?: string;
135
137
  deviceCapabilities?: Array<string>;
136
138
  liveAnnotationSupported: boolean;
139
+ enableSimultaneousInterpretation: boolean;
137
140
  alias?: string;
138
141
  clientMediaPreferences: ClientMediaPreferences;
139
142
  }) {
@@ -157,6 +160,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
157
160
  locale,
158
161
  deviceCapabilities = [],
159
162
  liveAnnotationSupported,
163
+ enableSimultaneousInterpretation,
160
164
  clientMediaPreferences,
161
165
  alias,
162
166
  } = options;
@@ -192,6 +196,14 @@ export default class MeetingRequest extends StatelessWebexPlugin {
192
196
  if (liveAnnotationSupported) {
193
197
  deviceCapabilities.push(ANNOTATION.ANNOTATION_ON_SHARE_SUPPORTED);
194
198
  }
199
+ if (enableSimultaneousInterpretation) {
200
+ deviceCapabilities.push(
201
+ INTERPRETATION.CAPABILITIES.HOST_CONTROL_SI_SUPPORTED,
202
+ INTERPRETATION.CAPABILITIES.INTERPRETER_CONTROL_SI_SUPPORTED,
203
+ INTERPRETATION.CAPABILITIES.SI_HANDOVER_SUPPORTED,
204
+ INTERPRETATION.CAPABILITIES.SIGN_INTERPRETER_SUPPORTED
205
+ );
206
+ }
195
207
 
196
208
  // append installationId to device config if it exists
197
209
  // @ts-ignore
@@ -1126,4 +1138,45 @@ export default class MeetingRequest extends StatelessWebexPlugin {
1126
1138
  throw err;
1127
1139
  }
1128
1140
  }
1141
+
1142
+ /**
1143
+ * Sends a request to retrieve the datachannel authorization token for a participant.
1144
+ *
1145
+ * For regular meeting data channel:
1146
+ * GET /locus/api/v1/loci/{uuid:lid}/participant/{uuid:pid}/datachannel/token
1147
+ *
1148
+ * For practice session data channel:
1149
+ * GET /locus/api/v1/loci/{uuid:lid}/participant/{uuid:pid}/practiceSession/datachannel/token
1150
+ *
1151
+ * @param {string} locusUrl - The locus url.
1152
+ * @param {string} requestingParticipantId - The participant UUID.
1153
+ * @param {boolean} [isPracticeSession=false] - Whether to get the practice session token.
1154
+ * @returns {Promise<{datachannelToken: string}>}
1155
+ */
1156
+ public async fetchDatachannelToken({
1157
+ locusUrl,
1158
+ requestingParticipantId,
1159
+ isPracticeSession = false,
1160
+ }: fetchDataChannelTokenOptions) {
1161
+ if (!locusUrl || !requestingParticipantId) {
1162
+ return Promise.reject(new Error('locusUrl and participantId are required'));
1163
+ }
1164
+ const practicePrefix = isPracticeSession ? '/practiceSession' : '';
1165
+
1166
+ const uri = `${locusUrl}/${PARTICIPANT}/${requestingParticipantId}${practicePrefix}/datachannel/token`;
1167
+
1168
+ // @ts-ignore
1169
+ return this.locusDeltaRequest({
1170
+ method: HTTP_VERBS.GET,
1171
+ uri,
1172
+ }).catch((err) => {
1173
+ LoggerProxy.logger.warn(
1174
+ `Meeting:request#fetchDatachannelToken --> Failed to retrieve ${
1175
+ isPracticeSession ? 'practice session ' : ''
1176
+ }datachannel token: ${err?.message || err}`
1177
+ );
1178
+
1179
+ return null;
1180
+ });
1181
+ }
1129
1182
  }
@@ -88,4 +88,10 @@ export type UnsetStageVideoLayout = {
88
88
  overrideDefault: false;
89
89
  };
90
90
 
91
+ export type fetchDataChannelTokenOptions = {
92
+ locusUrl: string;
93
+ requestingParticipantId: string;
94
+ isPracticeSession: boolean;
95
+ };
96
+
91
97
  export type SynchronizeVideoLayout = SetStageVideoLayout | UnsetStageVideoLayout;
@@ -1,4 +1,5 @@
1
1
  import {LocalCameraStream, LocalMicrophoneStream} from '@webex/media-helpers';
2
+ import url from 'url';
2
3
 
3
4
  import {cloneDeep} from 'lodash';
4
5
  import {MeetingNotActiveError, UserNotJoinedError} from '../common/errors/webex-errors';
@@ -24,6 +25,7 @@ import PermissionError from '../common/errors/permission';
24
25
  import PasswordError from '../common/errors/password-error';
25
26
  import CaptchaError from '../common/errors/captcha-error';
26
27
  import Trigger from '../common/events/trigger-proxy';
28
+ import {ServerRoles} from '../member/types';
27
29
 
28
30
  const MeetingUtil = {
29
31
  parseLocusJoin: (response) => {
@@ -32,6 +34,7 @@ const MeetingUtil = {
32
34
  // First todo: add check for existance
33
35
  parsed.locus = response.body.locus;
34
36
  parsed.dataSets = response.body.dataSets;
37
+ parsed.metadata = response.body.metaData;
35
38
  parsed.mediaConnections = response.body.mediaConnections;
36
39
  parsed.locusUrl = parsed.locus.url;
37
40
  parsed.locusId = parsed.locus.url.split('/').pop();
@@ -47,6 +50,124 @@ const MeetingUtil = {
47
50
  return parsed;
48
51
  },
49
52
 
53
+ /**
54
+ * Sanitizes a WebSocket URL by extracting only protocol, host, and pathname
55
+ * Returns concatenated protocol + host + pathname for safe logging
56
+ * Note: This is used for logging only; URL matching uses partial matching via _urlsPartiallyMatch
57
+ * @param {string} urlString - The URL to sanitize
58
+ * @returns {string} Sanitized URL or empty string if parsing fails
59
+ */
60
+ sanitizeWebSocketUrl: (urlString: string): string => {
61
+ if (!urlString || typeof urlString !== 'string') {
62
+ return '';
63
+ }
64
+
65
+ try {
66
+ const parsedUrl = url.parse(urlString);
67
+ const protocol = parsedUrl.protocol || '';
68
+ const host = parsedUrl.host || '';
69
+
70
+ // If we don't have at least protocol and host, it's not a valid URL
71
+ if (!protocol || !host) {
72
+ return '';
73
+ }
74
+
75
+ const pathname = parsedUrl.pathname || '';
76
+
77
+ // Strip trailing slash if pathname is just '/'
78
+ const normalizedPathname = pathname === '/' ? '' : pathname;
79
+
80
+ return `${protocol}//${host}${normalizedPathname}`;
81
+ } catch (error) {
82
+ LoggerProxy.logger.warn(
83
+ `Meeting:util#sanitizeWebSocketUrl --> unable to parse URL: ${error}`
84
+ );
85
+
86
+ return '';
87
+ }
88
+ },
89
+
90
+ /**
91
+ * Checks if two URLs partially match using an endsWith approach
92
+ * Combines host and pathname, then checks if one ends with the other
93
+ * This handles cases where one URL goes through a proxy (e.g., /webproxy/) while the other is direct
94
+ * @param {string} url1 - First URL to compare
95
+ * @param {string} url2 - Second URL to compare
96
+ * @returns {boolean} True if one URL path ends with the other (partial match), false otherwise
97
+ */
98
+ _urlsPartiallyMatch: (url1: string, url2: string): boolean => {
99
+ if (!url1 || !url2) {
100
+ return false;
101
+ }
102
+
103
+ try {
104
+ const parsedUrl1 = url.parse(url1);
105
+ const parsedUrl2 = url.parse(url2);
106
+
107
+ const host1 = parsedUrl1.host || '';
108
+ const host2 = parsedUrl2.host || '';
109
+ const pathname1 = parsedUrl1.pathname || '';
110
+ const pathname2 = parsedUrl2.pathname || '';
111
+
112
+ // If either failed to parse, they don't match
113
+ if (!host1 || !host2 || !pathname1 || !pathname2) {
114
+ return false;
115
+ }
116
+
117
+ // Combine host and pathname for comparison
118
+ const combined1 = host1 + pathname1;
119
+ const combined2 = host2 + pathname2;
120
+
121
+ // Check if one combined path ends with the other (handles proxy URLs)
122
+ return combined1.endsWith(combined2) || combined2.endsWith(combined1);
123
+ } catch (e) {
124
+ LoggerProxy.logger.warn('Meeting:util#_urlsPartiallyMatch --> error comparing URLs', e);
125
+
126
+ return false;
127
+ }
128
+ },
129
+
130
+ /**
131
+ * Gets socket URL information for metrics, including whether the socket URLs match
132
+ * Uses partial matching to handle proxy URLs (e.g., URLs with /webproxy/ prefix)
133
+ * @param {Object} webex - The webex instance
134
+ * @returns {Object} Object with hasMismatchedSocket, mercurySocketUrl, and deviceSocketUrl properties
135
+ */
136
+ getSocketUrlInfo: (
137
+ webex: any
138
+ ): {hasMismatchedSocket: boolean; mercurySocketUrl: string; deviceSocketUrl: string} => {
139
+ try {
140
+ const mercuryUrl = webex?.internal?.mercury?.socket?.url;
141
+ const deviceUrl = webex?.internal?.device?.webSocketUrl;
142
+
143
+ const sanitizedMercuryUrl = MeetingUtil.sanitizeWebSocketUrl(mercuryUrl);
144
+ const sanitizedDeviceUrl = MeetingUtil.sanitizeWebSocketUrl(deviceUrl);
145
+
146
+ // Only report a mismatch if both URLs are present and they don't match
147
+ // If either URL is missing, we can't determine if there's a mismatch, so return false
148
+ let hasMismatchedSocket = false;
149
+ if (sanitizedMercuryUrl && sanitizedDeviceUrl) {
150
+ hasMismatchedSocket = !MeetingUtil._urlsPartiallyMatch(mercuryUrl, deviceUrl);
151
+ }
152
+
153
+ return {
154
+ hasMismatchedSocket,
155
+ mercurySocketUrl: sanitizedMercuryUrl,
156
+ deviceSocketUrl: sanitizedDeviceUrl,
157
+ };
158
+ } catch (error) {
159
+ LoggerProxy.logger.warn(
160
+ `Meeting:util#getSocketUrlInfo --> error getting socket URL info: ${error}`
161
+ );
162
+
163
+ return {
164
+ hasMismatchedSocket: false,
165
+ mercurySocketUrl: '',
166
+ deviceSocketUrl: '',
167
+ };
168
+ }
169
+ },
170
+
50
171
  remoteUpdateAudioVideo: (meeting, audioMuted?: boolean, videoMuted?: boolean) => {
51
172
  if (!meeting) {
52
173
  return Promise.reject(new ParameterError('You need a meeting object.'));
@@ -196,6 +317,7 @@ const MeetingUtil = {
196
317
  locale: options.locale,
197
318
  deviceCapabilities: options.deviceCapabilities,
198
319
  liveAnnotationSupported: options.liveAnnotationSupported,
320
+ enableSimultaneousInterpretation: options.enableSimultaneousInterpretation,
199
321
  clientMediaPreferences,
200
322
  alias: options.alias,
201
323
  })
@@ -203,6 +325,7 @@ const MeetingUtil = {
203
325
  const parsed = MeetingUtil.parseLocusJoin(res);
204
326
  meeting.setLocus(parsed);
205
327
  meeting.isoLocalClientMeetingJoinTime = res?.headers?.date; // read from header if exist, else fall back to system clock : https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-555657
328
+ const socketUrlInfo = MeetingUtil.getSocketUrlInfo(webex);
206
329
  webex.internal.newMetrics.submitClientEvent({
207
330
  name: 'client.locus.join.response',
208
331
  payload: {
@@ -210,6 +333,9 @@ const MeetingUtil = {
210
333
  identifiers: {
211
334
  trackingId: res.headers.trackingid,
212
335
  },
336
+ eventData: {
337
+ ...socketUrlInfo,
338
+ },
213
339
  },
214
340
  options: {
215
341
  meetingId: meeting.id,
@@ -220,12 +346,19 @@ const MeetingUtil = {
220
346
  return parsed;
221
347
  })
222
348
  .catch((err) => {
349
+ const socketUrlInfo = MeetingUtil.getSocketUrlInfo(webex);
223
350
  webex.internal.newMetrics.submitClientEvent({
224
351
  name: 'client.locus.join.response',
225
352
  payload: {
226
353
  identifiers: {meetingLookupUrl: meeting.meetingInfo?.meetingLookupUrl},
354
+ eventData: {
355
+ ...socketUrlInfo,
356
+ },
357
+ },
358
+ options: {
359
+ meetingId: meeting.id,
360
+ rawError: err,
227
361
  },
228
- options: {meetingId: meeting.id, rawError: err},
229
362
  });
230
363
 
231
364
  throw err;
@@ -237,7 +370,9 @@ const MeetingUtil = {
237
370
  meeting.stopPeriodicLogUpload();
238
371
 
239
372
  meeting.breakouts.cleanUp();
373
+ meeting.webinar.cleanUp();
240
374
  meeting.simultaneousInterpretation.cleanUp();
375
+ meeting.locusInfo.cleanUp();
241
376
  meeting.locusMediaRequest = undefined;
242
377
 
243
378
  meeting.webex?.internal?.newMetrics?.callDiagnosticMetrics?.clearEventLimitsForCorrelationId(
@@ -261,8 +396,10 @@ const MeetingUtil = {
261
396
  .then(() => meeting.stopKeepAlive())
262
397
  .then(() => {
263
398
  if (meeting.config?.enableAutomaticLLM) {
264
- meeting.updateLLMConnection();
399
+ return meeting.cleanupLLMConneciton({throwOnError: false});
265
400
  }
401
+
402
+ return undefined;
266
403
  });
267
404
  },
268
405
 
@@ -528,6 +665,11 @@ const MeetingUtil = {
528
665
  displayHints.includes(DISPLAY_HINTS.LEAVE_TRANSFER_HOST_END_MEETING) ||
529
666
  displayHints.includes(DISPLAY_HINTS.LEAVE_END_MEETING),
530
667
 
668
+ requireHostEndMeetingBeforeLeave: (displayHints) =>
669
+ displayHints.includes(DISPLAY_HINTS.REQUIRE_HOST_END_MEETING_BEFORE_LEAVE) ||
670
+ (!displayHints.includes(DISPLAY_HINTS.LEAVE_TRANSFER_HOST_END_MEETING) &&
671
+ displayHints.includes(DISPLAY_HINTS.END_MEETING)),
672
+
531
673
  canManageBreakout: (displayHints) => displayHints.includes(DISPLAY_HINTS.BREAKOUT_MANAGEMENT),
532
674
 
533
675
  canStartBreakout: (displayHints) => !displayHints.includes(DISPLAY_HINTS.DISABLE_BREAKOUT_START),
@@ -705,6 +847,19 @@ const MeetingUtil = {
705
847
  requestBody.sequence = sequence;
706
848
  },
707
849
 
850
+ /**
851
+ * Checks if Locus API response contains a Locus DTO
852
+ *
853
+ * @param {any} response http response from Locus API call
854
+ * @returns {boolean} true if response contains a Locus DTO
855
+ */
856
+ isLocusDtoInAPIResponse(response: any) {
857
+ return (
858
+ response?.body?.locus || // for APIs called on our participant - locus is one of props in the response body
859
+ response?.body?.url // for APIs that act on locus itself (like mute all), the body is the locus
860
+ );
861
+ },
862
+
708
863
  /**
709
864
  * Updates the locus info for the meeting with the locus
710
865
  * information returned from API requests made to Locus
@@ -713,12 +868,13 @@ const MeetingUtil = {
713
868
  * @param {Object} response The response of the http request
714
869
  * @returns {Object}
715
870
  */
716
- updateLocusFromApiResponse: (meeting, response) => {
871
+ updateLocusFromApiResponse: (meeting: any, response: any) => {
717
872
  if (!meeting) {
718
873
  return response;
719
874
  }
720
875
 
721
- if (response?.body?.locus) {
876
+ // locus API responses can come in different shapes:
877
+ if (MeetingUtil.isLocusDtoInAPIResponse(response)) {
722
878
  meeting.locusInfo.handleLocusAPIResponse(meeting, response.body);
723
879
  }
724
880
 
@@ -764,14 +920,58 @@ const MeetingUtil = {
764
920
 
765
921
  const options = buildLocusDeltaRequestOptions(originalOptions);
766
922
 
767
- return meeting
768
- .request(options)
769
- .then((response) => MeetingUtil.updateLocusFromApiResponse(meeting, response));
923
+ return meeting.request(options).then((response) => {
924
+ const requestUri = options?.uri;
925
+ const meetingLocusUrl = meeting.locusUrl;
926
+
927
+ if (!requestUri || !meetingLocusUrl || !requestUri.startsWith(meetingLocusUrl)) {
928
+ LoggerProxy.logger.info(
929
+ `Meeting:util#generateLocusDeltaRequest --> skipping updateLocusFromApiResponse, request uri "${requestUri}" does not match meeting locusUrl "${meetingLocusUrl}"`
930
+ );
931
+
932
+ return response;
933
+ }
934
+
935
+ return MeetingUtil.updateLocusFromApiResponse(meeting, response);
936
+ });
770
937
  };
771
938
 
772
939
  return locusDeltaRequest;
773
940
  },
774
941
 
942
+ canAttendeeRequestAiAssistantEnabled: (displayHints = [], roles: any[] = []) => {
943
+ const isHostOrCoHost =
944
+ roles.includes(ServerRoles.Cohost) || roles.includes(ServerRoles.Moderator);
945
+
946
+ if (isHostOrCoHost) {
947
+ return false;
948
+ }
949
+
950
+ if (displayHints.includes(DISPLAY_HINTS.ATTENDEE_REQUEST_AI_ASSISTANT_ENABLED)) {
951
+ return true;
952
+ }
953
+
954
+ return false;
955
+ },
956
+
957
+ attendeeRequestAiAssistantDeclinedAll: (displayHints = []) =>
958
+ displayHints.includes(DISPLAY_HINTS.ATTENDEE_REQUEST_AI_ASSISTANT_DECLINED_ALL),
959
+
960
+ isAnonymizeDisplayNamesEnabled: (displayHints) =>
961
+ displayHints.includes(DISPLAY_HINTS.ANONYMOUS_DISPLAY_NAMES_ENABLED),
962
+
963
+ canViewTheParticipantList: (displayHints, canNotViewTheParticipantList: boolean) => {
964
+ if (!displayHints.includes(DISPLAY_HINTS.VIEW_THE_PARTICIPANT_LIST)) {
965
+ return false;
966
+ }
967
+
968
+ if (canNotViewTheParticipantList) {
969
+ return false;
970
+ }
971
+
972
+ return displayHints.includes(DISPLAY_HINTS.CAN_VIEW_THE_PARTICIPANT_LIST);
973
+ },
974
+
775
975
  selfSupportsFeature: (feature: SELF_POLICY, userPolicies: Record<SELF_POLICY, boolean>) => {
776
976
  if (!userPolicies) {
777
977
  return true;
@@ -19,7 +19,7 @@ const ADHOC_MEETING_DEFAULT_ERROR =
19
19
  const MEETING_IS_IN_PROGRESS_MESSAGE = 'Meeting is in progress';
20
20
  const STATIC_MEETING_LINK_ALREADY_EXISTS_MESSAGE = 'Static meeting link already exists';
21
21
  const FETCH_STATIC_MEETING_LINK = 'Meeting link does not exists for conversation';
22
- const CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006];
22
+ const CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006, 423008];
23
23
  const CAPTCHA_ERROR_REQUIRES_REGISTRATION_ID_CODES = [423007];
24
24
 
25
25
  const POLICY_ERROR_CODES = [403049, 403104, 403103, 403048, 403102, 403101];
@@ -35,7 +35,9 @@ const JOIN_FORBIDDEN_CODES = [403003];
35
35
  * 403137 - Registration ID verified failure
36
36
  *
37
37
  */
38
- const JOIN_WEBINAR_ERROR_CODES = [403021, 403022, 403024, 403137, 423007, 403026, 403037, 403137];
38
+ const JOIN_WEBINAR_ERROR_CODES = [
39
+ 403021, 403022, 403024, 403137, 423007, 403026, 403037, 403137, 403106,
40
+ ];
39
41
 
40
42
  /**
41
43
  * Error to indicate that wbxappapi requires a password