From 9f73ddd35bea15f9bd898acdf60785b7aca102f5 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Sun, 6 Jun 2010 13:07:30 -0400 Subject: [PATCH] freetdm: fix ss7 config --- libs/freetdm/mod_freetdm/mod_freetdm.c | 14 +++++++++----- libs/freetdm/src/ftdm_io.c | 7 +++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/libs/freetdm/mod_freetdm/mod_freetdm.c b/libs/freetdm/mod_freetdm/mod_freetdm.c index a0ff5c0f1c..74b700484f 100644 --- a/libs/freetdm/mod_freetdm/mod_freetdm.c +++ b/libs/freetdm/mod_freetdm/mod_freetdm.c @@ -2199,7 +2199,7 @@ static switch_status_t load_config(void) } switch_core_hash_init(&globals.ss7_configs, module_pool); - if ((spans = switch_xml_child(cfg, "ss7_spans"))) { + if ((spans = switch_xml_child(cfg, "sangoma_ss7_spans"))) { for (myspan = switch_xml_child(spans, "span"); myspan; myspan = myspan->next) { ftdm_status_t zstatus = FTDM_FAIL; const char *context = "default"; @@ -2248,6 +2248,10 @@ static switch_status_t load_config(void) } memset(spanparameters, 0, sizeof(spanparameters)); + paramindex = 0; + spanparameters[paramindex].var = "confnode"; + spanparameters[paramindex].ptr = ss7confnode; + paramindex++; for (param = switch_xml_child(myspan, "param"); param; param = param->next) { char *var = (char *) switch_xml_attr_soft(param, "name"); char *val = (char *) switch_xml_attr_soft(param, "value"); @@ -2268,10 +2272,10 @@ static switch_status_t load_config(void) } } - if (ftdm_configure_span(span, "ss7", on_ss7_signal, - "confnode", ss7confnode, - "parameters", spanparameters, - FTDM_TAG_END) != FTDM_SUCCESS) { + if (ftdm_configure_span_signaling(span, + "sangoma_ss7", + on_ss7_signal, + spanparameters) != FTDM_SUCCESS) { ftdm_log(FTDM_LOG_ERROR, "Error configuring ss7 FreeTDM span %d\n", span_id); continue; } diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index b979cfa261..c22767b658 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -3867,10 +3867,13 @@ FT_DECLARE(ftdm_status_t) ftdm_configure_span(ftdm_span_t *span, const char *typ ftdm_load_module_assume(type); if ((mod = (ftdm_module_t *) hashtable_search(globals.module_hash, (void *)type))) { ftdm_log(FTDM_LOG_INFO, "auto-loaded '%s'\n", type); + } else { + ftdm_log(FTDM_LOG_ERROR, "can't load '%s'\n", type); + return FTDM_FAIL; } } - if (mod && mod->sig_configure) { + if (mod->sig_configure) { va_list ap; va_start(ap, sig_cb); status = mod->sig_configure(span, sig_cb, ap); @@ -3879,7 +3882,7 @@ FT_DECLARE(ftdm_status_t) ftdm_configure_span(ftdm_span_t *span, const char *typ status = post_configure_span_channels(span); } } else { - ftdm_log(FTDM_LOG_ERROR, "can't find '%s'\n", type); + ftdm_log(FTDM_LOG_CRIT, "module '%s' did not implement the sig_configure method\n", type); status = FTDM_FAIL; }