0

早上好,我需要使用 SIP.js 进行有人值守转移。有人成功完成这项任务吗?我现在只能进行盲转,我发现一篇文章报告说在 0.7.x 版本中支持有人参与的转槽替换命令。

https://www.onsip.com/blog/sipjs-070-adds-fixes-and-support-for-attended-transfer-recommended-upgrade

4

2 回答 2

2

也许为时已晚,但我为未来写下答案。我是按以下步骤完成的:

  • 将当前会话保存在其他变量中,例如var holded_session = session;
  • 呼叫当前会话保持,session.hold()
  • 拨打新电话ua.invite()
  • 转账session.refer(holded_session)

功能hold()unhold()文档中没有记录,但是当您将会话输出到控制台时,您会在其中看到它。

于 2016-03-24T13:00:17.443 回答
0

我以这种方式解决了音频问题

    sessionOne.hold();//already exists previously


    var uri = phone + '@' + sip_server;
    var options = {
       media: {
           constraints: {
               audio: true,
               video: false
           },
           render: {
               remote: document.getElementById('audio-output')
           },
           stream: mediaStream
       },
       extraHeaders: [...],
       inviteWithoutSdp: true,
       rel100: SIP.C.supported.SUPPORTED,
       activeAfterTransfer: false //die when the transfer is completed
   };

   sessionTwo = userAgent.invite(uri, options);
   //if yo want handle the transfer at the application level, then implements the handler events as on('refer', function(request) {}) for the session object
   ...
   sessionOne.refer(sessionTwo);//session two already must is accepted (sip server)
于 2020-06-03T05:31:41.803 回答