]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4135 --resolve hint, add a leading '=' to disable passing a-leg codecs <param...
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 20 Apr 2012 00:36:48 +0000 (19:36 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 20 Apr 2012 00:36:48 +0000 (19:36 -0500)
src/switch_loadable_module.c

index d61a537ff39f03dba782349c31b84a4391233fe9..104c4b4073ff656d0f5094d2406f8fc97b5e40a8 100644 (file)
@@ -1981,6 +1981,10 @@ static void switch_loadable_module_sort_codecs(const switch_codec_implementation
 
        for (i = 0; i < arraylen; i++) {
                int this_ptime = array[i]->microseconds_per_packet / 1000;
+               
+               if (!strcasecmp(array[i]->iananame, "ilbc")) {
+                       this_ptime = 20;
+               }
 
                if (!sorted_ptime) {
                        sorted_ptime = this_ptime;
@@ -1999,6 +2003,10 @@ static void switch_loadable_module_sort_codecs(const switch_codec_implementation
                        for(j = i; j < arraylen; j++) {
                                int check_ptime = array[j]->microseconds_per_packet / 1000;
 
+                               if (!strcasecmp(array[i]->iananame, "ilbc")) {
+                                       check_ptime = 20;
+                               }
+
                                if (check_ptime == sorted_ptime) {
 #ifdef DEBUG_CODEC_SORTING
                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "swap %d %d ptime %d\n", i, j, check_ptime);
@@ -2069,7 +2077,7 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs(const switch_codec_impleme
 
 SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_implementation_t **array, int arraylen, char **prefs, int preflen)
 {
-       int x, i = 0;
+       int x, i = 0, j = 0;
        switch_codec_interface_t *codec_interface;
        const switch_codec_implementation_t *imp;
 
@@ -2079,6 +2087,12 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
                char *cur, *next = NULL, *name, *p, buf[256];
                uint32_t interval = 0, rate = 0, bit = 0;
 
+               for(j = 0; j < x; j++) {
+                       if (!strcasecmp(prefs[j], prefs[x])) {
+                               goto next_x;
+                       }
+               }
+
                switch_copy_string(buf, prefs[x], sizeof(buf));
                name = next = cur = buf;
 
@@ -2164,6 +2178,10 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
                        }
 
                }
+
+       next_x:
+
+               continue;
        }
 
        switch_mutex_unlock(loadable_modules.mutex);