Browse Source

MT#55283 Force transcoding

Closes #1912

Change-Id: I2ac29b8cf97f20637f693589dcf82fdba5b60026
coverity_scan
Michal Hajek 9 months ago
committed by Richard Fuchs
parent
commit
018de40f2d
6 changed files with 18 additions and 0 deletions
  1. +4
    -0
      daemon/call_interfaces.c
  2. +5
    -0
      daemon/codec.c
  3. +6
    -0
      docs/ng_control_protocol.md
  4. +1
    -0
      include/call.h
  5. +1
    -0
      include/call_interfaces.h
  6. +1
    -0
      utils/rtpengine-ng-client

+ 4
- 0
daemon/call_interfaces.c View File

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


+ 5
- 0
daemon/codec.c View File

@ -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? // 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; 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; ) { for (__auto_type l = receiver->codecs.codec_prefs.head; l; ) {
rtp_payload_type *pt = l->data; rtp_payload_type *pt = l->data;


+ 6
- 0
docs/ng_control_protocol.md View File

@ -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 given, the answer will be accepted even if some codecs were rejected, and codecs will be
transcoded as required. 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` * `always transcode`
Legacy flag, synonymous to `codec-accept=all`. Legacy flag, synonymous to `codec-accept=all`.


+ 1
- 0
include/call.h View File

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


+ 1
- 0
include/call_interfaces.h View File

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


+ 1
- 0
utils/rtpengine-ng-client View File

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


Loading…
Cancel
Save