๋ฒ๊ทธ ์ค๋ช
๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์๋ํ์ง ์์ต๋๋ค.
DOMException: 'RTCPeerConnection'์์ 'setRemoteDescription' ์คํ ์คํจ: SessionDescription์ ๊ตฌ๋ฌธ ๋ถ์ํ์ง ๋ชปํ์ต๋๋ค. [๊ฐ์ฒด ๊ฐ์ฒด] ์์ ์ค: v=
http://localhost/sip-0.11.4%20 (1).js:9733:38์์
๋์ผํ ์ฝ๋ ์น์ ์์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค.
` /**
* ์๊ฒฉ ์ค๋ช
์ ๊ธฐ๋ณธ ๋ฏธ๋์ด ๊ตฌํ์ผ๋ก ์ค์
* @param {String} sessionDescription ๋ฏธ๋์ด ๊ตฌํ์ ์ค์ ๋ SIP ๋ฉ์์ง์ ์ํด ์ ๊ณต๋๋ ์ค๋ช
* @param {Object} [options] getDescription์์ ์ฌ์ฉํ ์ต์
๊ฐ์ฒด
* @param {MediaStreamConstraints} [options.constraints] MediaStreamConstraints https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints
* @param {Object} [options.peerConnectionOptions] ์ด๊ฒ์ด ์ค์ ๋๋ฉด ์ ์ต์
์ผ๋ก ํผ์ด ์ฐ๊ฒฐ์ ๋ค์ ์์ฑํฉ๋๋ค.
* @param {Array} [modifiers] ์ค๋ช
์์ ์๋ฅผ ํ ๋ฒ ์ฌ์ฉํ๋ ๋ฐฐ์ด
* @returns {Promise} ์ค๋ช
์ด ์ค์ ๋๋ฉด ํด๊ฒฐ๋๋ Promise
*/
setDescription: { ์ฐ๊ธฐ ๊ฐ๋ฅ: true, ๊ฐ: function setDescription(sessionDescription, ์ต์
, ์์ ์) {
var _this = ์ด๊ฒ;
var self = this;
options = options || {};
if (options.peerConnectionOptions) {
this.initPeerConnection(options.peerConnectionOptions);
}
modifiers = modifiers || [];
if (!Array.isArray(modifiers)) {
modifiers = [modifiers];
}
modifiers = modifiers.concat(this.modifiers);
var description = {
type: this.hasOffer('local') ? 'answer' : 'offer',
sdp: sessionDescription
};
return SIP.Utils.Promise.resolve().then(function () {
// Media should be acquired in getDescription unless we need to do it sooner for some reason (FF61+)
if (this.shouldAcquireMedia && this.options.alwaysAcquireMediaFirst) {
return this.acquire(this.constraints).then(function () {
this.shouldAcquireMedia = false;
}.bind(this));
}
}.bind(this)).then(function () {
return SIP.Utils.reducePromises(modifiers, description);
}).catch(function (e) {
if (e instanceof SIP.Exceptions.SessionDescriptionHandlerError) {
throw e;
}
var error = new SIP.Exceptions.SessionDescriptionHandlerError("setDescription", e, "The modifiers did not resolve successfully");
_this.logger.error(error.message);
self.emit('peerConnection-setRemoteDescriptionFailed', error);
throw error;
}).then(function (modifiedDescription) {
self.emit('setDescription', modifiedDescription);
return self.peerConnection.setRemoteDescription(modifiedDescription);
}).catch(function (e) {
if (e instanceof SIP.Exceptions.SessionDescriptionHandlerError) {
throw e;
}
// Check the original SDP for video, and ensure that we have want to do audio fallback
if (/^m=video.+$/gm.test(sessionDescription) && !options.disableAudioFallback) {
// Do not try to audio fallback again
options.disableAudioFallback = true;
// Remove video first, then do the other modifiers
return _this.setDescription(sessionDescription, options, [SIP.Web.Modifiers.stripVideo].concat(modifiers));
}
var error = new SIP.Exceptions.SessionDescriptionHandlerError("setDescription", e);
_this.logger.error(error.error);
_this.emit('peerConnection-setRemoteDescriptionFailed', error);
throw error;
}).then(function setRemoteDescriptionSuccess() {
if (self.peerConnection.getReceivers) {
self.emit('setRemoteDescription', self.peerConnection.getReceivers());
} else {
self.emit('setRemoteDescription', self.peerConnection.getRemoteStreams());
}
self.emit('confirmed', self);
});
} },`
Inspect js ์ฝ๋๋ "modifiedDescription.sdp"๊ฐ sdp์ ์ฌ๊ท ๊ฐ์ฒด์์ ๋ณด์ฌ์ฃผ์์ต๋๋ค.
์์ ์ ์ ์ฒด ๋ก๊ทธ๋ฅผ ๊ฒ์ํ์ญ์์ค. SDP๋ฅผ ์ง์ ์์ ํ๋ ค๊ณ ํฉ๋๊น, ์๋๋ฉด ๋จ์ํ ์ด์ ๋ฒ์ ์์ ํ์ฌ ๋ฒ์ ์ผ๋ก ์ ๋ฐ์ดํธํ๋ ค๊ณ ํฉ๋๊น?
๋ณํ ๋๋ ๋ธ๋ผ์ฐ์ ์ฝ์์ ๋ก๊ทธ? ๊ทธ๋ฆฌ๊ณ ๋ธ๋ผ์ฐ์ ์ฝ์์์ traceSip: true๊ฐ ํ์ํฉ๋๊น?
0.11.4 ๋ฒ์ ๋ถํฐ ์ฌ์ฉ๋ sip.js๋ฅผ ์์ํฉ๋๋ค. ๋๋ sdp๋ฅผ ์์ ํ์ง ์์์ต๋๋ค.
๋ธ๋ผ์ฐ์ ์ฝ์
[์์ ] (https://gist.github.com/kakabara/d39058805af90637a62931893900fb55) ํ์ง๋ง ํ์ด์ดํญ์ค์์ "Failed to parse SDP: SDP Parse Error on line 1: End of line Beyond the end of buffer"๋ผ๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค. 326๋ผ์ธ์์ ํ์ธํ์ธ์.
Google CHrome์์ setRemoteDescription ๊ตฌ๋ฌธ ๋ถ์ ์คํจ๋ก ์์ธ๊ฐ ๋ฐ์ํฉ๋๋ค.
๋ณํ๋ ICE ํ๋ณด์๋ฅผ ๋ณด๋ด์ง ์์ต๋๋ค. ์์ ์ ๋ฌธ์ ๋ ์์์ ์ธ๊ธํ ๊ฒ๊ณผ ๋์ผํ ๋ฌธ์ ๊ฐ ์๋๋๋ค.
์ฃ์กํฉ๋๋ค. ์๋ชป๋ ๋ฌธ์ ๋ ๋จผ์ ์ ๋๋ค. ๋๋ ๋ด ๋ฐ์ ์๊ฐ ์ผ์ ํ๋ณด๋ฅผ ๋ณด๋ด๋ ๊ฒ์ ์ดํดํ์ง๋ง ๋ณํ๋ ๋ค๋ฅธ ํด๋ผ์ด์ธํธ์๊ฒ ์ด๊ฒ์ ๋ณด๋ด์ง ์์ต๋๊น?
์ฃ์กํฉ๋๋ค. ๋ ์ดํด๊ฐ ์ ๋ผ์. WebRTC์๋ ICE ๋ฐ DTLS๊ฐ ํ์ํฉ๋๋ค. ์ด๊ฒ์ ๋ณํ ๋ฌธ์ ์ฒ๋ผ ๋ณด์ด๋ฏ๋ก ์ด๊ฒ์ ๋ซ์ ๊ฒ์ ๋๋ค. ๊ทํ์ ๋ฌธ์ ์ ๋ํ ๋ณํ ํ๋ก์ ํธ์ ํ์ ์กฐ์น๋ฅผ ์ทจํ์ญ์์ค.