@webex/plugin-meetings 2.52.9 → 2.52.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "2.52.9",
3
+ "version": "2.52.11",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -39,15 +39,15 @@
39
39
  "devDependencies": {
40
40
  "@babel/core": "^7.17.10",
41
41
  "@types/jsdom": "^21",
42
- "@webex/babel-config-legacy": "2.52.9",
43
- "@webex/eslint-config-legacy": "2.52.9",
44
- "@webex/jest-config-legacy": "2.52.9",
45
- "@webex/legacy-tools": "2.52.9",
46
- "@webex/test-helper-chai": "2.52.9",
47
- "@webex/test-helper-mocha": "2.52.9",
48
- "@webex/test-helper-mock-webex": "2.52.9",
49
- "@webex/test-helper-retry": "2.52.9",
50
- "@webex/test-helper-test-users": "2.52.9",
42
+ "@webex/babel-config-legacy": "2.52.11",
43
+ "@webex/eslint-config-legacy": "2.52.11",
44
+ "@webex/jest-config-legacy": "2.52.11",
45
+ "@webex/legacy-tools": "2.52.11",
46
+ "@webex/test-helper-chai": "2.52.11",
47
+ "@webex/test-helper-mocha": "2.52.11",
48
+ "@webex/test-helper-mock-webex": "2.52.11",
49
+ "@webex/test-helper-retry": "2.52.11",
50
+ "@webex/test-helper-test-users": "2.52.11",
51
51
  "chai": "^4.3.4",
52
52
  "chai-as-promised": "^7.1.1",
53
53
  "eslint": "^8.24.0",
@@ -58,18 +58,18 @@
58
58
  "typescript": "^4.7.4"
59
59
  },
60
60
  "dependencies": {
61
- "@webex/common": "2.52.9",
61
+ "@webex/common": "2.52.11",
62
62
  "@webex/internal-media-core": "0.0.7-beta",
63
- "@webex/internal-plugin-conversation": "2.52.9",
64
- "@webex/internal-plugin-device": "2.52.9",
65
- "@webex/internal-plugin-mercury": "2.52.9",
66
- "@webex/internal-plugin-metrics": "2.52.9",
67
- "@webex/internal-plugin-support": "2.52.9",
68
- "@webex/internal-plugin-user": "2.52.9",
69
- "@webex/plugin-people": "2.52.9",
70
- "@webex/plugin-rooms": "2.52.9",
63
+ "@webex/internal-plugin-conversation": "2.52.11",
64
+ "@webex/internal-plugin-device": "2.52.11",
65
+ "@webex/internal-plugin-mercury": "2.52.11",
66
+ "@webex/internal-plugin-metrics": "2.52.11",
67
+ "@webex/internal-plugin-support": "2.52.11",
68
+ "@webex/internal-plugin-user": "2.52.11",
69
+ "@webex/plugin-people": "2.52.11",
70
+ "@webex/plugin-rooms": "2.52.11",
71
71
  "@webex/ts-sdp": "1.0.1",
72
- "@webex/webex-core": "2.52.9",
72
+ "@webex/webex-core": "2.52.11",
73
73
  "bowser": "^2.11.0",
74
74
  "btoa": "^1.2.1",
75
75
  "dotenv": "^4.0.0",
@@ -267,6 +267,7 @@ SelfUtils.getStatus = (status) => ({
267
267
  SelfUtils.wasMediaInactiveOrReleased = (oldSelf: any = {}, changedSelf: any) =>
268
268
  oldSelf.joinedWith &&
269
269
  oldSelf.joinedWith.state === _JOINED_ &&
270
+ changedSelf.joinedWith &&
270
271
  changedSelf.joinedWith.state === _LEFT_ &&
271
272
  (changedSelf.joinedWith.reason === MEETING_END_REASON.INACTIVE ||
272
273
  changedSelf.joinedWith.reason === MEETING_END_REASON.MEDIA_RELEASED);
@@ -4019,11 +4019,30 @@ export default class Meeting extends StatelessWebexPlugin {
4019
4019
  * @memberof Meeting
4020
4020
  */
4021
4021
  public usePhoneAudio(phoneNumber: string) {
4022
- if (!phoneNumber) {
4023
- return this.dialInPstn();
4024
- }
4022
+ const promise = phoneNumber ? this.dialOutPstn(phoneNumber) : this.dialInPstn();
4023
+
4024
+ return promise
4025
+ .then(() => {
4026
+ LoggerProxy.logger.info(
4027
+ `Meeting:index#usePhoneAudio --> ${
4028
+ phoneNumber ? 'dialOutPstn' : 'dialInPstn'
4029
+ } request completed`
4030
+ );
4031
+ LoggerProxy.logger.info(
4032
+ `Meeting:index#usePhoneAudio --> removing audio track from desktop`
4033
+ );
4025
4034
 
4026
- return this.dialOutPstn(phoneNumber);
4035
+ // removing audio from desktop to avoid echo as phone audio is being used
4036
+ Media.stopTracks(this.mediaProperties.audioTrack);
4037
+ })
4038
+ .catch((error) => {
4039
+ LoggerProxy.logger.error(
4040
+ 'Meeting:index#usePhoneAudio --> Failed to move audio to phone',
4041
+ error
4042
+ );
4043
+
4044
+ return Promise.reject(error);
4045
+ });
4027
4046
  }
4028
4047
 
4029
4048
  /**
@@ -2471,14 +2471,22 @@ describe('plugin-meetings', () => {
2471
2471
  });
2472
2472
 
2473
2473
  describe('#usePhoneAudio', () => {
2474
+ const fakeAudioTrack = () => ({stop: () => {}});
2475
+ let sandbox = null;
2476
+
2474
2477
  beforeEach(() => {
2475
- meeting.meetingRequest.dialIn = sinon
2476
- .stub()
2477
- .returns(Promise.resolve({body: {locus: 'testData'}}));
2478
- meeting.meetingRequest.dialOut = sinon
2479
- .stub()
2480
- .returns(Promise.resolve({body: {locus: 'testData'}}));
2481
- meeting.locusInfo.onFullLocus = sinon.stub().returns(Promise.resolve());
2478
+ sandbox = sinon.createSandbox();
2479
+ sandbox.stub(meeting.meetingRequest, 'dialIn').returns(Promise.resolve({body: {locus: 'testData'}}));
2480
+ sandbox.stub(meeting.meetingRequest, 'dialOut').returns(Promise.resolve({body: {locus: 'testData'}}));
2481
+ sandbox.stub(meeting.locusInfo, 'onFullLocus').returns(Promise.resolve());
2482
+ sandbox.stub(Media, 'stopTracks').returns(Promise.resolve());
2483
+
2484
+ meeting.mediaProperties.audioTrack = fakeAudioTrack;
2485
+ });
2486
+
2487
+ afterEach(() => {
2488
+ sandbox.restore();
2489
+ sandbox = null;
2482
2490
  });
2483
2491
 
2484
2492
  it('with no parameters triggers dial-in, delegating request to meetingRequest correctly', async () => {
@@ -2493,6 +2501,7 @@ describe('plugin-meetings', () => {
2493
2501
  });
2494
2502
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2495
2503
  assert.notCalled(meeting.meetingRequest.dialOut);
2504
+ assert.calledWith(Media.stopTracks, fakeAudioTrack)
2496
2505
 
2497
2506
  meeting.meetingRequest.dialIn.resetHistory();
2498
2507
  meeting.locusInfo.onFullLocus.resetHistory();
@@ -2508,6 +2517,7 @@ describe('plugin-meetings', () => {
2508
2517
  });
2509
2518
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2510
2519
  assert.notCalled(meeting.meetingRequest.dialOut);
2520
+ assert.calledWith(Media.stopTracks, fakeAudioTrack)
2511
2521
  });
2512
2522
 
2513
2523
  it('given a phone number, triggers dial-out, delegating request to meetingRequest correctly', async () => {
@@ -2525,6 +2535,7 @@ describe('plugin-meetings', () => {
2525
2535
  });
2526
2536
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2527
2537
  assert.notCalled(meeting.meetingRequest.dialIn);
2538
+ assert.calledWith(Media.stopTracks, fakeAudioTrack)
2528
2539
 
2529
2540
  meeting.meetingRequest.dialOut.resetHistory();
2530
2541
  meeting.locusInfo.onFullLocus.resetHistory();
@@ -2541,6 +2552,7 @@ describe('plugin-meetings', () => {
2541
2552
  });
2542
2553
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2543
2554
  assert.notCalled(meeting.meetingRequest.dialIn);
2555
+ assert.calledWith(Media.stopTracks, fakeAudioTrack)
2544
2556
  });
2545
2557
 
2546
2558
  it('rejects if the request failed (dial in)', () => {
@@ -2553,6 +2565,7 @@ describe('plugin-meetings', () => {
2553
2565
  .then(() => Promise.reject(new Error('Promise resolved when it should have rejected')))
2554
2566
  .catch((e) => {
2555
2567
  assert.equal(e, error);
2568
+ assert.notCalled(Media.stopTracks)
2556
2569
 
2557
2570
  return Promise.resolve();
2558
2571
  });
@@ -2568,6 +2581,7 @@ describe('plugin-meetings', () => {
2568
2581
  .then(() => Promise.reject(new Error('Promise resolved when it should have rejected')))
2569
2582
  .catch((e) => {
2570
2583
  assert.equal(e, error);
2584
+ assert.notCalled(Media.stopTracks)
2571
2585
 
2572
2586
  return Promise.resolve();
2573
2587
  });