mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-04 15:18:38 +00:00
mod_sangoma_codec: rename load/noload to register/noregister
This commit is contained in:
parent
3e338eb5c2
commit
26a6b43536
@ -110,11 +110,11 @@ vocallo_codec_t g_codec_map[] =
|
|||||||
{ -1, -1, NULL, NULL, -1, -1, -1, -1, -1, -1 },
|
{ -1, -1, NULL, NULL, -1, -1, -1, -1, -1, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* default codec list to load, users may override, special codec 'all' loads everything available unless listed in noload */
|
/* default codec list to load, users may override, special codec 'all' registers everything available unless listed in noregister */
|
||||||
static char g_codec_load_list[1024] = "all";
|
static char g_codec_register_list[1024] = "all";
|
||||||
|
|
||||||
/* default codec list to NOT load, users may override */
|
/* default codec list to NOT load, users may override */
|
||||||
static char g_codec_noload_list[1024] = "";
|
static char g_codec_noregister_list[1024] = "";
|
||||||
|
|
||||||
struct codec_data {
|
struct codec_data {
|
||||||
/* sngtc request and reply */
|
/* sngtc request and reply */
|
||||||
@ -854,12 +854,12 @@ static int sangoma_parse_config(void)
|
|||||||
char *val = (char *)switch_xml_attr_soft(param, "value");
|
char *val = (char *)switch_xml_attr_soft(param, "value");
|
||||||
|
|
||||||
/* this parameter overrides the default list of codecs to load */
|
/* this parameter overrides the default list of codecs to load */
|
||||||
if (!strcasecmp(var, "load")) {
|
if (!strcasecmp(var, "register")) {
|
||||||
strncpy(g_codec_load_list, val, sizeof(g_codec_load_list)-1);
|
strncpy(g_codec_register_list, val, sizeof(g_codec_register_list)-1);
|
||||||
g_codec_load_list[sizeof(g_codec_load_list)-1] = 0;
|
g_codec_register_list[sizeof(g_codec_register_list)-1] = 0;
|
||||||
} else if (!strcasecmp(var, "noload")) {
|
} else if (!strcasecmp(var, "noregister")) {
|
||||||
strncpy(g_codec_noload_list, val, sizeof(g_codec_noload_list)-1);
|
strncpy(g_codec_noregister_list, val, sizeof(g_codec_noregister_list)-1);
|
||||||
g_codec_noload_list[sizeof(g_codec_noload_list)-1] = 0;
|
g_codec_noregister_list[sizeof(g_codec_noregister_list)-1] = 0;
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Ignored unknown Sangoma codec setting %s\n", var);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Ignored unknown Sangoma codec setting %s\n", var);
|
||||||
}
|
}
|
||||||
@ -985,18 +985,18 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sangoma_codec_load)
|
|||||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||||
|
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Loading codecs, load='%s', noload='%s'\n", g_codec_load_list, g_codec_noload_list);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Loading codecs, register='%s', noregister='%s'\n", g_codec_register_list, g_codec_noregister_list);
|
||||||
for (c = 0; g_codec_map[c].codec_id != -1; c++) {
|
for (c = 0; g_codec_map[c].codec_id != -1; c++) {
|
||||||
|
|
||||||
/* check if the codec is in the load list, otherwise skip it */
|
/* check if the codec is in the load list, otherwise skip it */
|
||||||
if (strcasecmp(g_codec_load_list, "all") && !strcasestr(g_codec_load_list, g_codec_map[c].iana_name)) {
|
if (strcasecmp(g_codec_register_list, "all") && !strcasestr(g_codec_register_list, g_codec_map[c].iana_name)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Not loading codec %s because was not found in the load list\n",
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Not loading codec %s because was not found in the load list\n",
|
||||||
g_codec_map[c].iana_name);
|
g_codec_map[c].iana_name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* load it unless is named in the noload list */
|
/* load it unless is named in the noload list */
|
||||||
if (strcasestr(g_codec_noload_list, g_codec_map[c].iana_name)) {
|
if (strcasestr(g_codec_noregister_list, g_codec_map[c].iana_name)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Not loading codec %s because was not found in the noload list\n",
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Not loading codec %s because was not found in the noload list\n",
|
||||||
g_codec_map[c].iana_name);
|
g_codec_map[c].iana_name);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user