早上好,我需要使用SIP.js进行有人值守的转移。有人成功完成了这项任务吗? 我现在只能进行盲转,我发现有一篇文章报道在版本0.7.x中支持有人参加转移槽替换命令。
答案 0 :(得分:0)
也许为时已晚,但我为未来写了答案。我按照这个步骤做到了:
var holded_session = session;
session.hold()
ua.invite()
session.refer(holded_session)
文档中没有记录函数hold()
和unhold()
,但是当您将会话输出到控制台时,您会在其中看到它。
答案 1 :(得分: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)