JsSIP
JsSIP copied to clipboard
Add support for sender encodings priority option
Addresses #873. Adds the option to set the sender's priority when adding local media stream tracks to the peer connection in RTCSession.
I added an optional field called encodingsPriority to the options passed to call() and to answer(). When not passed, the default value is applied ('low').
I tested this both on Chrome and Safari. While encodings setting appears successful in both, as it turns out, Safari doesn't actually apply the settings to the packet headers, as can be verified with Wireshark:
Chrome
Safari
This appears to be a bug in Safari (verified both in v17.x and v18.x) and we're going to report it to Safari's bug tracker.
Example usage
const SESSION_OPTIONS = {
mediaConstraints: {
audio: true,
video: false
},
encodingsPriority: 'high',
};
const newSession = jssip.call(uri, SESSION_OPTIONS);