From 7e6755b407b5d08a41916f8f2f263ee6802ec6a4 Mon Sep 17 00:00:00 2001 From: Adhwaith Menon <111346225+adhmenon@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:15:55 +0530 Subject: [PATCH] feat:(munge-sdp): updated-sdk-with-latest-media-core (#3815) --- packages/@webex/media-helpers/package.json | 2 +- packages/@webex/plugin-meetings/package.json | 2 +- packages/calling/package.json | 2 +- .../src/CallingClient/calling/call.test.ts | 27 +------------------ .../calling/src/CallingClient/calling/call.ts | 23 +--------------- yarn.lock | 14 +++++----- 6 files changed, 12 insertions(+), 58 deletions(-) diff --git a/packages/@webex/media-helpers/package.json b/packages/@webex/media-helpers/package.json index f0970bfb4d9..2c8eae9c839 100644 --- a/packages/@webex/media-helpers/package.json +++ b/packages/@webex/media-helpers/package.json @@ -22,7 +22,7 @@ "deploy:npm": "yarn npm publish" }, "dependencies": { - "@webex/internal-media-core": "2.9.3", + "@webex/internal-media-core": "2.10.0", "@webex/ts-events": "^1.1.0", "@webex/web-media-effects": "2.18.0" }, diff --git a/packages/@webex/plugin-meetings/package.json b/packages/@webex/plugin-meetings/package.json index cabb064b969..e8f6d152c15 100644 --- a/packages/@webex/plugin-meetings/package.json +++ b/packages/@webex/plugin-meetings/package.json @@ -62,7 +62,7 @@ }, "dependencies": { "@webex/common": "workspace:*", - "@webex/internal-media-core": "2.9.3", + "@webex/internal-media-core": "2.10.0", "@webex/internal-plugin-conversation": "workspace:*", "@webex/internal-plugin-device": "workspace:*", "@webex/internal-plugin-llm": "workspace:*", diff --git a/packages/calling/package.json b/packages/calling/package.json index 64df00bfc0b..3638a90ad9b 100644 --- a/packages/calling/package.json +++ b/packages/calling/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@types/platform": "1.3.4", - "@webex/internal-media-core": "2.9.3", + "@webex/internal-media-core": "2.10.0", "@webex/media-helpers": "workspace:*", "async-mutex": "0.4.0", "buffer": "6.0.3", diff --git a/packages/calling/src/CallingClient/calling/call.test.ts b/packages/calling/src/CallingClient/calling/call.test.ts index ce43512f806..b15c416981f 100644 --- a/packages/calling/src/CallingClient/calling/call.test.ts +++ b/packages/calling/src/CallingClient/calling/call.test.ts @@ -109,6 +109,7 @@ describe('Call Tests', () => { sdpMunging: { convertPort9to0: true, addContentSlides: false, + copyClineToSessionLevel: true, }, }; @@ -717,32 +718,6 @@ describe('Call Tests', () => { {file: 'call', method: 'updateMedia'} ); }); - - describe('#addSessionConnection', () => { - let call; - - beforeEach(() => { - call = callManager.createCall(dest, CallDirection.INBOUND, deviceId, mockLineId); - }); - - it('should copy the c-line from media level to the session level', () => { - const sdp = `v=0\r\no=- 2890844526 2890842807 IN IP4 192.0.2.3\r\ns=-\r\nt=0 0\r\nm=audio 49170 RTP/AVP 0\r\nc=IN IP4 203.0.113.1\r\na=rtpmap:0 PCMU/8000`; - - const expectedSdp = `v=0\r\no=- 2890844526 2890842807 IN IP4 192.0.2.3\r\ns=-\r\nc=IN IP4 203.0.113.1\r\nt=0 0\r\nm=audio 49170 RTP/AVP 0\r\nc=IN IP4 203.0.113.1\r\na=rtpmap:0 PCMU/8000`; - - const result = call.addSessionConnection(sdp); - expect(result).toBe(expectedSdp); - }); - - it('should handle multiple media sections correctly', () => { - const sdp = `v=0\r\no=- 2890844526 2890842807 IN IP4 192.0.2.3\r\ns=-\r\nt=0 0\r\nm=audio 49170 RTP/AVP 0\r\nc=IN IP4 203.0.113.1\r\na=rtpmap:0 PCMU/8000\r\nm=video 51372 RTP/AVP 31\r\nc=IN IP4 203.0.113.2\r\na=rtpmap:31 H261/90000`; - - const expectedSdp = `v=0\r\no=- 2890844526 2890842807 IN IP4 192.0.2.3\r\ns=-\r\nc=IN IP4 203.0.113.1\r\nt=0 0\r\nm=audio 49170 RTP/AVP 0\r\nc=IN IP4 203.0.113.1\r\na=rtpmap:0 PCMU/8000\r\nm=video 51372 RTP/AVP 31\r\nc=IN IP4 203.0.113.2\r\na=rtpmap:31 H261/90000`; - - const result = call.addSessionConnection(sdp); - expect(result).toBe(expectedSdp); - }); - }); }); describe('State Machine handler tests', () => { diff --git a/packages/calling/src/CallingClient/calling/call.ts b/packages/calling/src/CallingClient/calling/call.ts index 9fc68949cba..fd7e64718e1 100644 --- a/packages/calling/src/CallingClient/calling/call.ts +++ b/packages/calling/src/CallingClient/calling/call.ts @@ -1904,6 +1904,7 @@ export class Call extends Eventing implements ICall { sdpMunging: { convertPort9to0: true, addContentSlides: false, + copyClineToSessionLevel: true, }, }, { @@ -2375,24 +2376,6 @@ export class Call extends Eventing implements ICall { }); } - /* istanbul ignore next */ - /** - * Copy SDP's c-line to session level from media level. - * SPARK-522437 - */ - private addSessionConnection(sdp: string): string { - const lines: string[] = sdp.split(/\r\n|\r|\n/); - const mIndex: number = lines.findIndex((line) => line.startsWith('m=')); - const tIndex: number = lines.findIndex((line) => line.startsWith('t=')); - - if (mIndex !== -1 && mIndex < lines.length - 1 && lines[mIndex + 1].startsWith('c=')) { - const cLine: string = lines[mIndex + 1]; - lines.splice(tIndex, 0, cLine); - } - - return lines.join('\r\n'); - } - /* istanbul ignore next */ /** * Setup a listener for roap events emitted by the media sdk. @@ -2413,10 +2396,6 @@ export class Call extends Eventing implements ICall { method: this.mediaRoapEventsListener.name, }); - if (event.roapMessage?.sdp) { - event.roapMessage.sdp = this.addSessionConnection(event.roapMessage.sdp); - } - switch (event.roapMessage.messageType) { case RoapScenario.OK: { const mediaOk = { diff --git a/yarn.lock b/yarn.lock index 1e007670e5f..01fd898c89c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7419,7 +7419,7 @@ __metadata: "@typescript-eslint/eslint-plugin": 5.38.1 "@typescript-eslint/parser": 5.38.1 "@web/dev-server": 0.4.5 - "@webex/internal-media-core": 2.9.3 + "@webex/internal-media-core": 2.10.0 "@webex/media-helpers": "workspace:*" async-mutex: 0.4.0 buffer: 6.0.3 @@ -7710,9 +7710,9 @@ __metadata: languageName: unknown linkType: soft -"@webex/internal-media-core@npm:2.9.3": - version: 2.9.3 - resolution: "@webex/internal-media-core@npm:2.9.3" +"@webex/internal-media-core@npm:2.10.0": + version: 2.10.0 + resolution: "@webex/internal-media-core@npm:2.10.0" dependencies: "@babel/runtime": ^7.18.9 "@babel/runtime-corejs2": ^7.25.0 @@ -7724,7 +7724,7 @@ __metadata: uuid: ^8.3.2 webrtc-adapter: ^8.1.2 xstate: ^4.30.6 - checksum: 568e54be4afa7f5a93a843f927c5af12828b781deebeb651f89e7f4639f149b7b1e1642a9f3c75d8d20a065838d170853f3ea90a0f57aed0601481d584e321b6 + checksum: 4191b75de30a22c131dba7cbc4922cf5da52ad799ab059391539355f50dcdf8aa02fb2fd738a5bbf4938a54bc869e00ba7f74fdd58e04f231825665fd7c05ce2 languageName: node linkType: hard @@ -8483,7 +8483,7 @@ __metadata: "@babel/preset-typescript": 7.22.11 "@webex/babel-config-legacy": "workspace:*" "@webex/eslint-config-legacy": "workspace:*" - "@webex/internal-media-core": 2.9.3 + "@webex/internal-media-core": 2.10.0 "@webex/jest-config-legacy": "workspace:*" "@webex/legacy-tools": "workspace:*" "@webex/test-helper-chai": "workspace:*" @@ -8719,7 +8719,7 @@ __metadata: "@webex/babel-config-legacy": "workspace:*" "@webex/common": "workspace:*" "@webex/eslint-config-legacy": "workspace:*" - "@webex/internal-media-core": 2.9.3 + "@webex/internal-media-core": 2.10.0 "@webex/internal-plugin-conversation": "workspace:*" "@webex/internal-plugin-device": "workspace:*" "@webex/internal-plugin-llm": "workspace:*"