SIP.js: Hold not working on Firefox

Describe the bug I am trying to migrate to version 0.17.0

When I try to place the call on “hold” in Firefox, although neither party can hear the other, the second party does not hear any hold music and the status of the call is not set to hold. After some investigation this is what I have found to be the issue: It seems like the sdp is modified AFTER the hold modifier, and the “a=sendrecv” is added back into the sdp (in addition to the “a=sendonly” which is already there)

Logs https://gist.github.com/m-heinemann/b32ff6af8c281e4349b6b2720c3a8dc3

Steps to Reproduce

  1. Clone the SIP.js repo
  2. Run npm install and npm run build-demo
  3. Go to file:///{localPath}/SIP.js/demo/demo-1.html on a Firefox browser
  4. Click Connect and Place Call. Open the dev tools and clear the console.
  5. Check the “Hold” checkbox. Now observe the sdp that is printed in the console. You will see that “a=sendrecv” appears in the sdp that is sent from the server to the client, in addition to “a=sendonly” which appears further down.

Expected behavior Placing the call on “hold” should play music for the second party and should set the call status to on hold

Observed behavior Neither party could hear audio from the other party, BUT the second party did not hear music and the call status was not set to hold

Environment Information

  • Node.js
  • Firefox version 78.0.2

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 33

Commits related to this issue

Most upvoted comments

I am currently experiencing the same issues as stated above. I am not using simple user, but I am implementing my own setHold function following the one in simpleUser. Sip.js version 0.20.1

It works as expected on Google Chrome. However when I try Firefox (Version 105.0.3) I do not get the hold music on the other parties end.

I am holding the call from web browser side, and my other device is a mobile phone.

Let me know what I can do for you to help us both figure this out.

@jhspyhard Thank you for the hack, this is working for me. Perhaps we can get the mozilla check in the hold option/modifier.

@john-e-riordan I’ve tested hold in Chrome 88.0.4324.190 - works fine, in Firefox 84.0.2 - throws InvalidAccessError (SIP.js v0.19.0).

Fri Mar 12 2021 18:36:06 GMT+0200 (Eastern European Standard Time) | sip.SessionDescriptionHandler | SessionDescriptionHandler.setDescription failed - InvalidAccessError: Answer tried to set send when offer did not set recv
Fri Mar 12 2021 18:36:06 GMT+0200 (Eastern European Standard Time) | sip.Inviter | Session.setAnswer: SDH setDescription rejected...
Fri Mar 12 2021 18:36:06 GMT+0200 (Eastern European Standard Time) | sip.Inviter | Answer tried to set send when offer did not set recv
Fri Mar 12 2021 18:36:06 GMT+0200 (Eastern European Standard Time) | sip.Inviter | Failed to handle answer in 2xx response to re-INVITE
Fri Mar 12 2021 18:36:06 GMT+0200 (Eastern European Standard Time) | sip.Inviter | Answer tried to set send when offer did not set recv

Code used to put on hold:

session.invite({
    sessionDescriptionHandlerOptions: {
        hold: true
    }
});

Also tried as described in the documentation and with the SimpleUser - same result.