Merge branch 'master' of git.freeswitch.org:freeswitch

This commit is contained in:
Moises Silva 2010-09-20 18:20:02 -04:00
commit 56c717d7f6
4 changed files with 48 additions and 3 deletions

View File

@ -789,9 +789,9 @@ static t38_mode_t negotiate_t38(pvt_t *pvt)
t38_options->T38FaxRateManagement = "transferredTCF"; t38_options->T38FaxRateManagement = "transferredTCF";
t38_options->T38FaxMaxBuffer = 2000; t38_options->T38FaxMaxBuffer = 2000;
t38_options->T38FaxMaxDatagram = LOCAL_FAX_MAX_DATAGRAM; t38_options->T38FaxMaxDatagram = LOCAL_FAX_MAX_DATAGRAM;
if (strcasecmp(t38_options->T38FaxUdpEC, "t38UDPRedundancy") == 0 if (!zstr(t38_options->T38FaxUdpEC) &&
|| (strcasecmp(t38_options->T38FaxUdpEC, "t38UDPRedundancy") == 0 ||
strcasecmp(t38_options->T38FaxUdpEC, "t38UDPFEC") == 0) { strcasecmp(t38_options->T38FaxUdpEC, "t38UDPFEC") == 0)) {
t38_options->T38FaxUdpEC = "t38UDPRedundancy"; t38_options->T38FaxUdpEC = "t38UDPRedundancy";
} else { } else {
t38_options->T38FaxUdpEC = NULL; t38_options->T38FaxUdpEC = NULL;

View File

@ -3507,6 +3507,7 @@ SWITCH_STANDARD_API(sofia_function)
"sofia status|xmlstatus gateway <name>\n" "sofia status|xmlstatus gateway <name>\n"
"sofia loglevel <all|default|tport|iptsec|nea|nta|nth_client|nth_server|nua|soa|sresolv|stun> [0-9]\n" "sofia loglevel <all|default|tport|iptsec|nea|nta|nth_client|nth_server|nua|soa|sresolv|stun> [0-9]\n"
"sofia tracelevel <console|alert|crit|err|warning|notice|info|debug>\n" "sofia tracelevel <console|alert|crit|err|warning|notice|info|debug>\n"
"sofa global siptrace [on|off]\n"
"--------------------------------------------------------------------------------\n"; "--------------------------------------------------------------------------------\n";
if (session) { if (session) {
@ -3562,6 +3563,26 @@ SWITCH_STANDARD_API(sofia_function)
} else if (!strcasecmp(argv[0], "help")) { } else if (!strcasecmp(argv[0], "help")) {
stream->write_function(stream, "%s", usage_string); stream->write_function(stream, "%s", usage_string);
goto done; goto done;
} else if (!strcasecmp(argv[0], "global")) {
int on = -1;
if (argc > 1) {
if (!strcasecmp(argv[1], "siptrace")) {
if (argc > 2) {
on = switch_true(argv[2]);
}
}
}
if (on != -1) {
sofia_glue_global_siptrace(on);
stream->write_function(stream, "+OK Global siptrace %s", on ? "on" : "off");
} else {
stream->write_function(stream, "-ERR Usage: siptrace on|off");
}
goto done;
} else if (!strcasecmp(argv[0], "recover")) { } else if (!strcasecmp(argv[0], "recover")) {
if (argv[1] && !strcasecmp(argv[1], "flush")) { if (argv[1] && !strcasecmp(argv[1], "flush")) {
sofia_glue_recover(SWITCH_TRUE); sofia_glue_recover(SWITCH_TRUE);
@ -4637,6 +4658,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
switch_console_set_complete("add sofia loglevel ::[all:default:tport:iptsec:nea:nta:nth_client:nth_server:nua:soa:sresolv:stun ::[0:1:2:3:4:5:6:7:8:9"); switch_console_set_complete("add sofia loglevel ::[all:default:tport:iptsec:nea:nta:nth_client:nth_server:nua:soa:sresolv:stun ::[0:1:2:3:4:5:6:7:8:9");
switch_console_set_complete("add sofia tracelevel ::[console:alert:crit:err:warning:notice:info:debug"); switch_console_set_complete("add sofia tracelevel ::[console:alert:crit:err:warning:notice:info:debug");
switch_console_set_complete("add sofia global siptrace ::[on:off");
switch_console_set_complete("add sofia profile"); switch_console_set_complete("add sofia profile");
switch_console_set_complete("add sofia profile restart all"); switch_console_set_complete("add sofia profile restart all");

View File

@ -1012,3 +1012,4 @@ char *sofia_glue_get_multipart(switch_core_session_t *session, const char *prefi
void sofia_glue_tech_simplify(private_object_t *tech_pvt); void sofia_glue_tech_simplify(private_object_t *tech_pvt);
switch_console_callback_match_t *sofia_reg_find_reg_url_multi(sofia_profile_t *profile, const char *user, const char *host); switch_console_callback_match_t *sofia_reg_find_reg_url_multi(sofia_profile_t *profile, const char *user, const char *host);
switch_bool_t sofia_glue_profile_exists(const char *key); switch_bool_t sofia_glue_profile_exists(const char *key);
void sofia_glue_global_siptrace(switch_bool_t on);

View File

@ -4342,6 +4342,27 @@ void sofia_glue_restart_all_profiles(void)
} }
void sofia_glue_global_siptrace(switch_bool_t on)
{
switch_hash_index_t *hi;
const void *var;
void *val;
sofia_profile_t *pptr;
switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) {
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &var, NULL, &val);
if ((pptr = (sofia_profile_t *) val)) {
nua_set_params(pptr->nua, TPTAG_LOG(on), TAG_END());
}
}
}
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
}
void sofia_glue_del_profile(sofia_profile_t *profile) void sofia_glue_del_profile(sofia_profile_t *profile)
{ {
sofia_gateway_t *gp; sofia_gateway_t *gp;