@webex/web-client-media-engine 3.12.0 → 3.12.1
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/dist/cjs/index.js +44 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +44 -5
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -9422,6 +9422,8 @@ function deepCopy(source) {
|
|
|
9422
9422
|
: source;
|
|
9423
9423
|
}
|
|
9424
9424
|
|
|
9425
|
+
const ipv4Regex = /(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.)(\d{1,3}\b)/g;
|
|
9426
|
+
const ipv6Regex = /(\b[\da-fA-F]{1,4}(:[\da-fA-F]{1,4}){7}\b)/g;
|
|
9425
9427
|
function matchMediaDescriptionsInAnswer(parsedOffer, parsedAnswer) {
|
|
9426
9428
|
parsedAnswer.session.groups = parsedOffer.session.groups;
|
|
9427
9429
|
parsedAnswer.media = parsedOffer.media.map((offerMediaDescription) => {
|
|
@@ -9509,6 +9511,15 @@ function injectDummyCandidates(mediaDescription) {
|
|
|
9509
9511
|
mediaDescription.addLine(new CandidateLine('dummy2', 1, 'tcp', 2, '0.0.0.0', 9, 'host'));
|
|
9510
9512
|
mediaDescription.addLine(new CandidateLine('dummy3', 1, 'udp', 1, '0.0.0.0', 9, 'relay'));
|
|
9511
9513
|
}
|
|
9514
|
+
function maskIp(sdp) {
|
|
9515
|
+
let maskedSdp = sdp.replace(ipv4Regex, (match, firstOctets) => {
|
|
9516
|
+
return `${firstOctets}0`;
|
|
9517
|
+
});
|
|
9518
|
+
maskedSdp = maskedSdp.replace(ipv6Regex, (match) => {
|
|
9519
|
+
return match.replace(/:[\da-fA-F]{1,4}$/, ':0');
|
|
9520
|
+
});
|
|
9521
|
+
return maskedSdp;
|
|
9522
|
+
}
|
|
9512
9523
|
function removeMidRidExtensions(mediaDescription) {
|
|
9513
9524
|
mediaDescription.extMaps.forEach((extMapLine, extId, extMap) => {
|
|
9514
9525
|
if (/^urn:ietf:params:rtp-hdrext:sdes:(?:mid|rtp-stream-id|repaired-rtp-stream-id)$/.test(extMapLine.uri)) {
|
|
@@ -14846,7 +14857,15 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
14846
14857
|
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, 'SDP not found in offer.');
|
|
14847
14858
|
}
|
|
14848
14859
|
offer.sdp = this.preProcessLocalOffer(offer.sdp);
|
|
14849
|
-
yield this.pc
|
|
14860
|
+
yield this.pc
|
|
14861
|
+
.setLocalDescription(offer)
|
|
14862
|
+
.then(() => __awaiter$1(this, void 0, void 0, function* () {
|
|
14863
|
+
logger.info('this.pc.setLocalDescription() resolved');
|
|
14864
|
+
}))
|
|
14865
|
+
.catch((error) => {
|
|
14866
|
+
var _a;
|
|
14867
|
+
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, `Error: ${error}. SDP: ${maskIp((_a = offer.sdp) !== null && _a !== void 0 ? _a : '')}`);
|
|
14868
|
+
});
|
|
14850
14869
|
const sdpToSend = this.prepareLocalOfferForRemoteServer((_a = this.pc.getLocalDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
|
|
14851
14870
|
createOfferResolve({ type: 'offer', sdp: sdpToSend });
|
|
14852
14871
|
if (this.currentCreateOfferId > createOfferId) {
|
|
@@ -14872,7 +14891,9 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
14872
14891
|
logErrorAndThrow(exports.WcmeErrorType.SET_ANSWER_FAILED, `Call to setAnswer without having previously called createOffer.`);
|
|
14873
14892
|
}
|
|
14874
14893
|
logger.info('calling this.pc.setRemoteDescription()');
|
|
14875
|
-
return this.pc
|
|
14894
|
+
return this.pc
|
|
14895
|
+
.setRemoteDescription({ type: 'answer', sdp })
|
|
14896
|
+
.then(() => __awaiter$1(this, void 0, void 0, function* () {
|
|
14876
14897
|
logger.info('this.pc.setRemoteDescription() resolved');
|
|
14877
14898
|
if (this.setAnswerResolve) {
|
|
14878
14899
|
this.setAnswerResolve();
|
|
@@ -14881,7 +14902,10 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
14881
14902
|
else {
|
|
14882
14903
|
logger.debug(`setAnswerResolve function was cleared between setAnswer and result of setRemoteDescription`);
|
|
14883
14904
|
}
|
|
14884
|
-
}))
|
|
14905
|
+
}))
|
|
14906
|
+
.catch((error) => {
|
|
14907
|
+
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, `Error: ${error}. SDP: ${maskIp(answer)}`);
|
|
14908
|
+
});
|
|
14885
14909
|
});
|
|
14886
14910
|
}
|
|
14887
14911
|
doLocalOfferAnswer() {
|
|
@@ -14892,9 +14916,24 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
14892
14916
|
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, 'SDP not found in offer.');
|
|
14893
14917
|
}
|
|
14894
14918
|
offer.sdp = this.preProcessLocalOffer(offer.sdp);
|
|
14895
|
-
yield this.pc
|
|
14919
|
+
yield this.pc
|
|
14920
|
+
.setLocalDescription(offer)
|
|
14921
|
+
.then(() => __awaiter$1(this, void 0, void 0, function* () {
|
|
14922
|
+
logger.info('this.pc.setLocalDescription() resolved');
|
|
14923
|
+
}))
|
|
14924
|
+
.catch((error) => {
|
|
14925
|
+
var _a;
|
|
14926
|
+
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, `Error: ${error}. SDP: ${maskIp((_a = offer.sdp) !== null && _a !== void 0 ? _a : '')}`);
|
|
14927
|
+
});
|
|
14896
14928
|
const answer = this.preProcessRemoteAnswer((_a = this.pc.getRemoteDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
|
|
14897
|
-
return this.pc
|
|
14929
|
+
return this.pc
|
|
14930
|
+
.setRemoteDescription({ type: 'answer', sdp: answer })
|
|
14931
|
+
.then(() => __awaiter$1(this, void 0, void 0, function* () {
|
|
14932
|
+
logger.info('this.pc.setRemoteDescription() resolved');
|
|
14933
|
+
}))
|
|
14934
|
+
.catch((error) => {
|
|
14935
|
+
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, `Error ${error}. SDP: ${maskIp(answer)}`);
|
|
14936
|
+
});
|
|
14898
14937
|
});
|
|
14899
14938
|
}
|
|
14900
14939
|
queueLocalOfferAnswer() {
|