|
|
@@ -2487,7 +2487,6 @@ export default class JingleSessionPC extends JingleSession {
|
|
2487
|
2487
|
* @param newSDP SDP object for new description.
|
|
2488
|
2488
|
*/
|
|
2489
|
2489
|
notifyMySSRCUpdate(oldSDP, newSDP) {
|
|
2490
|
|
-
|
|
2491
|
2490
|
if (this.state !== JingleSessionState.ACTIVE) {
|
|
2492
|
2491
|
logger.warn(`${this} Skipping SSRC update in '${this.state} ' state.`);
|
|
2493
|
2492
|
|
|
|
@@ -2508,6 +2507,27 @@ export default class JingleSessionPC extends JingleSession {
|
|
2508
|
2507
|
this._cachedOldLocalSdp = undefined;
|
|
2509
|
2508
|
this._cachedNewLocalSdp = undefined;
|
|
2510
|
2509
|
|
|
|
2510
|
+ const getSignaledSourceInfo = sdpDiffer => {
|
|
|
2511
|
+ const newMedia = sdpDiffer.getNewMedia();
|
|
|
2512
|
+ let ssrcs = [];
|
|
|
2513
|
+ let mediaType = null;
|
|
|
2514
|
+
|
|
|
2515
|
+ // It is assumed that sources are signaled one at a time.
|
|
|
2516
|
+ Object.keys(newMedia).forEach(mediaIndex => {
|
|
|
2517
|
+ const signaledSsrcs = Object.keys(newMedia[mediaIndex].ssrcs);
|
|
|
2518
|
+
|
|
|
2519
|
+ mediaType = newMedia[mediaIndex].mid;
|
|
|
2520
|
+ if (signaledSsrcs?.length) {
|
|
|
2521
|
+ ssrcs = ssrcs.concat(signaledSsrcs);
|
|
|
2522
|
+ }
|
|
|
2523
|
+ });
|
|
|
2524
|
+
|
|
|
2525
|
+ return {
|
|
|
2526
|
+ mediaType,
|
|
|
2527
|
+ ssrcs
|
|
|
2528
|
+ };
|
|
|
2529
|
+ };
|
|
|
2530
|
+
|
|
2511
|
2531
|
// send source-remove IQ.
|
|
2512
|
2532
|
let sdpDiffer = new SDPDiffer(newSDP, oldSDP);
|
|
2513
|
2533
|
const remove = $iq({ to: this.remoteJid,
|
|
|
@@ -2526,8 +2546,10 @@ export default class JingleSessionPC extends JingleSession {
|
|
2526
|
2546
|
const ctx = {};
|
|
2527
|
2547
|
|
|
2528
|
2548
|
if (removedAnySSRCs) {
|
|
2529
|
|
- logger.info(`${this} Sending source-remove`);
|
|
2530
|
|
- logger.debug(remove.tree());
|
|
|
2549
|
+ const sourceInfo = getSignaledSourceInfo(sdpDiffer);
|
|
|
2550
|
+
|
|
|
2551
|
+ // Log only the SSRCs instead of the full IQ.
|
|
|
2552
|
+ logger.info(`${this} Sending source-remove for ${sourceInfo.mediaType} ssrcs=${sourceInfo.ssrcs}`);
|
|
2531
|
2553
|
this.connection.sendIQ(
|
|
2532
|
2554
|
remove,
|
|
2533
|
2555
|
() => {
|
|
|
@@ -2554,15 +2576,17 @@ export default class JingleSessionPC extends JingleSession {
|
|
2554
|
2576
|
const containsNewSSRCs = sdpDiffer.toJingle(add);
|
|
2555
|
2577
|
|
|
2556
|
2578
|
if (containsNewSSRCs) {
|
|
2557
|
|
- logger.info(`${this} Sending source-add`);
|
|
2558
|
|
- logger.debug(add.tree());
|
|
|
2579
|
+ const sourceInfo = getSignaledSourceInfo(sdpDiffer);
|
|
|
2580
|
+
|
|
|
2581
|
+ // Log only the SSRCs instead of the full IQ.
|
|
|
2582
|
+ logger.info(`${this} Sending source-add for ${sourceInfo.mediaType} ssrcs=${sourceInfo.ssrcs}`);
|
|
2559
|
2583
|
this.connection.sendIQ(
|
|
2560
|
2584
|
add,
|
|
2561
|
2585
|
() => {
|
|
2562
|
2586
|
this.room.eventEmitter.emit(XMPPEvents.SOURCE_ADD, this, ctx);
|
|
2563
|
2587
|
},
|
|
2564
|
2588
|
this.newJingleErrorHandler(add, error => {
|
|
2565
|
|
- this.room.eventEmitter.emit(XMPPEvents.SOURCE_ADD_ERROR, this, error, ctx);
|
|
|
2589
|
+ this.room.eventEmitter.emit(XMPPEvents.SOURCE_ADD_ERROR, this, error, sourceInfo.mediaType, ctx);
|
|
2566
|
2590
|
}),
|
|
2567
|
2591
|
IQ_TIMEOUT);
|
|
2568
|
2592
|
}
|