Bug Report
Your environment
Issue description
While testing, I've encountered the following scenario:
- Call with 2-way audio is established.
- JsSIP user initiates hold
- JsSIP sends REINVITE with a=sendonly
- JsSIP received OK with a=recvonly and sends ACK, hold state is confirmed and stable
- Remote UA does a REFER with REPLACES to transfer the call to a conference. This is invisible to JsSIP as it occurs on the far side of a B2BUA. As a result, JsSIP received a REINVITE with a=sendrecv.
- JsSIP sends OK with a=sendrecv, hold state is out of sync. RTCSession still thinks _localHold is true but 2-way audio is heard
- JsSIP cannot initiate hold, even though 2-way audio is heard
In _receiveReinvite(), in the section "Request with SDP", this._mangleOffer() is only called if this._late_sdp is true. This issue could be fixed by calling _mangleOffer() when _late_sdp OR _localHold is true. Code block starting at line 2047 in RTCSession.js:
function sendAnswer(desc) {
const extraHeaders = [`Contact: ${this._contact}`];
this._handleSessionTimersInIncomingRequest(request, extraHeaders);
if (this._late_sdp || this._localHold) {
desc = this._mangleOffer(desc);
}
request.reply(200, null, extraHeaders, desc, () => {
this._status = C.STATUS_WAITING_FOR_ACK;
this._setInvite2xxTimer(request, desc);
this._setACKTimer();
});
// If callback is given execute it.
if (typeof data.callback === 'function') {
data.callback();
}
}
I'm going to test this change and will report back.
Thanks
Jamie
Bug Report
Your environment
Issue description
While testing, I've encountered the following scenario:
In _receiveReinvite(), in the section "Request with SDP", this._mangleOffer() is only called if this._late_sdp is true. This issue could be fixed by calling _mangleOffer() when _late_sdp OR _localHold is true. Code block starting at line 2047 in RTCSession.js:
I'm going to test this change and will report back.
Thanks
Jamie