mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
Compare sdp to determine if transcoding is being used. (#1444)
* compare sdp for transcoding * refactor sdp check for leading codec * fix reference to epOther * minor changes * minor * fix #1447 * fix security issue * use convenience getter appIsUsingWebsockets in CallSession --------- Co-authored-by: Dave Horton <daveh@beachdognet.com>
This commit is contained in:
@@ -55,11 +55,28 @@ const extractSdpMedia = (sdp) => {
|
||||
}
|
||||
};
|
||||
|
||||
const getLeadingCodec = (sdp) => {
|
||||
if (!sdp) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const parsed = sdpTransform.parse(sdp);
|
||||
const audio = parsed.media?.find((m) => m.type === 'audio');
|
||||
|
||||
if (!audio) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return audio.rtp?.[0]?.codec || null;
|
||||
};
|
||||
|
||||
|
||||
module.exports = {
|
||||
isOnhold,
|
||||
mergeSdpMedia,
|
||||
extractSdpMedia,
|
||||
isOpusFirst,
|
||||
makeOpusFirst,
|
||||
removeVideoSdp
|
||||
removeVideoSdp,
|
||||
getLeadingCodec
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user