summaryrefslogtreecommitdiff
path: root/res/res_stasis.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2016-10-20 07:27:21 -0500
committerMark Michelson <mmichelson@digium.com>2016-11-01 09:43:46 -0500
commitc30d677333028f9768a3913bb73f49936805adc9 (patch)
treef4f160cc668f006dda96658201be7d2b4a06b33b /res/res_stasis.c
parent3ad4719917c106a79546676ffec22af9a0921eb4 (diff)
res/stasis: Add CLI commands for displaying/debugging ARI apps
This patch adds three new CLI commands: - ari show apps: list the registered ARI applications - ari show app: show detailed information about an ARI application - ari set debug: dump events being sent to an ARI application Note that while these CLI commands live in the res_stasis module, we use the 'ari' family for these commands. This was done as most users of Asterisk aren't aware of the semantic differences between ARI and res_stasis, and some 'ari' CLI commands already exist. ASTERISK-26488 #close Change-Id: I51ad6ff0cabee0d69db06858c13f18b1c513c9f5
Diffstat (limited to 'res/res_stasis.c')
-rw-r--r--res/res_stasis.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/res/res_stasis.c b/res/res_stasis.c
index 8e596d557..f3d940e2d 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -65,6 +65,7 @@
#include "stasis/app.h"
#include "stasis/control.h"
#include "stasis/messaging.h"
+#include "stasis/cli.h"
#include "stasis/stasis_bridge.h"
#include "asterisk/core_unreal.h"
#include "asterisk/musiconhold.h"
@@ -1487,6 +1488,11 @@ static struct stasis_app *find_app_by_name(const char *app_name)
return res;
}
+struct stasis_app *stasis_app_get_by_name(const char *name)
+{
+ return find_app_by_name(name);
+}
+
static int append_name(void *obj, void *arg, int flags)
{
struct stasis_app *app = obj;
@@ -1959,6 +1965,8 @@ static int unload_module(void)
{
stasis_app_unregister_event_sources();
+ cli_cleanup();
+
messaging_cleanup();
cleanup();
@@ -2118,6 +2126,11 @@ static int load_module(void)
return AST_MODULE_LOAD_FAILURE;
}
+ if (cli_init()) {
+ unload_module();
+ return AST_MODULE_LOAD_FAILURE;
+ }
+
bridge_stasis_init();
stasis_app_register_event_sources();