From 6fc10ffbf63f374f3b6c35ba1254707cdc5a285c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 7 Dec 2011 05:13:08 -0600 Subject: [PATCH] allow 0 --- src/mod/applications/mod_spandsp/mod_spandsp.c | 8 ++++---- src/mod/applications/mod_spandsp/mod_spandsp_modem.c | 5 +---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c index 4a75052e43..58ce00a92c 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp.c @@ -288,7 +288,7 @@ switch_status_t load_configuration(switch_bool_t reload) spandsp_globals.modem_dialplan = "XML"; spandsp_globals.modem_context = "default"; - spandsp_globals.modem_count = 1; + spandsp_globals.modem_count = 0; spandsp_globals.enable_t38 = 1; @@ -324,7 +324,7 @@ switch_status_t load_configuration(switch_bool_t reload) if (!reload && !strcmp(name, "total-modems")) { int tmp = atoi(value); - if (tmp > 0 && tmp < MAX_MODEMS) { + if (tmp > -1 && tmp < MAX_MODEMS) { spandsp_globals.modem_count = tmp; } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid value [%d] for total-modems\n", tmp); @@ -533,9 +533,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spandsp_init) /* Not such severe to prevent loading */ } -#if defined(MODEM_SUPPORT) + //#if defined(MODEM_SUPPORT) modem_global_init(module_interface, pool); -#endif + //#endif switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_spandsp loaded, using spandsp library version [%s]\n", SPANDSP_RELEASE_DATETIME_STRING); return SWITCH_STATUS_SUCCESS; diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_modem.c b/src/mod/applications/mod_spandsp/mod_spandsp_modem.c index 30b340d18a..d03c186e2c 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_modem.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_modem.c @@ -1232,11 +1232,8 @@ switch_status_t modem_global_init(switch_loadable_module_interface_t **module_in { memset(&globals, 0, sizeof(globals)); globals.pool = pool; - globals.SOFT_MAX_MODEMS = 1; - if (spandsp_globals.modem_count > 0) { - globals.SOFT_MAX_MODEMS = spandsp_globals.modem_count; - } + globals.SOFT_MAX_MODEMS = spandsp_globals.modem_count; switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, pool);