]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_amrwb] add cfg setting mode-set-overwrite (it will answer with just one mode... 1190/head
authorDragos Oancea <dragos@signalwire.com>
Fri, 7 May 2021 14:17:15 +0000 (14:17 +0000)
committerDragos Oancea <dragos@signalwire.com>
Fri, 7 May 2021 14:29:33 +0000 (14:29 +0000)
conf/testing/autoload_configs/amrwb.conf.xml
conf/vanilla/autoload_configs/amrwb.conf.xml
src/mod/codecs/mod_amrwb/mod_amrwb.c

index 0bd8e6b7331403eccf0d7b66a48681488c1ee503..1163ffd1a65f6266f76dd85daa5454bb74d18052 100644 (file)
@@ -18,5 +18,7 @@
        <param name="adjust-bitrate" value="0"/>
        <!-- force OA when originating -->
        <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>
 </configuration>
index 0bd8e6b7331403eccf0d7b66a48681488c1ee503..1163ffd1a65f6266f76dd85daa5454bb74d18052 100644 (file)
@@ -18,5 +18,7 @@
        <param name="adjust-bitrate" value="0"/>
        <!-- force OA when originating -->
        <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>
 </configuration>
index ef7891cde674986b041cf9cbb188de31a35286af..8be5f4d54128aead788935b0b5ee20d9b4f500ed 100644 (file)
@@ -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);
+                               }
                        }
                }
        }