@webex/plugin-meetings 3.12.0-next.11 → 3.12.0-next.110
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/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 +90 -3
- 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/constants.js +11 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +67 -29
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +91 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/hashTree/constants.js +4 -1
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1003 -393
- 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 +406 -121
- 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 +19 -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 +1662 -829
- 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-info/meeting-info-v2.js +2 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +256 -118
- 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/constants.d.ts +6 -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 +178 -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 +61 -7
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +21 -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 +175 -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/meetings/index.d.ts +38 -18
- 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/breakouts/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +110 -1
- 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/constants.ts +14 -1
- package/src/controls-options-manager/index.ts +87 -28
- package/src/controls-options-manager/util.ts +81 -1
- package/src/hashTree/constants.ts +7 -0
- package/src/hashTree/hashTreeParser.ts +752 -192
- 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 +412 -130
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/types.ts +25 -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 +913 -111
- 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-info/meeting-info-v2.ts +4 -2
- package/src/meetings/index.ts +168 -79
- 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/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/events.ts +120 -2
- package/test/unit/spec/breakouts/index.ts +191 -2
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/controls-options-manager/index.js +244 -29
- package/test/unit/spec/controls-options-manager/util.js +165 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +2110 -170
- 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 +643 -63
- 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 +2711 -183
- 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-info/meetinginfov2.js +19 -10
- package/test/unit/spec/meetings/index.js +467 -36
- 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';
|
|
@@ -190,6 +193,7 @@ import AIEnableRequest from '../aiEnableRequest';
|
|
|
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
|
|
@@ -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,8 +5853,12 @@ 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) ||
|
|
@@ -5579,8 +5883,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5579
5883
|
});
|
|
5580
5884
|
}
|
|
5581
5885
|
|
|
5582
|
-
// we only want to call leave if join was successful and
|
|
5583
|
-
if (joined &&
|
|
5886
|
+
// we only want to call leave if join was successful, and we won't be doing any more retries
|
|
5887
|
+
if (joined && !shouldRetry) {
|
|
5584
5888
|
try {
|
|
5585
5889
|
await this.leave({resourceId: joinOptions?.resourceId, reason: 'joinWithMedia failure'});
|
|
5586
5890
|
} catch (e) {
|
|
@@ -5597,7 +5901,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5597
5901
|
reason: error.message,
|
|
5598
5902
|
stack: error.stack,
|
|
5599
5903
|
leaveErrorReason: leaveError?.message,
|
|
5600
|
-
isRetry,
|
|
5904
|
+
isRetry: retryCount > 0,
|
|
5601
5905
|
},
|
|
5602
5906
|
{
|
|
5603
5907
|
type: error.name,
|
|
@@ -5606,15 +5910,28 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5606
5910
|
|
|
5607
5911
|
if (shouldRetry) {
|
|
5608
5912
|
LoggerProxy.logger.warn('Meeting:index#joinWithMedia --> retrying call to joinWithMedia');
|
|
5609
|
-
this.joinWithMediaRetryInfo.
|
|
5913
|
+
this.joinWithMediaRetryInfo.retryCount = retryCount + 1;
|
|
5610
5914
|
this.joinWithMediaRetryInfo.prevJoinResponse = joinResponse;
|
|
5915
|
+
this.joinWithMediaRetryInfo.prevError = error;
|
|
5916
|
+
if (!this.joinWithMediaRetryInfo.firstError) {
|
|
5917
|
+
this.joinWithMediaRetryInfo.firstError = error;
|
|
5918
|
+
}
|
|
5611
5919
|
|
|
5612
5920
|
return this.joinWithMedia(options);
|
|
5613
5921
|
}
|
|
5614
5922
|
|
|
5615
|
-
|
|
5923
|
+
const {firstError} = this.joinWithMediaRetryInfo;
|
|
5616
5924
|
|
|
5617
|
-
|
|
5925
|
+
this.joinWithMediaRetryInfo = {
|
|
5926
|
+
retryCount: 0,
|
|
5927
|
+
prevJoinResponse: undefined,
|
|
5928
|
+
firstError: undefined,
|
|
5929
|
+
prevError: undefined,
|
|
5930
|
+
};
|
|
5931
|
+
|
|
5932
|
+
this.locusInfo.suspendDestroyMeeting(false);
|
|
5933
|
+
|
|
5934
|
+
throw firstError ?? error;
|
|
5618
5935
|
}
|
|
5619
5936
|
}
|
|
5620
5937
|
|
|
@@ -5857,7 +6174,18 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5857
6174
|
storeEventForDebugging('llm', event.data);
|
|
5858
6175
|
}
|
|
5859
6176
|
|
|
6177
|
+
const {trackingId} = event;
|
|
6178
|
+
|
|
5860
6179
|
this.locusInfo.parse(this, event.data);
|
|
6180
|
+
|
|
6181
|
+
// Only the client whose /sync request tracking id matches the tracking id echoed back on this
|
|
6182
|
+
// LLM message should emit client.locus.sync.complete. The tracking id lives at the top level
|
|
6183
|
+
// of the received LLM event envelope. When it is absent there is nothing to correlate, so
|
|
6184
|
+
// skip. onLocusSyncLlmMessage records the LLM arrival time and is a no-op unless a stored
|
|
6185
|
+
// record for this meeting matches the tracking id.
|
|
6186
|
+
if (trackingId) {
|
|
6187
|
+
this.onLocusSyncLlmMessage(this.id, trackingId);
|
|
6188
|
+
}
|
|
5861
6189
|
} else {
|
|
5862
6190
|
LoggerProxy.logger.warn(
|
|
5863
6191
|
`Meeting:index#processLocusLLMEvent --> Unknown event type: ${event.data.eventType}`
|
|
@@ -5865,6 +6193,31 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5865
6193
|
}
|
|
5866
6194
|
};
|
|
5867
6195
|
|
|
6196
|
+
/**
|
|
6197
|
+
* Verifies the relay event was delivered for the active LLM session binding.
|
|
6198
|
+
* @param {RelayEvent} event Event object coming from LLM Connection
|
|
6199
|
+
* @returns {boolean}
|
|
6200
|
+
*/
|
|
6201
|
+
private isRelayEventRouteValid(event: RelayEvent): boolean {
|
|
6202
|
+
const route = event?.headers?.route;
|
|
6203
|
+
|
|
6204
|
+
if (!route) {
|
|
6205
|
+
return true;
|
|
6206
|
+
}
|
|
6207
|
+
|
|
6208
|
+
const {llm} = (this as any).webex.internal;
|
|
6209
|
+
const isPracticeSession = llm.isConnected(LLM_PRACTICE_SESSION);
|
|
6210
|
+
const expectedBinding = isPracticeSession
|
|
6211
|
+
? llm.getBinding(LLM_PRACTICE_SESSION)
|
|
6212
|
+
: llm.getBinding();
|
|
6213
|
+
|
|
6214
|
+
if (!expectedBinding || route === expectedBinding) {
|
|
6215
|
+
return true;
|
|
6216
|
+
}
|
|
6217
|
+
|
|
6218
|
+
return false;
|
|
6219
|
+
}
|
|
6220
|
+
|
|
5868
6221
|
/**
|
|
5869
6222
|
* Callback called when a relay event is received from meeting LLM Connection
|
|
5870
6223
|
* @param {RelayEvent} e Event object coming from LLM Connection
|
|
@@ -5872,6 +6225,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5872
6225
|
* @returns {void}
|
|
5873
6226
|
*/
|
|
5874
6227
|
private processRelayEvent = (e: RelayEvent): void => {
|
|
6228
|
+
if (!this.isRelayEventRouteValid(e)) {
|
|
6229
|
+
return;
|
|
6230
|
+
}
|
|
5875
6231
|
switch (e.data.relayType) {
|
|
5876
6232
|
case REACTION_RELAY_TYPES.REACTION:
|
|
5877
6233
|
if (
|
|
@@ -5975,10 +6331,11 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5975
6331
|
*/
|
|
5976
6332
|
private restoreLLMSubscriptionsIfNeeded(): void {
|
|
5977
6333
|
try {
|
|
5978
|
-
|
|
5979
|
-
|
|
6334
|
+
const keepTranscriptionSubscribed =
|
|
6335
|
+
// @ts-ignore
|
|
6336
|
+
this.webex.internal.voicea?.getKeepTranscriptionSubscribed?.();
|
|
5980
6337
|
|
|
5981
|
-
if (!
|
|
6338
|
+
if (!keepTranscriptionSubscribed) {
|
|
5982
6339
|
return;
|
|
5983
6340
|
}
|
|
5984
6341
|
|
|
@@ -6002,6 +6359,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6002
6359
|
*/
|
|
6003
6360
|
private handleLLMOnline = (): void => {
|
|
6004
6361
|
this.restoreLLMSubscriptionsIfNeeded();
|
|
6362
|
+
this.locusInfo.syncAllHashTreeDatasets({onlyLLM: true});
|
|
6005
6363
|
|
|
6006
6364
|
Trigger.trigger(
|
|
6007
6365
|
this,
|
|
@@ -6237,7 +6595,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6237
6595
|
this.webex.internal.llm.off('online', this.handleLLMOnline);
|
|
6238
6596
|
// @ts-ignore
|
|
6239
6597
|
this.webex.internal.llm.on('online', this.handleLLMOnline);
|
|
6240
|
-
this.updateLLMConnection()
|
|
6598
|
+
this.updateLLMConnection({isInitialJoinPhase: true})
|
|
6241
6599
|
.catch((error) => {
|
|
6242
6600
|
LoggerProxy.logger.error(
|
|
6243
6601
|
'Meeting:index#join --> Transcription Socket Connection Failed',
|
|
@@ -6301,8 +6659,57 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6301
6659
|
}
|
|
6302
6660
|
}
|
|
6303
6661
|
|
|
6662
|
+
/**
|
|
6663
|
+
* Removes LLM event listeners and clears the health check timer.
|
|
6664
|
+
* Must be called before Locus /leave to avoid unnecessary syncs triggered
|
|
6665
|
+
* by events received while leaving (per Locus team recommendation).
|
|
6666
|
+
* Idempotent: safe to call multiple times; .off() is a no-op when no
|
|
6667
|
+
* matching listener is registered.
|
|
6668
|
+
* @private
|
|
6669
|
+
* @returns {void}
|
|
6670
|
+
*/
|
|
6671
|
+
private stopListeningForLLMEvents() {
|
|
6672
|
+
// @ts-ignore - fix types
|
|
6673
|
+
this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
|
|
6674
|
+
// @ts-ignore - fix types
|
|
6675
|
+
this.webex.internal.llm.off(LOCUS_LLM_EVENT, this.processLocusLLMEvent);
|
|
6676
|
+
this.clearLLMHealthCheckTimer();
|
|
6677
|
+
}
|
|
6678
|
+
|
|
6679
|
+
/**
|
|
6680
|
+
* Stops listening on every event bus (LLM, Mercury, voicea/transcription,
|
|
6681
|
+
* annotation) that could otherwise deliver events to this meeting while
|
|
6682
|
+
* Locus is processing /leave or /end. Per the Locus team recommendation,
|
|
6683
|
+
* this must run before the Locus request is dispatched to avoid
|
|
6684
|
+
* unnecessary syncs triggered by in-flight events.
|
|
6685
|
+
*
|
|
6686
|
+
* Voicea (transcription) subscribes to llm 'event:relay.event' internally,
|
|
6687
|
+
* and the annotation plugin subscribes to both mercury and llm, so both
|
|
6688
|
+
* must be torn down alongside the direct LLM/Mercury listeners.
|
|
6689
|
+
*
|
|
6690
|
+
* Idempotent: safe to call multiple times; .off() is a no-op when no
|
|
6691
|
+
* matching listener is registered, and stopTranscription is guarded.
|
|
6692
|
+
* @private
|
|
6693
|
+
* @returns {void}
|
|
6694
|
+
*/
|
|
6695
|
+
private stopListeningForMeetingEvents() {
|
|
6696
|
+
this.stopListeningForLLMEvents();
|
|
6697
|
+
this.stopListeningForMercuryEvents();
|
|
6698
|
+
if (this.transcription) {
|
|
6699
|
+
this.stopTranscription();
|
|
6700
|
+
this.transcription = undefined;
|
|
6701
|
+
}
|
|
6702
|
+
this.annotation.deregisterEvents();
|
|
6703
|
+
}
|
|
6704
|
+
|
|
6304
6705
|
/**
|
|
6305
6706
|
* Disconnects and cleans up the default LLM session listeners/timers.
|
|
6707
|
+
*
|
|
6708
|
+
* Ownership-aware: only calls `disconnectLLM` when this meeting is the
|
|
6709
|
+
* current owner of the default LLM session (or when no owner is recorded).
|
|
6710
|
+
* Event listeners belonging to this meeting instance are always detached
|
|
6711
|
+
* so they do not receive another meeting's relay events.
|
|
6712
|
+
*
|
|
6306
6713
|
* @param {Object} options
|
|
6307
6714
|
* @param {boolean} [options.removeOnlineListener=true] removes the one-time online listener
|
|
6308
6715
|
* @param {boolean} [options.throwOnError=true] rethrows disconnect errors when true
|
|
@@ -6315,12 +6722,29 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6315
6722
|
removeOnlineListener?: boolean;
|
|
6316
6723
|
throwOnError?: boolean;
|
|
6317
6724
|
} = {}): Promise<void> => {
|
|
6725
|
+
// @ts-ignore - Fix type
|
|
6726
|
+
// @ts-ignore - Fix type
|
|
6727
|
+
const {currentOwner, isOwner} = this.webex.internal.llm.resolveSessionOwnership(
|
|
6728
|
+
this.id,
|
|
6729
|
+
LLM_DEFAULT_SESSION
|
|
6730
|
+
);
|
|
6731
|
+
|
|
6318
6732
|
try {
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6733
|
+
if (isOwner) {
|
|
6734
|
+
// @ts-ignore - Fix type
|
|
6735
|
+
await this.webex.internal.llm.disconnectLLM(
|
|
6736
|
+
{
|
|
6737
|
+
code: 3050,
|
|
6738
|
+
reason: 'done (permanent)',
|
|
6739
|
+
},
|
|
6740
|
+
LLM_DEFAULT_SESSION,
|
|
6741
|
+
this.id
|
|
6742
|
+
);
|
|
6743
|
+
} else {
|
|
6744
|
+
LoggerProxy.logger.info(
|
|
6745
|
+
`Meeting:index#cleanupLLMConneciton --> skipping disconnect; LLM owned by meeting ${currentOwner}, not ${this.id}`
|
|
6746
|
+
);
|
|
6747
|
+
}
|
|
6324
6748
|
} catch (error) {
|
|
6325
6749
|
LoggerProxy.logger.error(
|
|
6326
6750
|
'Meeting:index#cleanupLLMConneciton --> Failed to disconnect default LLM session',
|
|
@@ -6335,23 +6759,33 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6335
6759
|
// @ts-ignore - Fix type
|
|
6336
6760
|
this.webex.internal.llm.off('online', this.handleLLMOnline);
|
|
6337
6761
|
}
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
//
|
|
6341
|
-
|
|
6762
|
+
this.stopListeningForLLMEvents();
|
|
6763
|
+
|
|
6764
|
+
// Re-check ownership after awaiting disconnectLLM. If ownership changed
|
|
6765
|
+
// while cleanup was in flight, do not clear another meeting's owner tag.
|
|
6766
|
+
if (isOwner) {
|
|
6767
|
+
const {currentOwner: currentOwnerAfterCleanup} =
|
|
6768
|
+
// @ts-ignore - Fix type
|
|
6769
|
+
this.webex.internal.llm.resolveSessionOwnership(this.id, LLM_DEFAULT_SESSION);
|
|
6342
6770
|
|
|
6343
|
-
|
|
6771
|
+
if (currentOwnerAfterCleanup === this.id) {
|
|
6772
|
+
// @ts-ignore - Fix type
|
|
6773
|
+
this.webex.internal.llm.setOwnerMeetingId?.(undefined);
|
|
6774
|
+
}
|
|
6775
|
+
}
|
|
6344
6776
|
}
|
|
6345
6777
|
};
|
|
6346
6778
|
|
|
6347
6779
|
/**
|
|
6348
|
-
* Clears
|
|
6349
|
-
*
|
|
6780
|
+
* Clears data channel tokens associated with this meeting ownership.
|
|
6781
|
+
* Ownership checks are enforced in internal-plugin-llm.
|
|
6350
6782
|
* @returns {void}
|
|
6351
6783
|
*/
|
|
6352
6784
|
clearDataChannelToken(): void {
|
|
6353
6785
|
// @ts-ignore
|
|
6354
|
-
this.webex.internal.llm.
|
|
6786
|
+
this.webex.internal.llm.clearDatachannelToken(LLM_DEFAULT_SESSION, this.id);
|
|
6787
|
+
// @ts-ignore
|
|
6788
|
+
this.webex.internal.llm.clearDatachannelToken(LLM_PRACTICE_SESSION, this.id);
|
|
6355
6789
|
}
|
|
6356
6790
|
|
|
6357
6791
|
/**
|
|
@@ -6366,14 +6800,15 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6366
6800
|
|
|
6367
6801
|
if (datachannelToken) {
|
|
6368
6802
|
// @ts-ignore
|
|
6369
|
-
this.webex.internal.llm.setDatachannelToken(datachannelToken,
|
|
6803
|
+
this.webex.internal.llm.setDatachannelToken(datachannelToken, LLM_DEFAULT_SESSION, this.id);
|
|
6370
6804
|
}
|
|
6371
6805
|
|
|
6372
6806
|
if (practiceSessionDatachannelToken) {
|
|
6373
6807
|
// @ts-ignore
|
|
6374
6808
|
this.webex.internal.llm.setDatachannelToken(
|
|
6375
6809
|
practiceSessionDatachannelToken,
|
|
6376
|
-
|
|
6810
|
+
LLM_PRACTICE_SESSION,
|
|
6811
|
+
this.id
|
|
6377
6812
|
);
|
|
6378
6813
|
}
|
|
6379
6814
|
}
|
|
@@ -6386,7 +6821,10 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6386
6821
|
private async ensureDefaultDatachannelTokenAfterAdmit(): Promise<boolean> {
|
|
6387
6822
|
try {
|
|
6388
6823
|
// @ts-ignore
|
|
6389
|
-
const datachannelToken = this.webex.internal.llm.getDatachannelToken(
|
|
6824
|
+
const datachannelToken = this.webex.internal.llm.getDatachannelToken(
|
|
6825
|
+
LLM_DEFAULT_SESSION,
|
|
6826
|
+
this.id
|
|
6827
|
+
);
|
|
6390
6828
|
// @ts-ignore
|
|
6391
6829
|
const isDataChannelTokenEnabled = await this.webex.internal.llm.isDataChannelTokenEnabled();
|
|
6392
6830
|
|
|
@@ -6408,7 +6846,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6408
6846
|
// @ts-ignore
|
|
6409
6847
|
this.webex.internal.llm.setDatachannelToken(
|
|
6410
6848
|
fetchedDatachannelToken,
|
|
6411
|
-
|
|
6849
|
+
LLM_DEFAULT_SESSION,
|
|
6850
|
+
this.id
|
|
6412
6851
|
);
|
|
6413
6852
|
|
|
6414
6853
|
return true;
|
|
@@ -6427,23 +6866,68 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6427
6866
|
/**
|
|
6428
6867
|
* Connects to low latency mercury and reconnects if the address has changed
|
|
6429
6868
|
* It will also disconnect if called when the meeting has ended
|
|
6869
|
+
* @param {Object} [options]
|
|
6870
|
+
* @param {boolean} [options.isInitialJoinPhase] true when called from initial join flow
|
|
6430
6871
|
* @returns {Promise}
|
|
6431
6872
|
*/
|
|
6432
|
-
async updateLLMConnection() {
|
|
6873
|
+
async updateLLMConnection({isInitialJoinPhase = false}: {isInitialJoinPhase?: boolean} = {}) {
|
|
6433
6874
|
// @ts-ignore - Fix type
|
|
6434
6875
|
const {url = undefined, info: {datachannelUrl = undefined} = {}} = this.locusInfo || {};
|
|
6435
6876
|
|
|
6436
6877
|
const isJoined = this.isJoined();
|
|
6437
6878
|
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6879
|
+
const dataChannelUrl = datachannelUrl;
|
|
6880
|
+
|
|
6881
|
+
// Ownership guard: when the default LLM session is already connected and
|
|
6882
|
+
// owned by a *different* Meeting instance, do not disconnect or reconfigure
|
|
6883
|
+
// it. Another meeting's `updateLLMConnection` must be ignored here to
|
|
6884
|
+
// avoid killing the socket it relies on. We only proceed to manage the
|
|
6885
|
+
// connection when this meeting is the current owner, or when no owner is
|
|
6886
|
+
// set yet (first claim).
|
|
6887
|
+
// @ts-ignore - Fix type
|
|
6888
|
+
const {currentOwner} = this.webex.internal.llm.resolveSessionOwnership(
|
|
6889
|
+
this.id,
|
|
6890
|
+
LLM_DEFAULT_SESSION
|
|
6441
6891
|
);
|
|
6442
6892
|
|
|
6443
|
-
|
|
6893
|
+
// Capture connectivity before any reconnect attempt. If LLM was already
|
|
6894
|
+
// connected, we must respect current ownership. If it was disconnected,
|
|
6895
|
+
// this flow may reclaim stale owner tags after a fresh connect.
|
|
6896
|
+
// @ts-ignore - Fix type
|
|
6897
|
+
const wasConnected = this.webex.internal.llm.isConnected();
|
|
6898
|
+
|
|
6899
|
+
// Prefer ownership-scoped token read. For disconnected stale-owner reclaim
|
|
6900
|
+
// flows, fallback to ownerless read so initial register can still carry a
|
|
6901
|
+
// token and recover from stale ownership without 401/403 dead-end.
|
|
6902
|
+
// @ts-ignore - Fix type
|
|
6903
|
+
let datachannelToken = this.webex.internal.llm.getDatachannelToken(
|
|
6904
|
+
LLM_DEFAULT_SESSION,
|
|
6905
|
+
this.id
|
|
6906
|
+
);
|
|
6907
|
+
|
|
6908
|
+
if (!datachannelToken && !wasConnected && currentOwner && currentOwner !== this.id) {
|
|
6909
|
+
// @ts-ignore - Fix type
|
|
6910
|
+
datachannelToken = this.webex.internal.llm.getDatachannelToken(LLM_DEFAULT_SESSION);
|
|
6911
|
+
}
|
|
6444
6912
|
|
|
6445
6913
|
// @ts-ignore - Fix type
|
|
6446
|
-
if (
|
|
6914
|
+
if (wasConnected) {
|
|
6915
|
+
if (currentOwner && currentOwner !== this.id) {
|
|
6916
|
+
// Another meeting owns the live LLM socket. We must not disconnect
|
|
6917
|
+
// or reconfigure it -- doing so would tear down a session the
|
|
6918
|
+
// owning meeting still relies on. Locus/datachannel URL mismatch is
|
|
6919
|
+
// expected here (each meeting has its own locus URL) and is NOT a
|
|
6920
|
+
// valid signal of staleness, so we never reclaim from this path.
|
|
6921
|
+
// The only safe reclaim mechanism is the `finally`-block owner-tag
|
|
6922
|
+
// release in `cleanupLLMConneciton`, which fires when this meeting
|
|
6923
|
+
// itself is being torn down.
|
|
6924
|
+
LoggerProxy.logger.info(
|
|
6925
|
+
`Meeting:index#updateLLMConnection --> skipping; LLM owned by meeting ${currentOwner}, not ${this.id}`
|
|
6926
|
+
);
|
|
6927
|
+
|
|
6928
|
+
return undefined;
|
|
6929
|
+
}
|
|
6930
|
+
|
|
6447
6931
|
if (
|
|
6448
6932
|
// @ts-ignore - Fix type
|
|
6449
6933
|
url === this.webex.internal.llm.getLocusUrl() &&
|
|
@@ -6460,10 +6944,56 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6460
6944
|
return undefined;
|
|
6461
6945
|
}
|
|
6462
6946
|
|
|
6947
|
+
// Bind refresh handler before registration so interceptor-triggered token
|
|
6948
|
+
// refresh during register POST can resolve a valid handler.
|
|
6949
|
+
// Prefer this meeting as owner, but allow owner-less fallback when a stale
|
|
6950
|
+
// foreign owner tag is present on a disconnected session.
|
|
6951
|
+
const refreshHandlerOwnerMeetingId =
|
|
6952
|
+
currentOwner && currentOwner !== this.id ? undefined : this.id;
|
|
6953
|
+
const shouldAlignRefreshHandlerAfterOwnershipClaim = refreshHandlerOwnerMeetingId !== this.id;
|
|
6954
|
+
// @ts-ignore - Fix type
|
|
6955
|
+
this.webex.internal.llm.setRefreshHandler(
|
|
6956
|
+
() => this.refreshDataChannelToken(),
|
|
6957
|
+
LLM_DEFAULT_SESSION,
|
|
6958
|
+
refreshHandlerOwnerMeetingId
|
|
6959
|
+
);
|
|
6960
|
+
|
|
6463
6961
|
// @ts-ignore - Fix type
|
|
6464
6962
|
return this.webex.internal.llm
|
|
6465
6963
|
.registerAndConnect(url, dataChannelUrl, datachannelToken)
|
|
6466
6964
|
.then((registerAndConnectResult) => {
|
|
6965
|
+
this.locusInfo.syncAllHashTreeDatasets({onlyLLM: true});
|
|
6966
|
+
// Record ownership of the default LLM session for this meeting so
|
|
6967
|
+
// subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
|
|
6968
|
+
// calls can detect and skip work that doesn't belong to them.
|
|
6969
|
+
// @ts-ignore - Fix type
|
|
6970
|
+
const {isOwner} = this.webex.internal.llm.resolveSessionOwnership(
|
|
6971
|
+
this.id,
|
|
6972
|
+
LLM_DEFAULT_SESSION
|
|
6973
|
+
);
|
|
6974
|
+
const canReclaimAfterDisconnectedStart = !wasConnected;
|
|
6975
|
+
|
|
6976
|
+
// Refresh handler is pre-bound before registerAndConnect so token
|
|
6977
|
+
// refresh can work even during the registration request itself.
|
|
6978
|
+
if (isOwner || canReclaimAfterDisconnectedStart) {
|
|
6979
|
+
// Record ownership of the default LLM session for this meeting so
|
|
6980
|
+
// subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
|
|
6981
|
+
// calls can detect and skip work that doesn't belong to them.
|
|
6982
|
+
// @ts-ignore - Fix type
|
|
6983
|
+
this.webex.internal.llm.setOwnerMeetingId?.(this.id);
|
|
6984
|
+
|
|
6985
|
+
// If we pre-bound refresh ownerlessly (stale-owner reclaim path),
|
|
6986
|
+
// align the handler with the newly claimed owner immediately after
|
|
6987
|
+
// ownership is updated.
|
|
6988
|
+
if (shouldAlignRefreshHandlerAfterOwnershipClaim) {
|
|
6989
|
+
// @ts-ignore - Fix type
|
|
6990
|
+
this.webex.internal.llm.setRefreshHandler(
|
|
6991
|
+
() => this.refreshDataChannelToken(),
|
|
6992
|
+
LLM_DEFAULT_SESSION,
|
|
6993
|
+
this.id
|
|
6994
|
+
);
|
|
6995
|
+
}
|
|
6996
|
+
}
|
|
6467
6997
|
// @ts-ignore - Fix type
|
|
6468
6998
|
this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
|
|
6469
6999
|
// @ts-ignore - Fix type
|
|
@@ -6478,10 +7008,114 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6478
7008
|
|
|
6479
7009
|
this.startLLMHealthCheckTimer();
|
|
6480
7010
|
|
|
7011
|
+
if (registerAndConnectResult) {
|
|
7012
|
+
if (isInitialJoinPhase) {
|
|
7013
|
+
this.sendLLMConnectMetric(registerAndConnectResult);
|
|
7014
|
+
}
|
|
7015
|
+
|
|
7016
|
+
this.breakouts?.trigger(BREAKOUTS.EVENTS.LLM_CONNECT_RESPONSE, {
|
|
7017
|
+
meeting: this,
|
|
7018
|
+
llmLatency: registerAndConnectResult,
|
|
7019
|
+
});
|
|
7020
|
+
}
|
|
7021
|
+
|
|
6481
7022
|
return Promise.resolve(registerAndConnectResult);
|
|
7023
|
+
})
|
|
7024
|
+
.catch((error) => {
|
|
7025
|
+
// Prefer the partial timing registerAndConnect attaches when register succeeded but the
|
|
7026
|
+
// websocket connect() failed, so a ws failure isn't misreported as register never completing.
|
|
7027
|
+
const llmLatency = {
|
|
7028
|
+
clientLLMDatachannelResponseTime: error?.timing?.clientLLMDatachannelResponseTime ?? 0,
|
|
7029
|
+
clientLLMWebSocketConnectTime: 0,
|
|
7030
|
+
};
|
|
7031
|
+
|
|
7032
|
+
if (isInitialJoinPhase) {
|
|
7033
|
+
this.sendLLMConnectMetric(llmLatency, error);
|
|
7034
|
+
}
|
|
7035
|
+
|
|
7036
|
+
this.breakouts?.trigger(BREAKOUTS.EVENTS.LLM_CONNECT_RESPONSE, {
|
|
7037
|
+
meeting: this,
|
|
7038
|
+
llmLatency,
|
|
7039
|
+
error,
|
|
7040
|
+
});
|
|
7041
|
+
|
|
7042
|
+
return Promise.reject(error);
|
|
6482
7043
|
});
|
|
6483
7044
|
}
|
|
6484
7045
|
|
|
7046
|
+
/**
|
|
7047
|
+
* Ensures breakout join response metric with LLM latency is emitted only once per breakout move id.
|
|
7048
|
+
* @param {string | undefined} breakoutMoveId
|
|
7049
|
+
* @param {boolean} [hasLLMLatency=false]
|
|
7050
|
+
* @returns {boolean}
|
|
7051
|
+
*/
|
|
7052
|
+
private shouldEmitBreakoutJoinResponseMetric(
|
|
7053
|
+
breakoutMoveId?: string,
|
|
7054
|
+
hasLLMLatency = false
|
|
7055
|
+
): boolean {
|
|
7056
|
+
if (!breakoutMoveId) {
|
|
7057
|
+
return false;
|
|
7058
|
+
}
|
|
7059
|
+
|
|
7060
|
+
if (!hasLLMLatency) {
|
|
7061
|
+
// When automatic LLM is enabled, updateLLMConnection will emit this same breakout join
|
|
7062
|
+
// response after the LLM connection finishes, including llmLatency and llmWebsocketUrl.
|
|
7063
|
+
// Suppress the earlier non-LLM event to avoid sending two events for the same move id,
|
|
7064
|
+
// where the first one would be missing the LLM-specific fields we want to validate.
|
|
7065
|
+
// @ts-ignore - config coming from registerPlugin
|
|
7066
|
+
return !this.config.enableAutomaticLLM;
|
|
7067
|
+
}
|
|
7068
|
+
|
|
7069
|
+
if (this.emittedBreakoutJoinResponseMoveIds.has(breakoutMoveId)) {
|
|
7070
|
+
return false;
|
|
7071
|
+
}
|
|
7072
|
+
|
|
7073
|
+
this.emittedBreakoutJoinResponseMoveIds.add(breakoutMoveId);
|
|
7074
|
+
|
|
7075
|
+
return true;
|
|
7076
|
+
}
|
|
7077
|
+
|
|
7078
|
+
/**
|
|
7079
|
+
* Sends LLM connect latencies for initial join flow.
|
|
7080
|
+
* @param {RegisterAndConnectTiming} timings
|
|
7081
|
+
* @param {any} [error]
|
|
7082
|
+
* @returns {void}
|
|
7083
|
+
*/
|
|
7084
|
+
private sendLLMConnectMetric(timings: RegisterAndConnectTiming, error?: any) {
|
|
7085
|
+
// @ts-ignore
|
|
7086
|
+
const llmWebsocketUrl = this.webex.internal.llm.getWebSocketUrl?.() || undefined;
|
|
7087
|
+
const {clientLLMDatachannelResponseTime = 0, clientLLMWebSocketConnectTime} = timings || {};
|
|
7088
|
+
|
|
7089
|
+
const llmLatency: any = {
|
|
7090
|
+
clientLLMDatachannelResponseTime,
|
|
7091
|
+
};
|
|
7092
|
+
|
|
7093
|
+
if (clientLLMWebSocketConnectTime !== undefined) {
|
|
7094
|
+
llmLatency.clientLLMWebSocketConnectTime = clientLLMWebSocketConnectTime;
|
|
7095
|
+
}
|
|
7096
|
+
|
|
7097
|
+
const payload: any = {
|
|
7098
|
+
identifiers: {
|
|
7099
|
+
llmWebsocketUrl,
|
|
7100
|
+
},
|
|
7101
|
+
llmLatency,
|
|
7102
|
+
};
|
|
7103
|
+
|
|
7104
|
+
const options: any = {
|
|
7105
|
+
meetingId: this.id,
|
|
7106
|
+
...(error && {rawError: error}),
|
|
7107
|
+
};
|
|
7108
|
+
|
|
7109
|
+
const metricEvent = {
|
|
7110
|
+
name: 'client.llm.connect.response',
|
|
7111
|
+
payload,
|
|
7112
|
+
options,
|
|
7113
|
+
};
|
|
7114
|
+
|
|
7115
|
+
// @ts-ignore
|
|
7116
|
+
this.webex.internal.newMetrics.submitClientEvent(metricEvent);
|
|
7117
|
+
}
|
|
7118
|
+
|
|
6485
7119
|
/**
|
|
6486
7120
|
* Use phone for meeting audio
|
|
6487
7121
|
* @param {String} phoneNumber If provided, it will dial-out using this number. If not provided, dial-in will be used
|
|
@@ -6909,14 +7543,28 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
6909
7543
|
// @ts-ignore
|
|
6910
7544
|
const cdl = this.webex.internal.newMetrics.callDiagnosticLatencies;
|
|
6911
7545
|
|
|
7546
|
+
// Save the remote-sdp-received timestamp before submitting the client event so we can
|
|
7547
|
+
// calculate and include localSDPGenRemoteSDPRecv in the client event payload
|
|
7548
|
+
cdl.saveTimestamp({
|
|
7549
|
+
key: 'client.media-engine.remote-sdp-received',
|
|
7550
|
+
options: {meetingId: this.id},
|
|
7551
|
+
});
|
|
7552
|
+
|
|
7553
|
+
const localSDPGenRemoteSDPRecv = cdl.getLocalSDPGenRemoteSDPRecv();
|
|
7554
|
+
|
|
6912
7555
|
// @ts-ignore
|
|
6913
7556
|
this.webex.internal.newMetrics.submitClientEvent({
|
|
6914
7557
|
name: 'client.media-engine.remote-sdp-received',
|
|
7558
|
+
payload: {
|
|
7559
|
+
eventData: {
|
|
7560
|
+
localSDPGenRemoteSDPRecv,
|
|
7561
|
+
},
|
|
7562
|
+
},
|
|
6915
7563
|
options: {meetingId: this.id},
|
|
6916
7564
|
});
|
|
6917
7565
|
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ROAP_OFFER_TO_ANSWER_LATENCY, {
|
|
6918
7566
|
correlation_id: this.correlationId,
|
|
6919
|
-
latency:
|
|
7567
|
+
latency: localSDPGenRemoteSDPRecv,
|
|
6920
7568
|
meetingId: this.id,
|
|
6921
7569
|
});
|
|
6922
7570
|
|
|
@@ -7504,23 +8152,104 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7504
8152
|
}
|
|
7505
8153
|
}
|
|
7506
8154
|
});
|
|
8155
|
+
this.statsAnalyzer.on(StatsAnalyzerEventNames.STATS_UPDATE, (data) => {
|
|
8156
|
+
// Extract srtpCipher from transport stats
|
|
8157
|
+
let srtpCipher: string | undefined;
|
|
8158
|
+
for (const stats of data.stats.values()) {
|
|
8159
|
+
if (stats.type === 'transport' && stats.srtpCipher) {
|
|
8160
|
+
srtpCipher = stats.srtpCipher as string;
|
|
8161
|
+
break;
|
|
8162
|
+
}
|
|
8163
|
+
}
|
|
8164
|
+
|
|
8165
|
+
// Only emit event if srtpCipher has changed
|
|
8166
|
+
if (srtpCipher && srtpCipher !== this.mediaProperties.srtpCipher) {
|
|
8167
|
+
LoggerProxy.logger.info(
|
|
8168
|
+
`Meeting:index#setupStatsAnalyzerEventHandlers --> SRTP cipher changed from ${this.mediaProperties.srtpCipher} to ${srtpCipher}`
|
|
8169
|
+
);
|
|
8170
|
+
this.mediaProperties.srtpCipher = srtpCipher;
|
|
8171
|
+
Trigger.trigger(
|
|
8172
|
+
this,
|
|
8173
|
+
{
|
|
8174
|
+
file: 'meeting/index',
|
|
8175
|
+
function: 'setupStatsAnalyzerEventHandlers',
|
|
8176
|
+
},
|
|
8177
|
+
EVENT_TRIGGERS.MEETING_SRTP_CIPHER_UPDATED,
|
|
8178
|
+
{srtpCipher}
|
|
8179
|
+
);
|
|
8180
|
+
}
|
|
8181
|
+
});
|
|
7507
8182
|
};
|
|
7508
8183
|
|
|
7509
8184
|
getMediaConnectionDebugId() {
|
|
7510
8185
|
return `MC-${this.id.substring(0, 4)}`;
|
|
7511
8186
|
}
|
|
7512
8187
|
|
|
8188
|
+
/**
|
|
8189
|
+
* Checks if the error indicates that Locus dropped us from the meeting,
|
|
8190
|
+
* either directly on the error or wrapped inside an AddMediaFailed cause.
|
|
8191
|
+
* This method is meant to be called only with errors thrown by Meeting.addMediaInternal()
|
|
8192
|
+
*
|
|
8193
|
+
* @param {Error} error
|
|
8194
|
+
* @returns {boolean}
|
|
8195
|
+
*/
|
|
8196
|
+
private isErrorMeaningLocusDroppedUs(error: Error | undefined): boolean {
|
|
8197
|
+
const statusCode = (error as any)?.statusCode;
|
|
8198
|
+
const causeStatusCode = (error as any)?.cause?.statusCode;
|
|
8199
|
+
|
|
8200
|
+
return (
|
|
8201
|
+
statusCode === 409 || statusCode === 403 || causeStatusCode === 409 || causeStatusCode === 403
|
|
8202
|
+
);
|
|
8203
|
+
}
|
|
8204
|
+
|
|
8205
|
+
/**
|
|
8206
|
+
* Determines if the next media attempt should use only TURN-TLS (iceTransportPolicy='relay').
|
|
8207
|
+
* We do this in the hope that it will minimize the chance of Homer sending DTLS packets on a wrong
|
|
8208
|
+
* transport (as there will be only 1 transport) and dealing with firewalls that let STUN packets through, but block
|
|
8209
|
+
* other UDP traffic.
|
|
8210
|
+
*
|
|
8211
|
+
* For clients landing on video mesh nodes (VMN), reachability might still have successful TLS (to public nodes)
|
|
8212
|
+
* but TURN discovery will result in empty TURN urls array and iceTransportPolicy='relay' will still be overriden to undefined,
|
|
8213
|
+
* see the code in establishMediaConnection()
|
|
8214
|
+
*
|
|
8215
|
+
* @param {Error} prevError - The error from the previous addMedia attempt
|
|
8216
|
+
* @returns {Promise<boolean>}
|
|
8217
|
+
*/
|
|
8218
|
+
private async shouldRetryMediaWithOnlyTurnTLS(prevError: Error | undefined): Promise<boolean> {
|
|
8219
|
+
if (
|
|
8220
|
+
this.isMultistream &&
|
|
8221
|
+
prevError instanceof AddMediaFailed &&
|
|
8222
|
+
prevError.isDtlsHandshakeFailure &&
|
|
8223
|
+
prevError.connectionType === 'UDP'
|
|
8224
|
+
) {
|
|
8225
|
+
const hasTlsReachability =
|
|
8226
|
+
// @ts-ignore
|
|
8227
|
+
await this.webex.meetings.reachability.isAnyClusterReachableViaProtocol('xtls');
|
|
8228
|
+
|
|
8229
|
+
if (hasTlsReachability) {
|
|
8230
|
+
LoggerProxy.logger.info(
|
|
8231
|
+
'Meeting:index#shouldRetryMediaWithOnlyTurnTLS --> previous attempt failed due to DTLS handshake failure over UDP and TLS reachability is available'
|
|
8232
|
+
);
|
|
8233
|
+
|
|
8234
|
+
return true;
|
|
8235
|
+
}
|
|
8236
|
+
}
|
|
8237
|
+
|
|
8238
|
+
return false;
|
|
8239
|
+
}
|
|
8240
|
+
|
|
7513
8241
|
/**
|
|
7514
8242
|
* Creates a webrtc media connection and publishes streams to it
|
|
7515
8243
|
*
|
|
7516
8244
|
* @param {Object} turnServerInfo TURN server information
|
|
7517
8245
|
* @param {BundlePolicy} [bundlePolicy] Bundle policy settings
|
|
7518
|
-
* @param {
|
|
8246
|
+
* @param {RTCIceTransportPolicy} [iceTransportPolicy] ICE transport policy override
|
|
7519
8247
|
* @returns {RoapMediaConnection | MultistreamRoapMediaConnection}
|
|
7520
8248
|
*/
|
|
7521
8249
|
private async createMediaConnection(
|
|
7522
8250
|
turnServerInfo?: TurnServerInfo,
|
|
7523
|
-
bundlePolicy?: BundlePolicy
|
|
8251
|
+
bundlePolicy?: BundlePolicy,
|
|
8252
|
+
iceTransportPolicy?: RTCIceTransportPolicy
|
|
7524
8253
|
) {
|
|
7525
8254
|
this.rtcMetrics = this.isMultistream
|
|
7526
8255
|
? // @ts-ignore
|
|
@@ -7544,12 +8273,15 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7544
8273
|
enableExtmap: this.config.enableExtmap,
|
|
7545
8274
|
turnServerInfo,
|
|
7546
8275
|
bundlePolicy,
|
|
8276
|
+
iceTransportPolicy,
|
|
7547
8277
|
// @ts-ignore - config coming from registerPlugin
|
|
7548
8278
|
iceCandidatesTimeout: this.config.iceCandidatesGatheringTimeout,
|
|
7549
8279
|
// @ts-ignore - config coming from registerPlugin
|
|
7550
8280
|
disableAudioMainDtx: this.config.experimental.disableAudioMainDtx,
|
|
7551
8281
|
// @ts-ignore - config coming from registerPlugin
|
|
7552
8282
|
enableAudioTwcc: this.config.enableAudioTwccForMultistream,
|
|
8283
|
+
// @ts-ignore - config coming from registerPlugin
|
|
8284
|
+
enableAv1SlidesSupport: this.config.enableAv1SlidesSupport,
|
|
7553
8285
|
stopIceGatheringAfterFirstRelayCandidate:
|
|
7554
8286
|
// @ts-ignore - config coming from registerPlugin
|
|
7555
8287
|
this.config.stopIceGatheringAfterFirstRelayCandidate,
|
|
@@ -7668,7 +8400,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7668
8400
|
try {
|
|
7669
8401
|
await this.mediaProperties.waitForMediaConnectionConnected(this.correlationId);
|
|
7670
8402
|
} catch (error) {
|
|
7671
|
-
const {iceConnected} = error;
|
|
8403
|
+
const {iceConnected} = error as MediaConnectionAwaiterFailureResult;
|
|
7672
8404
|
|
|
7673
8405
|
if (!this.hasMediaConnectionConnectedAtLeastOnce) {
|
|
7674
8406
|
// Only send CA event for join flow if we haven't successfully connected media yet
|
|
@@ -7708,13 +8440,12 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7708
8440
|
});
|
|
7709
8441
|
}
|
|
7710
8442
|
|
|
7711
|
-
|
|
7712
|
-
`Timed out waiting for media connection to be connected, correlationId=${this.correlationId}
|
|
8443
|
+
throw new MediaConnectionTimedOutError(
|
|
8444
|
+
`Timed out waiting for media connection to be connected, correlationId=${this.correlationId}`,
|
|
8445
|
+
iceConnected,
|
|
8446
|
+
// keep reference to the original rejected result (which is the object the SDK reports to CA as rawError above)
|
|
8447
|
+
error
|
|
7713
8448
|
);
|
|
7714
|
-
|
|
7715
|
-
timedOutError.cause = error;
|
|
7716
|
-
|
|
7717
|
-
throw timedOutError;
|
|
7718
8449
|
}
|
|
7719
8450
|
}
|
|
7720
8451
|
|
|
@@ -7761,11 +8492,10 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7761
8492
|
});
|
|
7762
8493
|
|
|
7763
8494
|
if (atLeastOneUnmutedOtherMember) {
|
|
7764
|
-
this.mediaProperties.sendMediaIssueMetric(
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
);
|
|
8495
|
+
this.mediaProperties.sendMediaIssueMetric('inbound_audio', data.issueSubType, {
|
|
8496
|
+
correlationId: this.correlationId,
|
|
8497
|
+
isMultistream: this.isMultistream,
|
|
8498
|
+
});
|
|
7769
8499
|
|
|
7770
8500
|
Trigger.trigger(
|
|
7771
8501
|
this,
|
|
@@ -7927,7 +8657,18 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
7927
8657
|
error
|
|
7928
8658
|
);
|
|
7929
8659
|
|
|
7930
|
-
|
|
8660
|
+
const {connectionType, selectedCandidatePairChanges, numTransports} =
|
|
8661
|
+
await this.mediaProperties.getCurrentConnectionInfo();
|
|
8662
|
+
|
|
8663
|
+
const iceConnected = error instanceof MediaConnectionTimedOutError && error.iceConnected;
|
|
8664
|
+
|
|
8665
|
+
throw new AddMediaFailed({
|
|
8666
|
+
cause: error,
|
|
8667
|
+
connectionType,
|
|
8668
|
+
selectedCandidatePairChanges,
|
|
8669
|
+
numTransports,
|
|
8670
|
+
iceConnected,
|
|
8671
|
+
});
|
|
7931
8672
|
}
|
|
7932
8673
|
}
|
|
7933
8674
|
|
|
@@ -8002,7 +8743,21 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8002
8743
|
({turnServerInfo} = await this.doTurnDiscovery(isReconnecting, isForced));
|
|
8003
8744
|
}
|
|
8004
8745
|
|
|
8005
|
-
|
|
8746
|
+
if (
|
|
8747
|
+
(!turnServerInfo || !turnServerInfo.urls?.length) &&
|
|
8748
|
+
this.addMediaData.iceTransportPolicy === 'relay'
|
|
8749
|
+
) {
|
|
8750
|
+
LoggerProxy.logger.info(
|
|
8751
|
+
`${LOG_HEADER} cannot do iceTransportPolicy=relay, because there is no turn server info available`
|
|
8752
|
+
);
|
|
8753
|
+
// drop the forced relay policy and use the default, because we don't have a TURN server
|
|
8754
|
+
this.addMediaData.iceTransportPolicy = undefined;
|
|
8755
|
+
}
|
|
8756
|
+
const mediaConnection = await this.createMediaConnection(
|
|
8757
|
+
turnServerInfo,
|
|
8758
|
+
bundlePolicy,
|
|
8759
|
+
this.addMediaData.iceTransportPolicy
|
|
8760
|
+
);
|
|
8006
8761
|
|
|
8007
8762
|
LoggerProxy.logger.info(
|
|
8008
8763
|
`${LOG_HEADER} media connection created this.isMultistream=${this.isMultistream}`
|
|
@@ -8039,7 +8794,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8039
8794
|
await this.remoteMediaManager.start();
|
|
8040
8795
|
}
|
|
8041
8796
|
|
|
8042
|
-
await
|
|
8797
|
+
await mediaConnection.initiateOffer();
|
|
8043
8798
|
|
|
8044
8799
|
await this.waitForRemoteSDPAnswer();
|
|
8045
8800
|
|
|
@@ -8107,6 +8862,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8107
8862
|
|
|
8108
8863
|
this.isMultistream = false;
|
|
8109
8864
|
|
|
8865
|
+
// reset iceTransportPolicy, because it's only applied for multistream media connections
|
|
8866
|
+
this.addMediaData.iceTransportPolicy = undefined;
|
|
8867
|
+
|
|
8110
8868
|
if (this.mediaProperties.webrtcMediaConnection) {
|
|
8111
8869
|
// close peer connection, but don't reset mute state information, because we will want to use it on the retry
|
|
8112
8870
|
this.closePeerConnections(false);
|
|
@@ -8187,6 +8945,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8187
8945
|
regionCode: this.webex.meetings.geoHintInfo?.regionCode,
|
|
8188
8946
|
},
|
|
8189
8947
|
preferTranscoding: !this.isMultistream,
|
|
8948
|
+
getCurrentSelfUrl: () => this.selfUrl,
|
|
8949
|
+
waitForSelfUrlChange: () => this.waitForSelfUrlChange(),
|
|
8190
8950
|
},
|
|
8191
8951
|
{
|
|
8192
8952
|
// @ts-ignore
|
|
@@ -8195,6 +8955,41 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8195
8955
|
);
|
|
8196
8956
|
}
|
|
8197
8957
|
|
|
8958
|
+
/**
|
|
8959
|
+
* Waits for LocusInfo to update meeting.selfUrl, with a timeout fallback.
|
|
8960
|
+
* @returns {Promise<void>}
|
|
8961
|
+
* @private
|
|
8962
|
+
* @memberof Meeting
|
|
8963
|
+
*/
|
|
8964
|
+
private waitForSelfUrlChange(): Promise<void> {
|
|
8965
|
+
if (this.joinWithMediaRetryInfo.retryCount > 0) {
|
|
8966
|
+
/* During joinWithMedia() retries we can get 403/409 from Locus and it doesn't mean
|
|
8967
|
+
* that the selfUrl will change, it is usually caused by Locus dropping us as a result of
|
|
8968
|
+
* media connection failure during joinWithMedia's earlier media connection attempt,
|
|
8969
|
+
* so we don't want to wait for selfUrl change as this would only slow down the join process. */
|
|
8970
|
+
LoggerProxy.logger.info(
|
|
8971
|
+
'Meeting:index#waitForSelfUrlChange --> joinWithMedia retry in progress, will not wait for selfUrl change'
|
|
8972
|
+
);
|
|
8973
|
+
|
|
8974
|
+
return Promise.resolve();
|
|
8975
|
+
}
|
|
8976
|
+
|
|
8977
|
+
if (!this.promisesWaitingForPropUpdate.selfUrl) {
|
|
8978
|
+
const pendingSelfUrlUpdate = new Defer();
|
|
8979
|
+
|
|
8980
|
+
this.promisesWaitingForPropUpdate.selfUrl = pendingSelfUrlUpdate;
|
|
8981
|
+
|
|
8982
|
+
setTimeout(() => {
|
|
8983
|
+
if (this.promisesWaitingForPropUpdate.selfUrl === pendingSelfUrlUpdate) {
|
|
8984
|
+
delete this.promisesWaitingForPropUpdate.selfUrl;
|
|
8985
|
+
pendingSelfUrlUpdate.resolve();
|
|
8986
|
+
}
|
|
8987
|
+
}, 5000);
|
|
8988
|
+
}
|
|
8989
|
+
|
|
8990
|
+
return this.promisesWaitingForPropUpdate.selfUrl.promise;
|
|
8991
|
+
}
|
|
8992
|
+
|
|
8198
8993
|
/**
|
|
8199
8994
|
* Creates a media connection to the server. Media connection is required for sending or receiving any audio/video.
|
|
8200
8995
|
*
|
|
@@ -8206,8 +9001,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8206
9001
|
addMedia(options: AddMediaOptions = {}): Promise<void> {
|
|
8207
9002
|
return this.addMediaInternal(
|
|
8208
9003
|
() => (this.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY'),
|
|
8209
|
-
undefined,
|
|
8210
9004
|
false,
|
|
9005
|
+
undefined /* turnServerInfo - it will be fetched via doTurnDiscovery() */,
|
|
9006
|
+
undefined /* iceTransportPolicy - we're relying on the default value */,
|
|
8211
9007
|
options
|
|
8212
9008
|
);
|
|
8213
9009
|
}
|
|
@@ -8216,8 +9012,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8216
9012
|
* Internal version of addMedia() with some more arguments for finer control of its behavior
|
|
8217
9013
|
*
|
|
8218
9014
|
* @param {Function} icePhaseCallback - callback to determine the icePhase for CA "client.ice.end" failure events
|
|
8219
|
-
* @param {TurnServerInfo} turnServerInfo - TURN server information
|
|
8220
9015
|
* @param {boolean} forceTurnDiscovery - if true, TURN discovery will be done
|
|
9016
|
+
* @param {TurnServerInfo} turnServerInfo - TURN server information
|
|
9017
|
+
* @param {RTCIceTransportPolicy} [iceTransportPolicy] - ICE transport policy override
|
|
8221
9018
|
* @param {AddMediaOptions} options - same as options of the public addMedia() method
|
|
8222
9019
|
* @returns {Promise<void>}
|
|
8223
9020
|
* @protected
|
|
@@ -8225,12 +9022,14 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8225
9022
|
*/
|
|
8226
9023
|
protected async addMediaInternal(
|
|
8227
9024
|
icePhaseCallback: () => string,
|
|
8228
|
-
|
|
8229
|
-
|
|
9025
|
+
forceTurnDiscovery: boolean,
|
|
9026
|
+
turnServerInfo?: TurnServerInfo,
|
|
9027
|
+
iceTransportPolicy?: RTCIceTransportPolicy,
|
|
8230
9028
|
options: AddMediaOptions = {}
|
|
8231
9029
|
): Promise<void> {
|
|
8232
9030
|
this.addMediaData.retriedWithTurnServer = false;
|
|
8233
9031
|
this.addMediaData.icePhaseCallback = icePhaseCallback;
|
|
9032
|
+
this.addMediaData.iceTransportPolicy = iceTransportPolicy;
|
|
8234
9033
|
|
|
8235
9034
|
this.hasMediaConnectionConnectedAtLeastOnce = false;
|
|
8236
9035
|
const LOG_HEADER = 'Meeting:index#addMedia -->';
|
|
@@ -8239,7 +9038,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8239
9038
|
options
|
|
8240
9039
|
)}, turnServerInfo=${JSON.stringify(
|
|
8241
9040
|
turnServerInfo
|
|
8242
|
-
)}, forceTurnDiscovery=${forceTurnDiscovery}`
|
|
9041
|
+
)}, forceTurnDiscovery=${forceTurnDiscovery}, iceTransportPolicy=${iceTransportPolicy}`
|
|
8243
9042
|
);
|
|
8244
9043
|
|
|
8245
9044
|
if (options.allowMediaInLobby !== true && this.meetingState !== FULL_STATE.ACTIVE) {
|
|
@@ -8353,12 +9152,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8353
9152
|
|
|
8354
9153
|
// Establish new media connection with forced TURN discovery
|
|
8355
9154
|
// 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
|
-
);
|
|
9155
|
+
await this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
|
|
8362
9156
|
} else {
|
|
8363
9157
|
throw error;
|
|
8364
9158
|
}
|
|
@@ -8387,7 +9181,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8387
9181
|
numTransports,
|
|
8388
9182
|
isMultistream: this.isMultistream,
|
|
8389
9183
|
retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
|
|
8390
|
-
isJoinWithMediaRetry: this.joinWithMediaRetryInfo.
|
|
9184
|
+
isJoinWithMediaRetry: this.joinWithMediaRetryInfo.retryCount > 0,
|
|
9185
|
+
iceTransportPolicy: this.addMediaData.iceTransportPolicy || 'all',
|
|
8391
9186
|
...reachabilityMetrics,
|
|
8392
9187
|
...iceCandidateErrors,
|
|
8393
9188
|
iceCandidatesCount: this.iceCandidatesCount,
|
|
@@ -8409,14 +9204,16 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8409
9204
|
// We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
|
|
8410
9205
|
this.remoteMediaManager?.logAllReceiveSlots();
|
|
8411
9206
|
this.startPeriodicLogUpload();
|
|
8412
|
-
} catch (error) {
|
|
9207
|
+
} catch (error: any) {
|
|
8413
9208
|
LoggerProxy.logger.error(`${LOG_HEADER} failed to establish media connection: `, error);
|
|
8414
9209
|
|
|
8415
9210
|
// @ts-ignore
|
|
8416
9211
|
const reachabilityMetrics = await this.getMediaReachabilityMetricFields();
|
|
8417
9212
|
|
|
8418
|
-
const {selectedCandidatePairChanges, numTransports} =
|
|
8419
|
-
|
|
9213
|
+
const {connectionType, selectedCandidatePairChanges, numTransports} =
|
|
9214
|
+
error instanceof AddMediaFailed
|
|
9215
|
+
? error
|
|
9216
|
+
: await this.mediaProperties.getCurrentConnectionInfo();
|
|
8420
9217
|
|
|
8421
9218
|
const iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
|
|
8422
9219
|
|
|
@@ -8432,7 +9229,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8432
9229
|
turnServerUsed: this.turnServerUsed,
|
|
8433
9230
|
retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
|
|
8434
9231
|
isMultistream: this.isMultistream,
|
|
8435
|
-
isJoinWithMediaRetry: this.joinWithMediaRetryInfo.
|
|
9232
|
+
isJoinWithMediaRetry: this.joinWithMediaRetryInfo.retryCount > 0,
|
|
9233
|
+
iceTransportPolicy: this.addMediaData.iceTransportPolicy || 'all',
|
|
8436
9234
|
signalingState:
|
|
8437
9235
|
this.mediaProperties.webrtcMediaConnection?.multistreamConnection?.pc?.pc
|
|
8438
9236
|
?.signalingState ||
|
|
@@ -8448,6 +9246,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8448
9246
|
?.iceConnectionState ||
|
|
8449
9247
|
this.mediaProperties.webrtcMediaConnection?.mediaConnection?.pc?.iceConnectionState ||
|
|
8450
9248
|
'unknown',
|
|
9249
|
+
connectionType,
|
|
8451
9250
|
...reachabilityMetrics,
|
|
8452
9251
|
...iceCandidateErrors,
|
|
8453
9252
|
iceCandidatesCount: this.iceCandidatesCount,
|
|
@@ -8796,6 +9595,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
8796
9595
|
options: {meetingId: this.id},
|
|
8797
9596
|
});
|
|
8798
9597
|
LoggerProxy.logger.log('Meeting:index#leave --> Leaving a meeting');
|
|
9598
|
+
this.stopListeningForMeetingEvents();
|
|
8799
9599
|
|
|
8800
9600
|
return MeetingUtil.leaveMeeting(this, options)
|
|
8801
9601
|
.then(async (leave) => {
|
|
@@ -9661,6 +10461,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
9661
10461
|
locus_id: this.locusId,
|
|
9662
10462
|
});
|
|
9663
10463
|
|
|
10464
|
+
this.stopListeningForMeetingEvents();
|
|
10465
|
+
|
|
9664
10466
|
return MeetingUtil.endMeetingForAll(this)
|
|
9665
10467
|
.then(async (end) => {
|
|
9666
10468
|
this.meetingFiniteStateMachine.end();
|
|
@@ -9722,12 +10524,15 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
9722
10524
|
}
|
|
9723
10525
|
this.queuedMediaUpdates = [];
|
|
9724
10526
|
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
10527
|
+
// Listener teardown (transcription, annotation, llm/mercury) runs in
|
|
10528
|
+
// stopListeningForMeetingEvents() before /leave and /end so events
|
|
10529
|
+
// received mid-teardown do not trigger Locus syncs. Calling it here
|
|
10530
|
+
// again would double-emit MEETING_STOPPED_RECEIVING_TRANSCRIPTION
|
|
10531
|
+
// because stopTranscription() always fires its trigger.
|
|
10532
|
+
//
|
|
10533
|
+
// Ownership-aware token clear is encapsulated inside clearDataChannelToken().
|
|
9730
10534
|
this.clearDataChannelToken();
|
|
10535
|
+
|
|
9731
10536
|
await this.cleanupLLMConneciton({throwOnError: false});
|
|
9732
10537
|
};
|
|
9733
10538
|
|
|
@@ -9804,15 +10609,12 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
9804
10609
|
* @public
|
|
9805
10610
|
* @memberof Meeting
|
|
9806
10611
|
*/
|
|
9807
|
-
public sendReaction(reactionType:
|
|
10612
|
+
public sendReaction(reactionType: string, skinToneType?: SkinToneType) {
|
|
9808
10613
|
const reactionChannelUrl = this.locusInfo?.controls?.reactions?.reactionChannelUrl as string;
|
|
9809
10614
|
const participantId = this.members.selfId;
|
|
9810
10615
|
|
|
9811
|
-
const reactionData = Reactions[reactionType];
|
|
10616
|
+
const reactionData = Reactions[reactionType] || {type: reactionType};
|
|
9812
10617
|
|
|
9813
|
-
if (!reactionData) {
|
|
9814
|
-
return Promise.reject(new Error(`${reactionType} is not a valid reaction.`));
|
|
9815
|
-
}
|
|
9816
10618
|
const skinToneData = SkinTones[skinToneType] || SkinTones.normal;
|
|
9817
10619
|
const reaction: Reaction = {
|
|
9818
10620
|
...reactionData,
|