From 8a0c5152d7770266a35403fa0d3b23abe1374d98 Mon Sep 17 00:00:00 2001 From: Ken Rice Date: Mon, 11 Feb 2013 20:08:15 -0600 Subject: [PATCH] FS-4906 --resolve --- src/mod/applications/mod_spandsp/mod_spandsp.c | 3 +++ src/mod/applications/mod_spandsp/mod_spandsp.h | 1 + src/mod/applications/mod_spandsp/mod_spandsp_modem.c | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c index 56c4d36ac1..e86d025a08 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp.c @@ -492,6 +492,7 @@ switch_status_t load_configuration(switch_bool_t reload) spandsp_globals.modem_dialplan = "XML"; spandsp_globals.modem_context = "default"; + spandsp_globals.modem_directory = "/dev"; spandsp_globals.modem_count = 0; @@ -532,6 +533,8 @@ switch_status_t load_configuration(switch_bool_t reload) } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid value [%d] for total-modems\n", tmp); } + } else if (!strcmp(name, "directory")) { + spandsp_globals.modem_directory = switch_core_strdup(spandsp_globals.config_pool, value); } else if (!strcmp(name, "dialplan")) { spandsp_globals.modem_dialplan = switch_core_strdup(spandsp_globals.config_pool, value); } else if (!strcmp(name, "context")) { diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.h b/src/mod/applications/mod_spandsp/mod_spandsp.h index ce9618f5e0..61344d89e9 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.h +++ b/src/mod/applications/mod_spandsp/mod_spandsp.h @@ -74,6 +74,7 @@ struct spandsp_globals { int modem_verbose; char *modem_context; char *modem_dialplan; + char *modem_directory; switch_hash_t *tones; int tonedebug; }; diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_modem.c b/src/mod/applications/mod_spandsp/mod_spandsp_modem.c index 3233a924d8..baac2f3551 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_modem.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_modem.c @@ -299,7 +299,8 @@ switch_status_t modem_init(modem_t *modem, modem_control_handler_t control_handl #ifndef WIN32 modem->slot = globals.NEXT_ID++; - snprintf(modem->devlink, sizeof(modem->devlink), "/dev/FS%d", modem->slot); + + snprintf(modem->devlink, sizeof(modem->devlink), "%s/FS%d", spandsp_globals.modem_directory, modem->slot); unlink(modem->devlink);