[Asterisk-code-review] voicemail: Fixed wrong voicemail message count (asterisk[13])
Kevin Harwell
asteriskteam at digium.com
Thu Mar 8 15:27:05 CST 2018
Kevin Harwell has submitted this change and it was merged. ( https://gerrit.asterisk.org/8462 )
Change subject: voicemail: Fixed wrong voicemail message count
......................................................................
voicemail: Fixed wrong voicemail message count
Fixed wrong voicemail mailbox reference for Action: VoicemailUsersList.
ASTERISK-27703
Change-Id: I99bfec14bd4ae475b0fa1fac5a7992f3e2e8d64a
---
M apps/app_voicemail.c
1 file changed, 22 insertions(+), 3 deletions(-)
Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Jenkins2: Verified
Joshua Colp: Looks good to me, approved
Kevin Harwell: Approved for Submit
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index db6b757..485d03f 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -13346,11 +13346,30 @@
astman_send_listack(s, m, "Voicemail user list will follow", "start");
AST_LIST_TRAVERSE(&users, vmu, list) {
- char dirname[256];
int new, old;
- inboxcount(vmu->mailbox, &new, &old);
+ int ret;
+ char *mailbox;
- make_dir(dirname, sizeof(dirname), vmu->context, vmu->mailbox, "INBOX");
+ /* create mailbox string */
+ if (!ast_strlen_zero(vmu->context)) {
+ ret = ast_asprintf(&mailbox, "%s@%s", vmu->mailbox, vmu->context);
+ } else {
+ ret = ast_asprintf(&mailbox, "%s", vmu->mailbox);
+ }
+ if (ret == -1) {
+ ast_log(LOG_ERROR, "Could not create mailbox string. err[%s]\n", strerror(errno));
+ continue;
+ }
+
+ /* get mailbox count */
+ ret = inboxcount(mailbox, &new, &old);
+ ast_free(mailbox);
+ if (ret == -1) {
+ ast_log(LOG_ERROR, "Could not get mailbox count. username[%s], context[%s]\n",
+ vmu->mailbox ?: "", vmu->context ?: "");
+ continue;
+ }
+
astman_append(s,
"Event: VoicemailUserEntry\r\n"
"%s"
--
To view, visit https://gerrit.asterisk.org/8462
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I99bfec14bd4ae475b0fa1fac5a7992f3e2e8d64a
Gerrit-Change-Number: 8462
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: sungtae kim <pchero21 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180308/af8a170a/attachment.html>
More information about the asterisk-code-review
mailing list