onsip / SIP.js

A simple, intuitive, and powerful JavaScript signaling library
https://sipjs.com
MIT License
1.88k stars 700 forks source link

REFER does not terminate current session #1069

Open DavidGOrtega opened 7 months ago

DavidGOrtega commented 7 months ago

In previous versions (0.15.XX) refer to target (blind transfer) or session (attended transfer) terminates (or send termination event?) current session. Now the session is left idle for a minute unless you send a bye.

const target = UserAgent.makeUri('sip:bob@example.com');
session.refer(target);
slavikbialik commented 6 months ago

Because usually when sending REFER to a SIP B2BUA (PBX or something) the PBX should be able to refer you to the requested destination and also to be the one that is sending the BYE to you (the one who originated the SIP REFER). So I don't know what was your behavior previously, but might be that the PBX was the one that sent you a SIP BYE to disconnect the call and not your client just decided to disconnect after making a REFER. If you still want such behavior, you can just use the 2nd argument in the "refer" method and you can delegate the "onNotify" callback function and catch the NOTIFY that you should receive after the referring and you can invoke the disconnection of the call yourself (if you're receiving it at all, as the PBX might receive it but not forwarding it to you as it should send you a SIP BYE).