aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-02 18:48:20 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-02 18:48:20 +0000
commit2db4c3eb926a7b85afc94e73f91277fbe3235ef2 (patch)
tree314b9cd86b05a84c0ff4b2823d969afead446257 /apps
parentab8ca9f979324046c937c302f4e8f461a1d80144 (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@191778 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c84
1 files changed, 47 insertions, 37 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 087e9aeb1..4646e9e53 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5580,7 +5580,8 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
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 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, "f");
}
}
- }
- } else {
- 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;
+ }
+
+ } 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 (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" */
+ 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);
}
}