diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-12-13 00:40:49 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-12-13 00:40:49 +0000 |
commit | 3a5e4317f569abc860a8554f6dcdd573e5211adb (patch) | |
tree | 1f6204ce658d43b72f270a2272e99488d35a4107 /main/app.c | |
parent | d2eb007bf0b3d362abb914f0851ac495ec39e50d (diff) |
test_voicemail_api: Add check for a registered voicemail provider before tests.
It is much nicer diagnosing a test failure if app_voicemail is actually
loaded.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/app.c')
-rw-r--r-- | main/app.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/main/app.c b/main/app.c index 140afde7b..579984dab 100644 --- a/main/app.c +++ b/main/app.c @@ -432,6 +432,17 @@ static AO2_GLOBAL_OBJ_STATIC(vm_provider); /*! Voicemail not registered warning */ static int vm_warnings; +int ast_vm_is_registered(void) +{ + struct ast_vm_functions *table; + int is_registered; + + table = ao2_global_obj_ref(vm_provider); + is_registered = table ? 1 : 0; + ao2_cleanup(table); + return is_registered; +} + int __ast_vm_register(const struct ast_vm_functions *vm_table, struct ast_module *module) { RAII_VAR(struct ast_vm_functions *, table, NULL, ao2_cleanup); |