Merge pull request #1190 from dragos-oancea/amrwb-cfg-mode-set

[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.
This commit is contained in:
Andrey Volk 2021-05-14 18:34:17 +03:00 committed by GitHub
commit 53a52e1571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -18,5 +18,7 @@
<param name="adjust-bitrate" value="0"/> <param name="adjust-bitrate" value="0"/>
<!-- force OA when originating --> <!-- force OA when originating -->
<param name="force-oa" value="0"/> <param name="force-oa" value="0"/>
<!-- don't mirror mode-set in SDP answer, but use our own (default-bitrate). -->
<param name="mode-set-overwrite" value="0"/>
</settings> </settings>
</configuration> </configuration>

View File

@ -18,5 +18,7 @@
<param name="adjust-bitrate" value="0"/> <param name="adjust-bitrate" value="0"/>
<!-- force OA when originating --> <!-- force OA when originating -->
<param name="force-oa" value="0"/> <param name="force-oa" value="0"/>
<!-- don't mirror mode-set in SDP answer, but use our own (default-bitrate). -->
<param name="mode-set-overwrite" value="0"/>
</settings> </settings>
</configuration> </configuration>

View File

@ -88,6 +88,7 @@ static struct {
switch_byte_t volte; switch_byte_t volte;
switch_byte_t adjust_bitrate; switch_byte_t adjust_bitrate;
switch_byte_t force_oa; /*force OA when originating*/ switch_byte_t force_oa; /*force OA when originating*/
switch_byte_t mode_set_overwrite;
int debug; int debug;
} globals; } 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. */ /* choose the highest mode (bitrate) for high audio quality. */
for (i = SWITCH_AMRWB_MODES-2; i > -1; i--) { for (i = SWITCH_AMRWB_MODES-2; i > -1; i--) {
if (context->enc_modes & (1 << i)) { if (context->enc_modes & (1 << i)) {
@ -572,6 +573,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_amrwb_load)
if (!strcasecmp(var, "force-oa")) { if (!strcasecmp(var, "force-oa")) {
globals.force_oa = (switch_byte_t) atoi(val); globals.force_oa = (switch_byte_t) atoi(val);
} }
if (!strcasecmp(var, "mode-set-overwrite")) {
globals.mode_set_overwrite = (switch_byte_t) atoi(val);
}
} }
} }
} }