@webex/plugin-meetings 3.12.0-next.14 → 3.12.0-next.140
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/AGENTS.md +9 -0
- package/dist/aiEnableRequest/index.js +15 -2
- package/dist/aiEnableRequest/index.js.map +1 -1
- package/dist/annotation/index.js +2 -2
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/events.js +29 -14
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +99 -4
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +49 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +37 -10
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +46 -10
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/hashTree/constants.js +4 -1
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1096 -391
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/utils.js +20 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +75 -15
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interpretation/index.js +10 -1
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +4 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +615 -176
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +36 -5
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/types.js +20 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +15 -2
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +8 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +4 -5
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +5 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1680 -835
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +229 -82
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +5 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +34 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.js +2 -1
- package/dist/meeting/voicea-meeting.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +9 -3
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +293 -124
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +116 -18
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +10 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +30 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +101 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js +8 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +7 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +62 -15
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +121 -83
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/config.d.ts +2 -2
- package/dist/types/constants.d.ts +13 -1
- package/dist/types/controls-options-manager/index.d.ts +16 -0
- package/dist/types/hashTree/constants.d.ts +1 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
- package/dist/types/hashTree/utils.d.ts +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +106 -8
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +22 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
- package/dist/types/media/properties.d.ts +6 -2
- package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
- package/dist/types/meeting/index.d.ts +176 -11
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +1 -0
- package/dist/types/meeting/util.d.ts +9 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
- package/dist/types/meetings/index.d.ts +40 -19
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +1 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +9 -0
- package/dist/types/members/index.d.ts +15 -2
- package/dist/types/members/util.d.ts +1 -5
- package/dist/types/metrics/constants.d.ts +6 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
- package/dist/types/reachability/clusterReachability.d.ts +3 -3
- package/dist/types/reachability/index.d.ts +10 -3
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/types/reactions/reactions.type.d.ts +3 -0
- package/dist/webinar/index.js +307 -161
- package/dist/webinar/index.js.map +1 -1
- package/package.json +23 -23
- package/src/aiEnableRequest/index.ts +16 -0
- package/src/annotation/index.ts +6 -4
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +122 -2
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +2 -2
- package/src/constants.ts +21 -3
- package/src/controls-options-manager/index.ts +62 -10
- package/src/hashTree/constants.ts +7 -0
- package/src/hashTree/hashTreeParser.ts +861 -193
- package/src/hashTree/utils.ts +19 -0
- package/src/index.ts +6 -0
- package/src/interceptors/dataChannelAuthToken.ts +88 -12
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interpretation/index.ts +27 -9
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/controlsUtils.ts +3 -1
- package/src/locus-info/index.ts +566 -164
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/types.ts +26 -1
- package/src/media/MediaConnectionAwaiter.ts +21 -4
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +8 -3
- package/src/meeting/in-meeting-actions.ts +8 -0
- package/src/meeting/index.ts +933 -119
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +11 -0
- package/src/meeting/util.ts +46 -5
- package/src/meeting/voicea-meeting.ts +1 -1
- package/src/meeting-info/meeting-info-v2.ts +10 -4
- package/src/meetings/index.ts +197 -80
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +117 -4
- package/src/member/index.ts +10 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +29 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/constants.ts +6 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +119 -28
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/reachability/clusterReachability.ts +3 -2
- package/src/reachability/index.ts +47 -16
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/util.ts +36 -0
- package/src/reactions/reactions.type.ts +3 -0
- package/src/recording-controller/index.ts +1 -2
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/index.ts +216 -38
- package/test/unit/spec/aiEnableRequest/index.ts +86 -0
- package/test/unit/spec/annotation/index.ts +3 -3
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/events.ts +120 -2
- package/test/unit/spec/breakouts/index.ts +223 -3
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/controls-options-manager/index.js +139 -32
- package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
- package/test/unit/spec/hashTree/utils.ts +37 -0
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interpretation/index.ts +26 -4
- package/test/unit/spec/locus-info/controlsUtils.js +172 -57
- package/test/unit/spec/locus-info/index.js +1014 -58
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +23 -23
- package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
- package/test/unit/spec/meeting/index.js +2805 -116
- package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +12 -0
- package/test/unit/spec/meeting/utils.js +153 -1
- package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
- package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
- package/test/unit/spec/meetings/index.js +533 -49
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +402 -51
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +89 -0
- package/test/unit/spec/members/index.js +216 -0
- package/test/unit/spec/members/request.js +37 -1
- package/test/unit/spec/members/utils.js +63 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
- package/test/unit/spec/reachability/index.ts +128 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/roap/turnDiscovery.ts +20 -0
- package/test/unit/spec/webinar/index.ts +332 -31
package/src/meeting/index.ts
CHANGED
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
MediaConnectionEventNames,
|
|
23
23
|
MediaContent,
|
|
24
24
|
MediaType,
|
|
25
|
-
MediaCodecMimeType,
|
|
26
25
|
RemoteTrackType,
|
|
27
26
|
RoapMessage,
|
|
28
27
|
StatsAnalyzer,
|
|
@@ -31,10 +30,10 @@ import {
|
|
|
31
30
|
NetworkQualityMonitor,
|
|
32
31
|
StatsMonitor,
|
|
33
32
|
StatsMonitorEventNames,
|
|
34
|
-
|
|
33
|
+
MediaCodecMimeType,
|
|
35
34
|
} from '@webex/internal-media-core';
|
|
36
35
|
|
|
37
|
-
import {DataChannelTokenType} from '@webex/internal-plugin-llm';
|
|
36
|
+
import {DataChannelTokenType, type RegisterAndConnectTiming} from '@webex/internal-plugin-llm';
|
|
38
37
|
|
|
39
38
|
import {
|
|
40
39
|
LocalStream,
|
|
@@ -67,6 +66,7 @@ import {
|
|
|
67
66
|
NoMediaEstablishedYetError,
|
|
68
67
|
UserNotJoinedError,
|
|
69
68
|
AddMediaFailed,
|
|
69
|
+
MediaConnectionTimedOutError,
|
|
70
70
|
SdpResponseTimeoutError,
|
|
71
71
|
} from '../common/errors/webex-errors';
|
|
72
72
|
|
|
@@ -77,6 +77,7 @@ import Roap, {type TurnDiscoveryResult, type TurnDiscoverySkipReason} from '../r
|
|
|
77
77
|
import {type TurnServerInfo} from '../roap/types';
|
|
78
78
|
import Media, {type BundlePolicy} from '../media';
|
|
79
79
|
import MediaProperties from '../media/properties';
|
|
80
|
+
import {type FailureResult as MediaConnectionAwaiterFailureResult} from '../media/MediaConnectionAwaiter';
|
|
80
81
|
import MeetingStateMachine from './state';
|
|
81
82
|
import {createMuteState} from './muteState';
|
|
82
83
|
import LocusInfo, {LocusLLMEvent} from '../locus-info';
|
|
@@ -137,6 +138,8 @@ import {
|
|
|
137
138
|
STAGE_MANAGER_TYPE,
|
|
138
139
|
LOCUSEVENT,
|
|
139
140
|
LOCUS_LLM_EVENT,
|
|
141
|
+
LLM_DEFAULT_SESSION,
|
|
142
|
+
LLM_PRACTICE_SESSION,
|
|
140
143
|
} from '../constants';
|
|
141
144
|
import BEHAVIORAL_METRICS from '../metrics/constants';
|
|
142
145
|
import ParameterError from '../common/errors/parameter';
|
|
@@ -183,13 +186,14 @@ import {ReachabilityMetrics} from '../reachability/reachability.types';
|
|
|
183
186
|
import {SetStageOptions, SetStageVideoLayout, UnsetStageVideoLayout} from './request.type';
|
|
184
187
|
import {Invitee} from './type';
|
|
185
188
|
import {DataSet, HashTreeMessage, Metadata} from '../hashTree/hashTreeParser';
|
|
186
|
-
import {LocusDTO} from '../locus-info/types';
|
|
189
|
+
import {LocusDTO, LocusErrorCodes} from '../locus-info/types';
|
|
187
190
|
import AIEnableRequest from '../aiEnableRequest';
|
|
188
191
|
|
|
189
192
|
// default callback so we don't call an undefined function, but in practice it should never be used
|
|
190
193
|
const DEFAULT_ICE_PHASE_CALLBACK = () => 'JOIN_MEETING_FINAL';
|
|
191
194
|
|
|
192
195
|
const LLM_HEALTHCHECK_TIMER_MS = 3 * 60 * 1000;
|
|
196
|
+
const JOIN_WITH_MEDIA_RETRY_MAX_COUNT = 2;
|
|
193
197
|
|
|
194
198
|
const logRequest = (request: any, {logText = ''}) => {
|
|
195
199
|
LoggerProxy.logger.info(`${logText} - sending request`);
|
|
@@ -612,7 +616,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
612
616
|
webinar: any;
|
|
613
617
|
conversationUrl: string;
|
|
614
618
|
callStateForMetrics: CallStateForMetrics;
|
|
615
|
-
destination: string;
|
|
619
|
+
destination: string | LocusDTO;
|
|
616
620
|
destinationType: DESTINATION_TYPE;
|
|
617
621
|
deviceUrl: string;
|
|
618
622
|
hostId: string;
|
|
@@ -651,6 +655,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
651
655
|
floorGrantPending: boolean;
|
|
652
656
|
hasJoinedOnce: boolean;
|
|
653
657
|
hasWebsocketConnected: boolean;
|
|
658
|
+
private mercuryOnlineHandler?: () => void;
|
|
659
|
+
private mercuryOfflineHandler?: () => void;
|
|
654
660
|
inMeetingActions: InMeetingActions;
|
|
655
661
|
isLocalShareLive: boolean;
|
|
656
662
|
isRoapInProgress: boolean;
|
|
@@ -662,6 +668,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
662
668
|
joinedWith?: any;
|
|
663
669
|
selfId?: string;
|
|
664
670
|
roles: any[];
|
|
671
|
+
canNotViewTheParticipantList?: boolean;
|
|
665
672
|
// ... there is more ... see SelfUtils.parse()
|
|
666
673
|
// end of the group
|
|
667
674
|
locusMediaRequest?: LocusMediaRequest;
|
|
@@ -735,6 +742,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
735
742
|
isMoveToInProgress = false;
|
|
736
743
|
registrationIdStatus: string;
|
|
737
744
|
brbState: BrbState;
|
|
745
|
+
private emittedBreakoutJoinResponseMoveIds: Set<string> = new Set();
|
|
746
|
+
private promisesWaitingForPropUpdate: Record<string, Defer> = {};
|
|
738
747
|
|
|
739
748
|
voiceaListenerCallbacks: object = {
|
|
740
749
|
[VOICEAEVENTS.VOICEA_ANNOUNCEMENT]: (payload: Transcription['languageOptions']) => {
|
|
@@ -784,13 +793,20 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
784
793
|
private addMediaData: {
|
|
785
794
|
retriedWithTurnServer: boolean;
|
|
786
795
|
icePhaseCallback: () => string;
|
|
796
|
+
iceTransportPolicy?: RTCIceTransportPolicy;
|
|
787
797
|
};
|
|
788
798
|
|
|
789
799
|
private sendSlotManager: SendSlotManager = new SendSlotManager(LoggerProxy);
|
|
790
800
|
private deferSDPAnswer?: Defer; // used for waiting for a response
|
|
791
801
|
private sdpResponseTimer?: ReturnType<typeof setTimeout>;
|
|
792
802
|
private hasMediaConnectionConnectedAtLeastOnce: boolean;
|
|
793
|
-
private joinWithMediaRetryInfo
|
|
803
|
+
private joinWithMediaRetryInfo: {
|
|
804
|
+
retryCount: number;
|
|
805
|
+
prevJoinResponse?: any;
|
|
806
|
+
firstError?: Error;
|
|
807
|
+
prevError?: Error;
|
|
808
|
+
};
|
|
809
|
+
|
|
794
810
|
private connectionStateHandler?: ConnectionStateHandler;
|
|
795
811
|
private iceCandidateErrors: Map<string, number>;
|
|
796
812
|
private iceCandidatesCount: number;
|
|
@@ -935,7 +951,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
935
951
|
this.simultaneousInterpretation = new SimultaneousInterpretation({}, {parent: this.webex});
|
|
936
952
|
|
|
937
953
|
// @ts-ignore
|
|
938
|
-
this.aiEnableRequest = new AIEnableRequest({}, {parent: this.webex});
|
|
954
|
+
this.aiEnableRequest = new AIEnableRequest({locusUrl: this.locusUrl}, {parent: this.webex});
|
|
939
955
|
|
|
940
956
|
/**
|
|
941
957
|
* @instance
|
|
@@ -966,6 +982,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
966
982
|
},
|
|
967
983
|
(csi: CSI) => (this.members.findMemberByCsi(csi) as any)?.id
|
|
968
984
|
);
|
|
985
|
+
|
|
969
986
|
/**
|
|
970
987
|
* Object containing helper classes for managing media requests for audio/video/screenshare (for multistream media connections)
|
|
971
988
|
* All multistream media requests sent out for this meeting have to go through them.
|
|
@@ -985,6 +1002,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
985
1002
|
mediaRequests
|
|
986
1003
|
);
|
|
987
1004
|
},
|
|
1005
|
+
this.getIngressPayloadTypeCallback.bind(this),
|
|
988
1006
|
{
|
|
989
1007
|
// @ts-ignore - config coming from registerPlugin
|
|
990
1008
|
degradationPreferences: this.config.degradationPreferences,
|
|
@@ -1006,6 +1024,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1006
1024
|
mediaRequests
|
|
1007
1025
|
);
|
|
1008
1026
|
},
|
|
1027
|
+
this.getIngressPayloadTypeCallback.bind(this),
|
|
1009
1028
|
{
|
|
1010
1029
|
// @ts-ignore - config coming from registerPlugin
|
|
1011
1030
|
degradationPreferences: this.config.degradationPreferences,
|
|
@@ -1027,6 +1046,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1027
1046
|
mediaRequests
|
|
1028
1047
|
);
|
|
1029
1048
|
},
|
|
1049
|
+
this.getIngressPayloadTypeCallback.bind(this),
|
|
1030
1050
|
{
|
|
1031
1051
|
// @ts-ignore - config coming from registerPlugin
|
|
1032
1052
|
degradationPreferences: this.config.degradationPreferences,
|
|
@@ -1048,11 +1068,14 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1048
1068
|
mediaRequests
|
|
1049
1069
|
);
|
|
1050
1070
|
},
|
|
1071
|
+
this.getIngressPayloadTypeCallback.bind(this),
|
|
1051
1072
|
{
|
|
1052
1073
|
// @ts-ignore - config coming from registerPlugin
|
|
1053
1074
|
degradationPreferences: this.config.degradationPreferences,
|
|
1054
1075
|
kind: 'video',
|
|
1055
1076
|
trimRequestsToNumOfSources: false,
|
|
1077
|
+
// @ts-ignore - config coming from registerPlugin
|
|
1078
|
+
enableAv1: this.config.enableAv1SlidesSupport,
|
|
1056
1079
|
}
|
|
1057
1080
|
),
|
|
1058
1081
|
};
|
|
@@ -1372,7 +1395,48 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1372
1395
|
* @memberof Meeting
|
|
1373
1396
|
*/
|
|
1374
1397
|
// @ts-ignore - Fix type
|
|
1375
|
-
this.locusInfo = new LocusInfo(
|
|
1398
|
+
this.locusInfo = new LocusInfo(
|
|
1399
|
+
{
|
|
1400
|
+
updateMeeting: this.updateMeetingObject.bind(this),
|
|
1401
|
+
syncLatencyTracker: {
|
|
1402
|
+
// Compute/store latency timestamps live on CallDiagnosticLatencies, while
|
|
1403
|
+
// submitting the client.locus.sync.complete CA event is owned by the metrics
|
|
1404
|
+
// facade. Wire each method to the layer that owns that responsibility.
|
|
1405
|
+
saveLatency: (...args) =>
|
|
1406
|
+
// @ts-ignore
|
|
1407
|
+
this.webex.internal.newMetrics.callDiagnosticLatencies.saveLatency(...args),
|
|
1408
|
+
saveTimestamp: (saveTimestampOptions: {
|
|
1409
|
+
key: string;
|
|
1410
|
+
value?: number;
|
|
1411
|
+
options: {meetingId: string; dataSetName: string; trackingId?: string};
|
|
1412
|
+
}) => {
|
|
1413
|
+
// @ts-ignore
|
|
1414
|
+
this.webex.internal.newMetrics.callDiagnosticLatencies.saveTimestamp(
|
|
1415
|
+
saveTimestampOptions
|
|
1416
|
+
);
|
|
1417
|
+
|
|
1418
|
+
// The /sync response is one of the two milestones (the other is the LLM message) that
|
|
1419
|
+
// complete client.locus.sync.complete. Try to complete now: the metric is emitted only
|
|
1420
|
+
// once both the LLM message and the /sync response have arrived (either can come first).
|
|
1421
|
+
if (
|
|
1422
|
+
saveTimestampOptions.key === 'internal.client.locus.sync.response' &&
|
|
1423
|
+
saveTimestampOptions.options?.trackingId
|
|
1424
|
+
) {
|
|
1425
|
+
this.tryCompleteLocusSyncLatency(
|
|
1426
|
+
saveTimestampOptions.options.meetingId,
|
|
1427
|
+
saveTimestampOptions.options.trackingId
|
|
1428
|
+
);
|
|
1429
|
+
}
|
|
1430
|
+
},
|
|
1431
|
+
clearLocusSyncLatency: (...args) =>
|
|
1432
|
+
// @ts-ignore
|
|
1433
|
+
this.webex.internal.newMetrics.callDiagnosticLatencies.clearLocusSyncLatency(...args),
|
|
1434
|
+
},
|
|
1435
|
+
},
|
|
1436
|
+
// @ts-ignore
|
|
1437
|
+
this.webex,
|
|
1438
|
+
this.id
|
|
1439
|
+
);
|
|
1376
1440
|
|
|
1377
1441
|
// We had to add listeners first before setting up the locus instance
|
|
1378
1442
|
/**
|
|
@@ -1557,6 +1621,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1557
1621
|
this.controlsOptionsManager = new ControlsOptionsManager(this.meetingRequest, {
|
|
1558
1622
|
locusUrl: this.locusInfo?.url,
|
|
1559
1623
|
displayHints: [],
|
|
1624
|
+
getControls: () => this.locusInfo?.controls,
|
|
1625
|
+
isWebinar: () => this.locusInfo?.info?.isWebinar,
|
|
1560
1626
|
});
|
|
1561
1627
|
|
|
1562
1628
|
this.setUpLocusInfoListeners();
|
|
@@ -1655,11 +1721,11 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1655
1721
|
/**
|
|
1656
1722
|
* Information needed for a retry of a call to joinWithMedia
|
|
1657
1723
|
* @instance
|
|
1658
|
-
* @type {{
|
|
1724
|
+
* @type {{retryCount: number; prevJoinResponse?: any}}
|
|
1659
1725
|
* @private
|
|
1660
1726
|
* @memberof Meeting
|
|
1661
1727
|
*/
|
|
1662
|
-
this.joinWithMediaRetryInfo = {
|
|
1728
|
+
this.joinWithMediaRetryInfo = {retryCount: 0, prevJoinResponse: undefined};
|
|
1663
1729
|
|
|
1664
1730
|
/**
|
|
1665
1731
|
* Connection state handler
|
|
@@ -1713,6 +1779,37 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1713
1779
|
this.mediaServerIp = undefined;
|
|
1714
1780
|
}
|
|
1715
1781
|
|
|
1782
|
+
/**
|
|
1783
|
+
* Get the ingress payload type for a given media type and codec mime type
|
|
1784
|
+
* @param {MediaType} mediaType - The media type
|
|
1785
|
+
* @param {MediaCodecMimeType} codecMimeType - The codec mime type
|
|
1786
|
+
* @returns {number | undefined} - The ingress payload type
|
|
1787
|
+
* @private
|
|
1788
|
+
* @memberof Meeting
|
|
1789
|
+
*/
|
|
1790
|
+
private getIngressPayloadTypeCallback(
|
|
1791
|
+
mediaType: MediaType,
|
|
1792
|
+
codecMimeType: MediaCodecMimeType
|
|
1793
|
+
): number | undefined {
|
|
1794
|
+
if (this.isMultistream) {
|
|
1795
|
+
try {
|
|
1796
|
+
return this.mediaProperties.webrtcMediaConnection.getIngressPayloadType(
|
|
1797
|
+
mediaType,
|
|
1798
|
+
codecMimeType
|
|
1799
|
+
);
|
|
1800
|
+
} catch (error) {
|
|
1801
|
+
LoggerProxy.logger.info(
|
|
1802
|
+
`Meeting:index#mediaRequestManager --> failed to get ingress payload type for mediaType=${mediaType}, codecMimeType=${codecMimeType}`,
|
|
1803
|
+
error
|
|
1804
|
+
);
|
|
1805
|
+
|
|
1806
|
+
return undefined;
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
return undefined;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1716
1813
|
/**
|
|
1717
1814
|
* Temporary func to return webex object,
|
|
1718
1815
|
* in order to access internal plugin metrics
|
|
@@ -1993,7 +2090,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1993
2090
|
this.config.installedOrgID,
|
|
1994
2091
|
this.locusId,
|
|
1995
2092
|
extraParams,
|
|
1996
|
-
{meetingId: this.id, sendCAevents},
|
|
2093
|
+
{meetingId: this.id, sendCAevents, correlationId: this.correlationId},
|
|
1997
2094
|
registrationId,
|
|
1998
2095
|
null,
|
|
1999
2096
|
classificationId
|
|
@@ -2325,6 +2422,89 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
2325
2422
|
});
|
|
2326
2423
|
}
|
|
2327
2424
|
|
|
2425
|
+
/**
|
|
2426
|
+
* Handles the LLM state-update message that resulted from a Locus /sync. Records the LLM arrival
|
|
2427
|
+
* time (the milestone that gates client.locus.sync.complete - the metric is emitted only for LLM
|
|
2428
|
+
* flows) and then tries to complete the metric.
|
|
2429
|
+
* @param {string} meetingId meeting id
|
|
2430
|
+
* @param {string} trackingId sync tracking id echoed back on the LLM message
|
|
2431
|
+
* @returns {void}
|
|
2432
|
+
* @private
|
|
2433
|
+
* @memberof Meeting
|
|
2434
|
+
*/
|
|
2435
|
+
private onLocusSyncLlmMessage(meetingId: string, trackingId: string) {
|
|
2436
|
+
// @ts-ignore
|
|
2437
|
+
this.webex.internal.newMetrics.callDiagnosticLatencies.recordLocusSyncMessageReceived(
|
|
2438
|
+
meetingId,
|
|
2439
|
+
trackingId
|
|
2440
|
+
);
|
|
2441
|
+
|
|
2442
|
+
this.tryCompleteLocusSyncLatency(meetingId, trackingId);
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
/**
|
|
2446
|
+
* Attempts to complete the Locus sync latency metric and emit client.locus.sync.complete. The
|
|
2447
|
+
* metric is emitted only once BOTH the /sync response and the resulting LLM message have arrived
|
|
2448
|
+
* (in either order); until then the record is kept so the missing milestone can still land. Both
|
|
2449
|
+
* trigger points (the LLM message handler and the /sync response timestamp) call this, so the
|
|
2450
|
+
* metric fires as soon as the second milestone is in.
|
|
2451
|
+
* @param {string} meetingId meeting id
|
|
2452
|
+
* @param {string} trackingId sync tracking id used to match the pending record
|
|
2453
|
+
* @returns {void}
|
|
2454
|
+
* @private
|
|
2455
|
+
* @memberof Meeting
|
|
2456
|
+
*/
|
|
2457
|
+
private tryCompleteLocusSyncLatency(meetingId: string, trackingId: string) {
|
|
2458
|
+
const completed =
|
|
2459
|
+
// @ts-ignore
|
|
2460
|
+
this.webex.internal.newMetrics.callDiagnosticLatencies.completeLocusSyncLatency(
|
|
2461
|
+
meetingId,
|
|
2462
|
+
trackingId
|
|
2463
|
+
);
|
|
2464
|
+
|
|
2465
|
+
if (completed) {
|
|
2466
|
+
this.emitLocusSyncCompleteMetric(meetingId, completed);
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
/**
|
|
2471
|
+
* Submits the client.locus.sync.complete Call Analyzer event for a completed Locus sync latency
|
|
2472
|
+
* measurement.
|
|
2473
|
+
* @param {string} meetingId meeting id
|
|
2474
|
+
* @param {object} completed completed sync latency payload from the metrics plugin
|
|
2475
|
+
* @returns {void}
|
|
2476
|
+
* @private
|
|
2477
|
+
* @memberof Meeting
|
|
2478
|
+
*/
|
|
2479
|
+
private emitLocusSyncCompleteMetric(
|
|
2480
|
+
meetingId: string,
|
|
2481
|
+
completed: {dataSet: string; syncLatency: object}
|
|
2482
|
+
) {
|
|
2483
|
+
// @ts-ignore
|
|
2484
|
+
const llmWebsocketUrl = this.webex.internal.llm?.getWebSocketUrl?.() || undefined;
|
|
2485
|
+
|
|
2486
|
+
// Per the LLM sync-latency spec, the event carries the LLM websocket url identifier,
|
|
2487
|
+
// the llmInfo.dataSet (main, atd-active or atd-unmuted) and the syncLatency block.
|
|
2488
|
+
const clientEvent = {
|
|
2489
|
+
name: 'client.locus.sync.complete',
|
|
2490
|
+
payload: {
|
|
2491
|
+
identifiers: {
|
|
2492
|
+
llmWebsocketUrl,
|
|
2493
|
+
},
|
|
2494
|
+
llmInfo: {
|
|
2495
|
+
dataSet: completed.dataSet,
|
|
2496
|
+
},
|
|
2497
|
+
syncLatency: completed.syncLatency,
|
|
2498
|
+
},
|
|
2499
|
+
options: {
|
|
2500
|
+
meetingId,
|
|
2501
|
+
},
|
|
2502
|
+
};
|
|
2503
|
+
|
|
2504
|
+
// @ts-ignore
|
|
2505
|
+
this.webex.internal.newMetrics.submitClientEvent(clientEvent);
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2328
2508
|
/**
|
|
2329
2509
|
* Proxy function for all the listener set ups
|
|
2330
2510
|
* @returns {undefined}
|
|
@@ -2789,7 +2969,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
2789
2969
|
private setupLocusControlsListener() {
|
|
2790
2970
|
this.locusInfo.on(
|
|
2791
2971
|
LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED,
|
|
2792
|
-
({state, modifiedBy, lastModified}) => {
|
|
2972
|
+
({state, modifiedBy, lastModified, modifiedByServiceAppName, modifiedByServiceAppId}) => {
|
|
2793
2973
|
let event;
|
|
2794
2974
|
|
|
2795
2975
|
switch (state) {
|
|
@@ -2815,6 +2995,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
2815
2995
|
state: state === RECORDING_STATE.RESUMED ? RECORDING_STATE.RECORDING : state,
|
|
2816
2996
|
modifiedBy,
|
|
2817
2997
|
lastModified,
|
|
2998
|
+
modifiedByServiceAppName,
|
|
2999
|
+
modifiedByServiceAppId,
|
|
2818
3000
|
};
|
|
2819
3001
|
Trigger.trigger(
|
|
2820
3002
|
this,
|
|
@@ -3213,7 +3395,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3213
3395
|
}
|
|
3214
3396
|
|
|
3215
3397
|
LoggerProxy.logger.info(
|
|
3216
|
-
`Meeting:index#
|
|
3398
|
+
`Meeting:index#setUpLocusMediaSharesListener --> this.shareStatus=${this.shareStatus} newShareStatus=${newShareStatus}`
|
|
3217
3399
|
);
|
|
3218
3400
|
|
|
3219
3401
|
if (newShareStatus !== this.shareStatus) {
|
|
@@ -3459,13 +3641,12 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3459
3641
|
this.breakouts.locusUrlUpdate(url);
|
|
3460
3642
|
this.simultaneousInterpretation.locusUrlUpdate(url);
|
|
3461
3643
|
this.annotation.locusUrlUpdate(url);
|
|
3644
|
+
this.aiEnableRequest.locusUrlUpdate(url);
|
|
3462
3645
|
this.locusUrl = url;
|
|
3463
3646
|
this.locusId = this.locusUrl?.split('/').pop();
|
|
3464
3647
|
this.recordingController.setLocusUrl(this.locusUrl);
|
|
3465
3648
|
this.controlsOptionsManager.setLocusUrl(this.locusUrl, !!isMainLocus);
|
|
3466
3649
|
this.webinar.locusUrlUpdate(url);
|
|
3467
|
-
// @ts-ignore
|
|
3468
|
-
this.webex.internal.llm.setRefreshHandler(() => this.refreshDataChannelToken());
|
|
3469
3650
|
|
|
3470
3651
|
Trigger.trigger(
|
|
3471
3652
|
this,
|
|
@@ -3734,7 +3915,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3734
3915
|
});
|
|
3735
3916
|
this.updateLLMConnection();
|
|
3736
3917
|
});
|
|
3737
|
-
this.locusInfo.on(LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, (payload) => {
|
|
3918
|
+
this.locusInfo.on(LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, async (payload) => {
|
|
3738
3919
|
this.stopKeepAlive();
|
|
3739
3920
|
|
|
3740
3921
|
if (payload) {
|
|
@@ -3761,13 +3942,15 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3761
3942
|
}
|
|
3762
3943
|
this.rtcMetrics?.sendNextMetrics();
|
|
3763
3944
|
|
|
3764
|
-
|
|
3945
|
+
try {
|
|
3946
|
+
await this.ensureDefaultDatachannelTokenAfterAdmit();
|
|
3947
|
+
} catch (error) {
|
|
3765
3948
|
LoggerProxy.logger.warn(
|
|
3766
3949
|
`Meeting:index#setUpLocusInfoSelfListener --> failed post-admit token prefetch flow: ${
|
|
3767
3950
|
error?.message || String(error)
|
|
3768
3951
|
}`
|
|
3769
3952
|
);
|
|
3770
|
-
}
|
|
3953
|
+
}
|
|
3771
3954
|
|
|
3772
3955
|
this.updateLLMConnection();
|
|
3773
3956
|
});
|
|
@@ -3813,6 +3996,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3813
3996
|
});
|
|
3814
3997
|
|
|
3815
3998
|
this.locusInfo.on(LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE, (payload) => {
|
|
3999
|
+
// canViewTheParticipantList meeting action depends on this value, so we need to update meeting actions
|
|
4000
|
+
this.updateMeetingActions();
|
|
4001
|
+
|
|
3816
4002
|
Trigger.trigger(
|
|
3817
4003
|
this,
|
|
3818
4004
|
{
|
|
@@ -4007,7 +4193,14 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
4007
4193
|
// is not changed by any delta event
|
|
4008
4194
|
if (object && Object.keys(object).length) {
|
|
4009
4195
|
Object.keys(object).forEach((key) => {
|
|
4196
|
+
const previousValue = this[key];
|
|
4197
|
+
|
|
4010
4198
|
this[key] = object[key];
|
|
4199
|
+
|
|
4200
|
+
if (this.promisesWaitingForPropUpdate[key] && previousValue !== object[key]) {
|
|
4201
|
+
this.promisesWaitingForPropUpdate[key].resolve();
|
|
4202
|
+
delete this.promisesWaitingForPropUpdate[key];
|
|
4203
|
+
}
|
|
4011
4204
|
});
|
|
4012
4205
|
}
|
|
4013
4206
|
}
|
|
@@ -4145,7 +4338,12 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
4145
4338
|
}
|
|
4146
4339
|
|
|
4147
4340
|
/**
|
|
4148
|
-
* Transfer the moderator role to another eligible member
|
|
4341
|
+
* Transfer the moderator role to another eligible member.
|
|
4342
|
+
*
|
|
4343
|
+
* If the target member is currently joined in the current session, the request is
|
|
4344
|
+
* sent against the current locus. Otherwise, we search the breakout sessions and,
|
|
4345
|
+
* when the member is found in one, we send the request against that breakout
|
|
4346
|
+
* session's locus url instead.
|
|
4149
4347
|
* @param {String} memberId
|
|
4150
4348
|
* @param {Boolean} moderator
|
|
4151
4349
|
* @returns {Promise} see #members.transferHostToMember
|
|
@@ -4153,7 +4351,21 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
4153
4351
|
* @memberof Meeting
|
|
4154
4352
|
*/
|
|
4155
4353
|
public transfer(memberId: string, moderator = true) {
|
|
4156
|
-
|
|
4354
|
+
const targetMember = this.members.membersCollection.get(memberId);
|
|
4355
|
+
|
|
4356
|
+
if (targetMember?.isInMeeting) {
|
|
4357
|
+
return this.members.transferHostToMember(memberId, moderator);
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4360
|
+
const breakout = this.breakouts?.breakouts?.models?.find((bo: any) => {
|
|
4361
|
+
const breakoutMember = bo.members?.membersCollection?.get(memberId);
|
|
4362
|
+
|
|
4363
|
+
return breakoutMember?.isInMeeting;
|
|
4364
|
+
});
|
|
4365
|
+
|
|
4366
|
+
const breakoutLocusUrl = breakout?.breakoutRosterLocus?.url;
|
|
4367
|
+
|
|
4368
|
+
return this.members.transferHostToMember(memberId, moderator, breakoutLocusUrl);
|
|
4157
4369
|
}
|
|
4158
4370
|
|
|
4159
4371
|
/**
|
|
@@ -4611,6 +4823,13 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
4611
4823
|
),
|
|
4612
4824
|
isAttendeeRequestAiAssistantDeclinedAll:
|
|
4613
4825
|
MeetingUtil.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints),
|
|
4826
|
+
isAnonymizeDisplayNamesEnabled: MeetingUtil.isAnonymizeDisplayNamesEnabled(
|
|
4827
|
+
this.userDisplayHints
|
|
4828
|
+
),
|
|
4829
|
+
canViewTheParticipantList: MeetingUtil.canViewTheParticipantList(
|
|
4830
|
+
this.userDisplayHints,
|
|
4831
|
+
this.canNotViewTheParticipantList ?? false
|
|
4832
|
+
),
|
|
4614
4833
|
}) || changed;
|
|
4615
4834
|
}
|
|
4616
4835
|
if (changed) {
|
|
@@ -4659,6 +4878,34 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
4659
4878
|
this.sipUri = sipUri;
|
|
4660
4879
|
}
|
|
4661
4880
|
|
|
4881
|
+
/**
|
|
4882
|
+
* After initial locus setup, refreshes destination with synced locus data and optionally
|
|
4883
|
+
* performs deferred meeting info fetch when initial locus was incomplete.
|
|
4884
|
+
* @param {LocusDTO} locus
|
|
4885
|
+
* @returns {void}
|
|
4886
|
+
*/
|
|
4887
|
+
public async finalizeMeetingAfterInitialLocusSetup(locus: LocusDTO): Promise<void> {
|
|
4888
|
+
if (locus && this?.destinationType === DESTINATION_TYPE.LOCUS_ID) {
|
|
4889
|
+
// destination is initialized from the initial locus snapshot in constructor,
|
|
4890
|
+
// so refresh it after locus sync to avoid stale partial hash-tree data.
|
|
4891
|
+
this.destination = locus;
|
|
4892
|
+
}
|
|
4893
|
+
if (
|
|
4894
|
+
(!this.meetingInfo || isEmpty(this.meetingInfo)) &&
|
|
4895
|
+
(this.destination as LocusDTO)?.info &&
|
|
4896
|
+
!this.fetchMeetingInfoTimeoutId &&
|
|
4897
|
+
!MeetingsUtil.isOneOnOneCall(locus)
|
|
4898
|
+
) {
|
|
4899
|
+
try {
|
|
4900
|
+
await this.fetchMeetingInfo({});
|
|
4901
|
+
} catch (error: any) {
|
|
4902
|
+
LoggerProxy.logger.info(
|
|
4903
|
+
`Meeting:index#finalizeMeetingAfterInitialLocusSetup --> deferred fetchMeetingInfo failed: ${error.message}`
|
|
4904
|
+
);
|
|
4905
|
+
}
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4908
|
+
|
|
4662
4909
|
/**
|
|
4663
4910
|
* Set the locus info the class instance. Should be called with the parsed locus
|
|
4664
4911
|
* we got in the join response.
|
|
@@ -5130,8 +5377,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5130
5377
|
public setMercuryListener() {
|
|
5131
5378
|
// Client will have a socket manager and handle reconnecting to mercury, when we reconnect to mercury
|
|
5132
5379
|
// if the meeting has active peer connections, it should try to reconnect.
|
|
5133
|
-
|
|
5134
|
-
this.webex.internal.mercury.on(ONLINE, () => {
|
|
5380
|
+
this.mercuryOnlineHandler = () => {
|
|
5135
5381
|
LoggerProxy.logger.info('Meeting:index#setMercuryListener --> Web socket online');
|
|
5136
5382
|
|
|
5137
5383
|
// Only send restore event when it was disconnected before and for connected later
|
|
@@ -5141,15 +5387,47 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5141
5387
|
});
|
|
5142
5388
|
}
|
|
5143
5389
|
this.hasWebsocketConnected = true;
|
|
5144
|
-
}
|
|
5390
|
+
};
|
|
5145
5391
|
|
|
5146
|
-
|
|
5147
|
-
this.webex.internal.mercury.on(OFFLINE, () => {
|
|
5392
|
+
this.mercuryOfflineHandler = () => {
|
|
5148
5393
|
LoggerProxy.logger.error('Meeting:index#setMercuryListener --> Web socket offline');
|
|
5149
5394
|
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MERCURY_CONNECTION_FAILURE, {
|
|
5150
5395
|
correlation_id: this.correlationId,
|
|
5151
5396
|
});
|
|
5152
|
-
}
|
|
5397
|
+
};
|
|
5398
|
+
|
|
5399
|
+
// @ts-ignore
|
|
5400
|
+
this.webex.internal.mercury.on(ONLINE, this.mercuryOnlineHandler);
|
|
5401
|
+
// @ts-ignore
|
|
5402
|
+
this.webex.internal.mercury.on(OFFLINE, this.mercuryOfflineHandler);
|
|
5403
|
+
}
|
|
5404
|
+
|
|
5405
|
+
/**
|
|
5406
|
+
* Removes this meeting's Mercury ONLINE/OFFLINE event listeners registered
|
|
5407
|
+
* by setMercuryListener(). Must be called before Locus /leave to avoid
|
|
5408
|
+
* unnecessary syncs/metrics triggered by events received while leaving
|
|
5409
|
+
* (per Locus team recommendation).
|
|
5410
|
+
*
|
|
5411
|
+
* Mercury is a process-wide singleton shared with other plugins, so we
|
|
5412
|
+
* pass the bound handler refs to .off() to avoid clearing every listener
|
|
5413
|
+
* for ONLINE/OFFLINE on the shared emitter.
|
|
5414
|
+
*
|
|
5415
|
+
* Idempotent: subsequent calls are no-ops because the handler refs are
|
|
5416
|
+
* cleared after detaching.
|
|
5417
|
+
* @private
|
|
5418
|
+
* @returns {void}
|
|
5419
|
+
*/
|
|
5420
|
+
private stopListeningForMercuryEvents() {
|
|
5421
|
+
if (this.mercuryOnlineHandler) {
|
|
5422
|
+
// @ts-ignore
|
|
5423
|
+
this.webex.internal.mercury.off(ONLINE, this.mercuryOnlineHandler);
|
|
5424
|
+
this.mercuryOnlineHandler = undefined;
|
|
5425
|
+
}
|
|
5426
|
+
if (this.mercuryOfflineHandler) {
|
|
5427
|
+
// @ts-ignore
|
|
5428
|
+
this.webex.internal.mercury.off(OFFLINE, this.mercuryOfflineHandler);
|
|
5429
|
+
this.mercuryOfflineHandler = undefined;
|
|
5430
|
+
}
|
|
5153
5431
|
}
|
|
5154
5432
|
|
|
5155
5433
|
/**
|
|
@@ -5173,6 +5451,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5173
5451
|
);
|
|
5174
5452
|
|
|
5175
5453
|
this.receiveSlotManager.reset();
|
|
5454
|
+
|
|
5176
5455
|
this.mediaProperties.webrtcMediaConnection.close();
|
|
5177
5456
|
this.mediaProperties.unsetPeerConnection();
|
|
5178
5457
|
this.sendSlotManager.reset();
|
|
@@ -5460,7 +5739,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5460
5739
|
} = {}
|
|
5461
5740
|
) {
|
|
5462
5741
|
const {mediaOptions, joinOptions = {}} = options;
|
|
5463
|
-
const {
|
|
5742
|
+
const {retryCount, prevJoinResponse, prevError} = this.joinWithMediaRetryInfo;
|
|
5464
5743
|
|
|
5465
5744
|
if (!mediaOptions?.allowMediaInLobby) {
|
|
5466
5745
|
return Promise.reject(
|
|
@@ -5471,9 +5750,6 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5471
5750
|
|
|
5472
5751
|
LoggerProxy.logger.info('Meeting:index#joinWithMedia called');
|
|
5473
5752
|
|
|
5474
|
-
let joined = false;
|
|
5475
|
-
let joinResponse = prevJoinResponse;
|
|
5476
|
-
|
|
5477
5753
|
/* Before we do anything, check if RTCPeerConnection is available. Normally this is checked
|
|
5478
5754
|
by addMediaInternal() itself when creating the media connection, but since joinWithMedia()
|
|
5479
5755
|
is a convenience method that does both join() and addMedia(), we want to fail fast here
|
|
@@ -5486,12 +5762,28 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5486
5762
|
);
|
|
5487
5763
|
}
|
|
5488
5764
|
|
|
5765
|
+
/* While we're trying to join, we may fail and be doing a retry. In that case,
|
|
5766
|
+
we sometimes get dropped by Locus as a result of the 1st failed attempt.
|
|
5767
|
+
That notification from Locus needs to be ignored, otherwise it causes the meeting to be
|
|
5768
|
+
cleaned up and prevents the retry from running correctly.
|
|
5769
|
+
*/
|
|
5770
|
+
this.locusInfo.suspendDestroyMeeting(true);
|
|
5771
|
+
|
|
5772
|
+
let joined = false;
|
|
5773
|
+
let joinResponse = prevJoinResponse;
|
|
5774
|
+
|
|
5775
|
+
const shouldJoin =
|
|
5776
|
+
!joinResponse || // first try, when the join response is empty
|
|
5777
|
+
(prevError && prevError instanceof UserNotJoinedError) || // last try failed with UserNotJoinedError
|
|
5778
|
+
this.isErrorMeaningLocusDroppedUs(prevError) ||
|
|
5779
|
+
MeetingUtil.isUserInLeftState(this.locusInfo); // locus dropped the connection before we can re-try addMedia
|
|
5780
|
+
|
|
5489
5781
|
try {
|
|
5490
5782
|
let turnServerInfo;
|
|
5491
5783
|
let turnDiscoverySkippedReason;
|
|
5492
5784
|
let forceTurnDiscovery = false;
|
|
5493
5785
|
|
|
5494
|
-
if (
|
|
5786
|
+
if (shouldJoin) {
|
|
5495
5787
|
// This is the 1st attempt or a retry after join request failed -> we need to do a join with TURN discovery
|
|
5496
5788
|
|
|
5497
5789
|
const turnDiscoveryRequest = await this.roap.generateTurnDiscoveryRequestMessage(
|
|
@@ -5530,16 +5822,24 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5530
5822
|
joined = true;
|
|
5531
5823
|
}
|
|
5532
5824
|
|
|
5825
|
+
const shouldRetryMediaWithOnlyTurnTLS = await this.shouldRetryMediaWithOnlyTurnTLS(prevError);
|
|
5826
|
+
|
|
5533
5827
|
const mediaResponse = await this.addMediaInternal(
|
|
5534
5828
|
() => {
|
|
5535
|
-
|
|
5829
|
+
// callback is not called when UserNotJoinedError is thrown
|
|
5830
|
+
return this.joinWithMediaRetryInfo.retryCount >= 1
|
|
5831
|
+
? 'JOIN_MEETING_FINAL'
|
|
5832
|
+
: 'JOIN_MEETING_RETRY';
|
|
5536
5833
|
},
|
|
5537
|
-
turnServerInfo,
|
|
5538
5834
|
forceTurnDiscovery,
|
|
5835
|
+
turnServerInfo,
|
|
5836
|
+
shouldRetryMediaWithOnlyTurnTLS ? 'relay' : undefined,
|
|
5539
5837
|
mediaOptions
|
|
5540
5838
|
);
|
|
5541
5839
|
|
|
5542
|
-
this.joinWithMediaRetryInfo = {
|
|
5840
|
+
this.joinWithMediaRetryInfo = {retryCount: 0, prevJoinResponse: undefined};
|
|
5841
|
+
|
|
5842
|
+
this.locusInfo.suspendDestroyMeeting(false);
|
|
5543
5843
|
|
|
5544
5844
|
return {
|
|
5545
5845
|
join: joinResponse,
|
|
@@ -5553,15 +5853,21 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5553
5853
|
|
|
5554
5854
|
this.roap.abortTurnDiscovery();
|
|
5555
5855
|
|
|
5556
|
-
//
|
|
5557
|
-
let shouldRetry =
|
|
5856
|
+
// let's do a retry (but not on 1-1 calls, because the flow would get too complicated)
|
|
5857
|
+
let shouldRetry =
|
|
5858
|
+
!MeetingsUtil.isOneOnOneCall(this.locusInfo.parsedLocus) &&
|
|
5859
|
+
(retryCount < 1 ||
|
|
5860
|
+
((error instanceof UserNotJoinedError || this.isErrorMeaningLocusDroppedUs(error)) &&
|
|
5861
|
+
retryCount < JOIN_WITH_MEDIA_RETRY_MAX_COUNT));
|
|
5558
5862
|
|
|
5559
5863
|
if (
|
|
5560
5864
|
CallDiagnosticUtils.isSdpOfferCreationError(error) ||
|
|
5561
|
-
CallDiagnosticUtils.isWebrtcApiNotAvailableError(error)
|
|
5865
|
+
CallDiagnosticUtils.isWebrtcApiNotAvailableError(error) ||
|
|
5866
|
+
this.isLocusUserFullError(error)
|
|
5562
5867
|
) {
|
|
5563
5868
|
// errors related to offer creation (for example missing H264 codec) will happen again no matter how many times we try,
|
|
5564
5869
|
// so there is no point doing a retry
|
|
5870
|
+
// when the locus is full, we also don't want to retry, because it will just fail again
|
|
5565
5871
|
shouldRetry = false;
|
|
5566
5872
|
}
|
|
5567
5873
|
|
|
@@ -5579,8 +5885,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5579
5885
|
});
|
|
5580
5886
|
}
|
|
5581
5887
|
|
|
5582
|
-
// we only want to call leave if join was successful and
|
|
5583
|
-
if (joined &&
|
|
5888
|
+
// we only want to call leave if join was successful, and we won't be doing any more retries
|
|
5889
|
+
if (joined && !shouldRetry) {
|
|
5584
5890
|
try {
|
|
5585
5891
|
await this.leave({resourceId: joinOptions?.resourceId, reason: 'joinWithMedia failure'});
|
|
5586
5892
|
} catch (e) {
|
|
@@ -5597,7 +5903,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5597
5903
|
reason: error.message,
|
|
5598
5904
|
stack: error.stack,
|
|
5599
5905
|
leaveErrorReason: leaveError?.message,
|
|
5600
|
-
isRetry,
|
|
5906
|
+
isRetry: retryCount > 0,
|
|
5601
5907
|
},
|
|
5602
5908
|
{
|
|
5603
5909
|
type: error.name,
|
|
@@ -5606,15 +5912,30 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5606
5912
|
|
|
5607
5913
|
if (shouldRetry) {
|
|
5608
5914
|
LoggerProxy.logger.warn('Meeting:index#joinWithMedia --> retrying call to joinWithMedia');
|
|
5609
|
-
this.joinWithMediaRetryInfo.
|
|
5915
|
+
this.joinWithMediaRetryInfo.retryCount = retryCount + 1;
|
|
5610
5916
|
this.joinWithMediaRetryInfo.prevJoinResponse = joinResponse;
|
|
5917
|
+
this.joinWithMediaRetryInfo.prevError = error;
|
|
5918
|
+
if (!this.joinWithMediaRetryInfo.firstError) {
|
|
5919
|
+
this.joinWithMediaRetryInfo.firstError = error;
|
|
5920
|
+
}
|
|
5611
5921
|
|
|
5612
5922
|
return this.joinWithMedia(options);
|
|
5613
5923
|
}
|
|
5614
5924
|
|
|
5615
|
-
|
|
5925
|
+
const {firstError} = this.joinWithMediaRetryInfo;
|
|
5616
5926
|
|
|
5617
|
-
|
|
5927
|
+
this.joinWithMediaRetryInfo = {
|
|
5928
|
+
retryCount: 0,
|
|
5929
|
+
prevJoinResponse: undefined,
|
|
5930
|
+
firstError: undefined,
|
|
5931
|
+
prevError: undefined,
|
|
5932
|
+
};
|
|
5933
|
+
|
|
5934
|
+
this.locusInfo.suspendDestroyMeeting(false);
|
|
5935
|
+
|
|
5936
|
+
// LOCUS_USER_FULL is a definitive capacity error the client must surface, so it takes
|
|
5937
|
+
// precedence over any earlier retryable error stored in firstError.
|
|
5938
|
+
throw this.isLocusUserFullError(error) ? error : firstError ?? error;
|
|
5618
5939
|
}
|
|
5619
5940
|
}
|
|
5620
5941
|
|
|
@@ -5857,7 +6178,18 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5857
6178
|
storeEventForDebugging('llm', event.data);
|
|
5858
6179
|
}
|
|
5859
6180
|
|
|
6181
|
+
const {trackingId} = event;
|
|
6182
|
+
|
|
5860
6183
|
this.locusInfo.parse(this, event.data);
|
|
6184
|
+
|
|
6185
|
+
// Only the client whose /sync request tracking id matches the tracking id echoed back on this
|
|
6186
|
+
// LLM message should emit client.locus.sync.complete. The tracking id lives at the top level
|
|
6187
|
+
// of the received LLM event envelope. When it is absent there is nothing to correlate, so
|
|
6188
|
+
// skip. onLocusSyncLlmMessage records the LLM arrival time and is a no-op unless a stored
|
|
6189
|
+
// record for this meeting matches the tracking id.
|
|
6190
|
+
if (trackingId) {
|
|
6191
|
+
this.onLocusSyncLlmMessage(this.id, trackingId);
|
|
6192
|
+
}
|
|
5861
6193
|
} else {
|
|
5862
6194
|
LoggerProxy.logger.warn(
|
|
5863
6195
|
`Meeting:index#processLocusLLMEvent --> Unknown event type: ${event.data.eventType}`
|
|
@@ -5865,6 +6197,31 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5865
6197
|
}
|
|
5866
6198
|
};
|
|
5867
6199
|
|
|
6200
|
+
/**
|
|
6201
|
+
* Verifies the relay event was delivered for the active LLM session binding.
|
|
6202
|
+
* @param {RelayEvent} event Event object coming from LLM Connection
|
|
6203
|
+
* @returns {boolean}
|
|
6204
|
+
*/
|
|
6205
|
+
private isRelayEventRouteValid(event: RelayEvent): boolean {
|
|
6206
|
+
const route = event?.headers?.route;
|
|
6207
|
+
|
|
6208
|
+
if (!route) {
|
|
6209
|
+
return true;
|
|
6210
|
+
}
|
|
6211
|
+
|
|
6212
|
+
const {llm} = (this as any).webex.internal;
|
|
6213
|
+
const isPracticeSession = llm.isConnected(LLM_PRACTICE_SESSION);
|
|
6214
|
+
const expectedBinding = isPracticeSession
|
|
6215
|
+
? llm.getBinding(LLM_PRACTICE_SESSION)
|
|
6216
|
+
: llm.getBinding();
|
|
6217
|
+
|
|
6218
|
+
if (!expectedBinding || route === expectedBinding) {
|
|
6219
|
+
return true;
|
|
6220
|
+
}
|
|
6221
|
+
|
|
6222
|
+
return false;
|
|
6223
|
+
}
|
|
6224
|
+
|
|
5868
6225
|
/**
|
|
5869
6226
|
* Callback called when a relay event is received from meeting LLM Connection
|
|
5870
6227
|
* @param {RelayEvent} e Event object coming from LLM Connection
|
|
@@ -5872,6 +6229,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5872
6229
|
* @returns {void}
|
|
5873
6230
|
*/
|
|
5874
6231
|
private processRelayEvent = (e: RelayEvent): void => {
|
|
6232
|
+
if (!this.isRelayEventRouteValid(e)) {
|
|
6233
|
+
return;
|
|
6234
|
+
}
|
|
5875
6235
|
switch (e.data.relayType) {
|
|
5876
6236
|
case REACTION_RELAY_TYPES.REACTION:
|
|
5877
6237
|
if (
|
|
@@ -5975,10 +6335,11 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5975
6335
|
*/
|
|
5976
6336
|
private restoreLLMSubscriptionsIfNeeded(): void {
|
|
5977
6337
|
try {
|
|
5978
|
-
|
|
5979
|
-
|
|
6338
|
+
const keepTranscriptionSubscribed =
|
|
6339
|
+
// @ts-ignore
|
|
6340
|
+
this.webex.internal.voicea?.getKeepTranscriptionSubscribed?.();
|
|
5980
6341
|
|
|
5981
|
-
if (!
|
|
6342
|
+
if (!keepTranscriptionSubscribed) {
|
|
5982
6343
|
return;
|
|
5983
6344
|
}
|
|
5984
6345
|
|
|
@@ -6002,6 +6363,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6002
6363
|
*/
|
|
6003
6364
|
private handleLLMOnline = (): void => {
|
|
6004
6365
|
this.restoreLLMSubscriptionsIfNeeded();
|
|
6366
|
+
this.locusInfo.syncAllHashTreeDatasets({onlyLLM: true});
|
|
6005
6367
|
|
|
6006
6368
|
Trigger.trigger(
|
|
6007
6369
|
this,
|
|
@@ -6237,7 +6599,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6237
6599
|
this.webex.internal.llm.off('online', this.handleLLMOnline);
|
|
6238
6600
|
// @ts-ignore
|
|
6239
6601
|
this.webex.internal.llm.on('online', this.handleLLMOnline);
|
|
6240
|
-
this.updateLLMConnection()
|
|
6602
|
+
this.updateLLMConnection({isInitialJoinPhase: true})
|
|
6241
6603
|
.catch((error) => {
|
|
6242
6604
|
LoggerProxy.logger.error(
|
|
6243
6605
|
'Meeting:index#join --> Transcription Socket Connection Failed',
|
|
@@ -6301,8 +6663,57 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6301
6663
|
}
|
|
6302
6664
|
}
|
|
6303
6665
|
|
|
6666
|
+
/**
|
|
6667
|
+
* Removes LLM event listeners and clears the health check timer.
|
|
6668
|
+
* Must be called before Locus /leave to avoid unnecessary syncs triggered
|
|
6669
|
+
* by events received while leaving (per Locus team recommendation).
|
|
6670
|
+
* Idempotent: safe to call multiple times; .off() is a no-op when no
|
|
6671
|
+
* matching listener is registered.
|
|
6672
|
+
* @private
|
|
6673
|
+
* @returns {void}
|
|
6674
|
+
*/
|
|
6675
|
+
private stopListeningForLLMEvents() {
|
|
6676
|
+
// @ts-ignore - fix types
|
|
6677
|
+
this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
|
|
6678
|
+
// @ts-ignore - fix types
|
|
6679
|
+
this.webex.internal.llm.off(LOCUS_LLM_EVENT, this.processLocusLLMEvent);
|
|
6680
|
+
this.clearLLMHealthCheckTimer();
|
|
6681
|
+
}
|
|
6682
|
+
|
|
6683
|
+
/**
|
|
6684
|
+
* Stops listening on every event bus (LLM, Mercury, voicea/transcription,
|
|
6685
|
+
* annotation) that could otherwise deliver events to this meeting while
|
|
6686
|
+
* Locus is processing /leave or /end. Per the Locus team recommendation,
|
|
6687
|
+
* this must run before the Locus request is dispatched to avoid
|
|
6688
|
+
* unnecessary syncs triggered by in-flight events.
|
|
6689
|
+
*
|
|
6690
|
+
* Voicea (transcription) subscribes to llm 'event:relay.event' internally,
|
|
6691
|
+
* and the annotation plugin subscribes to both mercury and llm, so both
|
|
6692
|
+
* must be torn down alongside the direct LLM/Mercury listeners.
|
|
6693
|
+
*
|
|
6694
|
+
* Idempotent: safe to call multiple times; .off() is a no-op when no
|
|
6695
|
+
* matching listener is registered, and stopTranscription is guarded.
|
|
6696
|
+
* @private
|
|
6697
|
+
* @returns {void}
|
|
6698
|
+
*/
|
|
6699
|
+
private stopListeningForMeetingEvents() {
|
|
6700
|
+
this.stopListeningForLLMEvents();
|
|
6701
|
+
this.stopListeningForMercuryEvents();
|
|
6702
|
+
if (this.transcription) {
|
|
6703
|
+
this.stopTranscription();
|
|
6704
|
+
this.transcription = undefined;
|
|
6705
|
+
}
|
|
6706
|
+
this.annotation.deregisterEvents();
|
|
6707
|
+
}
|
|
6708
|
+
|
|
6304
6709
|
/**
|
|
6305
6710
|
* Disconnects and cleans up the default LLM session listeners/timers.
|
|
6711
|
+
*
|
|
6712
|
+
* Ownership-aware: only calls `disconnectLLM` when this meeting is the
|
|
6713
|
+
* current owner of the default LLM session (or when no owner is recorded).
|
|
6714
|
+
* Event listeners belonging to this meeting instance are always detached
|
|
6715
|
+
* so they do not receive another meeting's relay events.
|
|
6716
|
+
*
|
|
6306
6717
|
* @param {Object} options
|
|
6307
6718
|
* @param {boolean} [options.removeOnlineListener=true] removes the one-time online listener
|
|
6308
6719
|
* @param {boolean} [options.throwOnError=true] rethrows disconnect errors when true
|
|
@@ -6315,12 +6726,29 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6315
6726
|
removeOnlineListener?: boolean;
|
|
6316
6727
|
throwOnError?: boolean;
|
|
6317
6728
|
} = {}): Promise<void> => {
|
|
6729
|
+
// @ts-ignore - Fix type
|
|
6730
|
+
// @ts-ignore - Fix type
|
|
6731
|
+
const {currentOwner, isOwner} = this.webex.internal.llm.resolveSessionOwnership(
|
|
6732
|
+
this.id,
|
|
6733
|
+
LLM_DEFAULT_SESSION
|
|
6734
|
+
);
|
|
6735
|
+
|
|
6318
6736
|
try {
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6737
|
+
if (isOwner) {
|
|
6738
|
+
// @ts-ignore - Fix type
|
|
6739
|
+
await this.webex.internal.llm.disconnectLLM(
|
|
6740
|
+
{
|
|
6741
|
+
code: 3050,
|
|
6742
|
+
reason: 'done (permanent)',
|
|
6743
|
+
},
|
|
6744
|
+
LLM_DEFAULT_SESSION,
|
|
6745
|
+
this.id
|
|
6746
|
+
);
|
|
6747
|
+
} else {
|
|
6748
|
+
LoggerProxy.logger.info(
|
|
6749
|
+
`Meeting:index#cleanupLLMConneciton --> skipping disconnect; LLM owned by meeting ${currentOwner}, not ${this.id}`
|
|
6750
|
+
);
|
|
6751
|
+
}
|
|
6324
6752
|
} catch (error) {
|
|
6325
6753
|
LoggerProxy.logger.error(
|
|
6326
6754
|
'Meeting:index#cleanupLLMConneciton --> Failed to disconnect default LLM session',
|
|
@@ -6335,23 +6763,33 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6335
6763
|
// @ts-ignore - Fix type
|
|
6336
6764
|
this.webex.internal.llm.off('online', this.handleLLMOnline);
|
|
6337
6765
|
}
|
|
6338
|
-
|
|
6339
|
-
this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
|
|
6340
|
-
// @ts-ignore - Fix type
|
|
6341
|
-
this.webex.internal.llm.off(LOCUS_LLM_EVENT, this.processLocusLLMEvent);
|
|
6766
|
+
this.stopListeningForLLMEvents();
|
|
6342
6767
|
|
|
6343
|
-
|
|
6768
|
+
// Re-check ownership after awaiting disconnectLLM. If ownership changed
|
|
6769
|
+
// while cleanup was in flight, do not clear another meeting's owner tag.
|
|
6770
|
+
if (isOwner) {
|
|
6771
|
+
const {currentOwner: currentOwnerAfterCleanup} =
|
|
6772
|
+
// @ts-ignore - Fix type
|
|
6773
|
+
this.webex.internal.llm.resolveSessionOwnership(this.id, LLM_DEFAULT_SESSION);
|
|
6774
|
+
|
|
6775
|
+
if (currentOwnerAfterCleanup === this.id) {
|
|
6776
|
+
// @ts-ignore - Fix type
|
|
6777
|
+
this.webex.internal.llm.setOwnerMeetingId?.(undefined);
|
|
6778
|
+
}
|
|
6779
|
+
}
|
|
6344
6780
|
}
|
|
6345
6781
|
};
|
|
6346
6782
|
|
|
6347
6783
|
/**
|
|
6348
|
-
* Clears
|
|
6349
|
-
*
|
|
6784
|
+
* Clears data channel tokens associated with this meeting ownership.
|
|
6785
|
+
* Ownership checks are enforced in internal-plugin-llm.
|
|
6350
6786
|
* @returns {void}
|
|
6351
6787
|
*/
|
|
6352
6788
|
clearDataChannelToken(): void {
|
|
6353
6789
|
// @ts-ignore
|
|
6354
|
-
this.webex.internal.llm.
|
|
6790
|
+
this.webex.internal.llm.clearDatachannelToken(LLM_DEFAULT_SESSION, this.id);
|
|
6791
|
+
// @ts-ignore
|
|
6792
|
+
this.webex.internal.llm.clearDatachannelToken(LLM_PRACTICE_SESSION, this.id);
|
|
6355
6793
|
}
|
|
6356
6794
|
|
|
6357
6795
|
/**
|
|
@@ -6366,14 +6804,15 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6366
6804
|
|
|
6367
6805
|
if (datachannelToken) {
|
|
6368
6806
|
// @ts-ignore
|
|
6369
|
-
this.webex.internal.llm.setDatachannelToken(datachannelToken,
|
|
6807
|
+
this.webex.internal.llm.setDatachannelToken(datachannelToken, LLM_DEFAULT_SESSION, this.id);
|
|
6370
6808
|
}
|
|
6371
6809
|
|
|
6372
6810
|
if (practiceSessionDatachannelToken) {
|
|
6373
6811
|
// @ts-ignore
|
|
6374
6812
|
this.webex.internal.llm.setDatachannelToken(
|
|
6375
6813
|
practiceSessionDatachannelToken,
|
|
6376
|
-
|
|
6814
|
+
LLM_PRACTICE_SESSION,
|
|
6815
|
+
this.id
|
|
6377
6816
|
);
|
|
6378
6817
|
}
|
|
6379
6818
|
}
|
|
@@ -6386,7 +6825,10 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6386
6825
|
private async ensureDefaultDatachannelTokenAfterAdmit(): Promise<boolean> {
|
|
6387
6826
|
try {
|
|
6388
6827
|
// @ts-ignore
|
|
6389
|
-
const datachannelToken = this.webex.internal.llm.getDatachannelToken(
|
|
6828
|
+
const datachannelToken = this.webex.internal.llm.getDatachannelToken(
|
|
6829
|
+
LLM_DEFAULT_SESSION,
|
|
6830
|
+
this.id
|
|
6831
|
+
);
|
|
6390
6832
|
// @ts-ignore
|
|
6391
6833
|
const isDataChannelTokenEnabled = await this.webex.internal.llm.isDataChannelTokenEnabled();
|
|
6392
6834
|
|
|
@@ -6408,7 +6850,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6408
6850
|
// @ts-ignore
|
|
6409
6851
|
this.webex.internal.llm.setDatachannelToken(
|
|
6410
6852
|
fetchedDatachannelToken,
|
|
6411
|
-
|
|
6853
|
+
LLM_DEFAULT_SESSION,
|
|
6854
|
+
this.id
|
|
6412
6855
|
);
|
|
6413
6856
|
|
|
6414
6857
|
return true;
|
|
@@ -6427,23 +6870,68 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6427
6870
|
/**
|
|
6428
6871
|
* Connects to low latency mercury and reconnects if the address has changed
|
|
6429
6872
|
* It will also disconnect if called when the meeting has ended
|
|
6873
|
+
* @param {Object} [options]
|
|
6874
|
+
* @param {boolean} [options.isInitialJoinPhase] true when called from initial join flow
|
|
6430
6875
|
* @returns {Promise}
|
|
6431
6876
|
*/
|
|
6432
|
-
async updateLLMConnection() {
|
|
6877
|
+
async updateLLMConnection({isInitialJoinPhase = false}: {isInitialJoinPhase?: boolean} = {}) {
|
|
6433
6878
|
// @ts-ignore - Fix type
|
|
6434
6879
|
const {url = undefined, info: {datachannelUrl = undefined} = {}} = this.locusInfo || {};
|
|
6435
6880
|
|
|
6436
6881
|
const isJoined = this.isJoined();
|
|
6437
6882
|
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6883
|
+
const dataChannelUrl = datachannelUrl;
|
|
6884
|
+
|
|
6885
|
+
// Ownership guard: when the default LLM session is already connected and
|
|
6886
|
+
// owned by a *different* Meeting instance, do not disconnect or reconfigure
|
|
6887
|
+
// it. Another meeting's `updateLLMConnection` must be ignored here to
|
|
6888
|
+
// avoid killing the socket it relies on. We only proceed to manage the
|
|
6889
|
+
// connection when this meeting is the current owner, or when no owner is
|
|
6890
|
+
// set yet (first claim).
|
|
6891
|
+
// @ts-ignore - Fix type
|
|
6892
|
+
const {currentOwner} = this.webex.internal.llm.resolveSessionOwnership(
|
|
6893
|
+
this.id,
|
|
6894
|
+
LLM_DEFAULT_SESSION
|
|
6441
6895
|
);
|
|
6442
6896
|
|
|
6443
|
-
|
|
6897
|
+
// Capture connectivity before any reconnect attempt. If LLM was already
|
|
6898
|
+
// connected, we must respect current ownership. If it was disconnected,
|
|
6899
|
+
// this flow may reclaim stale owner tags after a fresh connect.
|
|
6900
|
+
// @ts-ignore - Fix type
|
|
6901
|
+
const wasConnected = this.webex.internal.llm.isConnected();
|
|
6902
|
+
|
|
6903
|
+
// Prefer ownership-scoped token read. For disconnected stale-owner reclaim
|
|
6904
|
+
// flows, fallback to ownerless read so initial register can still carry a
|
|
6905
|
+
// token and recover from stale ownership without 401/403 dead-end.
|
|
6906
|
+
// @ts-ignore - Fix type
|
|
6907
|
+
let datachannelToken = this.webex.internal.llm.getDatachannelToken(
|
|
6908
|
+
LLM_DEFAULT_SESSION,
|
|
6909
|
+
this.id
|
|
6910
|
+
);
|
|
6911
|
+
|
|
6912
|
+
if (!datachannelToken && !wasConnected && currentOwner && currentOwner !== this.id) {
|
|
6913
|
+
// @ts-ignore - Fix type
|
|
6914
|
+
datachannelToken = this.webex.internal.llm.getDatachannelToken(LLM_DEFAULT_SESSION);
|
|
6915
|
+
}
|
|
6444
6916
|
|
|
6445
6917
|
// @ts-ignore - Fix type
|
|
6446
|
-
if (
|
|
6918
|
+
if (wasConnected) {
|
|
6919
|
+
if (currentOwner && currentOwner !== this.id) {
|
|
6920
|
+
// Another meeting owns the live LLM socket. We must not disconnect
|
|
6921
|
+
// or reconfigure it -- doing so would tear down a session the
|
|
6922
|
+
// owning meeting still relies on. Locus/datachannel URL mismatch is
|
|
6923
|
+
// expected here (each meeting has its own locus URL) and is NOT a
|
|
6924
|
+
// valid signal of staleness, so we never reclaim from this path.
|
|
6925
|
+
// The only safe reclaim mechanism is the `finally`-block owner-tag
|
|
6926
|
+
// release in `cleanupLLMConneciton`, which fires when this meeting
|
|
6927
|
+
// itself is being torn down.
|
|
6928
|
+
LoggerProxy.logger.info(
|
|
6929
|
+
`Meeting:index#updateLLMConnection --> skipping; LLM owned by meeting ${currentOwner}, not ${this.id}`
|
|
6930
|
+
);
|
|
6931
|
+
|
|
6932
|
+
return undefined;
|
|
6933
|
+
}
|
|
6934
|
+
|
|
6447
6935
|
if (
|
|
6448
6936
|
// @ts-ignore - Fix type
|
|
6449
6937
|
url === this.webex.internal.llm.getLocusUrl() &&
|
|
@@ -6460,10 +6948,56 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6460
6948
|
return undefined;
|
|
6461
6949
|
}
|
|
6462
6950
|
|
|
6951
|
+
// Bind refresh handler before registration so interceptor-triggered token
|
|
6952
|
+
// refresh during register POST can resolve a valid handler.
|
|
6953
|
+
// Prefer this meeting as owner, but allow owner-less fallback when a stale
|
|
6954
|
+
// foreign owner tag is present on a disconnected session.
|
|
6955
|
+
const refreshHandlerOwnerMeetingId =
|
|
6956
|
+
currentOwner && currentOwner !== this.id ? undefined : this.id;
|
|
6957
|
+
const shouldAlignRefreshHandlerAfterOwnershipClaim = refreshHandlerOwnerMeetingId !== this.id;
|
|
6958
|
+
// @ts-ignore - Fix type
|
|
6959
|
+
this.webex.internal.llm.setRefreshHandler(
|
|
6960
|
+
() => this.refreshDataChannelToken(),
|
|
6961
|
+
LLM_DEFAULT_SESSION,
|
|
6962
|
+
refreshHandlerOwnerMeetingId
|
|
6963
|
+
);
|
|
6964
|
+
|
|
6463
6965
|
// @ts-ignore - Fix type
|
|
6464
6966
|
return this.webex.internal.llm
|
|
6465
6967
|
.registerAndConnect(url, dataChannelUrl, datachannelToken)
|
|
6466
6968
|
.then((registerAndConnectResult) => {
|
|
6969
|
+
this.locusInfo.syncAllHashTreeDatasets({onlyLLM: true});
|
|
6970
|
+
// Record ownership of the default LLM session for this meeting so
|
|
6971
|
+
// subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
|
|
6972
|
+
// calls can detect and skip work that doesn't belong to them.
|
|
6973
|
+
// @ts-ignore - Fix type
|
|
6974
|
+
const {isOwner} = this.webex.internal.llm.resolveSessionOwnership(
|
|
6975
|
+
this.id,
|
|
6976
|
+
LLM_DEFAULT_SESSION
|
|
6977
|
+
);
|
|
6978
|
+
const canReclaimAfterDisconnectedStart = !wasConnected;
|
|
6979
|
+
|
|
6980
|
+
// Refresh handler is pre-bound before registerAndConnect so token
|
|
6981
|
+
// refresh can work even during the registration request itself.
|
|
6982
|
+
if (isOwner || canReclaimAfterDisconnectedStart) {
|
|
6983
|
+
// Record ownership of the default LLM session for this meeting so
|
|
6984
|
+
// subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
|
|
6985
|
+
// calls can detect and skip work that doesn't belong to them.
|
|
6986
|
+
// @ts-ignore - Fix type
|
|
6987
|
+
this.webex.internal.llm.setOwnerMeetingId?.(this.id);
|
|
6988
|
+
|
|
6989
|
+
// If we pre-bound refresh ownerlessly (stale-owner reclaim path),
|
|
6990
|
+
// align the handler with the newly claimed owner immediately after
|
|
6991
|
+
// ownership is updated.
|
|
6992
|
+
if (shouldAlignRefreshHandlerAfterOwnershipClaim) {
|
|
6993
|
+
// @ts-ignore - Fix type
|
|
6994
|
+
this.webex.internal.llm.setRefreshHandler(
|
|
6995
|
+
() => this.refreshDataChannelToken(),
|
|
6996
|
+
LLM_DEFAULT_SESSION,
|
|
6997
|
+
this.id
|
|
6998
|
+
);
|
|
6999
|
+
}
|
|
7000
|
+
}
|
|
6467
7001
|
// @ts-ignore - Fix type
|
|
6468
7002
|
this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
|
|
6469
7003
|
// @ts-ignore - Fix type
|
|
@@ -6478,10 +7012,114 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6478
7012
|
|
|
6479
7013
|
this.startLLMHealthCheckTimer();
|
|
6480
7014
|
|
|
7015
|
+
if (registerAndConnectResult) {
|
|
7016
|
+
if (isInitialJoinPhase) {
|
|
7017
|
+
this.sendLLMConnectMetric(registerAndConnectResult);
|
|
7018
|
+
}
|
|
7019
|
+
|
|
7020
|
+
this.breakouts?.trigger(BREAKOUTS.EVENTS.LLM_CONNECT_RESPONSE, {
|
|
7021
|
+
meeting: this,
|
|
7022
|
+
llmLatency: registerAndConnectResult,
|
|
7023
|
+
});
|
|
7024
|
+
}
|
|
7025
|
+
|
|
6481
7026
|
return Promise.resolve(registerAndConnectResult);
|
|
7027
|
+
})
|
|
7028
|
+
.catch((error) => {
|
|
7029
|
+
// Prefer the partial timing registerAndConnect attaches when register succeeded but the
|
|
7030
|
+
// websocket connect() failed, so a ws failure isn't misreported as register never completing.
|
|
7031
|
+
const llmLatency = {
|
|
7032
|
+
clientLLMDatachannelResponseTime: error?.timing?.clientLLMDatachannelResponseTime ?? 0,
|
|
7033
|
+
clientLLMWebSocketConnectTime: 0,
|
|
7034
|
+
};
|
|
7035
|
+
|
|
7036
|
+
if (isInitialJoinPhase) {
|
|
7037
|
+
this.sendLLMConnectMetric(llmLatency, error);
|
|
7038
|
+
}
|
|
7039
|
+
|
|
7040
|
+
this.breakouts?.trigger(BREAKOUTS.EVENTS.LLM_CONNECT_RESPONSE, {
|
|
7041
|
+
meeting: this,
|
|
7042
|
+
llmLatency,
|
|
7043
|
+
error,
|
|
7044
|
+
});
|
|
7045
|
+
|
|
7046
|
+
return Promise.reject(error);
|
|
6482
7047
|
});
|
|
6483
7048
|
}
|
|
6484
7049
|
|
|
7050
|
+
/**
|
|
7051
|
+
* Ensures breakout join response metric with LLM latency is emitted only once per breakout move id.
|
|
7052
|
+
* @param {string | undefined} breakoutMoveId
|
|
7053
|
+
* @param {boolean} [hasLLMLatency=false]
|
|
7054
|
+
* @returns {boolean}
|
|
7055
|
+
*/
|
|
7056
|
+
private shouldEmitBreakoutJoinResponseMetric(
|
|
7057
|
+
breakoutMoveId?: string,
|
|
7058
|
+
hasLLMLatency = false
|
|
7059
|
+
): boolean {
|
|
7060
|
+
if (!breakoutMoveId) {
|
|
7061
|
+
return false;
|
|
7062
|
+
}
|
|
7063
|
+
|
|
7064
|
+
if (!hasLLMLatency) {
|
|
7065
|
+
// When automatic LLM is enabled, updateLLMConnection will emit this same breakout join
|
|
7066
|
+
// response after the LLM connection finishes, including llmLatency and llmWebsocketUrl.
|
|
7067
|
+
// Suppress the earlier non-LLM event to avoid sending two events for the same move id,
|
|
7068
|
+
// where the first one would be missing the LLM-specific fields we want to validate.
|
|
7069
|
+
// @ts-ignore - config coming from registerPlugin
|
|
7070
|
+
return !this.config.enableAutomaticLLM;
|
|
7071
|
+
}
|
|
7072
|
+
|
|
7073
|
+
if (this.emittedBreakoutJoinResponseMoveIds.has(breakoutMoveId)) {
|
|
7074
|
+
return false;
|
|
7075
|
+
}
|
|
7076
|
+
|
|
7077
|
+
this.emittedBreakoutJoinResponseMoveIds.add(breakoutMoveId);
|
|
7078
|
+
|
|
7079
|
+
return true;
|
|
7080
|
+
}
|
|
7081
|
+
|
|
7082
|
+
/**
|
|
7083
|
+
* Sends LLM connect latencies for initial join flow.
|
|
7084
|
+
* @param {RegisterAndConnectTiming} timings
|
|
7085
|
+
* @param {any} [error]
|
|
7086
|
+
* @returns {void}
|
|
7087
|
+
*/
|
|
7088
|
+
private sendLLMConnectMetric(timings: RegisterAndConnectTiming, error?: any) {
|
|
7089
|
+
// @ts-ignore
|
|
7090
|
+
const llmWebsocketUrl = this.webex.internal.llm.getWebSocketUrl?.() || undefined;
|
|
7091
|
+
const {clientLLMDatachannelResponseTime = 0, clientLLMWebSocketConnectTime} = timings || {};
|
|
7092
|
+
|
|
7093
|
+
const llmLatency: any = {
|
|
7094
|
+
clientLLMDatachannelResponseTime,
|
|
7095
|
+
};
|
|
7096
|
+
|
|
7097
|
+
if (clientLLMWebSocketConnectTime !== undefined) {
|
|
7098
|
+
llmLatency.clientLLMWebSocketConnectTime = clientLLMWebSocketConnectTime;
|
|
7099
|
+
}
|
|
7100
|
+
|
|
7101
|
+
const payload: any = {
|
|
7102
|
+
identifiers: {
|
|
7103
|
+
llmWebsocketUrl,
|
|
7104
|
+
},
|
|
7105
|
+
llmLatency,
|
|
7106
|
+
};
|
|
7107
|
+
|
|
7108
|
+
const options: any = {
|
|
7109
|
+
meetingId: this.id,
|
|
7110
|
+
...(error && {rawError: error}),
|
|
7111
|
+
};
|
|
7112
|
+
|
|
7113
|
+
const metricEvent = {
|
|
7114
|
+
name: 'client.llm.connect.response',
|
|
7115
|
+
payload,
|
|
7116
|
+
options,
|
|
7117
|
+
};
|
|
7118
|
+
|
|
7119
|
+
// @ts-ignore
|
|
7120
|
+
this.webex.internal.newMetrics.submitClientEvent(metricEvent);
|
|
7121
|
+
}
|
|
7122
|
+
|
|
6485
7123
|
/**
|
|
6486
7124
|
* Use phone for meeting audio
|
|
6487
7125
|
* @param {String} phoneNumber If provided, it will dial-out using this number. If not provided, dial-in will be used
|
|
@@ -6909,16 +7547,32 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6909
7547
|
// @ts-ignore
|
|
6910
7548
|
const cdl = this.webex.internal.newMetrics.callDiagnosticLatencies;
|
|
6911
7549
|
|
|
7550
|
+
// Compute the offer->answer latency from when the local SDP offer was generated up to now,
|
|
7551
|
+
// rather than from the stored remote-sdp-received timestamp. That stored timestamp uses
|
|
7552
|
+
// saveFirstTimestampOnly, so if waitForRemoteSDPAnswer() already timed out and submitted a
|
|
7553
|
+
// remote-sdp-received event, the stored value would be pinned to the timeout time and would
|
|
7554
|
+
// under-report an answer that arrives late. This handler fires exactly when the answer is
|
|
7555
|
+
// processed, so Date.now() is the accurate "received" time.
|
|
7556
|
+
// (submitClientEvent below still records the remote-sdp-received timestamp used by the CA
|
|
7557
|
+
// join-time metric, so we don't need to save it here.)
|
|
7558
|
+
const localSdpGeneratedTimestamp = cdl.latencyTimestamps.get(
|
|
7559
|
+
'client.media-engine.local-sdp-generated'
|
|
7560
|
+
);
|
|
7561
|
+
const localSDPGenRemoteSDPRecv =
|
|
7562
|
+
localSdpGeneratedTimestamp !== undefined
|
|
7563
|
+
? Date.now() - localSdpGeneratedTimestamp
|
|
7564
|
+
: undefined;
|
|
7565
|
+
|
|
6912
7566
|
// @ts-ignore
|
|
6913
7567
|
this.webex.internal.newMetrics.submitClientEvent({
|
|
6914
7568
|
name: 'client.media-engine.remote-sdp-received',
|
|
7569
|
+
payload: {
|
|
7570
|
+
eventData: {
|
|
7571
|
+
localSDPGenRemoteSDPRecv,
|
|
7572
|
+
},
|
|
7573
|
+
},
|
|
6915
7574
|
options: {meetingId: this.id},
|
|
6916
7575
|
});
|
|
6917
|
-
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ROAP_OFFER_TO_ANSWER_LATENCY, {
|
|
6918
|
-
correlation_id: this.correlationId,
|
|
6919
|
-
latency: cdl.getLocalSDPGenRemoteSDPRecv(),
|
|
6920
|
-
meetingId: this.id,
|
|
6921
|
-
});
|
|
6922
7576
|
|
|
6923
7577
|
if (this.deferSDPAnswer) {
|
|
6924
7578
|
this.deferSDPAnswer.resolve();
|
|
@@ -7504,23 +8158,108 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7504
8158
|
}
|
|
7505
8159
|
}
|
|
7506
8160
|
});
|
|
8161
|
+
this.statsAnalyzer.on(StatsAnalyzerEventNames.STATS_UPDATE, (data) => {
|
|
8162
|
+
// Extract srtpCipher from transport stats
|
|
8163
|
+
let srtpCipher: string | undefined;
|
|
8164
|
+
for (const stats of data.stats.values()) {
|
|
8165
|
+
if (stats.type === 'transport' && stats.srtpCipher) {
|
|
8166
|
+
srtpCipher = stats.srtpCipher as string;
|
|
8167
|
+
break;
|
|
8168
|
+
}
|
|
8169
|
+
}
|
|
8170
|
+
|
|
8171
|
+
// Only emit event if srtpCipher has changed
|
|
8172
|
+
if (srtpCipher && srtpCipher !== this.mediaProperties.srtpCipher) {
|
|
8173
|
+
LoggerProxy.logger.info(
|
|
8174
|
+
`Meeting:index#setupStatsAnalyzerEventHandlers --> SRTP cipher changed from ${this.mediaProperties.srtpCipher} to ${srtpCipher}`
|
|
8175
|
+
);
|
|
8176
|
+
this.mediaProperties.srtpCipher = srtpCipher;
|
|
8177
|
+
Trigger.trigger(
|
|
8178
|
+
this,
|
|
8179
|
+
{
|
|
8180
|
+
file: 'meeting/index',
|
|
8181
|
+
function: 'setupStatsAnalyzerEventHandlers',
|
|
8182
|
+
},
|
|
8183
|
+
EVENT_TRIGGERS.MEETING_SRTP_CIPHER_UPDATED,
|
|
8184
|
+
{srtpCipher}
|
|
8185
|
+
);
|
|
8186
|
+
}
|
|
8187
|
+
});
|
|
7507
8188
|
};
|
|
7508
8189
|
|
|
7509
8190
|
getMediaConnectionDebugId() {
|
|
7510
8191
|
return `MC-${this.id.substring(0, 4)}`;
|
|
7511
8192
|
}
|
|
7512
8193
|
|
|
8194
|
+
/**
|
|
8195
|
+
* Checks if the error indicates that Locus dropped us from the meeting,
|
|
8196
|
+
* either directly on the error or wrapped inside an AddMediaFailed cause.
|
|
8197
|
+
* This method is meant to be called only with errors thrown by Meeting.addMediaInternal()
|
|
8198
|
+
*
|
|
8199
|
+
* @param {Error} error
|
|
8200
|
+
* @returns {boolean}
|
|
8201
|
+
*/
|
|
8202
|
+
private isErrorMeaningLocusDroppedUs(error: Error | undefined): boolean {
|
|
8203
|
+
const statusCode = (error as any)?.statusCode;
|
|
8204
|
+
const causeStatusCode = (error as any)?.cause?.statusCode;
|
|
8205
|
+
|
|
8206
|
+
return (
|
|
8207
|
+
statusCode === 409 || statusCode === 403 || causeStatusCode === 409 || causeStatusCode === 403
|
|
8208
|
+
);
|
|
8209
|
+
}
|
|
8210
|
+
|
|
8211
|
+
private isLocusUserFullError(error: Error | undefined): boolean {
|
|
8212
|
+
return (error as any)?.error?.body?.errorCode === LocusErrorCodes.LOCUS_USER_FULL;
|
|
8213
|
+
}
|
|
8214
|
+
|
|
8215
|
+
/**
|
|
8216
|
+
* Determines if the next media attempt should use only TURN-TLS (iceTransportPolicy='relay').
|
|
8217
|
+
* We do this in the hope that it will minimize the chance of Homer sending DTLS packets on a wrong
|
|
8218
|
+
* transport (as there will be only 1 transport) and dealing with firewalls that let STUN packets through, but block
|
|
8219
|
+
* other UDP traffic.
|
|
8220
|
+
*
|
|
8221
|
+
* For clients landing on video mesh nodes (VMN), reachability might still have successful TLS (to public nodes)
|
|
8222
|
+
* but TURN discovery will result in empty TURN urls array and iceTransportPolicy='relay' will still be overriden to undefined,
|
|
8223
|
+
* see the code in establishMediaConnection()
|
|
8224
|
+
*
|
|
8225
|
+
* @param {Error} prevError - The error from the previous addMedia attempt
|
|
8226
|
+
* @returns {Promise<boolean>}
|
|
8227
|
+
*/
|
|
8228
|
+
private async shouldRetryMediaWithOnlyTurnTLS(prevError: Error | undefined): Promise<boolean> {
|
|
8229
|
+
if (
|
|
8230
|
+
this.isMultistream &&
|
|
8231
|
+
prevError instanceof AddMediaFailed &&
|
|
8232
|
+
prevError.isDtlsHandshakeFailure &&
|
|
8233
|
+
prevError.connectionType === 'UDP'
|
|
8234
|
+
) {
|
|
8235
|
+
const hasTlsReachability =
|
|
8236
|
+
// @ts-ignore
|
|
8237
|
+
await this.webex.meetings.reachability.isAnyClusterReachableViaProtocol('xtls');
|
|
8238
|
+
|
|
8239
|
+
if (hasTlsReachability) {
|
|
8240
|
+
LoggerProxy.logger.info(
|
|
8241
|
+
'Meeting:index#shouldRetryMediaWithOnlyTurnTLS --> previous attempt failed due to DTLS handshake failure over UDP and TLS reachability is available'
|
|
8242
|
+
);
|
|
8243
|
+
|
|
8244
|
+
return true;
|
|
8245
|
+
}
|
|
8246
|
+
}
|
|
8247
|
+
|
|
8248
|
+
return false;
|
|
8249
|
+
}
|
|
8250
|
+
|
|
7513
8251
|
/**
|
|
7514
8252
|
* Creates a webrtc media connection and publishes streams to it
|
|
7515
8253
|
*
|
|
7516
8254
|
* @param {Object} turnServerInfo TURN server information
|
|
7517
8255
|
* @param {BundlePolicy} [bundlePolicy] Bundle policy settings
|
|
7518
|
-
* @param {
|
|
8256
|
+
* @param {RTCIceTransportPolicy} [iceTransportPolicy] ICE transport policy override
|
|
7519
8257
|
* @returns {RoapMediaConnection | MultistreamRoapMediaConnection}
|
|
7520
8258
|
*/
|
|
7521
8259
|
private async createMediaConnection(
|
|
7522
8260
|
turnServerInfo?: TurnServerInfo,
|
|
7523
|
-
bundlePolicy?: BundlePolicy
|
|
8261
|
+
bundlePolicy?: BundlePolicy,
|
|
8262
|
+
iceTransportPolicy?: RTCIceTransportPolicy
|
|
7524
8263
|
) {
|
|
7525
8264
|
this.rtcMetrics = this.isMultistream
|
|
7526
8265
|
? // @ts-ignore
|
|
@@ -7544,12 +8283,15 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7544
8283
|
enableExtmap: this.config.enableExtmap,
|
|
7545
8284
|
turnServerInfo,
|
|
7546
8285
|
bundlePolicy,
|
|
8286
|
+
iceTransportPolicy,
|
|
7547
8287
|
// @ts-ignore - config coming from registerPlugin
|
|
7548
8288
|
iceCandidatesTimeout: this.config.iceCandidatesGatheringTimeout,
|
|
7549
8289
|
// @ts-ignore - config coming from registerPlugin
|
|
7550
8290
|
disableAudioMainDtx: this.config.experimental.disableAudioMainDtx,
|
|
7551
8291
|
// @ts-ignore - config coming from registerPlugin
|
|
7552
8292
|
enableAudioTwcc: this.config.enableAudioTwccForMultistream,
|
|
8293
|
+
// @ts-ignore - config coming from registerPlugin
|
|
8294
|
+
enableAv1SlidesSupport: this.config.enableAv1SlidesSupport,
|
|
7553
8295
|
stopIceGatheringAfterFirstRelayCandidate:
|
|
7554
8296
|
// @ts-ignore - config coming from registerPlugin
|
|
7555
8297
|
this.config.stopIceGatheringAfterFirstRelayCandidate,
|
|
@@ -7569,6 +8311,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7569
8311
|
this.mediaProperties.mediaDirection.receiveShare,
|
|
7570
8312
|
];
|
|
7571
8313
|
|
|
8314
|
+
this.sendSlotManager.reset();
|
|
7572
8315
|
this.sendSlotManager.createSlot(mc, MediaType.VideoMain, videoEnabled);
|
|
7573
8316
|
this.sendSlotManager.createSlot(mc, MediaType.AudioMain, audioEnabled);
|
|
7574
8317
|
this.sendSlotManager.createSlot(mc, MediaType.VideoSlides, shareEnabled);
|
|
@@ -7668,7 +8411,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7668
8411
|
try {
|
|
7669
8412
|
await this.mediaProperties.waitForMediaConnectionConnected(this.correlationId);
|
|
7670
8413
|
} catch (error) {
|
|
7671
|
-
const {iceConnected} = error;
|
|
8414
|
+
const {iceConnected} = error as MediaConnectionAwaiterFailureResult;
|
|
7672
8415
|
|
|
7673
8416
|
if (!this.hasMediaConnectionConnectedAtLeastOnce) {
|
|
7674
8417
|
// Only send CA event for join flow if we haven't successfully connected media yet
|
|
@@ -7708,13 +8451,12 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7708
8451
|
});
|
|
7709
8452
|
}
|
|
7710
8453
|
|
|
7711
|
-
|
|
7712
|
-
`Timed out waiting for media connection to be connected, correlationId=${this.correlationId}
|
|
8454
|
+
throw new MediaConnectionTimedOutError(
|
|
8455
|
+
`Timed out waiting for media connection to be connected, correlationId=${this.correlationId}`,
|
|
8456
|
+
iceConnected,
|
|
8457
|
+
// keep reference to the original rejected result (which is the object the SDK reports to CA as rawError above)
|
|
8458
|
+
error
|
|
7713
8459
|
);
|
|
7714
|
-
|
|
7715
|
-
timedOutError.cause = error;
|
|
7716
|
-
|
|
7717
|
-
throw timedOutError;
|
|
7718
8460
|
}
|
|
7719
8461
|
}
|
|
7720
8462
|
|
|
@@ -7760,12 +8502,12 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7760
8502
|
return !member.isSelf && !member.isPairedWithSelf && !member.isAudioMuted;
|
|
7761
8503
|
});
|
|
7762
8504
|
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
this.
|
|
7768
|
-
);
|
|
8505
|
+
// we also ignore any issues while we're waiting in the lobby, as we're not receiving any audio yet
|
|
8506
|
+
if (atLeastOneUnmutedOtherMember && !this.isUserUnadmitted) {
|
|
8507
|
+
this.mediaProperties.sendMediaIssueMetric('inbound_audio', data.issueSubType, {
|
|
8508
|
+
correlationId: this.correlationId,
|
|
8509
|
+
isMultistream: this.isMultistream,
|
|
8510
|
+
});
|
|
7769
8511
|
|
|
7770
8512
|
Trigger.trigger(
|
|
7771
8513
|
this,
|
|
@@ -7927,7 +8669,18 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7927
8669
|
error
|
|
7928
8670
|
);
|
|
7929
8671
|
|
|
7930
|
-
|
|
8672
|
+
const {connectionType, selectedCandidatePairChanges, numTransports} =
|
|
8673
|
+
await this.mediaProperties.getCurrentConnectionInfo();
|
|
8674
|
+
|
|
8675
|
+
const iceConnected = error instanceof MediaConnectionTimedOutError && error.iceConnected;
|
|
8676
|
+
|
|
8677
|
+
throw new AddMediaFailed({
|
|
8678
|
+
cause: error,
|
|
8679
|
+
connectionType,
|
|
8680
|
+
selectedCandidatePairChanges,
|
|
8681
|
+
numTransports,
|
|
8682
|
+
iceConnected,
|
|
8683
|
+
});
|
|
7931
8684
|
}
|
|
7932
8685
|
}
|
|
7933
8686
|
|
|
@@ -8002,7 +8755,21 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8002
8755
|
({turnServerInfo} = await this.doTurnDiscovery(isReconnecting, isForced));
|
|
8003
8756
|
}
|
|
8004
8757
|
|
|
8005
|
-
|
|
8758
|
+
if (
|
|
8759
|
+
(!turnServerInfo || !turnServerInfo.urls?.length) &&
|
|
8760
|
+
this.addMediaData.iceTransportPolicy === 'relay'
|
|
8761
|
+
) {
|
|
8762
|
+
LoggerProxy.logger.info(
|
|
8763
|
+
`${LOG_HEADER} cannot do iceTransportPolicy=relay, because there is no turn server info available`
|
|
8764
|
+
);
|
|
8765
|
+
// drop the forced relay policy and use the default, because we don't have a TURN server
|
|
8766
|
+
this.addMediaData.iceTransportPolicy = undefined;
|
|
8767
|
+
}
|
|
8768
|
+
const mediaConnection = await this.createMediaConnection(
|
|
8769
|
+
turnServerInfo,
|
|
8770
|
+
bundlePolicy,
|
|
8771
|
+
this.addMediaData.iceTransportPolicy
|
|
8772
|
+
);
|
|
8006
8773
|
|
|
8007
8774
|
LoggerProxy.logger.info(
|
|
8008
8775
|
`${LOG_HEADER} media connection created this.isMultistream=${this.isMultistream}`
|
|
@@ -8039,7 +8806,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8039
8806
|
await this.remoteMediaManager.start();
|
|
8040
8807
|
}
|
|
8041
8808
|
|
|
8042
|
-
await
|
|
8809
|
+
await mediaConnection.initiateOffer();
|
|
8043
8810
|
|
|
8044
8811
|
await this.waitForRemoteSDPAnswer();
|
|
8045
8812
|
|
|
@@ -8107,6 +8874,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8107
8874
|
|
|
8108
8875
|
this.isMultistream = false;
|
|
8109
8876
|
|
|
8877
|
+
// reset iceTransportPolicy, because it's only applied for multistream media connections
|
|
8878
|
+
this.addMediaData.iceTransportPolicy = undefined;
|
|
8879
|
+
|
|
8110
8880
|
if (this.mediaProperties.webrtcMediaConnection) {
|
|
8111
8881
|
// close peer connection, but don't reset mute state information, because we will want to use it on the retry
|
|
8112
8882
|
this.closePeerConnections(false);
|
|
@@ -8187,6 +8957,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8187
8957
|
regionCode: this.webex.meetings.geoHintInfo?.regionCode,
|
|
8188
8958
|
},
|
|
8189
8959
|
preferTranscoding: !this.isMultistream,
|
|
8960
|
+
getCurrentSelfUrl: () => this.selfUrl,
|
|
8961
|
+
waitForSelfUrlChange: () => this.waitForSelfUrlChange(),
|
|
8190
8962
|
},
|
|
8191
8963
|
{
|
|
8192
8964
|
// @ts-ignore
|
|
@@ -8195,6 +8967,41 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8195
8967
|
);
|
|
8196
8968
|
}
|
|
8197
8969
|
|
|
8970
|
+
/**
|
|
8971
|
+
* Waits for LocusInfo to update meeting.selfUrl, with a timeout fallback.
|
|
8972
|
+
* @returns {Promise<void>}
|
|
8973
|
+
* @private
|
|
8974
|
+
* @memberof Meeting
|
|
8975
|
+
*/
|
|
8976
|
+
private waitForSelfUrlChange(): Promise<void> {
|
|
8977
|
+
if (this.joinWithMediaRetryInfo.retryCount > 0) {
|
|
8978
|
+
/* During joinWithMedia() retries we can get 403/409 from Locus and it doesn't mean
|
|
8979
|
+
* that the selfUrl will change, it is usually caused by Locus dropping us as a result of
|
|
8980
|
+
* media connection failure during joinWithMedia's earlier media connection attempt,
|
|
8981
|
+
* so we don't want to wait for selfUrl change as this would only slow down the join process. */
|
|
8982
|
+
LoggerProxy.logger.info(
|
|
8983
|
+
'Meeting:index#waitForSelfUrlChange --> joinWithMedia retry in progress, will not wait for selfUrl change'
|
|
8984
|
+
);
|
|
8985
|
+
|
|
8986
|
+
return Promise.resolve();
|
|
8987
|
+
}
|
|
8988
|
+
|
|
8989
|
+
if (!this.promisesWaitingForPropUpdate.selfUrl) {
|
|
8990
|
+
const pendingSelfUrlUpdate = new Defer();
|
|
8991
|
+
|
|
8992
|
+
this.promisesWaitingForPropUpdate.selfUrl = pendingSelfUrlUpdate;
|
|
8993
|
+
|
|
8994
|
+
setTimeout(() => {
|
|
8995
|
+
if (this.promisesWaitingForPropUpdate.selfUrl === pendingSelfUrlUpdate) {
|
|
8996
|
+
delete this.promisesWaitingForPropUpdate.selfUrl;
|
|
8997
|
+
pendingSelfUrlUpdate.resolve();
|
|
8998
|
+
}
|
|
8999
|
+
}, 5000);
|
|
9000
|
+
}
|
|
9001
|
+
|
|
9002
|
+
return this.promisesWaitingForPropUpdate.selfUrl.promise;
|
|
9003
|
+
}
|
|
9004
|
+
|
|
8198
9005
|
/**
|
|
8199
9006
|
* Creates a media connection to the server. Media connection is required for sending or receiving any audio/video.
|
|
8200
9007
|
*
|
|
@@ -8206,8 +9013,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8206
9013
|
addMedia(options: AddMediaOptions = {}): Promise<void> {
|
|
8207
9014
|
return this.addMediaInternal(
|
|
8208
9015
|
() => (this.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY'),
|
|
8209
|
-
undefined,
|
|
8210
9016
|
false,
|
|
9017
|
+
undefined /* turnServerInfo - it will be fetched via doTurnDiscovery() */,
|
|
9018
|
+
undefined /* iceTransportPolicy - we're relying on the default value */,
|
|
8211
9019
|
options
|
|
8212
9020
|
);
|
|
8213
9021
|
}
|
|
@@ -8216,8 +9024,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8216
9024
|
* Internal version of addMedia() with some more arguments for finer control of its behavior
|
|
8217
9025
|
*
|
|
8218
9026
|
* @param {Function} icePhaseCallback - callback to determine the icePhase for CA "client.ice.end" failure events
|
|
8219
|
-
* @param {TurnServerInfo} turnServerInfo - TURN server information
|
|
8220
9027
|
* @param {boolean} forceTurnDiscovery - if true, TURN discovery will be done
|
|
9028
|
+
* @param {TurnServerInfo} turnServerInfo - TURN server information
|
|
9029
|
+
* @param {RTCIceTransportPolicy} [iceTransportPolicy] - ICE transport policy override
|
|
8221
9030
|
* @param {AddMediaOptions} options - same as options of the public addMedia() method
|
|
8222
9031
|
* @returns {Promise<void>}
|
|
8223
9032
|
* @protected
|
|
@@ -8225,12 +9034,14 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8225
9034
|
*/
|
|
8226
9035
|
protected async addMediaInternal(
|
|
8227
9036
|
icePhaseCallback: () => string,
|
|
8228
|
-
|
|
8229
|
-
|
|
9037
|
+
forceTurnDiscovery: boolean,
|
|
9038
|
+
turnServerInfo?: TurnServerInfo,
|
|
9039
|
+
iceTransportPolicy?: RTCIceTransportPolicy,
|
|
8230
9040
|
options: AddMediaOptions = {}
|
|
8231
9041
|
): Promise<void> {
|
|
8232
9042
|
this.addMediaData.retriedWithTurnServer = false;
|
|
8233
9043
|
this.addMediaData.icePhaseCallback = icePhaseCallback;
|
|
9044
|
+
this.addMediaData.iceTransportPolicy = iceTransportPolicy;
|
|
8234
9045
|
|
|
8235
9046
|
this.hasMediaConnectionConnectedAtLeastOnce = false;
|
|
8236
9047
|
const LOG_HEADER = 'Meeting:index#addMedia -->';
|
|
@@ -8239,7 +9050,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8239
9050
|
options
|
|
8240
9051
|
)}, turnServerInfo=${JSON.stringify(
|
|
8241
9052
|
turnServerInfo
|
|
8242
|
-
)}, forceTurnDiscovery=${forceTurnDiscovery}`
|
|
9053
|
+
)}, forceTurnDiscovery=${forceTurnDiscovery}, iceTransportPolicy=${iceTransportPolicy}`
|
|
8243
9054
|
);
|
|
8244
9055
|
|
|
8245
9056
|
if (options.allowMediaInLobby !== true && this.meetingState !== FULL_STATE.ACTIVE) {
|
|
@@ -8353,12 +9164,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8353
9164
|
|
|
8354
9165
|
// Establish new media connection with forced TURN discovery
|
|
8355
9166
|
// We need to do TURN discovery again, because backend will be creating a new confluence, so it might land on a different node or cluster
|
|
8356
|
-
await this.establishMediaConnection(
|
|
8357
|
-
remoteMediaManagerConfig,
|
|
8358
|
-
bundlePolicy,
|
|
8359
|
-
true,
|
|
8360
|
-
undefined
|
|
8361
|
-
);
|
|
9167
|
+
await this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
|
|
8362
9168
|
} else {
|
|
8363
9169
|
throw error;
|
|
8364
9170
|
}
|
|
@@ -8387,7 +9193,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8387
9193
|
numTransports,
|
|
8388
9194
|
isMultistream: this.isMultistream,
|
|
8389
9195
|
retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
|
|
8390
|
-
isJoinWithMediaRetry: this.joinWithMediaRetryInfo.
|
|
9196
|
+
isJoinWithMediaRetry: this.joinWithMediaRetryInfo.retryCount > 0,
|
|
9197
|
+
iceTransportPolicy: this.addMediaData.iceTransportPolicy || 'all',
|
|
8391
9198
|
...reachabilityMetrics,
|
|
8392
9199
|
...iceCandidateErrors,
|
|
8393
9200
|
iceCandidatesCount: this.iceCandidatesCount,
|
|
@@ -8409,14 +9216,16 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8409
9216
|
// We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
|
|
8410
9217
|
this.remoteMediaManager?.logAllReceiveSlots();
|
|
8411
9218
|
this.startPeriodicLogUpload();
|
|
8412
|
-
} catch (error) {
|
|
9219
|
+
} catch (error: any) {
|
|
8413
9220
|
LoggerProxy.logger.error(`${LOG_HEADER} failed to establish media connection: `, error);
|
|
8414
9221
|
|
|
8415
9222
|
// @ts-ignore
|
|
8416
9223
|
const reachabilityMetrics = await this.getMediaReachabilityMetricFields();
|
|
8417
9224
|
|
|
8418
|
-
const {selectedCandidatePairChanges, numTransports} =
|
|
8419
|
-
|
|
9225
|
+
const {connectionType, selectedCandidatePairChanges, numTransports} =
|
|
9226
|
+
error instanceof AddMediaFailed
|
|
9227
|
+
? error
|
|
9228
|
+
: await this.mediaProperties.getCurrentConnectionInfo();
|
|
8420
9229
|
|
|
8421
9230
|
const iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
|
|
8422
9231
|
|
|
@@ -8432,7 +9241,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8432
9241
|
turnServerUsed: this.turnServerUsed,
|
|
8433
9242
|
retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
|
|
8434
9243
|
isMultistream: this.isMultistream,
|
|
8435
|
-
isJoinWithMediaRetry: this.joinWithMediaRetryInfo.
|
|
9244
|
+
isJoinWithMediaRetry: this.joinWithMediaRetryInfo.retryCount > 0,
|
|
9245
|
+
iceTransportPolicy: this.addMediaData.iceTransportPolicy || 'all',
|
|
8436
9246
|
signalingState:
|
|
8437
9247
|
this.mediaProperties.webrtcMediaConnection?.multistreamConnection?.pc?.pc
|
|
8438
9248
|
?.signalingState ||
|
|
@@ -8448,6 +9258,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8448
9258
|
?.iceConnectionState ||
|
|
8449
9259
|
this.mediaProperties.webrtcMediaConnection?.mediaConnection?.pc?.iceConnectionState ||
|
|
8450
9260
|
'unknown',
|
|
9261
|
+
connectionType,
|
|
8451
9262
|
...reachabilityMetrics,
|
|
8452
9263
|
...iceCandidateErrors,
|
|
8453
9264
|
iceCandidatesCount: this.iceCandidatesCount,
|
|
@@ -8796,6 +9607,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8796
9607
|
options: {meetingId: this.id},
|
|
8797
9608
|
});
|
|
8798
9609
|
LoggerProxy.logger.log('Meeting:index#leave --> Leaving a meeting');
|
|
9610
|
+
this.stopListeningForMeetingEvents();
|
|
8799
9611
|
|
|
8800
9612
|
return MeetingUtil.leaveMeeting(this, options)
|
|
8801
9613
|
.then(async (leave) => {
|
|
@@ -9661,6 +10473,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
9661
10473
|
locus_id: this.locusId,
|
|
9662
10474
|
});
|
|
9663
10475
|
|
|
10476
|
+
this.stopListeningForMeetingEvents();
|
|
10477
|
+
|
|
9664
10478
|
return MeetingUtil.endMeetingForAll(this)
|
|
9665
10479
|
.then(async (end) => {
|
|
9666
10480
|
this.meetingFiniteStateMachine.end();
|
|
@@ -9722,12 +10536,15 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
9722
10536
|
}
|
|
9723
10537
|
this.queuedMediaUpdates = [];
|
|
9724
10538
|
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
10539
|
+
// Listener teardown (transcription, annotation, llm/mercury) runs in
|
|
10540
|
+
// stopListeningForMeetingEvents() before /leave and /end so events
|
|
10541
|
+
// received mid-teardown do not trigger Locus syncs. Calling it here
|
|
10542
|
+
// again would double-emit MEETING_STOPPED_RECEIVING_TRANSCRIPTION
|
|
10543
|
+
// because stopTranscription() always fires its trigger.
|
|
10544
|
+
//
|
|
10545
|
+
// Ownership-aware token clear is encapsulated inside clearDataChannelToken().
|
|
9730
10546
|
this.clearDataChannelToken();
|
|
10547
|
+
|
|
9731
10548
|
await this.cleanupLLMConneciton({throwOnError: false});
|
|
9732
10549
|
};
|
|
9733
10550
|
|
|
@@ -9804,15 +10621,12 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
9804
10621
|
* @public
|
|
9805
10622
|
* @memberof Meeting
|
|
9806
10623
|
*/
|
|
9807
|
-
public sendReaction(reactionType:
|
|
10624
|
+
public sendReaction(reactionType: string, skinToneType?: SkinToneType) {
|
|
9808
10625
|
const reactionChannelUrl = this.locusInfo?.controls?.reactions?.reactionChannelUrl as string;
|
|
9809
10626
|
const participantId = this.members.selfId;
|
|
9810
10627
|
|
|
9811
|
-
const reactionData = Reactions[reactionType];
|
|
10628
|
+
const reactionData = Reactions[reactionType] || {type: reactionType};
|
|
9812
10629
|
|
|
9813
|
-
if (!reactionData) {
|
|
9814
|
-
return Promise.reject(new Error(`${reactionType} is not a valid reaction.`));
|
|
9815
|
-
}
|
|
9816
10630
|
const skinToneData = SkinTones[skinToneType] || SkinTones.normal;
|
|
9817
10631
|
const reaction: Reaction = {
|
|
9818
10632
|
...reactionData,
|