mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
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:
11
main/app.c
11
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);
|
||||
|
Reference in New Issue
Block a user