-
Notifications
You must be signed in to change notification settings - Fork 788
Description
Description
Currently, JsSIP does not provide a way to set or prioritize specific codecs during the SIP negotiation process. This is a crucial feature for optimizing call quality and adapting to different network conditions. Without the ability to select or prioritize codecs, users have limited control over how media is transmitted, potentially leading to suboptimal call quality or compatibility issues with certain systems.
Expected Behavior
JsSIP should expose a method or option that allows users to:
Set codec preferences (e.g., Opus, G.711, G.729, etc.).
Prioritize codecs by defining an order of preference, which would then be reflected in the SDP offer/answer.
Actual Behavior:
JsSIP currently selects codecs without providing a mechanism to modify the codec order or preference. Users cannot influence which codecs are prioritized during SDP negotiation.
Suggested Enhancement
Add a method (e.g., setCodecPreferences()) that allows developers to define the desired codec order for SIP sessions.
Allow this method to take an array of codec identifiers (such as payload types or names), which would then be used to construct the SDP. Ensure that this functionality works for both audio and video codecs.
Example Usage
const codecPreferences: ['opus/48000/2', 'PCMU/8000', 'PCMA/8000'];
session.answer({
mediaConstraints,
pcConfig,
rtcOfferConstraints: {
offerToReceiveAudio: true,
offerToReceiveVideo: false,
codecPreferences
}
})
This would result in the SDP offer being constructed with the specified codecs in the preferred order.
Impact
This enhancement would significantly improve the flexibility and performance of JsSIP in various network conditions and across different SIP systems by allowing developers to fine-tune the media negotiation process.