Skip to content

Commit

Permalink
fix(SDP) Include the trackId in the signaled msid for the source. (#2621
Browse files Browse the repository at this point in the history
)

* fix(SDP) Include the trackId in the signaled msid for the source.
Without the trackID in a=ssrc lines in SDP, older versions of Chrome (108) reject the remote description resulting in endpoint getting kicked out of the conference.

* squash: Fix unit test
  • Loading branch information
jallamsetty1 authored Jan 23, 2025
1 parent 8a5c1dd commit 54592e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions modules/sdp/LocalSdpMunger.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default class LocalSdpMunger {
const mediaType = mediaSection.mLine.type;
const mediaDirection = mediaSection.mLine.direction;
const sources = [ ...new Set(mediaSection.mLine.ssrcs?.map(s => s.id)) ];
let trackId = mediaSection.mLine.msid?.split(' ')[1];
let sourceName;

if (ssrcMap.size) {
Expand All @@ -51,8 +52,12 @@ export default class LocalSdpMunger {
for (const source of sources) {
if ((mediaDirection === MediaDirection.SENDONLY || mediaDirection === MediaDirection.SENDRECV)
&& sourceName) {
const msid = ssrcMap.get(sourceName).msid;
const generatedMsid = `${msid}-${this.tpc.id}`;
const msid = mediaSection.ssrcs.find(ssrc => ssrc.id === source && ssrc.attribute === 'msid');

if (msid) {
trackId = msid.value.split(' ')[1];
}
const generatedMsid = `${ssrcMap.get(sourceName).msid}-${this.tpc.id} ${trackId}-${this.tpc.id}`;
const existingMsid = mediaSection.ssrcs
.find(ssrc => ssrc.id === source && ssrc.attribute === 'msid');

Expand Down
3 changes: 2 additions & 1 deletion modules/sdp/LocalSdpMunger.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ describe('TransformSdpsForUnifiedPlan', () => {
if (ssrcLine.attribute === 'msid') {
const msid = ssrcLine.value;

expect(msid).toBe(`${localEndpointId}-video-0-${tpc.id}`);
expect(msid)
.toBe(`${localEndpointId}-video-0-${tpc.id} bdbd2c0a-7959-4578-8db5-9a6a1aec4ecf-${tpc.id}`);
}
}
});
Expand Down

0 comments on commit 54592e6

Please sign in to comment.