OPENZAP-238: [freetdm] Several core and gsm improvements

* Add error handing in mod_freetdm for ftdm trace failures

* Allow freetdm signaling modules to specify a destroy function

* Added conditional forwarding to the freetdm gsm module
  Just specify the conditional-forwarding-number gsm parameter in freetdm.conf.xml

* Added new 'gsm call' freetdm command for raw GSM calls which can be
  used to enable/disabling network features (e.g call *93) without
  having to resort to use a full originate that requires routing the
  call somewhere when answered

* Miscelaneous cleanup of piggy coding style left over by one of the
  previous authors -_-
This commit is contained in:
Moises Silva
2014-07-22 20:53:28 -04:00
parent ff283f60de
commit f5894db211
5 changed files with 172 additions and 47 deletions

View File

@@ -728,7 +728,14 @@ static ftdm_status_t ftdm_span_destroy(ftdm_span_t *span)
}
ftdm_mutex_unlock(span->mutex);
ftdm_mutex_destroy(&span->mutex);
ftdm_safe_free(span->signal_data);
/* Give the span a chance to destroy its own signaling data */
if (span->destroy) {
span->destroy(span);
} else if (span->signal_data) {
/* We take care of their dirty business ... */
ftdm_free(span->signal_data);
}
return status;
}
@@ -5520,7 +5527,8 @@ FT_DECLARE(ftdm_io_interface_t *) ftdm_global_get_io_interface(const char *iotyp
FT_DECLARE(int) ftdm_load_module(const char *name)
{
ftdm_dso_lib_t lib;
int count = 0, x = 0;
int count = 0;
ftdm_bool_t load_proceed = FTDM_TRUE;
char path[512] = "";
char *err;
ftdm_module_t *mod;
@@ -5544,11 +5552,11 @@ FT_DECLARE(int) ftdm_load_module(const char *name)
if (mod->io_load(&interface1) != FTDM_SUCCESS || !interface1 || !interface1->name) {
ftdm_log(FTDM_LOG_ERROR, "Error loading %s\n", path);
load_proceed = FTDM_FALSE;
} else {
ftdm_log(FTDM_LOG_INFO, "Loading IO from %s [%s]\n", path, interface1->name);
if (ftdm_global_add_io_interface(interface1) == FTDM_SUCCESS) {
process_module_config(interface1);
x++;
}
}
}
@@ -5556,13 +5564,13 @@ FT_DECLARE(int) ftdm_load_module(const char *name)
if (mod->sig_load) {
if (mod->sig_load() != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error loading %s\n", path);
load_proceed = FTDM_FALSE;
} else {
ftdm_log(FTDM_LOG_INFO, "Loading SIG from %s\n", path);
x++;
}
}
if (x) {
if (load_proceed) {
char *p;
mod->lib = lib;
ftdm_set_string(mod->path, path);
@@ -5583,7 +5591,7 @@ FT_DECLARE(int) ftdm_load_module(const char *name)
}
ftdm_mutex_unlock(globals.mutex);
} else {
ftdm_log(FTDM_LOG_ERROR, "Unloading %s\n", path);
ftdm_log(FTDM_LOG_ERROR, "Errors during module load. Unloading %s\n", path);
ftdm_dso_destroy(&lib);
}