Sip.js: DOMException:无法在“RTCPeerConnection”上执行“setRemoteDescription”:无法解析 SessionDescription。 [object Object] 期望行:v=

创建于 2018-10-12  ·  8评论  ·  资料来源: onsip/SIP.js

描述错误
无法正确运行库。

DOMException:无法在“RTCPeerConnection”上执行“setRemoteDescription”:无法解析 SessionDescription。 [object Object] 期望行: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} 一旦描述被设置就解决的承诺
*/
setDescription: { writable: true, value: function setDescription(sessionDescription, options, modifiers) {
var _this = 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条评论

检查 js 代码显示“modifiedDescription.sdp”是 sdp 的递归对象

请在要点中发布完整日志。 您是自己尝试修改 SDP,还是只是尝试从以前的版本更新到当前版本?

从星号或浏览器控制台记录? 并且需要 traceSip: true,在浏览器控制台中?
我从 0.11.4 版本开始使用 sip.js。 我没有修改sdp。

浏览器控制台

[gist] (https://gist.github.com/kakabara/d39058805af90637a62931893900fb55) 但在 Firefox 中,我收到错误消息“无法解析 SDP:第 1 行的 SDP 解析错误:行尾超出缓冲区末尾”。 在 326 行上看到它。
在 Google CHrome 中获取我的异常解析失败 setRemoteDescription

Asterisk 不会发送 ICE 候选人。 要点中的问题与您上面提到的问题不同。

抱歉,对于我不正确的问题,这是第一个问题。 我理解正确我的,调用者发送冰候选者,但星号不发送给其他客户端这个?

对不起。 我不明白。 WebRTC 需要 ICE 和 DTLS。 这看起来像一个星号问题,所以我要关闭它。 请在那里跟进有关您的问题的 Asterisk 项目。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

raphaelhovsepyan picture raphaelhovsepyan  ·  6评论

Pjata picture Pjata  ·  11评论

josephfrazier picture josephfrazier  ·  26评论

diegoteixeir4 picture diegoteixeir4  ·  5评论

tm1000 picture tm1000  ·  12评论