Merge branch 'releases.3.3' into smgmaster

Conflicts:
	build/modules.conf.in
	libs/freetdm/mod_freetdm/mod_freetdm.c
This commit is contained in:
Moises Silva 2011-05-31 20:06:41 -04:00
commit 74532a8b7b
7 changed files with 88 additions and 275 deletions

View File

@ -1,120 +1,13 @@
loggers/mod_console
loggers/mod_logfile
loggers/mod_syslog
#applications/mod_cidlookup
applications/mod_commands
applications/mod_conference
applications/mod_dptools
applications/mod_enum
#applications/mod_osp
applications/mod_fifo
#applications/mod_curl
applications/mod_db
applications/mod_commands
applications/mod_hash
#applications/mod_redis
applications/mod_voicemail
#applications/mod_directory
#applications/mod_lcr
applications/mod_expr
applications/mod_esf
#applications/mod_easyroute
applications/mod_fsv
#applications/mod_nibblebill
#applications/mod_soundtouch
#applications/mod_rss
applications/mod_spandsp
#applications/mod_snom
#applications/mod_vmd
#applications/mod_avmd
#applications/mod_memcache
#applications/mod_spy
applications/mod_cluechoo
applications/mod_valet_parking
#applications/mod_distributor
#applications/mod_stress
#applications/mod_snapshot
#applications/mod_snipe_hunt
#applications/mod_callcenter
#applications/mod_fsk
#applications/mod_ladspa
#applications/mod_mongo
codecs/mod_g723_1
codecs/mod_amr
#codecs/mod_amrwb
#codecs/mod_silk
#codecs/mod_codec2
codecs/mod_g729
#codecs/mod_com_g729
codecs/mod_h26x
codecs/mod_bv
codecs/mod_ilbc
codecs/mod_speex
codecs/mod_siren
#codecs/mod_celt
#codecs/mod_opus
#codecs/mod_sangoma_codec
#codecs/mod_dahdi_codec
#dialplans/mod_dialplan_directory
dialplans/mod_dialplan_xml
dialplans/mod_dialplan_asterisk
#directories/mod_ldap
#endpoints/mod_dingaling
#endpoints/mod_portaudio
endpoints/mod_sofia
endpoints/mod_loopback
#endpoints/mod_alsa
#endpoints/mod_opal
#endpoints/mod_skinny
#endpoints/mod_skypopen
#endpoints/mod_h323
#endpoints/mod_khomp
#../../libs/openzap/mod_openzap
#../../libs/freetdm/mod_freetdm
#asr_tts/mod_unimrcp
#asr_tts/mod_flite
#asr_tts/mod_pocketsphinx
#asr_tts/mod_cepstral
#asr_tts/mod_tts_commandline
#event_handlers/mod_event_multicast
event_handlers/mod_event_socket
#event_handlers/mod_event_zmq
event_handlers/mod_cdr_csv
event_handlers/mod_cdr_sqlite
#event_handlers/mod_cdr_pg_csv
#event_handlers/mod_radius_cdr
#event_handlers/mod_erlang_event
#event_handlers/mod_snmp
formats/mod_native_file
formats/mod_sndfile
#formats/mod_shout
formats/mod_local_stream
formats/mod_tone_stream
#formats/mod_portaudio_stream
#formats/mod_shell_stream
#languages/mod_python
languages/mod_spidermonkey
languages/mod_lua
#languages/mod_perl
#languages/mod_yaml
#languages/mod_java
#languages/mod_managed
xml_int/mod_xml_rpc
#xml_int/mod_xml_curl
../../libs/freetdm/mod_freetdm
xml_int/mod_xml_cdr
#xml_int/mod_xml_ldap
say/mod_say_en
#say/mod_say_de
#say/mod_say_es
#say/mod_say_fr
#say/mod_say_it
#say/mod_say_nl
#say/mod_say_pt
#say/mod_say_ru
#say/mod_say_zh
#say/mod_say_hu
#say/mod_say_th
#say/mod_say_he
#timers/mod_timerfd
## Experimental Modules (don't cry if they're broken)
#../../contrib/mod/xml_int/mod_xml_odbc
event_handlers/mod_event_socket
codecs/mod_sangoma_codec

View File

@ -8,7 +8,7 @@
#include <signal.h>
#define CMD_BUFLEN 1024
#define PROMPT_PREFIX "sangoma-media-gateway"
#define PROMPT_PREFIX "netborder-ss7"
static int WARN_STOP = 0;
#ifdef WIN32
@ -854,7 +854,7 @@ static void print_banner(FILE *stream)
"\n"
"*******************************************************\n"
"* Sangoma Media Gateway *\n"
"* Netborder SS7 Gateway *\n"
"* Powered by FreeSWITCH (http://www.freeswitch.org) *\n"
"*******************************************************\n"
"\n"
@ -1002,13 +1002,13 @@ int main(int argc, char *argv[])
int rv = 0;
#ifndef WIN32
char hfile[512] = "/etc/smg_cli_history";
char cfile[512] = "/etc/smg_cli.conf";
char dft_cfile[512] = "/etc/smg_cli.conf";
char hfile[512] = "/etc/nbess7_cli_history";
char cfile[512] = "/etc/nbess7_cli.conf";
char dft_cfile[512] = "/etc/nbess7_cli.conf";
#else
char hfile[512] = "smg_cli_history";
char cfile[512] = "smg_cli.conf";
char dft_cfile[512] = "smg_cli.conf";
char hfile[512] = "nbess7_cli_history";
char cfile[512] = "nbess7_cli.conf";
char dft_cfile[512] = "nbess7_cli.conf";
#endif
char *home = getenv("HOME");
/* Vars for optargs */
@ -1054,8 +1054,8 @@ int main(int argc, char *argv[])
if (home) {
snprintf(hfile, sizeof(hfile), "%s/.smg_cli_history", home);
snprintf(cfile, sizeof(cfile), "%s/.smg_cli_conf", home);
snprintf(hfile, sizeof(hfile), "%s/.nbess7_cli_history", home);
snprintf(cfile, sizeof(cfile), "%s/.nbess7_cli_conf", home);
}
signal(SIGINT, handle_SIGINT);
@ -1368,7 +1368,7 @@ int main(int argc, char *argv[])
print_banner(stdout);
esl_log(ESL_LOG_INFO, "Sangoma Media Gateway CLI Ready.\nenter /help for a list of commands.\n");
esl_log(ESL_LOG_INFO, "Netborder SS7 CLI Ready.\nenter /help for a list of commands.\n");
printf("%s\n", handle.last_sr_reply);
while (running > 0) {

View File

@ -18,6 +18,11 @@ with the signaling protocols that you can run on top of your I/O interfaces.
-->
<!--<param name="enable-analog-option" value="call-swap"/>-->
<!--<param name="enable-analog-option" value="3-way"/>-->
<!--
Refuse to load the module if there is configuration errors
Defaults to 'no'
-->
<!--<param name="fail-on-error" value="no"/>-->
</settings>
<!-- Sample analog configuration (The analog_spans tag is for ftmod_analog) -->

View File

@ -87,7 +87,9 @@ static struct {
analog_option_t analog_options;
switch_hash_t *ss7_configs;
int sip_headers;
int crash_on_assert;
uint8_t crash_on_assert;
uint8_t fail_on_error;
uint8_t config_error;
} globals;
/* private data attached to each fs session */
@ -2427,6 +2429,10 @@ static uint32_t enable_analog_option(const char *str, uint32_t current_options)
}
#define CONFIG_ERROR(...) do { \
ftdm_log(FTDM_LOG_ERROR, __VA_ARGS__); \
globals.config_error = 1; \
} while(0)
/* create ftdm_conf_node_t tree based on a fixed pattern XML configuration list
* last 2 args are for limited aka dumb recursivity
* */
@ -2619,7 +2625,7 @@ static int add_profile_parameters(switch_xml_t cfg, const char *profname, ftdm_c
profnode = switch_xml_child(cfg, "config_profiles");
if (!profnode) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "cannot find profile '%s', there is no 'config_profiles' XML section\n", profname);
CONFIG_ERROR("cannot find profile '%s', there is no 'config_profiles' XML section\n", profname);
return 0;
}
@ -2635,7 +2641,7 @@ static int add_profile_parameters(switch_xml_t cfg, const char *profname, ftdm_c
}
if (!profile) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to find profile '%s'\n", profname);
CONFIG_ERROR("failed to find profile '%s'\n", profname);
return 0;
}
@ -2670,7 +2676,7 @@ static void parse_bri_pri_spans(switch_xml_t cfg, switch_xml_t spans)
unsigned paramindex = 0;
if (!name && !id) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "sangoma isdn span missing required attribute 'id' or 'name', skipping ...\n");
CONFIG_ERROR("sangoma isdn span missing required attribute 'id' or 'name', skipping ...\n");
continue;
}
@ -2688,7 +2694,7 @@ static void parse_bri_pri_spans(switch_xml_t cfg, switch_xml_t spans)
}
if (zstatus != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
CONFIG_ERROR("Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
@ -2716,7 +2722,7 @@ static void parse_bri_pri_spans(switch_xml_t cfg, switch_xml_t spans)
char *val = (char *) switch_xml_attr_soft(param, "value");
if (ftdm_array_len(spanparameters) - 1 == paramindex) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Too many parameters for ss7 span, ignoring any parameter after %s\n", var);
CONFIG_ERROR("Too many parameters for ss7 span, ignoring any parameter after %s\n", var);
break;
}
@ -2746,10 +2752,10 @@ static void parse_bri_pri_spans(switch_xml_t cfg, switch_xml_t spans)
int calls;
int seconds;
if (sscanf(val, "%d/%d", &calls, &seconds) != 2) {
ftdm_log(FTDM_LOG_ERROR, "Invalid %s parameter, format example: 3/1 for 3 calls per second\n", var);
CONFIG_ERROR("Invalid %s parameter, format example: 3/1 for 3 calls per second\n", var);
} else {
if (calls < 1 || seconds < 1) {
ftdm_log(FTDM_LOG_ERROR, "Invalid %s parameter value, minimum call limit must be 1 per second\n", var);
CONFIG_ERROR("Invalid %s parameter value, minimum call limit must be 1 per second\n", var);
} else {
SPAN_CONFIG[span_id].limit_calls = calls;
SPAN_CONFIG[span_id].limit_seconds = seconds;
@ -2759,7 +2765,7 @@ static void parse_bri_pri_spans(switch_xml_t cfg, switch_xml_t spans)
if (!strcasecmp(val, "answer")) {
SPAN_CONFIG[span_id].limit_reset_event = FTDM_LIMIT_RESET_ON_ANSWER;
} else {
ftdm_log(FTDM_LOG_ERROR, "Invalid %s parameter value, only accepted event is 'answer'\n", var);
CONFIG_ERROR("Invalid %s parameter value, only accepted event is 'answer'\n", var);
}
} else {
spanparameters[paramindex].var = var;
@ -2772,7 +2778,7 @@ static void parse_bri_pri_spans(switch_xml_t cfg, switch_xml_t spans)
"sangoma_isdn",
on_clear_channel_signal,
spanparameters) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error configuring Sangoma ISDN FreeTDM span %d\n", span_id);
CONFIG_ERROR("Error configuring Sangoma ISDN FreeTDM span %d\n", span_id);
continue;
}
SPAN_CONFIG[span_id].span = span;
@ -2789,15 +2795,11 @@ static switch_status_t load_config(void)
const char *cf = "freetdm.conf";
switch_xml_t cfg, xml, settings, param, spans, myspan;
ftdm_conf_node_t *ss7confnode = NULL;
ftdm_span_t *boost_spans[FTDM_MAX_PHYSICAL_SPANS_PER_LOGICAL_SPAN];
ftdm_span_t *boost_span = NULL;
unsigned boosti = 0;
unsigned int i = 0;
ftdm_channel_t *fchan = NULL;
ftdm_iterator_t *chaniter = NULL;
ftdm_iterator_t *curr = NULL;
memset(boost_spans, 0, sizeof(boost_spans));
memset(&globals, 0, sizeof(globals));
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool);
if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
@ -2816,6 +2818,8 @@ static switch_status_t load_config(void)
switch_set_string(globals.hold_music, val);
} else if (!strcasecmp(var, "crash-on-assert")) {
globals.crash_on_assert = switch_true(val);
} else if (!strcasecmp(var, "fail-on-error")) {
globals.fail_on_error = switch_true(val);
} else if (!strcasecmp(var, "sip-headers")) {
globals.sip_headers = switch_true(val);
} else if (!strcasecmp(var, "enable-analog-option")) {
@ -2846,11 +2850,11 @@ static switch_status_t load_config(void)
uint32_t span_id = 0;
unsigned paramindex = 0;
if (!name && !id) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ss7 span missing required attribute 'id' or 'name', skipping ...\n");
CONFIG_ERROR("ss7 span missing required attribute 'id' or 'name', skipping ...\n");
continue;
}
if (!configname) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ss7 span missing required attribute, skipping ...\n");
CONFIG_ERROR("ss7 span missing required attribute, skipping ...\n");
continue;
}
if (name) {
@ -2867,7 +2871,7 @@ static switch_status_t load_config(void)
}
if (zstatus != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
CONFIG_ERROR("Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
@ -2877,7 +2881,7 @@ static switch_status_t load_config(void)
ss7confnode = get_ss7_config_node(cfg, configname);
if (!ss7confnode) {
ftdm_log(FTDM_LOG_ERROR, "Error finding ss7config '%s' for FreeTDM span id: %s\n", configname, switch_str_nil(id));
CONFIG_ERROR("Error finding ss7config '%s' for FreeTDM span id: %s\n", configname, switch_str_nil(id));
continue;
}
@ -2891,7 +2895,7 @@ static switch_status_t load_config(void)
char *val = (char *) switch_xml_attr_soft(param, "value");
if (ftdm_array_len(spanparameters) - 1 == paramindex) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Too many parameters for ss7 span, ignoring any parameter after %s\n", var);
CONFIG_ERROR("Too many parameters for ss7 span, ignoring any parameter after %s\n", var);
break;
}
@ -2910,7 +2914,7 @@ static switch_status_t load_config(void)
"sangoma_ss7",
on_clear_channel_signal,
spanparameters) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error configuring ss7 FreeTDM span %d\n", span_id);
CONFIG_ERROR("Error configuring ss7 FreeTDM span %d\n", span_id);
continue;
}
SPAN_CONFIG[span_id].span = span;
@ -2961,7 +2965,7 @@ static switch_status_t load_config(void)
}
if (zstatus != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
CONFIG_ERROR("Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
@ -2995,10 +2999,10 @@ static switch_status_t load_config(void)
int calls;
int seconds;
if (sscanf(val, "%d/%d", &calls, &seconds) != 2) {
ftdm_log(FTDM_LOG_ERROR, "Invalid %s parameter, format example: 3/1 for 3 calls per second\n", var);
CONFIG_ERROR("Invalid %s parameter, format example: 3/1 for 3 calls per second\n", var);
} else {
if (calls < 1 || seconds < 1) {
ftdm_log(FTDM_LOG_ERROR, "Invalid %s parameter value, minimum call limit must be 1 per second\n", var);
CONFIG_ERROR("Invalid %s parameter value, minimum call limit must be 1 per second\n", var);
} else {
SPAN_CONFIG[span_id].limit_calls = calls;
SPAN_CONFIG[span_id].limit_seconds = seconds;
@ -3008,7 +3012,7 @@ static switch_status_t load_config(void)
if (!strcasecmp(val, "answer")) {
SPAN_CONFIG[span_id].limit_reset_event = FTDM_LIMIT_RESET_ON_ANSWER;
} else {
ftdm_log(FTDM_LOG_ERROR, "Invalid %s parameter value, only accepted event is 'answer'\n", var);
CONFIG_ERROR("Invalid %s parameter value, only accepted event is 'answer'\n", var);
}
} else if (!strcasecmp(var, "dial-regex")) {
dial_regex = val;
@ -3036,7 +3040,7 @@ static switch_status_t load_config(void)
}
if (!id && !name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "span missing required param 'id'\n");
CONFIG_ERROR("span missing required param 'id'\n");
continue;
}
@ -3066,7 +3070,7 @@ static switch_status_t load_config(void)
}
if (zstatus != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
CONFIG_ERROR("Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
@ -3086,7 +3090,7 @@ static switch_status_t load_config(void)
"callwaiting", &callwaiting,
"wait_dialtone_timeout", &dialtone_timeout,
FTDM_TAG_END) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error configuring FreeTDM analog span %s\n", ftdm_span_get_name(span));
CONFIG_ERROR("Error configuring FreeTDM analog span %s\n", ftdm_span_get_name(span));
continue;
}
@ -3162,7 +3166,7 @@ static switch_status_t load_config(void)
}
if (!id && !name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "span missing required param 'id'\n");
CONFIG_ERROR("span missing required param 'id'\n");
continue;
}
@ -3194,7 +3198,7 @@ static switch_status_t load_config(void)
}
if (zstatus != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
CONFIG_ERROR("Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
@ -3208,7 +3212,7 @@ static switch_status_t load_config(void)
"digit_timeout", &to,
"max_dialstr", &max,
FTDM_TAG_END) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error starting FreeTDM span %d\n", span_id);
CONFIG_ERROR("Error starting FreeTDM span %d\n", span_id);
continue;
}
@ -3245,7 +3249,7 @@ static switch_status_t load_config(void)
uint32_t span_id = 0;
if (!name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "span missing required attribute 'name'\n");
CONFIG_ERROR("span missing required attribute 'name'\n");
continue;
}
@ -3256,7 +3260,7 @@ static switch_status_t load_config(void)
char *val = (char *) switch_xml_attr_soft(param, "value");
if (ftdm_array_len(spanparameters) - 1 == paramindex) {
ftdm_log(FTDM_LOG_ERROR, "Too many parameters for pri span '%s', ignoring everything after '%s'\n", name, var);
CONFIG_ERROR("Too many parameters for pri span '%s', ignoring everything after '%s'\n", name, var);
break;
}
@ -3278,13 +3282,13 @@ static switch_status_t load_config(void)
zstatus = ftdm_span_find_by_name(name, &span);
if (zstatus != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error finding FreeTDM span %s\n", name);
CONFIG_ERROR("Error finding FreeTDM span %s\n", name);
continue;
}
span_id = ftdm_span_get_id(span);
if (ftdm_configure_span_signaling(span, "isdn", on_clear_channel_signal, spanparameters) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error configuring FreeTDM span %s\n", name);
CONFIG_ERROR("Error configuring FreeTDM span %s\n", name);
continue;
}
@ -3311,7 +3315,7 @@ static switch_status_t load_config(void)
int span_id = 0;
if (!name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "span missing required attribute 'name'\n");
CONFIG_ERROR("span missing required attribute 'name'\n");
continue;
}
@ -3322,7 +3326,7 @@ static switch_status_t load_config(void)
char *val = (char *) switch_xml_attr_soft(param, "value");
if (ftdm_array_len(spanparameters) - 1 == paramindex) {
ftdm_log(FTDM_LOG_ERROR, "Too many parameters for pritap span '%s', ignoring everything after '%s'\n", name, var);
CONFIG_ERROR("Too many parameters for pritap span '%s', ignoring everything after '%s'\n", name, var);
break;
}
@ -3339,13 +3343,13 @@ static switch_status_t load_config(void)
zstatus = ftdm_span_find_by_name(name, &span);
if (zstatus != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error finding FreeTDM span %s\n", name);
CONFIG_ERROR("Error finding FreeTDM span %s\n", name);
continue;
}
span_id = ftdm_span_get_id(span);
if (ftdm_configure_span_signaling(span, "pritap", on_clear_channel_signal, spanparameters) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error configuring FreeTDM span %s\n", name);
CONFIG_ERROR("Error configuring FreeTDM span %s\n", name);
continue;
}
@ -3371,7 +3375,7 @@ static switch_status_t load_config(void)
uint32_t span_id = 0;
if (!name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "span missing required attribute 'name'\n");
CONFIG_ERROR("span missing required attribute 'name'\n");
continue;
}
@ -3382,7 +3386,7 @@ static switch_status_t load_config(void)
char *val = (char *) switch_xml_attr_soft(param, "value");
if (ftdm_array_len(spanparameters) - 1 == paramindex) {
ftdm_log(FTDM_LOG_ERROR, "Too many parameters for libpri span, ignoring everything after '%s'\n", var);
CONFIG_ERROR("Too many parameters for libpri span, ignoring everything after '%s'\n", var);
break;
}
@ -3404,13 +3408,13 @@ static switch_status_t load_config(void)
zstatus = ftdm_span_find_by_name(name, &span);
if (zstatus != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error finding FreeTDM span %s\n", name);
CONFIG_ERROR("Error finding FreeTDM span %s\n", name);
continue;
}
span_id = ftdm_span_get_id(span);
if (ftdm_configure_span_signaling(span, "libpri", on_clear_channel_signal, spanparameters) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error configuring FreeTDM span %s\n", name);
CONFIG_ERROR("Error configuring FreeTDM span %s\n", name);
continue;
}
@ -3423,86 +3427,6 @@ static switch_status_t load_config(void)
}
}
if ((spans = switch_xml_child(cfg, "boost_spans"))) {
for (myspan = switch_xml_child(spans, "span"); myspan; myspan = myspan->next) {
char *id = (char *) switch_xml_attr(myspan, "id");
char *name = (char *) switch_xml_attr(myspan, "name");
char *sigmod = (char *) switch_xml_attr(myspan, "sigmod");
ftdm_status_t zstatus = FTDM_FAIL;
const char *context = "default";
const char *dialplan = "XML";
uint32_t span_id = 0;
ftdm_span_t *span = NULL;
ftdm_conf_parameter_t spanparameters[30];
unsigned paramindex = 0;
if (!id && !name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "boost span requires an id or name as attribute: <span id=ftid|name=ftname>\n");
continue;
}
memset(spanparameters, 0, sizeof(spanparameters));
if (sigmod) {
spanparameters[paramindex].var = "sigmod";
spanparameters[paramindex].val = sigmod;
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");
if (ftdm_array_len(spanparameters) - 1 == paramindex) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Too many parameters for boost span, ignoring any parameter after %s\n", var);
break;
}
if (!strcasecmp(var, "context")) {
context = val;
} else if (!strcasecmp(var, "dialplan")) {
dialplan = val;
} else {
spanparameters[paramindex].var = var;
spanparameters[paramindex].val = val;
paramindex++;
}
}
if (name) {
zstatus = ftdm_span_find_by_name(name, &span);
} else {
if (switch_is_number(id)) {
span_id = atoi(id);
zstatus = ftdm_span_find(span_id, &span);
}
if (zstatus != FTDM_SUCCESS) {
zstatus = ftdm_span_find_by_name(id, &span);
}
}
if (zstatus != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
if (!span_id) {
span_id = ftdm_span_get_id(span);
}
if (ftdm_configure_span_signaling(span, "sangoma_boost", on_clear_channel_signal, spanparameters) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error starting FreeTDM span %d error: %s\n", span_id, ftdm_span_get_last_error(span));
continue;
}
SPAN_CONFIG[span_id].span = span;
switch_copy_string(SPAN_CONFIG[span_id].context, context, sizeof(SPAN_CONFIG[span_id].context));
switch_copy_string(SPAN_CONFIG[span_id].dialplan, dialplan, sizeof(SPAN_CONFIG[span_id].dialplan));
switch_copy_string(SPAN_CONFIG[span_id].type, "Sangoma (boost)", sizeof(SPAN_CONFIG[span_id].type));
boost_spans[boosti++] = span;
}
}
if ((spans = switch_xml_child(cfg, "r2_spans"))) {
for (myspan = switch_xml_child(spans, "span"); myspan; myspan = myspan->next) {
char *name = (char *) switch_xml_attr(myspan, "name");
@ -3521,7 +3445,7 @@ static switch_status_t load_config(void)
unsigned paramindex = 0;
if (!name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "'name' attribute required for R2 spans!\n");
CONFIG_ERROR("'name' attribute required for R2 spans!\n");
continue;
}
@ -3556,14 +3480,13 @@ static switch_status_t load_config(void)
zstatus = ftdm_span_find_by_name(name, &span);
if (zstatus != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error finding FreeTDM R2 Span '%s'\n", name);
CONFIG_ERROR("Error finding FreeTDM R2 Span '%s'\n", name);
continue;
}
span_id = ftdm_span_get_id(span);
if (ftdm_configure_span_signaling(span, "r2", on_r2_signal, spanparameters) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_ERROR, "Error configuring FreeTDM R2 span %s, error: %s\n",
name, ftdm_span_get_last_error(span));
CONFIG_ERROR("Error configuring FreeTDM R2 span %s, error: %s\n", name, ftdm_span_get_last_error(span));
continue;
}
@ -3581,24 +3504,12 @@ static switch_status_t load_config(void)
switch_copy_string(SPAN_CONFIG[span_id].type, "R2", sizeof(SPAN_CONFIG[span_id].type));
if (ftdm_span_start(span) == FTDM_FAIL) {
ftdm_log(FTDM_LOG_ERROR, "Error starting FreeTDM R2 span %s, error: %s\n", name, ftdm_span_get_last_error(span));
CONFIG_ERROR("Error starting FreeTDM R2 span %s, error: %s\n", name, ftdm_span_get_last_error(span));
continue;
}
}
}
/* start all boost spans now that we're done configuring. Unfortunately at this point boost modules have the limitation
* of needing all spans to be configured before starting them */
for (i=0 ; i < boosti; i++) {
boost_span = boost_spans[i];
ftdm_log(FTDM_LOG_DEBUG, "Starting boost span %d\n", ftdm_span_get_id(boost_span));
if (ftdm_span_start(boost_span) == FTDM_FAIL) {
ftdm_log(FTDM_LOG_ERROR, "Error starting boost FreeTDM span %d, error: %s\n",
ftdm_span_get_id(boost_span), ftdm_span_get_last_error(boost_span));
continue;
}
}
if (globals.crash_on_assert) {
ftdm_log(FTDM_LOG_WARNING, "Crash on assert enabled\n");
ftdm_global_set_crash_policy(FTDM_CRASH_ON_ASSERT);
@ -3606,6 +3517,11 @@ static switch_status_t load_config(void)
switch_xml_free(xml);
if (globals.fail_on_error && globals.config_error) {
ftdm_log(FTDM_LOG_ERROR, "Refusing to load module with errors\n");
return SWITCH_STATUS_TERM;
}
return SWITCH_STATUS_SUCCESS;
}

View File

@ -90,7 +90,7 @@ typedef struct private_object private_object_t;
#define MULTICAST_EVENT "multicast::event"
#define SOFIA_REPLACES_HEADER "_sofia_replaces_"
#define SOFIA_USER_AGENT "SangomaMediaGateway/" SWITCH_VERSION_MAJOR "." SWITCH_VERSION_MINOR "." SWITCH_VERSION_MICRO "-" SWITCH_VERSION_REVISION
#define SOFIA_USER_AGENT "NetborderSS7/" SWITCH_VERSION_MAJOR "." SWITCH_VERSION_MINOR "." SWITCH_VERSION_MICRO "-" SWITCH_VERSION_REVISION
#define SOFIA_CHAT_PROTO "sip"
#define SOFIA_MULTIPART_PREFIX "sip_mp_"
#define SOFIA_MULTIPART_PREFIX_T "~sip_mp_"

View File

@ -48,7 +48,7 @@
#include "private/switch_core_pvt.h"
/* pid filename: Stores the process id of the freeswitch process */
#define PIDFILE "sangoma-media-gateway.pid"
#define PIDFILE "netborder-ss7.pid"
static char *pfile = PIDFILE;
static int system_ready = 0;
@ -540,7 +540,7 @@ int main(int argc, char *argv[])
}
if (local_argv[x] && !strcmp(local_argv[x], "-version")) {
fprintf(stdout, "Sangoma Media Gateway Version: %s\n", SWITCH_VERSION_FULL);
fprintf(stdout, "Netborder SS7 Version: %s\n", SWITCH_VERSION_FULL);
return 0;
known_opt++;
}

View File

@ -1802,17 +1802,16 @@ SWITCH_DECLARE(const char *) switch_core_banner(void)
"* Brought to you by ClueCon http://www.cluecon.com/ *\n" "************************************************************\n" "\n");
#else
return (
"\n _____ ___ ___ _ _ _____ _ \n"
"/ ___| | \\/ | | (_) | __ \\ | | \n"
"\\ `--. __ _ _ __ __ _ ___ _ __ ___ __ _ | . . | ___ __| |_ __ _ | | \\/ __ _| |_ _____ ____ _ _ _ \n"
" `--. \\/ _` | '_ \\ / _` |/ _ \\| '_ ` _ \\ / _` | | |\\/| |/ _ \\/ _` | |/ _` | | | __ / _` | __|/ _ \\ \\ /\\ / / _` | | | |\n"
"/\\__/ / (_| | | | | (_| | (_) | | | | | | (_| | | | | | __/ (_| | | (_| | | |_\\ \\ (_| | |_| __/\\ V V / (_| | |_| |\n"
"\\____/ \\__,_|_| |_|\\__, |\\___/|_| |_| |_|\\__,_| \\_| |_/\\___|\\__,_|_|\\__,_| \\____/\\__,_|\\__|\\___| \\_/\\_/ \\__,_|\\__, |\n"
" __/ | __/ |\n"
" |___/ |___/ \n"
"************************************************************\n"
"* Powered by: FreeSWITCH (http://www.freeswitch.org) *\n"
"************************************************************\n" "\n");
"************************************************************************\n"
"* .__ __. .______ _______ _______. _______. ______ *\n"
"* | \\ | | | _ \\ | ____| / | / ||____ |*\n"
"* | \\| | | |_) | | |__ | (----` | (----` / / *\n"
"* | . ` | | _ < | __| \\ \\ \\ \\ / / *\n"
"* | |\\ | | |_) | | |____ .----) | .----) | / / *\n"
"* |__| \\__| |______/ |_______| |_______/ |_______/ /_/ *\n"
"* *\n"
"* Powered by: FreeSWITCH (http://www.freeswitch.org) *\n"
"**************************************************************************\n" "\n");
#endif
}