add send-presence-on-register (true|false|first-only) param to sofia and api command sofia global debug [presence|sla|none]

This commit is contained in:
Anthony Minessale
2011-01-14 13:57:58 -06:00
parent 57b410eba6
commit 7b01cbbca4
4 changed files with 90 additions and 22 deletions
+32 -1
View File
@@ -3695,11 +3695,39 @@ SWITCH_STANDARD_API(sofia_function)
int wdon = -1;
if (argc > 1) {
if (!strcasecmp(argv[1], "debug")) {
if (argc > 2) {
if (strstr(argv[2], "presence")) {
mod_sofia_globals.debug_presence = 1;
stream->write_function(stream, "+OK Debugging presence\n");
}
if (strstr(argv[2], "sla")) {
mod_sofia_globals.debug_sla = 1;
stream->write_function(stream, "+OK Debugging sla\n");
}
if (strstr(argv[2], "none")) {
stream->write_function(stream, "+OK Debugging nothing\n");
mod_sofia_globals.debug_presence = 0;
mod_sofia_globals.debug_sla = 0;
}
}
stream->write_function(stream, "+OK Debugging summary: presence: %s sla: %s\n",
mod_sofia_globals.debug_presence ? "on" : "off",
mod_sofia_globals.debug_sla ? "on" : "off");
goto done;
}
if (!strcasecmp(argv[1], "siptrace")) {
if (argc > 2) {
ston = switch_true(argv[2]);
}
}
if (!strcasecmp(argv[1], "watchdog")) {
if (argc > 2) {
wdon = switch_true(argv[2]);
@@ -3714,7 +3742,7 @@ SWITCH_STANDARD_API(sofia_function)
sofia_glue_global_watchdog(wdon);
stream->write_function(stream, "+OK Global watchdog %s", wdon ? "on" : "off");
} else {
stream->write_function(stream, "-ERR Usage: siptrace <on|off>|watchdog <on|off>");
stream->write_function(stream, "-ERR Usage: siptrace <on|off>|watchdog <on|off>|debug <sla|presence|none");
}
goto done;
@@ -4838,6 +4866,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
switch_console_set_complete("add sofia global siptrace ::[on:off");
switch_console_set_complete("add sofia global watchdog ::[on:off");
switch_console_set_complete("add sofia global debug ::[presence:sla:none");
switch_console_set_complete("add sofia profile");
switch_console_set_complete("add sofia profile restart all");