"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 tracelevel <console|alert|crit|err|warning|notice|info|debug>\n"
+ "sofa global siptrace [on|off]\n"
"--------------------------------------------------------------------------------\n";
if (session) {
} else if (!strcasecmp(argv[0], "help")) {
stream->write_function(stream, "%s", usage_string);
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")) {
if (argv[1] && !strcasecmp(argv[1], "flush")) {
sofia_glue_recover(SWITCH_TRUE);
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 global siptrace ::[on:off");
+
switch_console_set_complete("add sofia profile");
switch_console_set_complete("add sofia profile restart all");
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_bool_t sofia_glue_profile_exists(const char *key);
+void sofia_glue_global_siptrace(switch_bool_t on);
}
+
+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)
{
sofia_gateway_t *gp;