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
This commit is contained in:
Richard Mudgett
2013-12-13 00:40:49 +00:00
parent d2eb007bf0
commit 3a5e4317f5
3 changed files with 24 additions and 1 deletions

View File

@@ -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);