mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-25 04:01:55 +00:00
FS-4135 --resolve hint, add a leading '=' to disable passing a-leg codecs <param name="outbound-codec-prefs" value="=6839{outbound_codec_prefs}"/>
This commit is contained in:
parent
a47d924a82
commit
5f76f3b912
@ -1982,6 +1982,10 @@ static void switch_loadable_module_sort_codecs(const switch_codec_implementation
|
|||||||
for (i = 0; i < arraylen; i++) {
|
for (i = 0; i < arraylen; i++) {
|
||||||
int this_ptime = array[i]->microseconds_per_packet / 1000;
|
int this_ptime = array[i]->microseconds_per_packet / 1000;
|
||||||
|
|
||||||
|
if (!strcasecmp(array[i]->iananame, "ilbc")) {
|
||||||
|
this_ptime = 20;
|
||||||
|
}
|
||||||
|
|
||||||
if (!sorted_ptime) {
|
if (!sorted_ptime) {
|
||||||
sorted_ptime = this_ptime;
|
sorted_ptime = this_ptime;
|
||||||
#ifdef DEBUG_CODEC_SORTING
|
#ifdef DEBUG_CODEC_SORTING
|
||||||
@ -1999,6 +2003,10 @@ static void switch_loadable_module_sort_codecs(const switch_codec_implementation
|
|||||||
for(j = i; j < arraylen; j++) {
|
for(j = i; j < arraylen; j++) {
|
||||||
int check_ptime = array[j]->microseconds_per_packet / 1000;
|
int check_ptime = array[j]->microseconds_per_packet / 1000;
|
||||||
|
|
||||||
|
if (!strcasecmp(array[i]->iananame, "ilbc")) {
|
||||||
|
check_ptime = 20;
|
||||||
|
}
|
||||||
|
|
||||||
if (check_ptime == sorted_ptime) {
|
if (check_ptime == sorted_ptime) {
|
||||||
#ifdef DEBUG_CODEC_SORTING
|
#ifdef DEBUG_CODEC_SORTING
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "swap %d %d ptime %d\n", i, j, check_ptime);
|
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)
|
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;
|
switch_codec_interface_t *codec_interface;
|
||||||
const switch_codec_implementation_t *imp;
|
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];
|
char *cur, *next = NULL, *name, *p, buf[256];
|
||||||
uint32_t interval = 0, rate = 0, bit = 0;
|
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));
|
switch_copy_string(buf, prefs[x], sizeof(buf));
|
||||||
name = next = cur = 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);
|
switch_mutex_unlock(loadable_modules.mutex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user