[Freeswitch-svn] [commit] r4377 - freeswitch/trunk/src/mod/applications/mod_commands
Freeswitch SVN
mikej at freeswitch.org
Fri Feb 23 15:32:31 EST 2007
Author: mikej
Date: Fri Feb 23 15:32:31 2007
New Revision: 4377
Modified:
freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
Log:
Breaking change: show command with no arguments now returns the usage syntax instead of the list of all registered interfaces. show api and show application now does not display items with no description set in their interface structs, allowing you to have "hidden" api's and applications, for example to keep an old api name for something for backwards compatibility sake, but you do not want it to show up in the help commands.
Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Fri Feb 23 15:32:31 2007
@@ -621,11 +621,12 @@
// If you changes the field qty or order of any of these select
// statmements, you must also change show_callback and friends to match!
if (!cmd) {
- sprintf (sql, "select * from interfaces");
+ stream->write_function(stream, "USAGE: %s\n", show_api_interface.syntax);
+ return SWITCH_STATUS_SUCCESS;
} else if ( !strcmp(cmd,"codec") || !strcmp(cmd,"dialplan") || !strcmp(cmd,"file") || !strcmp(cmd,"timer")) {
sprintf (sql, "select type, name from interfaces where type = '%s'", cmd);
} else if (!strcmp(cmd,"application") || !strcmp(cmd,"api")) {
- sprintf (sql, "select name, description, syntax from interfaces where type = '%s'", cmd);
+ sprintf (sql, "select name, description, syntax from interfaces where type = '%s' and description != ''" , cmd);
} else if ( !strcmp(cmd,"calls")) {
sprintf (sql, "select * from calls");
} else if ( !strcmp(cmd,"channels")) {
@@ -779,7 +780,7 @@
/*.interface_name */ "show",
/*.desc */ "Show",
/*.function */ show_function,
- /*.syntax */ "<blank>|codec|application|api|dialplan|file|timer|calls|channels",
+ /*.syntax */ "codec|application|api|dialplan|file|timer|calls|channels",
/*.next */ &status_api_interface
};
More information about the Freeswitch-svn
mailing list