summaryrefslogtreecommitdiff
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2007-11-16 17:11:43 +0000
committerMark Michelson <mmichelson@digium.com>2007-11-16 17:11:43 +0000
commit68a805b70b577c4fed69d067e1ed9f7a89ce1dea (patch)
tree714e836e45da139fc9f85496b37ce367929fce8f /apps/app_voicemail.c
parent547306835ea0dcb7f8ea05de79b6f976de89ae9e (diff)
Adding confirmation playback when forwarding voicemail messages. This will attempt
to play the name(s) of the person(s) to whom you are forwarding the message prior to prompting for prepending. If no name is found, the extension is read back verbatim. (closes issue #9046, reported and patched by jaroth) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 91b7409be..5fb1b8449 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4168,6 +4168,8 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
struct vm_state *dstvms;
#endif
char username[70]="";
+ char fn[PATH_MAX]; /* for playback of name greeting */
+ char ecodes[16] = "#";
int res = 0, cmd = 0;
struct ast_vm_user *receiver = NULL, *vmtmp;
AST_LIST_HEAD_NOLOCK_STATIC(extensions, ast_vm_user);
@@ -4280,6 +4282,22 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
valid_extensions = 0;
break;
}
+
+ /* play name if available, else play extension number */
+ snprintf(fn, sizeof(fn), "%s%s/%s/greet", VM_SPOOL_DIR, receiver->context, s);
+ RETRIEVE(fn, -1, s, receiver->context);
+ if (ast_fileexists(fn, NULL, NULL) > 0) {
+ res = ast_stream_and_wait(chan, fn, ecodes);
+ if (res) {
+ DISPOSE(fn, -1);
+ return res;
+ }
+ } else {
+ /* Dispose just in case */
+ DISPOSE(fn, -1);
+ res = ast_say_digit_str(chan, s, ecodes, chan->language);
+ }
+
s = strsep(&stringp, "*");
}
/* break from the loop of reading the extensions */