@webex/plugin-meetings 1.159.0 → 1.159.3

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.
@@ -275,7 +275,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
275
275
  // Either the locus
276
276
  // TODO : Add check for the callBack Address
277
277
 
278
- meeting = this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locusUrl) || this.meetingCollection.getByKey(_constants.CORRELATION_ID, _util2.default.checkForCorrelationId(this.webex.internal.device.url, data.locus)) || this.meetingCollection.getByKey(_constants.SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) || this.meetingCollection.getByKey(_constants.CONVERSATION_URL, data.locus.conversationUrl); // Special case when locus has got replaced, This only happend once if a replace locus exists
278
+ meeting = this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locusUrl) || this.meetingCollection.getByKey(_constants.CORRELATION_ID, _util2.default.checkForCorrelationId(this.webex.internal.device.url, data.locus)) || this.meetingCollection.getByKey(_constants.SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) || (this.config.experimental.enableUnifiedMeetings ? undefined : this.meetingCollection.getByKey(_constants.CONVERSATION_URL, data.locus.conversationUrl)); // Special case when locus has got replaced, This only happend once if a replace locus exists
279
279
  // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call
280
280
 
281
281
  if (!meeting && ((_data$locus = data.locus) === null || _data$locus === void 0 ? void 0 : (_data$locus$replaces = _data$locus.replaces) === null || _data$locus$replaces === void 0 ? void 0 : _data$locus$replaces.length) > 0) {
@@ -712,8 +712,9 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
712
712
  var _this9 = this;
713
713
 
714
714
  return this.request.fetchLoginUserInformation().then(function (res) {
715
- _this9.preferredWebexSite = _util2.default.parseUserPreferences(res.userPreferences);
716
- console.error(_this9.preferredWebexSite);
715
+ if (res && res.userPreferences) {
716
+ _this9.preferredWebexSite = _util2.default.parseUserPreferences(res === null || res === void 0 ? void 0 : res.userPreferences);
717
+ }
717
718
  });
718
719
  }
719
720
  /**
@@ -783,7 +784,16 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
783
784
  var meeting = null;
784
785
 
785
786
  if (type === _constants._CONVERSATION_URL_ || options.type === _constants._CONVERSATION_URL_) {
786
- meeting = _this10.meetingCollection.getByKey(_constants.CONVERSATION_URL, targetDest);
787
+ var foundMeeting = _this10.meetingCollection.getByKey(_constants.CONVERSATION_URL, targetDest);
788
+
789
+ if (foundMeeting) {
790
+ var foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting; // If the found meeting is not a calendar meeting, return that meeting.
791
+ // This allows for the creation of instant-meetings when calendar meetings are present.
792
+
793
+ if (foundMeetingIsNotCalendarMeeting) {
794
+ meeting = foundMeeting;
795
+ }
796
+ }
787
797
  } // Attempt to collect the meeting if it exists.
788
798
 
789
799
 
@@ -869,20 +879,19 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
869
879
  roapSeq: 0,
870
880
  locus: type === _constants._LOCUS_ID_ ? destination : null,
871
881
  // pass the locus object if present
872
- meetingInfoProvider: this.meetingInfo
882
+ meetingInfoProvider: this.meetingInfo,
883
+ destination: destination,
884
+ destinationType: type
873
885
  }, {
874
886
  parent: this.webex
875
887
  });
876
888
  this.meetingCollection.set(meeting);
877
889
  _context.prev = 3;
878
890
  _context.next = 6;
879
- return meeting.fetchMeetingInfo({
880
- destination: destination,
881
- type: type
882
- });
891
+ return meeting.fetchMeetingInfo({});
883
892
 
884
893
  case 6:
885
- _context.next = 13;
894
+ _context.next = 12;
886
895
  break;
887
896
 
888
897
  case 8:
@@ -896,13 +905,10 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
896
905
  _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
897
906
  }
898
907
 
899
- _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context.t0, " fetching /meetingInfo for creation.")); // We need to save this info for future reference
900
-
908
+ _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context.t0, " fetching /meetingInfo for creation."));
901
909
 
902
- meeting.destination = destination;
903
-
904
- case 13:
905
- _context.prev = 13;
910
+ case 12:
911
+ _context.prev = 12;
906
912
 
907
913
  // For type LOCUS_ID we need to parse the locus object to get the information
908
914
  // about the caller and callee
@@ -925,17 +931,17 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
925
931
  });
926
932
  }
927
933
 
928
- return _context.finish(13);
934
+ return _context.finish(12);
929
935
 
930
- case 16:
936
+ case 15:
931
937
  return _context.abrupt("return", meeting);
932
938
 
933
- case 17:
939
+ case 16:
934
940
  case "end":
935
941
  return _context.stop();
936
942
  }
937
943
  }
938
- }, _callee, this, [[3, 8, 13, 16]]);
944
+ }, _callee, this, [[3, 8, 12, 15]]);
939
945
  }));
940
946
 
941
947
  function createMeeting(_x) {
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"names":["Meetings","args","MEETINGS","request","Request","parent","webex","loggerRequest","LoggerRequest","meetingCollection","MeetingCollection","personalMeetingRoom","reachability","registered","preferredWebexSite","media","getUserMedia","Media","getSupportedDevice","onReady","MeetingsUtil","checkH264Support","disableNotifications","Metrics","initialSetup","data","meeting","getByKey","LOCUS_URL","locusUrl","CORRELATION_ID","checkForCorrelationId","internal","device","url","locus","SIP_URI","self","callbackInfo","callbackAddress","CONVERSATION_URL","conversationUrl","replaces","length","fullState","state","LOCUS","STATE","INACTIVE","LoggerProxy","logger","warn","_LEFT_","removed","create","_LOCUS_ID_","then","newMeeting","locusInfo","catch","e","console","log","finally","getMeetingByType","_ID_","id","postEvent","event","eventType","REMOTE_STARTED","trigger","MERCURY_EVENT","Trigger","file","function","EVENT_TRIGGERS","MEETING_ADDED","type","_MEETING_","_JOIN_","_INCOMING_","parse","envelope","LOCUSEVENT","MESSAGE_ROAP","handleLocusEvent","MEETINGS_NETWORK_DISCONNECTED","mercury","on","LOCUS_MERCURY","handleLocusMercury","ROAP","ROAP_MERCURY","handleRoapMercury","ONLINE","syncMeetings","OFFLINE","handleMercuryOffline","off","once","READY","StaticConfig","set","config","LoggerConfig","logging","meetingInfo","experimental","enableUnifiedMeetings","MeetingInfoV2","MeetingInfo","PersonalMeetingRoom","MEETINGS_READY","changeState","enableAdhocMeetings","canAuthorize","error","reject","Error","info","resolve","all","fetchUserPreferredWebexSite","getGeoHint","startReachability","message","register","connect","call","listenForEvents","MEETINGS_REGISTERED","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETINGS_REGISTRATION_SUCCESS","MEETINGS_REGISTRATION_FAILED","reason","stack","stopListeningForEvents","disconnect","unregister","MEETINGS_UNREGISTERED","options","uploadLogs","uploadResult","MEETING_LOG_UPLOAD_SUCCESS","meetingId","details","uploadError","MEETING_LOG_UPLOAD_FAILURE","UPLOAD_LOGS_FAILURE","meetingsId","code","Reachability","setReachability","getReachability","gatherReachability","fetchGeoHint","res","geoHintInfo","fetchLoginUserInformation","parseUserPreferences","userPreferences","MeetingUtil","cleanUp","delete","MEETING_REMOVED","destination","fetchInfoOptions","targetDest","_CONVERSATION_URL_","createMeeting","createdMeeting","EVENTS","DESTROY_MEETING","payload","autoUploadLogs","callStart","lastActive","correlationId","feedbackId","locusId","webExMeetingId","destroy","REQUEST_UPLOAD_LOGS","meetingInstance","Meeting","userId","deviceUrl","orgId","roapSeq","meetingInfoProvider","fetchMeetingInfo","CaptchaError","PasswordError","debug","sipUri","setSipUri","meetingAddedType","getMeetingAddedType","value","getAll","getActiveMeetings","locusArray","activeLocusUrl","loci","forEach","push","meetingsCollection","includes","MEETING_REMOVED_REASON","NO_MEETINGS_TO_SYNC","scheduled","get","StatsAnalyzer","StatsCalculator","WebexPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAuBA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;IACqBA,Q;;;;;AAGjB;AACJ;AACA;AACA;AACA;AACA;AACI,sBAAqB;AAAA;;AAAA;;AAAA,sCAANC,IAAM;AAANA,MAAAA,IAAM;AAAA;;AACnB,oDAASA,IAAT;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AATyB,4FARTC,mBAQS;AAUnB,UAAKC,OAAL,GAAe,IAAIC,iBAAJ,CAAY,EAAZ,EAAgB;AAACC,MAAAA,MAAM,EAAE,MAAKC;AAAd,KAAhB,CAAf;AACA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,aAAL,GAAqB,IAAIC,gBAAJ,CAAkB;AAACF,MAAAA,KAAK,EAAE,MAAKA;AAAb,KAAlB,CAArB;AACA,UAAKG,iBAAL,GAAyB,IAAIC,mBAAJ,EAAzB;AACA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,mBAAL,GAA2B,IAA3B;AACA;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,YAAL,GAAoB,IAApB;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,UAAL,GAAkB,KAAlB;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,kBAAL,GAA0B,EAA1B;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,KAAL,GAAa;AACXC,MAAAA,YAAY,E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AAAA,SAAS,EAAE;AAAZ,OAA9B,CAAP;AACD;AAED;AACJ;AACA;AACA;;;;WACI,qBAAY;AACV,aAAOnK,qBAAYoK,GAAZ,EAAP;AACD;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,uBAAc;AACZ,aAAOC,iBAAP;AACD;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,yBAAgB;AACd,aAAOC,mBAAP;AACD;;;EA90BiCC,sB","sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n*/\n\nimport '@webex/internal-plugin-mercury';\nimport '@webex/internal-plugin-conversation';\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport 'webrtc-adapter';\n\nimport Metrics from '../metrics';\nimport {trigger, eventType} from '../metrics/config';\nimport LoggerConfig from '../common/logs/logger-config';\nimport StaticConfig from '../common/config';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport LoggerRequest from '../common/logs/request';\nimport Trigger from '../common/events/trigger-proxy';\nimport Media from '../media';\nimport MeetingUtil from '../meeting/util';\nimport {\n MEETINGS,\n EVENTS,\n EVENT_TRIGGERS,\n READY,\n LOCUSEVENT,\n LOCUS_URL,\n ROAP,\n ONLINE,\n OFFLINE,\n _MEETING_,\n _JOIN_,\n _LOCUS_ID_,\n _INCOMING_,\n LOCUS,\n CORRELATION_ID,\n SIP_URI,\n _LEFT_,\n _ID_,\n MEETING_REMOVED_REASON,\n _CONVERSATION_URL_,\n CONVERSATION_URL\n} from '../constants';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport MeetingInfo from '../meeting-info';\nimport MeetingInfoV2 from '../meeting-info/meeting-info-v2';\nimport Meeting from '../meeting';\nimport PersonalMeetingRoom from '../personal-meeting-room';\nimport Reachability from '../reachability';\nimport Request from '../meetings/request';\nimport StatsAnalyzer from '../analyzer/analyzer';\nimport StatsCalculator from '../analyzer/calculator';\nimport PasswordError from '../common/errors/password-error';\nimport CaptchaError from '../common/errors/captcha-error';\n\nimport MeetingCollection from './collection';\nimport MeetingsUtil from './util';\n\n\n/**\n * Meetings Ready Event\n * Emitted when the meetings instance on webex is ready\n * @event meetings:ready\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meetings Network Disconnected Event\n * Emitted when the meetings instance is disconnected from\n * the internal mercury server\n * @event network:disconnected\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meetings Registered Event\n * Emitted when the meetings instance has been registered and listening\n * @event meetings:registered\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meeting Removed Event\n * Emitted when a meeting was removed from the cache of meetings\n * @event meeting:removed\n * @instance\n * @type {Object}\n * @property {String} meetingId the removed meeting\n * @property {Object} response the server response\n * @property {String} type what type of meeting it was\n * @memberof Meetings\n */\n\n/**\n * Meeting Added Event\n * Emitted when a meeting was added to the cache of meetings\n * @event meeting:added\n * @instance\n * @type {Object}\n * @property {String} meetingId the added meeting\n * @property {String} type what type of meeting it was\n * @memberof Meetings\n */\n\n/**\n * Maintain a cache of meetings and sync with services.\n * @class\n */\nexport default class Meetings extends WebexPlugin {\n namespace = MEETINGS;\n\n /**\n * Initializes the Meetings Plugin\n * @constructor\n * @public\n * @memberof Meetings\n */\n constructor(...args) {\n super(...args);\n\n /**\n * The Meetings request to interact with server\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.request = new Request({}, {parent: this.webex});\n /**\n * Log upload request helper\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.loggerRequest = new LoggerRequest({webex: this.webex});\n this.meetingCollection = new MeetingCollection();\n /**\n * The PersonalMeetingRoom object to interact with server\n * @instance\n * @type {Object}\n * @public\n * @memberof Meetings\n */\n this.personalMeetingRoom = null;\n /**\n * The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called\n * starts as null\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.reachability = null;\n\n /**\n * If the meetings plugin has been registered and listening via {@link Meetings#register}\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Meetings\n */\n this.registered = false;\n\n /**\n * This values indicates the preferred webex site the user will start there meeting, getsits value from {@link Meetings#register}\n * @instance\n * @type {String}\n * @private\n * @memberof Meetings\n */\n this.preferredWebexSite = '';\n\n /**\n * The public interface for the internal Media util files. These are helpful to expose outside the context\n * of a meeting so that a user can access media without creating a meeting instance.\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.media = {\n getUserMedia: Media.getUserMedia,\n getSupportedDevice: Media.getSupportedDevice\n };\n\n this.onReady();\n MeetingsUtil.checkH264Support({disableNotifications: true});\n Metrics.initialSetup(this.meetingCollection, this.webex);\n }\n\n /**\n * handle locus events and takes meeting actions with them as they come in\n * @param {Object} data a locus event\n * @param {String} data.locusUrl\n * @param {Object} data.locus\n * @param {String} data.eventType\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleLocusEvent(data) {\n let meeting = null;\n\n // getting meeting by correlationId. This will happen for the new event\n // Either the locus\n // TODO : Add check for the callBack Address\n meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locusUrl) ||\n this.meetingCollection.getByKey(CORRELATION_ID, MeetingsUtil.checkForCorrelationId(this.webex.internal.device.url, data.locus)) ||\n this.meetingCollection.getByKey(SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) ||\n this.meetingCollection.getByKey(CONVERSATION_URL, data.locus.conversationUrl);\n\n // Special case when locus has got replaced, This only happend once if a replace locus exists\n // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call\n\n if (!meeting && data.locus?.replaces?.length > 0) {\n // Always the last element in the replace is the active one\n meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locus.replaces[data.locus.replaces.length - 1].locusUrl);\n }\n\n if (!meeting) {\n // TODO: create meeting when we get a meeting object\n // const checkForEnded = (locus) => {\n // TODO: you already ended the meeting but you got an event later\n // Mainly for 1:1 Callsor meeting\n // Happens mainly after refresh\n\n // 1:1 Meeting\n // 1) You ended a call before but you got a mercury event\n // Make sure end the call and cleanup the meeting only if the mercury\n // event says so\n // 2) Maintain lastSync time in the meetings object which helps to compare\n // If the meeting came befor or after the sync . ANy meeting start time before the sync time is invalid\n\n // For space Meeting\n // Check the locus object and see who has joined\n\n // };\n // rather then locus object change to locus url\n\n if (data.locus && data.locus.fullState && data.locus.fullState.state === LOCUS.STATE.INACTIVE) {\n // just ignore the event as its already ended and not active\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');\n\n return;\n }\n\n\n // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object\n // Any future events will be neglected\n\n if (data.locus && data.locus.self && (data.locus.self.state === _LEFT_ && data.locus.self.removed === true)) {\n // just ignore the event as its already ended and not active\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');\n\n return;\n }\n\n this.create(data.locus, _LOCUS_ID_).then((newMeeting) => {\n meeting = newMeeting;\n\n // It's a new meeting so initialize the locus data\n meeting.locusInfo.initialSetup(data.locus);\n }).catch((e) => {\n console.log(e);\n })\n .finally(() => {\n // There will be cases where locus event comes in gets created and deleted because its a 1:1 and meeting gets deleted\n // because the other user left so before sending 'added' event make sure it exists in the collection\n\n if (this.getMeetingByType(_ID_, meeting.id)) {\n Metrics.postEvent({event: eventType.REMOTE_STARTED, meeting, data: {trigger: trigger.MERCURY_EVENT}});\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'handleLocusEvent'\n },\n EVENT_TRIGGERS.MEETING_ADDED,\n {\n meeting,\n type: meeting.type === _MEETING_ ? _JOIN_ : _INCOMING_\n }\n );\n }\n else {\n // Meeting got added but was not found in the collection. It might have got destroyed\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Created and destroyed meeting object before sending an event');\n }\n });\n }\n else {\n meeting.locusInfo.parse(meeting, data);\n }\n }\n\n /**\n * handles locus events through mercury that are not roap\n * @param {Object} envelope\n * @param {Object} envelope.data\n * @param {String} envelope.data.eventType\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleLocusMercury(envelope) {\n const {data} = envelope;\n const {eventType} = data;\n\n if (eventType && eventType !== LOCUSEVENT.MESSAGE_ROAP) {\n this.handleLocusEvent(data);\n }\n }\n\n\n /**\n * handles mecury offline event\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleMercuryOffline() {\n Trigger.trigger(\n this,\n {\n file: 'meetings/index',\n function: 'handleMercuryOffline'\n },\n EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED,\n );\n }\n\n\n /**\n * registers for locus and roap mercury events\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n listenForEvents() {\n this.webex.internal.mercury.on(LOCUSEVENT.LOCUS_MERCURY, (envelope) => {\n this.handleLocusMercury(envelope);\n });\n this.webex.internal.mercury.on(ROAP.ROAP_MERCURY, (envelope) => {\n MeetingsUtil.handleRoapMercury(envelope, this.meetingCollection);\n });\n\n this.webex.internal.mercury.on(ONLINE, () => {\n this.syncMeetings();\n });\n\n this.webex.internal.mercury.on(OFFLINE, () => {\n this.handleMercuryOffline();\n });\n }\n\n /**\n * stops listening for locus and roap mercury events\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n stopListeningForEvents() {\n this.webex.internal.mercury.off(LOCUSEVENT.LOCUS_MERCURY);\n this.webex.internal.mercury.off(ROAP.ROAP_MERCURY);\n this.webex.internal.mercury.off(ONLINE);\n }\n\n /**\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n onReady() {\n this.webex.once(READY, () => {\n StaticConfig.set(this.config);\n LoggerProxy.set(this.webex.logger);\n LoggerConfig.set(this.config.logging);\n\n /**\n * The MeetingInfo object to interact with server\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.meetingInfo = this.config.experimental.enableUnifiedMeetings ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);\n this.personalMeetingRoom = new PersonalMeetingRoom({meetingInfo: this.meetingInfo}, {parent: this.webex});\n\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'onReady'\n },\n EVENT_TRIGGERS.MEETINGS_READY\n );\n });\n }\n\n /**\n * API to toggle unified meetings\n * @param {Boolean} changeState\n * @private\n * @memberof Meetings\n * @returns {undefined}\n */\n _toggleUnifiedMeetings(changeState) {\n if (typeof changeState !== 'boolean') {\n return;\n }\n if (this.config?.experimental?.enableUnifiedMeetings !== changeState) {\n this.config.experimental.enableUnifiedMeetings = changeState;\n this.meetingInfo = changeState ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);\n }\n }\n\n /**\n * API to toggle starting adhoc meeting\n * @param {Boolean} changeState\n * @private\n * @memberof Meetings\n * @returns {undefined}\n */\n _toggleAdhocMeetings(changeState) {\n if (typeof changeState !== 'boolean') {\n return;\n }\n if (this.config?.experimental?.enableAdhocMeetings !== changeState) {\n this.config.experimental.enableAdhocMeetings = changeState;\n }\n }\n\n /**\n * Explicitly sets up the meetings plugin by registering\n * the device, connecting to mercury, and listening for locus events.\n *\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n register() {\n if (!this.webex.canAuthorize) {\n LoggerProxy.logger.error('Meetings:index#register --> ERROR, Unable to register, SDK cannot authorize');\n\n return Promise.reject(new Error('SDK cannot authorize'));\n }\n\n\n if (this.registered) {\n LoggerProxy.logger.info('Meetings:index#register --> INFO, Meetings plugin already registered');\n\n return Promise.resolve();\n }\n\n return Promise.all([\n this.fetchUserPreferredWebexSite(),\n this.getGeoHint(),\n this.startReachability().catch((error) => {\n LoggerProxy.logger.error(`Meetings:index#register --> GDM error, ${error.message}`);\n }),\n this.webex.internal.device.register()\n .then(() => LoggerProxy.logger.info(`Meetings:index#register --> INFO, Device registered ${this.webex.internal.device.url}`))\n .then(() => this.webex.internal.mercury.connect()),\n MeetingsUtil.checkH264Support.call(this)\n ]).then(() => {\n this.listenForEvents();\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'register'\n },\n EVENT_TRIGGERS.MEETINGS_REGISTERED\n );\n this.registered = true;\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_SUCCESS,\n );\n })\n .catch((error) => {\n LoggerProxy.logger.error(`Meetings:index#register --> ERROR, Unable to register, ${error.message}`);\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_FAILED,\n {\n reason: error.message,\n stack: error.stack\n }\n );\n\n return Promise.reject(error);\n });\n }\n\n /**\n * Explicitly tears down the meetings plugin by deregistering\n * the device, disconnecting from mercury, and stops listening to locus events\n *\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n unregister() {\n if (!this.registered) {\n LoggerProxy.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');\n\n return Promise.resolve();\n }\n\n this.stopListeningForEvents();\n\n return this.webex.internal.mercury.disconnect()\n .then(() => this.webex.internal.device.unregister())\n .then(() => {\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'unregister'\n },\n EVENT_TRIGGERS.MEETINGS_UNREGISTERED\n );\n this.registered = false;\n });\n }\n\n /**\n * Uploads logs to the webex services for tracking\n * @param {Object} [options={}]\n * @param {String} [options.callStart] Call Start Time\n * @param {String} [options.feedbackId] ID used for tracking\n * @param {String} [options.locusId]\n * @param {String} [options.correlationId]\n * @param {String} [options.meetingId] webex meeting ID\n * @param {String} [options.userId] userId\n * @param {String} [options.orgId] org id\n * @returns {String} feedback ID logs were submitted under\n */\n uploadLogs(options = {}) {\n LoggerProxy.logger.info('Meetings:index#uploadLogs --> uploading logs');\n\n return this.loggerRequest.uploadLogs(options)\n .then((uploadResult) => {\n LoggerProxy.logger.info('Meetings:index#uploadLogs --> Upload logs for meeting completed.', uploadResult);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'uploadLogs'\n },\n EVENT_TRIGGERS.MEETING_LOG_UPLOAD_SUCCESS,\n {\n meetingId: options.meetingId,\n details: uploadResult\n }\n );\n })\n .catch((uploadError) => {\n LoggerProxy.logger.error('Meetings:index#uploadLogs --> Unable to upload logs for meeting', uploadError);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'uploadLogs'\n },\n EVENT_TRIGGERS.MEETING_LOG_UPLOAD_FAILURE,\n {\n meetingId: options.meetingId,\n reason: uploadError\n }\n );\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.UPLOAD_LOGS_FAILURE,\n {\n meetingId: options.meetingsId,\n reason: uploadError.message,\n stack: uploadError.stack,\n code: uploadError.code\n }\n );\n });\n }\n\n /**\n * initializes the reachability instance for Meetings\n * @returns {undefined}\n * @public\n * @memberof Meetings\n */\n setReachability() {\n this.reachability = new Reachability(this.webex);\n }\n\n /**\n * gets the reachability instance for Meetings\n * @returns {Reachability}\n * @public\n * @memberof Meetings\n */\n getReachability() {\n return this.reachability;\n }\n\n /**\n * initializes and starts gathering reachability for Meetings\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n startReachability() {\n if (!this.reachability) {\n this.setReachability();\n }\n\n return this.getReachability().gatherReachability();\n }\n\n /**\n * Get geoHint for info for meetings\n * @returns {Promise}\n * @private\n * @memberof Meetings\n */\n getGeoHint() {\n return this.request.fetchGeoHint().then((res) => {\n this.geoHintInfo = res;\n });\n }\n\n /**\n * Fetch user preferred webex site information\n * This also has other infomation about the user\n * @returns {Promise}\n * @private\n * @memberof Meetings\n */\n fetchUserPreferredWebexSite() {\n return this.request.fetchLoginUserInformation().then((res) => {\n this.preferredWebexSite = MeetingsUtil.parseUserPreferences(res.userPreferences);\n console.error(this.preferredWebexSite);\n });\n }\n\n\n /**\n * gets the personal meeting room instance, for saved PMR values for this user\n * @returns {PersonalMeetingRoom}\n * @public\n * @memberof Meetings\n */\n\n getPersonalMeetingRoom() {\n return this.personalMeetingRoom;\n }\n\n /**\n * @param {Meeting} meeting\n * @param {Object} reason\n * @param {String} type\n * @returns {Undefined}\n * @private\n * @memberof Meetings\n */\n destroy(meeting, reason) {\n MeetingUtil.cleanUp(meeting);\n this.meetingCollection.delete(meeting.id);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'destroy'\n },\n EVENT_TRIGGERS.MEETING_REMOVED,\n {\n meetingId: meeting.id,\n reason\n }\n );\n }\n\n /**\n * Create a meeting.\n * @param {string} destination - sipURL, spaceId, phonenumber, or locus object}\n * @param {string} [type] - the optional specified type, such as locusId\n * @returns {Promise<Meeting>} A new Meeting.\n * @public\n * @memberof Meetings\n */\n create(destination, type = null) {\n // TODO: type should be from a dictionary\n\n // Validate meeting information based on the provided destination and\n // type. This must be performed prior to determining if the meeting is\n // found in the collection, as we mutate the destination for hydra person\n // id values.\n return this.meetingInfo.fetchInfoOptions(destination, type)\n // Catch a failure to fetch info options.\n .catch((error) => {\n LoggerProxy.logger.info(`Meetings:index#create --> INFO, unable to determine info options: ${error.message}`);\n })\n .then((options = {}) => {\n // Normalize the destination.\n const targetDest = options.destination || destination;\n\n // check for the conversation URL then sip Url\n let meeting = null;\n\n if (type === _CONVERSATION_URL_ || options.type === _CONVERSATION_URL_) {\n meeting = this.meetingCollection.getByKey(CONVERSATION_URL, targetDest);\n }\n\n // Attempt to collect the meeting if it exists.\n if (!meeting) {\n meeting = this.meetingCollection.getByKey(SIP_URI, targetDest);\n }\n\n\n // Validate if a meeting was found.\n if (!meeting) {\n // Create a meeting based on the normalized destination and type.\n return this.createMeeting(targetDest, type)\n .then((createdMeeting) => {\n // If the meeting was successfully created.\n if (createdMeeting && createdMeeting.on) {\n // Create a destruction event for the meeting.\n createdMeeting.on(EVENTS.DESTROY_MEETING, (payload) => {\n if (this.config.autoUploadLogs) {\n this.uploadLogs({\n callStart: createdMeeting.locusInfo?.fullState?.lastActive,\n correlationId: createdMeeting.correlationId,\n feedbackId: createdMeeting.correlationId,\n locusId: createdMeeting.locusId,\n meetingId: createdMeeting.locusInfo?.info?.webExMeetingId\n }).then(() => this.destroy(createdMeeting, payload.reason));\n }\n else {\n this.destroy(createdMeeting, payload.reason);\n }\n });\n\n createdMeeting.on(EVENTS.REQUEST_UPLOAD_LOGS, (meetingInstance) => {\n if (this.config.autoUploadLogs) {\n this.uploadLogs({\n callStart: meetingInstance?.locusInfo?.fullState?.lastActive,\n correlationId: meetingInstance.correlationId,\n feedbackId: meetingInstance.correlationId,\n locusId: meetingInstance.locusId,\n meetingId: meetingInstance.locusInfo?.info?.webExMeetingId\n });\n }\n });\n }\n else {\n LoggerProxy.logger.error(`Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ${meeting}`);\n }\n\n // Return the newly created meeting.\n return Promise.resolve(createdMeeting);\n });\n }\n\n // Return the existing meeting.\n return Promise.resolve(meeting);\n });\n }\n\n /**\n * @param {String} destination see create()\n * @param {String} type see create()\n * @returns {Promise} a new meeting instance complete with meeting info and destination\n * @private\n * @memberof Meetings\n */\n async createMeeting(destination, type = null) {\n const meeting = new Meeting(\n {\n userId: this.webex.internal.device.userId,\n deviceUrl: this.webex.internal.device.url,\n orgId: this.webex.internal.device.orgId,\n roapSeq: 0,\n locus: type === _LOCUS_ID_ ? destination : null, // pass the locus object if present\n meetingInfoProvider: this.meetingInfo\n },\n {\n parent: this.webex\n }\n );\n\n this.meetingCollection.set(meeting);\n\n try {\n await meeting.fetchMeetingInfo({destination, type});\n }\n catch (err) {\n if (!(err instanceof CaptchaError) && !(err instanceof PasswordError)) {\n // if there is no meeting info we assume its a 1:1 call or wireless share\n LoggerProxy.logger.info(`Meetings:index#createMeeting --> Info Unable to fetch meeting info for ${destination}.`);\n LoggerProxy.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');\n }\n LoggerProxy.logger.debug(`Meetings:index#createMeeting --> Debug ${err} fetching /meetingInfo for creation.`);\n // We need to save this info for future reference\n meeting.destination = destination;\n }\n finally {\n // For type LOCUS_ID we need to parse the locus object to get the information\n // about the caller and callee\n // Meeting Added event will be created in `handleLocusEvent`\n if (type !== _LOCUS_ID_) {\n if (!meeting.sipUri) {\n meeting.setSipUri(destination);\n }\n\n // TODO: check if we have to move this to parser\n const meetingAddedType = MeetingsUtil.getMeetingAddedType(type);\n\n // We typically shouldn't need to trigger both and event and return a promise.\n // Is this a special case? We want to make the public API usage as simple as possible.\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'createMeeting'\n },\n EVENT_TRIGGERS.MEETING_ADDED,\n {\n meeting,\n type: meetingAddedType\n }\n );\n }\n }\n\n return meeting;\n\n // Create the meeting calling the necessary service endpoints.\n\n // Internally, there are many more destinations:\n //\n // - locusID\n // - meetingURL\n // - globalMeetingID, e.g, *00*meetingID\n // - meetingID\n // - meetingURL\n // - PSTN\n // - phone number\n //\n // Our job is to determine the appropriate one\n // and its corresponding service so that developers\n // need only sipURL or spaceID to get a meeting\n // and its ID, but have the option to use createWithType()\n // and specify those types to get meetingInfo\n }\n\n /**\n * get a specifc meeting given it's type matched to the value, i.e., locus url\n * @param {String} type\n * @param {Object} value\n * @returns {Meeting}\n * @public\n * @memberof Meetings\n */\n getMeetingByType(type, value) {\n return this.meetingCollection.getByKey(type, value);\n }\n\n /**\n * Get all meetings.\n * @param {object} options\n * @param {object} options.startDate - get meetings after this start date\n * @param {object} options.endDate - get meetings before this end date\n * @returns {Object} All currently active meetings.\n * @public\n * @memberof Meetings\n */\n getAllMeetings(options = {}) {\n // Options may include other parameters to filter this collection\n // of meetings.\n return this.meetingCollection.getAll(options);\n }\n\n /**\n * syncs all the meeting from server\n * @returns {undefined}\n * @public\n * @memberof Meetings\n */\n syncMeetings() {\n return this.request.getActiveMeetings().then((locusArray) => {\n const activeLocusUrl = [];\n\n if (locusArray?.loci && locusArray.loci.length > 0) {\n locusArray.loci.forEach((locus) => {\n activeLocusUrl.push(locus.url);\n this.handleLocusEvent({\n locus,\n locusUrl: locus.url\n });\n });\n }\n const meetingsCollection = this.meetingCollection.getAll();\n\n if (Object.keys(meetingsCollection).length > 0) {\n // Some time the mercury event is missed after mercury reconnect\n // if sync returns no locus then clear all the meetings\n for (const meeting of Object.values(meetingsCollection)) {\n if (!activeLocusUrl.includes(meeting.locusUrl)) {\n // destroy function also uploads logs\n this.destroy(meeting, MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);\n }\n }\n }\n });\n }\n\n /**\n * Get all scheduled meetings.\n * @param {object} options\n * @param {object} options.startDate - get meetings after this start date\n * @param {object} options.endDate - get meetings before this end date\n * @returns {Object} All scheduled meetings.\n * @memberof Meetings\n */\n getScheduledMeetings() {\n return this.meetingCollection.getAll({scheduled: true});\n }\n\n /**\n * Get the logger instance for plugin-meetings\n * @returns {Logger}\n */\n getLogger() {\n return LoggerProxy.get();\n }\n\n /**\n * Get the Stats Analyzer singleton\n * @returns {StatsAnalyzer}\n * @public\n * @memberof Meetings\n */\n getAnalyzer() {\n return StatsAnalyzer;\n }\n\n /**\n * Get the Stats Calculator singleton\n * @returns {StatsCalculator}\n * @public\n * @memberof Meetings\n */\n getCalculator() {\n return StatsCalculator;\n }\n}\n"]}
1
+ {"version":3,"sources":["index.js"],"names":["Meetings","args","MEETINGS","request","Request","parent","webex","loggerRequest","LoggerRequest","meetingCollection","MeetingCollection","personalMeetingRoom","reachability","registered","preferredWebexSite","media","getUserMedia","Media","getSupportedDevice","onReady","MeetingsUtil","checkH264Support","disableNotifications","Metrics","initialSetup","data","meeting","getByKey","LOCUS_URL","locusUrl","CORRELATION_ID","checkForCorrelationId","internal","device","url","locus","SIP_URI","self","callbackInfo","callbackAddress","config","experimental","enableUnifiedMeetings","undefined","CONVERSATION_URL","conversationUrl","replaces","length","fullState","state","LOCUS","STATE","INACTIVE","LoggerProxy","logger","warn","_LEFT_","removed","create","_LOCUS_ID_","then","newMeeting","locusInfo","catch","e","console","log","finally","getMeetingByType","_ID_","id","postEvent","event","eventType","REMOTE_STARTED","trigger","MERCURY_EVENT","Trigger","file","function","EVENT_TRIGGERS","MEETING_ADDED","type","_MEETING_","_JOIN_","_INCOMING_","parse","envelope","LOCUSEVENT","MESSAGE_ROAP","handleLocusEvent","MEETINGS_NETWORK_DISCONNECTED","mercury","on","LOCUS_MERCURY","handleLocusMercury","ROAP","ROAP_MERCURY","handleRoapMercury","ONLINE","syncMeetings","OFFLINE","handleMercuryOffline","off","once","READY","StaticConfig","set","LoggerConfig","logging","meetingInfo","MeetingInfoV2","MeetingInfo","PersonalMeetingRoom","MEETINGS_READY","changeState","enableAdhocMeetings","canAuthorize","error","reject","Error","info","resolve","all","fetchUserPreferredWebexSite","getGeoHint","startReachability","message","register","connect","call","listenForEvents","MEETINGS_REGISTERED","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETINGS_REGISTRATION_SUCCESS","MEETINGS_REGISTRATION_FAILED","reason","stack","stopListeningForEvents","disconnect","unregister","MEETINGS_UNREGISTERED","options","uploadLogs","uploadResult","MEETING_LOG_UPLOAD_SUCCESS","meetingId","details","uploadError","MEETING_LOG_UPLOAD_FAILURE","UPLOAD_LOGS_FAILURE","meetingsId","code","Reachability","setReachability","getReachability","gatherReachability","fetchGeoHint","res","geoHintInfo","fetchLoginUserInformation","userPreferences","parseUserPreferences","MeetingUtil","cleanUp","delete","MEETING_REMOVED","destination","fetchInfoOptions","targetDest","_CONVERSATION_URL_","foundMeeting","foundMeetingIsNotCalendarMeeting","scheduledMeeting","createMeeting","createdMeeting","EVENTS","DESTROY_MEETING","payload","autoUploadLogs","callStart","lastActive","correlationId","feedbackId","locusId","webExMeetingId","destroy","REQUEST_UPLOAD_LOGS","meetingInstance","Meeting","userId","deviceUrl","orgId","roapSeq","meetingInfoProvider","destinationType","fetchMeetingInfo","CaptchaError","PasswordError","debug","sipUri","setSipUri","meetingAddedType","getMeetingAddedType","value","getAll","getActiveMeetings","locusArray","activeLocusUrl","loci","forEach","push","meetingsCollection","includes","MEETING_REMOVED_REASON","NO_MEETINGS_TO_SYNC","scheduled","get","StatsAnalyzer","StatsCalculator","WebexPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAuBA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;IACqBA,Q;;;;;AAGjB;AACJ;AACA;AACA;AACA;AACA;AACI,sBAAqB;AAAA;;AAAA;;AAAA,sCAANC,IAAM;AAANA,MAAAA,IAAM;AAAA;;AACnB,oDAASA,IAAT;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AATyB,4FARTC,mBAQS;AAUnB,UAAKC,OAAL,GAAe,IAAIC,iBAAJ,CAAY,EAAZ,EAAgB;AAACC,MAAAA,MAAM,EAAE,MAAKC;AAAd,KAAhB,CAAf;AACA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,aAAL,GAAqB,IAAIC,gBAAJ,CAAkB;AAACF,MAAAA,KAAK,EAAE,MAAKA;AAAb,KAAlB,CAArB;AACA,UAAKG,iBAAL,GAAyB,IAAIC,mBAAJ,EAAzB;AACA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,mBAAL,GAA2B,IAA3B;AACA;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,YAAL,GAAoB,IAApB;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,UAAL,GAAkB,KAAlB;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,kBAAL,GAA0B,EAA1B;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,KAAL,GAAa;AACXC,MAAAA,YAAY,EAAEC,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AAL,EAAgD;AAC9C;AACA,cAAA,OAAI,CAAC8J,OAAL,CAAajK,OAAb,EAAsB6L,kCAAuBC,mBAA7C;AACD;AACF;AACF;AACF,OAxBM,CAAP;AAyBD;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACI,gCAAuB;AACrB,aAAO,KAAK/M,iBAAL,CAAuBqM,MAAvB,CAA8B;AAACW,QAAAA,SAAS,EAAE;AAAZ,OAA9B,CAAP;AACD;AAED;AACJ;AACA;AACA;;;;WACI,qBAAY;AACV,aAAOpK,qBAAYqK,GAAZ,EAAP;AACD;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,uBAAc;AACZ,aAAOC,iBAAP;AACD;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,yBAAgB;AACd,aAAOC,mBAAP;AACD;;;EAz1BiCC,sB","sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n*/\n\nimport '@webex/internal-plugin-mercury';\nimport '@webex/internal-plugin-conversation';\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport 'webrtc-adapter';\n\nimport Metrics from '../metrics';\nimport {trigger, eventType} from '../metrics/config';\nimport LoggerConfig from '../common/logs/logger-config';\nimport StaticConfig from '../common/config';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport LoggerRequest from '../common/logs/request';\nimport Trigger from '../common/events/trigger-proxy';\nimport Media from '../media';\nimport MeetingUtil from '../meeting/util';\nimport {\n MEETINGS,\n EVENTS,\n EVENT_TRIGGERS,\n READY,\n LOCUSEVENT,\n LOCUS_URL,\n ROAP,\n ONLINE,\n OFFLINE,\n _MEETING_,\n _JOIN_,\n _LOCUS_ID_,\n _INCOMING_,\n LOCUS,\n CORRELATION_ID,\n SIP_URI,\n _LEFT_,\n _ID_,\n MEETING_REMOVED_REASON,\n _CONVERSATION_URL_,\n CONVERSATION_URL\n} from '../constants';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport MeetingInfo from '../meeting-info';\nimport MeetingInfoV2 from '../meeting-info/meeting-info-v2';\nimport Meeting from '../meeting';\nimport PersonalMeetingRoom from '../personal-meeting-room';\nimport Reachability from '../reachability';\nimport Request from '../meetings/request';\nimport StatsAnalyzer from '../analyzer/analyzer';\nimport StatsCalculator from '../analyzer/calculator';\nimport PasswordError from '../common/errors/password-error';\nimport CaptchaError from '../common/errors/captcha-error';\n\nimport MeetingCollection from './collection';\nimport MeetingsUtil from './util';\n\n\n/**\n * Meetings Ready Event\n * Emitted when the meetings instance on webex is ready\n * @event meetings:ready\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meetings Network Disconnected Event\n * Emitted when the meetings instance is disconnected from\n * the internal mercury server\n * @event network:disconnected\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meetings Registered Event\n * Emitted when the meetings instance has been registered and listening\n * @event meetings:registered\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meeting Removed Event\n * Emitted when a meeting was removed from the cache of meetings\n * @event meeting:removed\n * @instance\n * @type {Object}\n * @property {String} meetingId the removed meeting\n * @property {Object} response the server response\n * @property {String} type what type of meeting it was\n * @memberof Meetings\n */\n\n/**\n * Meeting Added Event\n * Emitted when a meeting was added to the cache of meetings\n * @event meeting:added\n * @instance\n * @type {Object}\n * @property {String} meetingId the added meeting\n * @property {String} type what type of meeting it was\n * @memberof Meetings\n */\n\n/**\n * Maintain a cache of meetings and sync with services.\n * @class\n */\nexport default class Meetings extends WebexPlugin {\n namespace = MEETINGS;\n\n /**\n * Initializes the Meetings Plugin\n * @constructor\n * @public\n * @memberof Meetings\n */\n constructor(...args) {\n super(...args);\n\n /**\n * The Meetings request to interact with server\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.request = new Request({}, {parent: this.webex});\n /**\n * Log upload request helper\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.loggerRequest = new LoggerRequest({webex: this.webex});\n this.meetingCollection = new MeetingCollection();\n /**\n * The PersonalMeetingRoom object to interact with server\n * @instance\n * @type {Object}\n * @public\n * @memberof Meetings\n */\n this.personalMeetingRoom = null;\n /**\n * The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called\n * starts as null\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.reachability = null;\n\n /**\n * If the meetings plugin has been registered and listening via {@link Meetings#register}\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Meetings\n */\n this.registered = false;\n\n /**\n * This values indicates the preferred webex site the user will start there meeting, getsits value from {@link Meetings#register}\n * @instance\n * @type {String}\n * @private\n * @memberof Meetings\n */\n this.preferredWebexSite = '';\n\n /**\n * The public interface for the internal Media util files. These are helpful to expose outside the context\n * of a meeting so that a user can access media without creating a meeting instance.\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.media = {\n getUserMedia: Media.getUserMedia,\n getSupportedDevice: Media.getSupportedDevice\n };\n\n this.onReady();\n MeetingsUtil.checkH264Support({disableNotifications: true});\n Metrics.initialSetup(this.meetingCollection, this.webex);\n }\n\n /**\n * handle locus events and takes meeting actions with them as they come in\n * @param {Object} data a locus event\n * @param {String} data.locusUrl\n * @param {Object} data.locus\n * @param {String} data.eventType\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleLocusEvent(data) {\n let meeting = null;\n\n // getting meeting by correlationId. This will happen for the new event\n // Either the locus\n // TODO : Add check for the callBack Address\n meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locusUrl) ||\n this.meetingCollection.getByKey(CORRELATION_ID, MeetingsUtil.checkForCorrelationId(this.webex.internal.device.url, data.locus)) ||\n this.meetingCollection.getByKey(SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) ||\n (this.config.experimental.enableUnifiedMeetings ? undefined : this.meetingCollection.getByKey(CONVERSATION_URL, data.locus.conversationUrl));\n\n // Special case when locus has got replaced, This only happend once if a replace locus exists\n // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call\n\n if (!meeting && data.locus?.replaces?.length > 0) {\n // Always the last element in the replace is the active one\n meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locus.replaces[data.locus.replaces.length - 1].locusUrl);\n }\n\n if (!meeting) {\n // TODO: create meeting when we get a meeting object\n // const checkForEnded = (locus) => {\n // TODO: you already ended the meeting but you got an event later\n // Mainly for 1:1 Callsor meeting\n // Happens mainly after refresh\n\n // 1:1 Meeting\n // 1) You ended a call before but you got a mercury event\n // Make sure end the call and cleanup the meeting only if the mercury\n // event says so\n // 2) Maintain lastSync time in the meetings object which helps to compare\n // If the meeting came befor or after the sync . ANy meeting start time before the sync time is invalid\n\n // For space Meeting\n // Check the locus object and see who has joined\n\n // };\n // rather then locus object change to locus url\n\n if (data.locus && data.locus.fullState && data.locus.fullState.state === LOCUS.STATE.INACTIVE) {\n // just ignore the event as its already ended and not active\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');\n\n return;\n }\n\n\n // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object\n // Any future events will be neglected\n\n if (data.locus && data.locus.self && (data.locus.self.state === _LEFT_ && data.locus.self.removed === true)) {\n // just ignore the event as its already ended and not active\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');\n\n return;\n }\n\n this.create(data.locus, _LOCUS_ID_).then((newMeeting) => {\n meeting = newMeeting;\n\n // It's a new meeting so initialize the locus data\n meeting.locusInfo.initialSetup(data.locus);\n }).catch((e) => {\n console.log(e);\n })\n .finally(() => {\n // There will be cases where locus event comes in gets created and deleted because its a 1:1 and meeting gets deleted\n // because the other user left so before sending 'added' event make sure it exists in the collection\n\n if (this.getMeetingByType(_ID_, meeting.id)) {\n Metrics.postEvent({event: eventType.REMOTE_STARTED, meeting, data: {trigger: trigger.MERCURY_EVENT}});\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'handleLocusEvent'\n },\n EVENT_TRIGGERS.MEETING_ADDED,\n {\n meeting,\n type: meeting.type === _MEETING_ ? _JOIN_ : _INCOMING_\n }\n );\n }\n else {\n // Meeting got added but was not found in the collection. It might have got destroyed\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Created and destroyed meeting object before sending an event');\n }\n });\n }\n else {\n meeting.locusInfo.parse(meeting, data);\n }\n }\n\n /**\n * handles locus events through mercury that are not roap\n * @param {Object} envelope\n * @param {Object} envelope.data\n * @param {String} envelope.data.eventType\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleLocusMercury(envelope) {\n const {data} = envelope;\n const {eventType} = data;\n\n if (eventType && eventType !== LOCUSEVENT.MESSAGE_ROAP) {\n this.handleLocusEvent(data);\n }\n }\n\n\n /**\n * handles mecury offline event\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleMercuryOffline() {\n Trigger.trigger(\n this,\n {\n file: 'meetings/index',\n function: 'handleMercuryOffline'\n },\n EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED,\n );\n }\n\n\n /**\n * registers for locus and roap mercury events\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n listenForEvents() {\n this.webex.internal.mercury.on(LOCUSEVENT.LOCUS_MERCURY, (envelope) => {\n this.handleLocusMercury(envelope);\n });\n this.webex.internal.mercury.on(ROAP.ROAP_MERCURY, (envelope) => {\n MeetingsUtil.handleRoapMercury(envelope, this.meetingCollection);\n });\n\n this.webex.internal.mercury.on(ONLINE, () => {\n this.syncMeetings();\n });\n\n this.webex.internal.mercury.on(OFFLINE, () => {\n this.handleMercuryOffline();\n });\n }\n\n /**\n * stops listening for locus and roap mercury events\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n stopListeningForEvents() {\n this.webex.internal.mercury.off(LOCUSEVENT.LOCUS_MERCURY);\n this.webex.internal.mercury.off(ROAP.ROAP_MERCURY);\n this.webex.internal.mercury.off(ONLINE);\n }\n\n /**\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n onReady() {\n this.webex.once(READY, () => {\n StaticConfig.set(this.config);\n LoggerProxy.set(this.webex.logger);\n LoggerConfig.set(this.config.logging);\n\n /**\n * The MeetingInfo object to interact with server\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.meetingInfo = this.config.experimental.enableUnifiedMeetings ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);\n this.personalMeetingRoom = new PersonalMeetingRoom({meetingInfo: this.meetingInfo}, {parent: this.webex});\n\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'onReady'\n },\n EVENT_TRIGGERS.MEETINGS_READY\n );\n });\n }\n\n /**\n * API to toggle unified meetings\n * @param {Boolean} changeState\n * @private\n * @memberof Meetings\n * @returns {undefined}\n */\n _toggleUnifiedMeetings(changeState) {\n if (typeof changeState !== 'boolean') {\n return;\n }\n if (this.config?.experimental?.enableUnifiedMeetings !== changeState) {\n this.config.experimental.enableUnifiedMeetings = changeState;\n this.meetingInfo = changeState ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);\n }\n }\n\n /**\n * API to toggle starting adhoc meeting\n * @param {Boolean} changeState\n * @private\n * @memberof Meetings\n * @returns {undefined}\n */\n _toggleAdhocMeetings(changeState) {\n if (typeof changeState !== 'boolean') {\n return;\n }\n if (this.config?.experimental?.enableAdhocMeetings !== changeState) {\n this.config.experimental.enableAdhocMeetings = changeState;\n }\n }\n\n /**\n * Explicitly sets up the meetings plugin by registering\n * the device, connecting to mercury, and listening for locus events.\n *\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n register() {\n if (!this.webex.canAuthorize) {\n LoggerProxy.logger.error('Meetings:index#register --> ERROR, Unable to register, SDK cannot authorize');\n\n return Promise.reject(new Error('SDK cannot authorize'));\n }\n\n\n if (this.registered) {\n LoggerProxy.logger.info('Meetings:index#register --> INFO, Meetings plugin already registered');\n\n return Promise.resolve();\n }\n\n return Promise.all([\n this.fetchUserPreferredWebexSite(),\n this.getGeoHint(),\n this.startReachability().catch((error) => {\n LoggerProxy.logger.error(`Meetings:index#register --> GDM error, ${error.message}`);\n }),\n this.webex.internal.device.register()\n .then(() => LoggerProxy.logger.info(`Meetings:index#register --> INFO, Device registered ${this.webex.internal.device.url}`))\n .then(() => this.webex.internal.mercury.connect()),\n MeetingsUtil.checkH264Support.call(this)\n ]).then(() => {\n this.listenForEvents();\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'register'\n },\n EVENT_TRIGGERS.MEETINGS_REGISTERED\n );\n this.registered = true;\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_SUCCESS,\n );\n })\n .catch((error) => {\n LoggerProxy.logger.error(`Meetings:index#register --> ERROR, Unable to register, ${error.message}`);\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_FAILED,\n {\n reason: error.message,\n stack: error.stack\n }\n );\n\n return Promise.reject(error);\n });\n }\n\n /**\n * Explicitly tears down the meetings plugin by deregistering\n * the device, disconnecting from mercury, and stops listening to locus events\n *\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n unregister() {\n if (!this.registered) {\n LoggerProxy.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');\n\n return Promise.resolve();\n }\n\n this.stopListeningForEvents();\n\n return this.webex.internal.mercury.disconnect()\n .then(() => this.webex.internal.device.unregister())\n .then(() => {\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'unregister'\n },\n EVENT_TRIGGERS.MEETINGS_UNREGISTERED\n );\n this.registered = false;\n });\n }\n\n /**\n * Uploads logs to the webex services for tracking\n * @param {Object} [options={}]\n * @param {String} [options.callStart] Call Start Time\n * @param {String} [options.feedbackId] ID used for tracking\n * @param {String} [options.locusId]\n * @param {String} [options.correlationId]\n * @param {String} [options.meetingId] webex meeting ID\n * @param {String} [options.userId] userId\n * @param {String} [options.orgId] org id\n * @returns {String} feedback ID logs were submitted under\n */\n uploadLogs(options = {}) {\n LoggerProxy.logger.info('Meetings:index#uploadLogs --> uploading logs');\n\n return this.loggerRequest.uploadLogs(options)\n .then((uploadResult) => {\n LoggerProxy.logger.info('Meetings:index#uploadLogs --> Upload logs for meeting completed.', uploadResult);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'uploadLogs'\n },\n EVENT_TRIGGERS.MEETING_LOG_UPLOAD_SUCCESS,\n {\n meetingId: options.meetingId,\n details: uploadResult\n }\n );\n })\n .catch((uploadError) => {\n LoggerProxy.logger.error('Meetings:index#uploadLogs --> Unable to upload logs for meeting', uploadError);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'uploadLogs'\n },\n EVENT_TRIGGERS.MEETING_LOG_UPLOAD_FAILURE,\n {\n meetingId: options.meetingId,\n reason: uploadError\n }\n );\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.UPLOAD_LOGS_FAILURE,\n {\n meetingId: options.meetingsId,\n reason: uploadError.message,\n stack: uploadError.stack,\n code: uploadError.code\n }\n );\n });\n }\n\n /**\n * initializes the reachability instance for Meetings\n * @returns {undefined}\n * @public\n * @memberof Meetings\n */\n setReachability() {\n this.reachability = new Reachability(this.webex);\n }\n\n /**\n * gets the reachability instance for Meetings\n * @returns {Reachability}\n * @public\n * @memberof Meetings\n */\n getReachability() {\n return this.reachability;\n }\n\n /**\n * initializes and starts gathering reachability for Meetings\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n startReachability() {\n if (!this.reachability) {\n this.setReachability();\n }\n\n return this.getReachability().gatherReachability();\n }\n\n /**\n * Get geoHint for info for meetings\n * @returns {Promise}\n * @private\n * @memberof Meetings\n */\n getGeoHint() {\n return this.request.fetchGeoHint().then((res) => {\n this.geoHintInfo = res;\n });\n }\n\n /**\n * Fetch user preferred webex site information\n * This also has other infomation about the user\n * @returns {Promise}\n * @private\n * @memberof Meetings\n */\n fetchUserPreferredWebexSite() {\n return this.request.fetchLoginUserInformation().then((res) => {\n if (res && res.userPreferences) {\n this.preferredWebexSite = MeetingsUtil.parseUserPreferences(res?.userPreferences);\n }\n });\n }\n\n\n /**\n * gets the personal meeting room instance, for saved PMR values for this user\n * @returns {PersonalMeetingRoom}\n * @public\n * @memberof Meetings\n */\n\n getPersonalMeetingRoom() {\n return this.personalMeetingRoom;\n }\n\n /**\n * @param {Meeting} meeting\n * @param {Object} reason\n * @param {String} type\n * @returns {Undefined}\n * @private\n * @memberof Meetings\n */\n destroy(meeting, reason) {\n MeetingUtil.cleanUp(meeting);\n this.meetingCollection.delete(meeting.id);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'destroy'\n },\n EVENT_TRIGGERS.MEETING_REMOVED,\n {\n meetingId: meeting.id,\n reason\n }\n );\n }\n\n /**\n * Create a meeting.\n * @param {string} destination - sipURL, spaceId, phonenumber, or locus object}\n * @param {string} [type] - the optional specified type, such as locusId\n * @returns {Promise<Meeting>} A new Meeting.\n * @public\n * @memberof Meetings\n */\n create(destination, type = null) {\n // TODO: type should be from a dictionary\n\n // Validate meeting information based on the provided destination and\n // type. This must be performed prior to determining if the meeting is\n // found in the collection, as we mutate the destination for hydra person\n // id values.\n return this.meetingInfo.fetchInfoOptions(destination, type)\n // Catch a failure to fetch info options.\n .catch((error) => {\n LoggerProxy.logger.info(`Meetings:index#create --> INFO, unable to determine info options: ${error.message}`);\n })\n .then((options = {}) => {\n // Normalize the destination.\n const targetDest = options.destination || destination;\n\n // check for the conversation URL then sip Url\n let meeting = null;\n\n if (type === _CONVERSATION_URL_ || options.type === _CONVERSATION_URL_) {\n const foundMeeting = this.meetingCollection.getByKey(CONVERSATION_URL, targetDest);\n\n if (foundMeeting) {\n const foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting;\n\n // If the found meeting is not a calendar meeting, return that meeting.\n // This allows for the creation of instant-meetings when calendar meetings are present.\n if (foundMeetingIsNotCalendarMeeting) {\n meeting = foundMeeting;\n }\n }\n }\n\n // Attempt to collect the meeting if it exists.\n if (!meeting) {\n meeting = this.meetingCollection.getByKey(SIP_URI, targetDest);\n }\n\n\n // Validate if a meeting was found.\n if (!meeting) {\n // Create a meeting based on the normalized destination and type.\n return this.createMeeting(targetDest, type)\n .then((createdMeeting) => {\n // If the meeting was successfully created.\n if (createdMeeting && createdMeeting.on) {\n // Create a destruction event for the meeting.\n createdMeeting.on(EVENTS.DESTROY_MEETING, (payload) => {\n if (this.config.autoUploadLogs) {\n this.uploadLogs({\n callStart: createdMeeting.locusInfo?.fullState?.lastActive,\n correlationId: createdMeeting.correlationId,\n feedbackId: createdMeeting.correlationId,\n locusId: createdMeeting.locusId,\n meetingId: createdMeeting.locusInfo?.info?.webExMeetingId\n }).then(() => this.destroy(createdMeeting, payload.reason));\n }\n else {\n this.destroy(createdMeeting, payload.reason);\n }\n });\n\n createdMeeting.on(EVENTS.REQUEST_UPLOAD_LOGS, (meetingInstance) => {\n if (this.config.autoUploadLogs) {\n this.uploadLogs({\n callStart: meetingInstance?.locusInfo?.fullState?.lastActive,\n correlationId: meetingInstance.correlationId,\n feedbackId: meetingInstance.correlationId,\n locusId: meetingInstance.locusId,\n meetingId: meetingInstance.locusInfo?.info?.webExMeetingId\n });\n }\n });\n }\n else {\n LoggerProxy.logger.error(`Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ${meeting}`);\n }\n\n // Return the newly created meeting.\n return Promise.resolve(createdMeeting);\n });\n }\n\n // Return the existing meeting.\n return Promise.resolve(meeting);\n });\n }\n\n /**\n * @param {String} destination see create()\n * @param {String} type see create()\n * @returns {Promise} a new meeting instance complete with meeting info and destination\n * @private\n * @memberof Meetings\n */\n async createMeeting(destination, type = null) {\n const meeting = new Meeting(\n {\n userId: this.webex.internal.device.userId,\n deviceUrl: this.webex.internal.device.url,\n orgId: this.webex.internal.device.orgId,\n roapSeq: 0,\n locus: type === _LOCUS_ID_ ? destination : null, // pass the locus object if present\n meetingInfoProvider: this.meetingInfo,\n destination,\n destinationType: type,\n },\n {\n parent: this.webex\n }\n );\n\n this.meetingCollection.set(meeting);\n\n try {\n await meeting.fetchMeetingInfo({});\n }\n catch (err) {\n if (!(err instanceof CaptchaError) && !(err instanceof PasswordError)) {\n // if there is no meeting info we assume its a 1:1 call or wireless share\n LoggerProxy.logger.info(`Meetings:index#createMeeting --> Info Unable to fetch meeting info for ${destination}.`);\n LoggerProxy.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');\n }\n LoggerProxy.logger.debug(`Meetings:index#createMeeting --> Debug ${err} fetching /meetingInfo for creation.`);\n }\n finally {\n // For type LOCUS_ID we need to parse the locus object to get the information\n // about the caller and callee\n // Meeting Added event will be created in `handleLocusEvent`\n if (type !== _LOCUS_ID_) {\n if (!meeting.sipUri) {\n meeting.setSipUri(destination);\n }\n\n // TODO: check if we have to move this to parser\n const meetingAddedType = MeetingsUtil.getMeetingAddedType(type);\n\n // We typically shouldn't need to trigger both and event and return a promise.\n // Is this a special case? We want to make the public API usage as simple as possible.\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'createMeeting'\n },\n EVENT_TRIGGERS.MEETING_ADDED,\n {\n meeting,\n type: meetingAddedType\n }\n );\n }\n }\n\n return meeting;\n\n // Create the meeting calling the necessary service endpoints.\n\n // Internally, there are many more destinations:\n //\n // - locusID\n // - meetingURL\n // - globalMeetingID, e.g, *00*meetingID\n // - meetingID\n // - meetingURL\n // - PSTN\n // - phone number\n //\n // Our job is to determine the appropriate one\n // and its corresponding service so that developers\n // need only sipURL or spaceID to get a meeting\n // and its ID, but have the option to use createWithType()\n // and specify those types to get meetingInfo\n }\n\n /**\n * get a specifc meeting given it's type matched to the value, i.e., locus url\n * @param {String} type\n * @param {Object} value\n * @returns {Meeting}\n * @public\n * @memberof Meetings\n */\n getMeetingByType(type, value) {\n return this.meetingCollection.getByKey(type, value);\n }\n\n /**\n * Get all meetings.\n * @param {object} options\n * @param {object} options.startDate - get meetings after this start date\n * @param {object} options.endDate - get meetings before this end date\n * @returns {Object} All currently active meetings.\n * @public\n * @memberof Meetings\n */\n getAllMeetings(options = {}) {\n // Options may include other parameters to filter this collection\n // of meetings.\n return this.meetingCollection.getAll(options);\n }\n\n /**\n * syncs all the meeting from server\n * @returns {undefined}\n * @public\n * @memberof Meetings\n */\n syncMeetings() {\n return this.request.getActiveMeetings().then((locusArray) => {\n const activeLocusUrl = [];\n\n if (locusArray?.loci && locusArray.loci.length > 0) {\n locusArray.loci.forEach((locus) => {\n activeLocusUrl.push(locus.url);\n this.handleLocusEvent({\n locus,\n locusUrl: locus.url\n });\n });\n }\n const meetingsCollection = this.meetingCollection.getAll();\n\n if (Object.keys(meetingsCollection).length > 0) {\n // Some time the mercury event is missed after mercury reconnect\n // if sync returns no locus then clear all the meetings\n for (const meeting of Object.values(meetingsCollection)) {\n if (!activeLocusUrl.includes(meeting.locusUrl)) {\n // destroy function also uploads logs\n this.destroy(meeting, MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);\n }\n }\n }\n });\n }\n\n /**\n * Get all scheduled meetings.\n * @param {object} options\n * @param {object} options.startDate - get meetings after this start date\n * @param {object} options.endDate - get meetings before this end date\n * @returns {Object} All scheduled meetings.\n * @memberof Meetings\n */\n getScheduledMeetings() {\n return this.meetingCollection.getAll({scheduled: true});\n }\n\n /**\n * Get the logger instance for plugin-meetings\n * @returns {Logger}\n */\n getLogger() {\n return LoggerProxy.get();\n }\n\n /**\n * Get the Stats Analyzer singleton\n * @returns {StatsAnalyzer}\n * @public\n * @memberof Meetings\n */\n getAnalyzer() {\n return StatsAnalyzer;\n }\n\n /**\n * Get the Stats Calculator singleton\n * @returns {StatsCalculator}\n * @public\n * @memberof Meetings\n */\n getCalculator() {\n return StatsCalculator;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "1.159.0",
3
+ "version": "1.159.3",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -24,19 +24,19 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@babel/runtime-corejs2": "^7.14.8",
27
- "@webex/webex-core": "1.159.0",
28
- "@webex/internal-plugin-mercury": "1.159.0",
29
- "@webex/internal-plugin-conversation": "1.159.0",
27
+ "@webex/webex-core": "1.159.3",
28
+ "@webex/internal-plugin-mercury": "1.159.3",
29
+ "@webex/internal-plugin-conversation": "1.159.3",
30
30
  "webrtc-adapter": "^7.7.0",
31
31
  "lodash": "^4.17.21",
32
32
  "uuid": "^3.3.2",
33
33
  "global": "^4.4.0",
34
34
  "ip-anonymize": "^0.1.0",
35
- "@webex/common": "1.159.0",
35
+ "@webex/common": "1.159.3",
36
36
  "bowser": "^2.11.0",
37
37
  "sdp-transform": "^2.12.0",
38
38
  "readable-stream": "^3.6.0",
39
- "@webex/common-timers": "1.159.0",
39
+ "@webex/common-timers": "1.159.3",
40
40
  "btoa": "^1.2.1",
41
41
  "javascript-state-machine": "^3.1.0",
42
42
  "envify": "^4.1.0"
@@ -37,7 +37,6 @@ import {
37
37
  _CALL_,
38
38
  _INCOMING_,
39
39
  _JOIN_,
40
- _SIP_URI_,
41
40
  AUDIO,
42
41
  CONNECTION_STATE,
43
42
  CONTENT,
@@ -577,6 +576,22 @@ export default class Meeting extends StatelessWebexPlugin {
577
576
  * @memberof Meeting
578
577
  */
579
578
  this.sipUri = null;
579
+ /**
580
+ * @instance
581
+ * @type {String}
582
+ * @readonly
583
+ * @public
584
+ * @memberof Meeting
585
+ */
586
+ this.destination = attrs.destination;
587
+ /**
588
+ * @instance
589
+ * @type {String}
590
+ * @readonly
591
+ * @public
592
+ * @memberof Meeting
593
+ */
594
+ this.destinationType = attrs.destinationType;
580
595
  /**
581
596
  * @instance
582
597
  * @type {String}
@@ -901,7 +916,7 @@ export default class Meeting extends StatelessWebexPlugin {
901
916
  * @returns {Promise}
902
917
  */
903
918
  async fetchMeetingInfo({
904
- destination, type, password = null, captchaCode = null
919
+ password = null, captchaCode = null
905
920
  }) {
906
921
  if (captchaCode && !this.requiredCaptcha) {
907
922
  return Promise.reject(new Error('fetchMeetingInfo() called with captchaCode when captcha was not required'));
@@ -913,7 +928,7 @@ export default class Meeting extends StatelessWebexPlugin {
913
928
  try {
914
929
  const captchaInfo = captchaCode ? {code: captchaCode, id: this.requiredCaptcha.captchaId} : null;
915
930
 
916
- const info = await this.attrs.meetingInfoProvider.fetchMeetingInfo(destination, type, password, captchaInfo);
931
+ const info = await this.attrs.meetingInfoProvider.fetchMeetingInfo(this.destination, this.destinationType, password, captchaInfo);
917
932
 
918
933
  this.parseMeetingInfo(info);
919
934
  this.meetingInfo = info ? info.body : null;
@@ -930,7 +945,7 @@ export default class Meeting extends StatelessWebexPlugin {
930
945
  }
931
946
  catch (err) {
932
947
  if (err instanceof MeetingInfoV2PasswordError) {
933
- LoggerProxy.logger.info(`Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ${destination} - password required (code=${err?.body?.code}).`);
948
+ LoggerProxy.logger.info(`Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ${this.destination} - password required (code=${err?.body?.code}).`);
934
949
 
935
950
  // when wbxappapi requires password it still populates partial meeting info in the response
936
951
  if (err.meetingInfo) {
@@ -948,7 +963,7 @@ export default class Meeting extends StatelessWebexPlugin {
948
963
  throw (new PasswordError());
949
964
  }
950
965
  else if (err instanceof MeetingInfoV2CaptchaError) {
951
- LoggerProxy.logger.info(`Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ${destination} - captcha required (code=${err?.body?.code}).`);
966
+ LoggerProxy.logger.info(`Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ${this.destination} - captcha required (code=${err?.body?.code}).`);
952
967
 
953
968
  this.meetingInfoFailureReason = (this.requiredCaptcha) ?
954
969
  MEETING_INFO_FAILURE_REASON.WRONG_CAPTCHA :
@@ -979,7 +994,7 @@ export default class Meeting extends StatelessWebexPlugin {
979
994
  */
980
995
  verifyPassword(password, captchaCode) {
981
996
  return this.fetchMeetingInfo({
982
- destination: this.sipUri, type: _SIP_URI_, password, captchaCode
997
+ password, captchaCode
983
998
  })
984
999
  .then(() => ({isPasswordValid: true, requiredCaptcha: null, failureReason: MEETING_INFO_FAILURE_REASON.NONE}))
985
1000
  .catch((error) => {
@@ -210,7 +210,7 @@ export default class Meetings extends WebexPlugin {
210
210
  meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locusUrl) ||
211
211
  this.meetingCollection.getByKey(CORRELATION_ID, MeetingsUtil.checkForCorrelationId(this.webex.internal.device.url, data.locus)) ||
212
212
  this.meetingCollection.getByKey(SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) ||
213
- this.meetingCollection.getByKey(CONVERSATION_URL, data.locus.conversationUrl);
213
+ (this.config.experimental.enableUnifiedMeetings ? undefined : this.meetingCollection.getByKey(CONVERSATION_URL, data.locus.conversationUrl));
214
214
 
215
215
  // Special case when locus has got replaced, This only happend once if a replace locus exists
216
216
  // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call
@@ -640,8 +640,9 @@ export default class Meetings extends WebexPlugin {
640
640
  */
641
641
  fetchUserPreferredWebexSite() {
642
642
  return this.request.fetchLoginUserInformation().then((res) => {
643
- this.preferredWebexSite = MeetingsUtil.parseUserPreferences(res.userPreferences);
644
- console.error(this.preferredWebexSite);
643
+ if (res && res.userPreferences) {
644
+ this.preferredWebexSite = MeetingsUtil.parseUserPreferences(res?.userPreferences);
645
+ }
645
646
  });
646
647
  }
647
648
 
@@ -710,7 +711,17 @@ export default class Meetings extends WebexPlugin {
710
711
  let meeting = null;
711
712
 
712
713
  if (type === _CONVERSATION_URL_ || options.type === _CONVERSATION_URL_) {
713
- meeting = this.meetingCollection.getByKey(CONVERSATION_URL, targetDest);
714
+ const foundMeeting = this.meetingCollection.getByKey(CONVERSATION_URL, targetDest);
715
+
716
+ if (foundMeeting) {
717
+ const foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting;
718
+
719
+ // If the found meeting is not a calendar meeting, return that meeting.
720
+ // This allows for the creation of instant-meetings when calendar meetings are present.
721
+ if (foundMeetingIsNotCalendarMeeting) {
722
+ meeting = foundMeeting;
723
+ }
724
+ }
714
725
  }
715
726
 
716
727
  // Attempt to collect the meeting if it exists.
@@ -783,7 +794,9 @@ export default class Meetings extends WebexPlugin {
783
794
  orgId: this.webex.internal.device.orgId,
784
795
  roapSeq: 0,
785
796
  locus: type === _LOCUS_ID_ ? destination : null, // pass the locus object if present
786
- meetingInfoProvider: this.meetingInfo
797
+ meetingInfoProvider: this.meetingInfo,
798
+ destination,
799
+ destinationType: type,
787
800
  },
788
801
  {
789
802
  parent: this.webex
@@ -793,7 +806,7 @@ export default class Meetings extends WebexPlugin {
793
806
  this.meetingCollection.set(meeting);
794
807
 
795
808
  try {
796
- await meeting.fetchMeetingInfo({destination, type});
809
+ await meeting.fetchMeetingInfo({});
797
810
  }
798
811
  catch (err) {
799
812
  if (!(err instanceof CaptchaError) && !(err instanceof PasswordError)) {
@@ -802,8 +815,6 @@ export default class Meetings extends WebexPlugin {
802
815
  LoggerProxy.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
803
816
  }
804
817
  LoggerProxy.logger.debug(`Meetings:index#createMeeting --> Debug ${err} fetching /meetingInfo for creation.`);
805
- // We need to save this info for future reference
806
- meeting.destination = destination;
807
818
  }
808
819
  finally {
809
820
  // For type LOCUS_ID we need to parse the locus object to get the information