diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-21 23:11:40 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-21 23:11:40 +0000 |
commit | b97e01d50cc6f08d180ddac54d8ee700645caae3 (patch) | |
tree | 91dcbac7c4b017808e3c736ac02a4d6cd2a99bfa /apps | |
parent | ae89345fd94dbbc3404611ae5a403098e74a3d33 (diff) |
display new/old messages in voicemail event (bug #3117)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4521 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/app_voicemail.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 2a6986280..a24286d39 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2843,6 +2843,7 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, int msgnum, long duration, char *fmt, char *cidnum, char *cidname) { char todir[256], fn[256], ext_context[256], *stringp; + int newmsgs = 0, oldmsgs = 0; make_dir(todir, sizeof(todir), vmu->context, vmu->mailbox, "INBOX"); make_file(fn, sizeof(fn), todir, msgnum); @@ -2879,7 +2880,10 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, } /* Leave voicemail for someone */ - manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s@%s\r\nWaiting: %d\r\n", vmu->mailbox, vmu->context, ast_app_has_voicemail(ext_context, NULL)); + if (ast_app_has_voicemail(ext_context, NULL)) { + ast_app_messagecount(ext_context, &newmsgs, &oldmsgs); + } + manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s@%s\r\nWaiting: %d\r\nNew: %d\r\nOld: %d\r\n", vmu->mailbox, vmu->context, ast_app_has_voicemail(ext_context, NULL), newmsgs, oldmsgs); run_externnotify(chan->context, ext_context); return 0; } |