dunno, some stuff...

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8179 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-04-23 17:38:13 +00:00
parent 727cf3a673
commit 8b6dc52cb9
4 changed files with 121 additions and 8 deletions
@@ -1885,7 +1885,7 @@ static int show_callback(void *pArg, int argc, char **argv, char **columnNames)
return 0;
}
#define COMPLETE_SYNTAX "add <word>|del [<word>|all]"
#define COMPLETE_SYNTAX "add <word>|del [<word>|*]"
SWITCH_STANDARD_API(complete_function)
{
@@ -1900,7 +1900,23 @@ SWITCH_STANDARD_API(complete_function)
return SWITCH_STATUS_SUCCESS;
}
#define SHOW_SYNTAX "codec|application|api|dialplan|file|timer|calls|channels"
#define ALIAS_SYNTAX "add <alias> <command> | del [<alias>|*]"
SWITCH_STANDARD_API(alias_function)
{
switch_status_t status;
if ((status = switch_console_set_alias(cmd)) == SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "+OK\n");
} else {
stream->write_function(stream, "-USAGE: %s\n", ALIAS_SYNTAX);
}
return SWITCH_STATUS_SUCCESS;
}
#define SHOW_SYNTAX "codec|application|api|dialplan|file|timer|calls|channels|aliases|complete"
SWITCH_STANDARD_API(show_function)
{
char sql[1024];
@@ -1951,6 +1967,10 @@ SWITCH_STANDARD_API(show_function)
sprintf(sql, "select * from calls order by created_epoch");
} else if (!strcasecmp(command, "channels")) {
sprintf(sql, "select * from channels order by created_epoch");
} else if (!strcasecmp(command, "aliases")) {
sprintf(sql, "select * from aliases order by alias");
} else if (!strcasecmp(command, "complete")) {
sprintf(sql, "select * from complete order by a1,a2,a3,a4,a5,a6,a7,a8,a9,a10");
} else if (!strncasecmp(command, "help", 4)) {
char *cmdname = NULL;
@@ -2280,6 +2300,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
SWITCH_ADD_API(commands_api_interface, "break", "Break", break_function, BREAK_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "show", "Show", show_function, SHOW_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "complete", "Complete", complete_function, COMPLETE_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "alias", "Alias", alias_function, ALIAS_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "status", "status", status_function, "");
SWITCH_ADD_API(commands_api_interface, "uuid_bridge", "uuid_bridge", uuid_bridge_function, "");
SWITCH_ADD_API(commands_api_interface, "uuid_setvar", "uuid_setvar", uuid_setvar_function, SETVAR_SYNTAX);