MT#55283 Force transcoding

Closes #1912

Change-Id: I2ac29b8cf97f20637f693589dcf82fdba5b60026
coverity_scan
Michal Hajek 2 months ago committed by Richard Fuchs
parent 7d16141a6a
commit 018de40f2d

@ -1060,6 +1060,10 @@ void call_ng_flags_flags(str *s, unsigned int idx, helper_arg arg) {
case CSH_LOOKUP("allow transcoding"):
out->allow_transcoding = true;
break;
case CSH_LOOKUP("force-transcoding"):
case CSH_LOOKUP("force transcoding"):
out->force_transcoding = true;
break;
case CSH_LOOKUP("always-transcode"):
case CSH_LOOKUP("always transcode"):;
static const str str_all = STR_CONST("all");

@ -1175,6 +1175,11 @@ void __codec_handlers_update(struct call_media *receiver, struct call_media *sin
// do we have to force everything through the transcoding engine even if codecs match?
bool force_transcoding = do_pcm_dtmf_blocking || do_dtmf_blocking || use_audio_player;
if ( (a.flags && a.flags->force_transcoding) || ML_ISSET(other_monologue, FORCE_TRANSCODING)) {
ilogs(codec, LOG_DEBUG, "Flag force-transcoding exist");
force_transcoding = true;
ML_SET(other_monologue, FORCE_TRANSCODING);
}
for (__auto_type l = receiver->codecs.codec_prefs.head; l; ) {
rtp_payload_type *pt = l->data;

@ -920,6 +920,12 @@ Spaces in each string may be replaced by hyphens.
given, the answer will be accepted even if some codecs were rejected, and codecs will be
transcoded as required.
* `force transcoding`
This flag will force transcoding between channels. This provides a loss measurement
between the A-leg and B-leg. If this flag appears in the NG protocol, it will always be
transcoded (for example, between codecs G722 and G722).
* `always transcode`
Legacy flag, synonymous to `codec-accept=all`.

@ -231,6 +231,7 @@ enum {
#define ML_FLAG_SILENCE_MEDIA 0x01000000
#define ML_FLAG_MOH_SENDRECV 0x02000000
#define ML_FLAG_MOH_ZEROCONN 0x04000000
#define ML_FLAG_FORCE_TRANSCODING 0x08000000
/* call_t */
#define CALL_FLAG_IPV4_OFFER 0x00010000

@ -219,6 +219,7 @@ RTPE_NG_FLAGS_STR_CASE_HT_PARAMS
static_codecs:1,
allow_no_codec_media:1,
allow_transcoding:1,
force_transcoding:1,
allow_asymmetric_codecs:1,
early_media:1,
accept_any:1,

@ -41,6 +41,7 @@ my @flags = qw(
pierce-NAT
SIP-source-address
allow-transcoding
force-transcoding
trickle-ICE
reject-ICE
egress

Loading…
Cancel
Save