[asterisk-commits] mmichelson: branch 1.4 r191778 - /branches/1.4/apps/app_voicemail.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat May 2 13:48:26 CDT 2009
Author: mmichelson
Date: Sat May 2 13:48:20 2009
New Revision: 191778
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=191778
Log:
Fix a bug which resulted from the Hebrew voicemail commit.
This fixes a case where a certain message could get played twice.
(closes issue #13155)
Reported by: greenfieldtech
Patches:
app_voicemail.c.multi-lang-patch uploaded by greenfieldtech (license 369)
Tested by: greenfieldtech
Modified:
branches/1.4/apps/app_voicemail.c
Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=191778&r1=191777&r2=191778
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Sat May 2 13:48:20 2009
@@ -5580,7 +5580,8 @@
vms->starting = 0;
make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg);
adsi_message(chan, vms);
- if (!strcasecmp(chan->language, "he")) { /* HEBREW FORMAT */
+
+ if (!strcasecmp(chan->language, "he")) { /* HEBREW FORMAT */
/*
* The syntax in hebrew for counting the number of message is up side down
* in comparison to english.
@@ -5600,47 +5601,56 @@
res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, "f");
}
}
- }
- } else {
+ }
+
+ } else if (!strcasecmp(chan->language, "pl")) { /* POLISH FORMAT */
+ if (vms->curmsg && (vms->curmsg != vms->lastmsg)) {
+ int ten, one;
+ char nextmsg[256];
+ ten = (vms->curmsg + 1) / 10;
+ one = (vms->curmsg + 1) % 10;
+
+ if (vms->curmsg < 20) {
+ snprintf(nextmsg, sizeof(nextmsg), "digits/n-%d", vms->curmsg + 1);
+ res = wait_file2(chan, vms, nextmsg);
+ } else {
+ snprintf(nextmsg, sizeof(nextmsg), "digits/n-%d", ten * 10);
+ res = wait_file2(chan, vms, nextmsg);
+ if (one > 0) {
+ if (!res) {
+ snprintf(nextmsg, sizeof(nextmsg), "digits/n-%d", one);
+ res = wait_file2(chan, vms, nextmsg);
+ }
+ }
+ }
+ }
+ if (!res)
+ res = wait_file2(chan, vms, "vm-message");
+
+ } else if (!strcasecmp(chan->language, "se")) { /* SWEDISH FORMAT */
if (!vms->curmsg)
res = wait_file2(chan, vms, "vm-first"); /* "First" */
else if (vms->curmsg == vms->lastmsg)
- res = wait_file2(chan, vms, "vm-last"); /* "last" */
- }
- if (!res) {
- /* POLISH syntax */
- if (!strcasecmp(chan->language, "pl")) {
- if (vms->curmsg && (vms->curmsg != vms->lastmsg)) {
- int ten, one;
- char nextmsg[256];
- ten = (vms->curmsg + 1) / 10;
- one = (vms->curmsg + 1) % 10;
-
- if (vms->curmsg < 20) {
- snprintf(nextmsg, sizeof(nextmsg), "digits/n-%d", vms->curmsg + 1);
- res = wait_file2(chan, vms, nextmsg);
- } else {
- snprintf(nextmsg, sizeof(nextmsg), "digits/n-%d", ten * 10);
- res = wait_file2(chan, vms, nextmsg);
- if (one > 0) {
- if (!res) {
- snprintf(nextmsg, sizeof(nextmsg), "digits/n-%d", one);
- res = wait_file2(chan, vms, nextmsg);
- }
- }
- }
- }
+ res = wait_file2(chan, vms, "vm-last"); /* "last" */
+ res = wait_file2(chan, vms, "vm-meddelandet"); /* "message" */
+ if (vms->curmsg && (vms->curmsg != vms->lastmsg)) {
if (!res)
- res = wait_file2(chan, vms, "vm-message");
- } else {
- if (!strcasecmp(chan->language, "se")) /* SWEDISH syntax */
- res = wait_file2(chan, vms, "vm-meddelandet"); /* "message" */
- else /* DEFAULT syntax */
- res = wait_file2(chan, vms, "vm-message");
- if (vms->curmsg && (vms->curmsg != vms->lastmsg)) {
- if (!res)
- res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, NULL);
- }
+ res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, NULL);
+ }
+ /* We know that the difference between English and Swedish
+ * is very small, however, we differ the two for standartization
+ * purposes, and possible changes to either of these in the
+ * future
+ */
+ } else {
+ if (!vms->curmsg) /* Default syntax */
+ res = wait_file2(chan, vms, "vm-first"); /* "First" */
+ else if (vms->curmsg == vms->lastmsg)
+ res = wait_file2(chan, vms, "vm-last"); /* "last" */
+ res = wait_file2(chan, vms, "vm-message");
+ if (vms->curmsg && (vms->curmsg != vms->lastmsg)) {
+ if (!res)
+ res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, NULL);
}
}
More information about the asterisk-commits
mailing list