Sip.js: DOMException: 'RTCPeerConnection'์—์„œ 'setRemoteDescription' ์‹คํ–‰ ์‹คํŒจ: SessionDescription์„ ๊ตฌ๋ฌธ ๋ถ„์„ํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค. [๊ฐ์ฒด ๊ฐœ์ฒด] ์˜ˆ์ƒ ์ค„: v=

์— ๋งŒ๋“  2018๋…„ 10์›” 12์ผ  ยท  8์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: onsip/SIP.js

๋ฒ„๊ทธ ์„ค๋ช…
๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์ž‘๋™ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

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);
    });
  } },`

๋ชจ๋“  8 ๋Œ“๊ธ€

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๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๋ณ„ํ‘œ ๋ฌธ์ œ์ฒ˜๋Ÿผ ๋ณด์ด๋ฏ€๋กœ ์ด๊ฒƒ์„ ๋‹ซ์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๊ท€ํ•˜์˜ ๋ฌธ์ œ์— ๋Œ€ํ•œ ๋ณ„ํ‘œ ํ”„๋กœ์ ํŠธ์˜ ํ›„์† ์กฐ์น˜๋ฅผ ์ทจํ•˜์‹ญ์‹œ์˜ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰