summaryrefslogtreecommitdiff
path: root/res/res_ari_asterisk.c
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-04-16 18:54:31 -0600
committerGeorge Joseph <gjoseph@digium.com>2017-04-16 18:54:52 -0600
commit4ccaffe64401f8e7eced58d5800ad2ef0bbb24ff (patch)
treec8e2ffee07b608158eb67b801ad86682fdf4d492 /res/res_ari_asterisk.c
parent5e2a8ef94ad573f83a65b4d37b4f34ac947c07a2 (diff)
make ari-stubs so doc periodic jobs can run
The periodic doc job does a make ari-stubs and checks that there are no changes before generating the docs. Since I changed the mustache template (and the generated code directly) recently and forgot to regenerate the stubs, the doc job thinks they're out of date. Change-Id: Ibd4bc649556615ff714d44534c45b6c2f6aa449d
Diffstat (limited to 'res/res_ari_asterisk.c')
-rw-r--r--res/res_ari_asterisk.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/res/res_ari_asterisk.c b/res/res_ari_asterisk.c
index b1680e300..1a574aaaf 100644
--- a/res/res_ari_asterisk.c
+++ b/res/res_ari_asterisk.c
@@ -1213,19 +1213,24 @@ static struct stasis_rest_handlers asterisk = {
.children = { &asterisk_config,&asterisk_info,&asterisk_modules,&asterisk_logging,&asterisk_variable, }
};
+static int unload_module(void)
+{
+ ast_ari_remove_handler(&asterisk);
+ stasis_app_unref();
+ return 0;
+}
+
static int load_module(void)
{
int res = 0;
stasis_app_ref();
res |= ast_ari_add_handler(&asterisk);
- return res;
-}
+ if (res) {
+ unload_module();
+ return AST_MODULE_LOAD_DECLINE;
+ }
-static int unload_module(void)
-{
- ast_ari_remove_handler(&asterisk);
- stasis_app_unref();
- return 0;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Asterisk resources",