[asterisk-commits] kmoore: branch kmoore/stasis-http_sounds r389571 - /team/kmoore/stasis-http_s...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 23 14:10:25 CDT 2013


Author: kmoore
Date: Thu May 23 14:10:21 2013
New Revision: 389571

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389571
Log:
Add sounds reload CLI command back in

Modified:
    team/kmoore/stasis-http_sounds/res/res_sounds.c

Modified: team/kmoore/stasis-http_sounds/res/res_sounds.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-http_sounds/res/res_sounds.c?view=diff&rev=389571&r1=389570&r2=389571
==============================================================================
--- team/kmoore/stasis-http_sounds/res/res_sounds.c (original)
+++ team/kmoore/stasis-http_sounds/res/res_sounds.c Thu May 23 14:10:21 2013
@@ -634,6 +634,33 @@
 }
 
 /*! \brief Allow for reloading of sounds via the command line */
+static char *handle_cli_sounds_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "sounds reload";
+		e->usage =
+			"Usage: sounds reload\n"
+			"       Reloads the index of sound files and their descriptions.\n";
+		return NULL;
+	case CLI_GENERATE:
+		return NULL;
+	}
+
+	if (a->argc != 2) {
+		return CLI_SHOWUSAGE;
+	}
+
+	if (reindex()) {
+		ast_cli(a->fd, "Sound re-indexing failed.\n");
+		return CLI_FAILURE;
+	}
+
+	ast_cli(a->fd, "Sound files re-indexed.\n");
+	return CLI_SUCCESS;
+}
+
+/*! \brief Allow for reloading of sounds via the command line */
 static char *handle_cli_sounds_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
@@ -689,6 +716,7 @@
 /*! \brief Struct for registering CLI commands */
 static struct ast_cli_entry cli_sounds[] = {
 	AST_CLI_DEFINE(handle_cli_sounds_show, "Shows available sounds"),
+	AST_CLI_DEFINE(handle_cli_sounds_reload, "Reload sounds index"),
 };
 
 /*! \brief Struct for registering this sound indexer's function calls */




More information about the asterisk-commits mailing list