diff options
author | Richard Mudgett <rmudgett@digium.com> | 2014-06-20 17:06:42 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2014-06-20 17:06:42 +0000 |
commit | 86e8ab5ed47bccf0ee80acfd711eb81b0991522c (patch) | |
tree | fcd846af640f5a6dd9b91d732907729ae7ccb6a8 /apps/app_directory.c | |
parent | 577632dec957bfec258918a381133a3c41411b37 (diff) |
voicemail API callbacks: Extract the sayname API call to its own registerd callback.
* Extract the sayname API call to its own registerd callback. This allows
the app_directory and app_chanspy applications to say a mailbox owner's
name using an alternate provider when app_voicemail is not available
because you are using res_mwi_external. app_directory still uses the
voicemail.conf file.
AFS-64 #close
Reported by: Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_directory.c')
-rw-r--r-- | apps/app_directory.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c index 3afb19f29..350401e46 100644 --- a/apps/app_directory.c +++ b/apps/app_directory.c @@ -26,7 +26,6 @@ */ /*** MODULEINFO - <depend>app_voicemail</depend> <support_level>core</support_level> ***/ #include "asterisk.h" @@ -290,7 +289,13 @@ static int play_mailbox_owner(struct ast_channel *chan, const char *context, const char *ext, const char *name, struct ast_flags *flags) { int res = 0; - if ((res = ast_app_sayname(chan, ext, context)) >= 0) { + char *mailbox_id; + + mailbox_id = ast_alloca(strlen(ext) + strlen(context) + 2); + sprintf(mailbox_id, "%s@%s", ext, context); /* Safe */ + + res = ast_app_sayname(chan, mailbox_id); + if (res >= 0) { ast_stopstream(chan); /* If Option 'e' was specified, also read the extension number with the name */ if (ast_test_flag(flags, OPT_SAYEXTENSION)) { |