Good morning, I need to make attended transfers with SIP.js. Anyone succeded in this task? I can only make blind transfers right now, i found an article that reports that in version 0.7.x there is support for attended transfer trough replace command.
Make an attended transfer with SIP.js
3.9k Views Asked by CaTourist At
2
There are 2 best solutions below
0
On
I solved this for audio this manner
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)
Maybe too late, but I write answer for future. I made it in this steps:
var holded_session = session;session.hold()ua.invite()session.refer(holded_session)Functions
hold()andunhold()are not documented in documentation, but when you output session into console, you will see its in there.