Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 205877) +++ apps/app_voicemail.c (working copy) @@ -288,6 +288,21 @@ mailbox. + + + Play the name of a voicemail user + + + + + + + + + This application will say the recorded name of the voicemail user specified as the + argument to this application. If no context is provided, default is assumed. + + Tell if a mailbox is configured. @@ -702,8 +717,10 @@ static char *app2 = "VoiceMailMain"; static char *app3 = "MailboxExists"; -static char *app4 = "VMAuthenticate"; +static char *app4 = "VMAuthenticate"; +static char *sayname_app = "VMSayName"; + static AST_LIST_HEAD_STATIC(users, ast_vm_user); static AST_LIST_HEAD_STATIC(zones, vm_zone); static char zonetag[80]; @@ -11115,6 +11132,26 @@ return res; } +static int vmsayname_exec(struct ast_channel *chan, const char *data) +{ + char *context; + char *args_copy; + + if (ast_strlen_zero(data)) { + ast_log(LOG_WARNING, "VMSayName requires at least one argument mailbox@context"); + return -1; + } + + args_copy = ast_strdupa(data); + if ((context = strchr(args_copy, '@'))) { + *context++ = '\0'; + } else { + context = "default"; + } + + return sayname(chan, args_copy, context); +} + static int reload(void) { return load_config(1); @@ -11165,6 +11202,7 @@ res |= ast_register_application_xml(app2, vm_execmain); res |= ast_register_application_xml(app3, vm_box_exists); res |= ast_register_application_xml(app4, vmauthenticate); + res |= ast_register_application_xml(sayname_app, vmsayname_exec); res |= ast_custom_function_register(&mailbox_exists_acf); res |= ast_manager_register_xml("VoicemailUsersList", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, manager_list_voicemail_users); if (res)