sofia log-level control improvements

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6728 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2007-12-13 02:42:00 +00:00
parent 98c156d807
commit d8786f35fd
8 changed files with 43 additions and 7 deletions
+15
View File
@@ -1354,6 +1354,7 @@ SWITCH_STANDARD_API(sofia_function)
"sofia help\n"
"sofia profile <profile_name> [start|stop|restart|flush_inbound_reg|[register|unregister] [<gateway name>|all]] [reloadxml]\n"
"sofia status [[profile | gateway] <name>]\n"
"sofia loglevel [0-9]\n"
"--------------------------------------------------------------------------------\n";
if (session) {
@@ -1379,6 +1380,20 @@ SWITCH_STANDARD_API(sofia_function)
func = cmd_profile;
} else if (!strcasecmp(argv[0], "status")) {
func = cmd_status;
} else if (!strcasecmp(argv[0], "loglevel")) {
if (argc > 1 && argv[1]) {
int level;
level = atoi(argv[1]);
if (level >= 0 && level <= 9) {
su_log_set_level(NULL, atoi(argv[1]));
stream->write_function(stream, "Sofia-sip log level set to [%d]", level);
} else {
stream->write_function(stream, "%s", usage_string);
}
} else {
stream->write_function(stream, "%s", usage_string);
}
goto done;
} else if (!strcasecmp(argv[0], "help")) {
stream->write_function(stream, "%s", usage_string);
goto done;