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.
Asked
Active
Viewed 3,545 times
2 Answers
2
Maybe too late, but I write answer for future. I made it in this steps:
- saved current session in other variable, for example
var holded_session = session;
- call in current session hold,
session.hold()
- make new call
ua.invite()
- make transfer
session.refer(holded_session)
Functions hold()
and unhold()
are not documented in documentation, but when you output session into console, you will see its in there.

Greno
- 65
- 6
0
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)