stream->write_function(stream, "CALLS-OUT \t%u\n", profile->ob_calls);
stream->write_function(stream, "FAILED-CALLS-OUT \t%u\n", profile->ob_failed_calls);
}
- stream->write_function(stream, "\nRegistrations:\n%s\n", line);
cb.profile = profile;
cb.stream = stream;
"network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
" from sip_registrations where profile_name='%q' and contact like '%%%q%%'", profile->name, argv[3]);
}
+ if (!sql && argv[2] && !strcasecmp(argv[2], "reg")) {
+ sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
+ "rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
+ "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
+ " from sip_registrations where profile_name='%q'", profile->name);
+ }
if (!sql && argv[2] && !strcasecmp(argv[2], "user") && argv[3]) {
char *dup = strdup(argv[3]);
char *host = NULL, *user = NULL;
switch_safe_free(sqlextra);
}
- if (!sql) {
- sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
- "rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
- "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
- " from sip_registrations where profile_name='%q'", profile->name);
- }
+ if (sql) {
+ stream->write_function(stream, "\nRegistrations:\n%s\n", line);
- sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, show_reg_callback, &cb);
- switch_safe_free(sql);
+ sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, show_reg_callback, &cb);
+ switch_safe_free(sql);
- stream->write_function(stream, "Total items returned: %d\n", cb.row_process);
- stream->write_function(stream, "%s\n", line);
+ stream->write_function(stream, "Total items returned: %d\n", cb.row_process);
+ stream->write_function(stream, "%s\n", line);
+ }
sofia_glue_release_profile(profile);
+
} else {
stream->write_function(stream, "Invalid Profile!\n");
}
" siptrace <on|off>\n"
" capture <on|off>\n"
" watchdog <on|off>\n\n"
- "sofia <status|xmlstatus> profile <name> [reg <contact str>] | [pres <pres str>] | [user <user@domain>]\n"
+ "sofia <status|xmlstatus> profile <name> [reg [<contact str>]] | [pres <pres str>] | [user <user@domain>]\n"
"sofia <status|xmlstatus> gateway <name>\n\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\n"