From: Dragos Oancea Date: Fri, 7 May 2021 14:17:15 +0000 (+0000) Subject: [mod_amrwb] add cfg setting mode-set-overwrite (it will answer with just one mode... X-Git-Tag: v1.10.7^2~324^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1190%2Fhead;p=thirdparty%2Ffreeswitch.git [mod_amrwb] add cfg setting mode-set-overwrite (it will answer with just one mode-set value) - fixes audio quality issues in mod_conference with some UEs. --- diff --git a/conf/testing/autoload_configs/amrwb.conf.xml b/conf/testing/autoload_configs/amrwb.conf.xml index 0bd8e6b733..1163ffd1a6 100644 --- a/conf/testing/autoload_configs/amrwb.conf.xml +++ b/conf/testing/autoload_configs/amrwb.conf.xml @@ -18,5 +18,7 @@ + + diff --git a/conf/vanilla/autoload_configs/amrwb.conf.xml b/conf/vanilla/autoload_configs/amrwb.conf.xml index 0bd8e6b733..1163ffd1a6 100644 --- a/conf/vanilla/autoload_configs/amrwb.conf.xml +++ b/conf/vanilla/autoload_configs/amrwb.conf.xml @@ -18,5 +18,7 @@ + + diff --git a/src/mod/codecs/mod_amrwb/mod_amrwb.c b/src/mod/codecs/mod_amrwb/mod_amrwb.c index ef7891cde6..8be5f4d541 100644 --- a/src/mod/codecs/mod_amrwb/mod_amrwb.c +++ b/src/mod/codecs/mod_amrwb/mod_amrwb.c @@ -88,6 +88,7 @@ static struct { switch_byte_t volte; switch_byte_t adjust_bitrate; switch_byte_t force_oa; /*force OA when originating*/ + switch_byte_t mode_set_overwrite; int debug; } globals; @@ -273,7 +274,7 @@ static switch_status_t switch_amrwb_init(switch_codec_t *codec, switch_codec_fla } } - if (context->enc_modes) { + if (context->enc_modes && !globals.mode_set_overwrite) { /* choose the highest mode (bitrate) for high audio quality. */ for (i = SWITCH_AMRWB_MODES-2; i > -1; i--) { if (context->enc_modes & (1 << i)) { @@ -572,6 +573,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_amrwb_load) if (!strcasecmp(var, "force-oa")) { globals.force_oa = (switch_byte_t) atoi(val); } + if (!strcasecmp(var, "mode-set-overwrite")) { + globals.mode_set_overwrite = (switch_byte_t) atoi(val); + } } } }