mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
Feat 1120 video call - remove video media from SDP if the call is audio call (#1124)
* sending jambonz:error when the incoming message is not parsable https://github.com/jambonz/jambonz-feature-server/issues/1094 * writing an alert when incoming paylod is invalid * added content to the jambonz:error payload * removing video media from sdp if the call is an audio call. This is to avoid sending video media to destination if the incoming call is an audio call * calling removeVideoSdp only when the environment variable JAMBONES_VIDEO_CALLS_ENABLED_IN_FS is set to true, this will ensure there are no regression issues for audio calls * fixed jslint errors
This commit is contained in:
@@ -35,6 +35,12 @@ const makeOpusFirst = (sdp) => {
|
||||
}
|
||||
return sdpTransform.write(parsedSdp);
|
||||
};
|
||||
const removeVideoSdp = (sdp) => {
|
||||
const parsedSdp = sdpTransform.parse(sdp);
|
||||
// Filter out video media sections, keeping only non-video media
|
||||
parsedSdp.media = parsedSdp.media.filter((media) => media.type !== 'video');
|
||||
return sdpTransform.write(parsedSdp);
|
||||
};
|
||||
|
||||
const extractSdpMedia = (sdp) => {
|
||||
const parsedSdp1 = sdpTransform.parse(sdp);
|
||||
@@ -54,5 +60,6 @@ module.exports = {
|
||||
mergeSdpMedia,
|
||||
extractSdpMedia,
|
||||
isOpusFirst,
|
||||
makeOpusFirst
|
||||
makeOpusFirst,
|
||||
removeVideoSdp
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user