freetdm: fix ss7 config

This commit is contained in:
Moises Silva 2010-06-06 13:07:30 -04:00
parent f87bf812e7
commit 9f73ddd35b
2 changed files with 14 additions and 7 deletions

View File

@ -2199,7 +2199,7 @@ static switch_status_t load_config(void)
} }
switch_core_hash_init(&globals.ss7_configs, module_pool); 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) { for (myspan = switch_xml_child(spans, "span"); myspan; myspan = myspan->next) {
ftdm_status_t zstatus = FTDM_FAIL; ftdm_status_t zstatus = FTDM_FAIL;
const char *context = "default"; const char *context = "default";
@ -2248,6 +2248,10 @@ static switch_status_t load_config(void)
} }
memset(spanparameters, 0, sizeof(spanparameters)); 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) { for (param = switch_xml_child(myspan, "param"); param; param = param->next) {
char *var = (char *) switch_xml_attr_soft(param, "name"); char *var = (char *) switch_xml_attr_soft(param, "name");
char *val = (char *) switch_xml_attr_soft(param, "value"); 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, if (ftdm_configure_span_signaling(span,
"confnode", ss7confnode, "sangoma_ss7",
"parameters", spanparameters, on_ss7_signal,
FTDM_TAG_END) != FTDM_SUCCESS) { spanparameters) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error configuring ss7 FreeTDM span %d\n", span_id); ftdm_log(FTDM_LOG_ERROR, "Error configuring ss7 FreeTDM span %d\n", span_id);
continue; continue;
} }

View File

@ -3867,10 +3867,13 @@ FT_DECLARE(ftdm_status_t) ftdm_configure_span(ftdm_span_t *span, const char *typ
ftdm_load_module_assume(type); ftdm_load_module_assume(type);
if ((mod = (ftdm_module_t *) hashtable_search(globals.module_hash, (void *)type))) { if ((mod = (ftdm_module_t *) hashtable_search(globals.module_hash, (void *)type))) {
ftdm_log(FTDM_LOG_INFO, "auto-loaded '%s'\n", 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_list ap;
va_start(ap, sig_cb); va_start(ap, sig_cb);
status = mod->sig_configure(span, sig_cb, ap); 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); status = post_configure_span_channels(span);
} }
} else { } 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; status = FTDM_FAIL;
} }