[Freeswitch-svn] [commit] r1630 - in freeswitch/trunk: . src/mod/applications/mod_commands
mikej at freeswitch.org
mikej at freeswitch.org
Thu Jun 15 02:02:09 EDT 2006
Author: mikej
Date: Thu Jun 15 02:02:08 2006
New Revision: 1630
Modified:
freeswitch/trunk/AUTHORS
freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
Log:
add options to show api command to show applications, codecs, file formats, ect. and cleanup the output format of this command. Thanks jkr888 (Johny Kadarisman) for the contribution.
Modified: freeswitch/trunk/AUTHORS
==============================================================================
--- freeswitch/trunk/AUTHORS (original)
+++ freeswitch/trunk/AUTHORS Thu Jun 15 02:02:08 2006
@@ -21,6 +21,7 @@
and moral support.
Michal "cypromis" Bielicki (michal.bielicki AT halo2.pl) - Solaris porting, and autotools enhancements.
James Martelletti <james at nerdc0re.com> - All around cool guy (mod_syslog)
+ Johny Kadarisman <jkr888 at gmail.com>
A big THANK YOU goes to:
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 Thu Jun 15 02:02:08 2006
@@ -24,6 +24,8 @@
* Contributor(s):
*
* Anthony Minessale II <anthmct at yahoo.com>
+ * Michael Jerris <mike at jerris.com>
+ * Johny Kadarisman <jkr888 at gmail.com>
*
*
* mod_commands.c -- Misc. Command Module
@@ -185,7 +187,7 @@
static int show_callback(void *pArg, int argc, char **argv, char **columnNames){
switch_stream_handle_t *stream = (switch_stream_handle_t *) pArg;
- stream->write_function(stream, "%s\n", argv[1]);
+ stream->write_function(stream, "%s|%s\n", argv[0], argv[1] ? argv[1] : "NULL");
return 0;
}
@@ -196,7 +198,22 @@
char *errmsg;
switch_core_db_t *db = switch_core_db_handle();
- sprintf (sql, "select * from interfaces");
+ if (!cmd) {
+ sprintf (sql, "select * from interfaces");
+ }
+ else if ( !strcmp(cmd,"codec") || !strcmp(cmd,"application") ||
+ !strcmp(cmd,"api") || !strcmp(cmd,"dialplan") ||
+ !strcmp(cmd,"file") || !strcmp(cmd,"timer")
+ ) {
+ sprintf (sql, "select * from interfaces where type = '%s'", cmd);
+ }
+ else {
+ stream->write_function(stream, "Invalid interfaces type!\n");
+ stream->write_function(stream, "Example:\n");
+ stream->write_function(stream, "show <blank>|codec|application|api|dialplan|file|timer\n");
+ return SWITCH_STATUS_SUCCESS;
+ }
+
switch_core_db_exec(db, sql, show_callback, stream, &errmsg);
if (errmsg) {
More information about the Freeswitch-svn
mailing list