Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 95623) +++ apps/app_voicemail.c (working copy) @@ -3776,8 +3776,13 @@ if (d) return d; for (x = start; x< 5; x++) { /* For all folders */ - if ((d = ast_say_number(chan, x, AST_DIGIT_ANY, chan->language, (char *) NULL))) - return d; + if (strcasecmp(chan->language,"he")) { + if ((d = ast_say_number(chan, x, AST_DIGIT_ANY, chan->language, (char *) NULL))) + return d; + } else { + if ((d = ast_say_number(chan, x, AST_DIGIT_ANY, chan->language, "f"))) + return d; + } d = ast_play_and_wait(chan, "vm-for"); /* "for" */ if (d) return d; @@ -4294,7 +4299,9 @@ else if (!strcasecmp(chan->language,"gr")) res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q H 'digits/kai' M ", NULL); else if (!strcasecmp(chan->language,"pt_BR")) - res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Ad 'digits/pt-de' B 'digits/pt-de' Y 'digits/pt-as' HM ", NULL); + res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Ad 'digits/pt-de' B 'digits/pt-de' Y 'digits/pt-as' HM ", NULL); + else if (!strcasecmp(chan->language,"he")) + res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/he/at' IM", NULL); else res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' IMp", NULL); #if 0 @@ -4476,16 +4483,34 @@ save_body(body, vms, "2", attachedfilefmt); adsi_message(chan, vms); - 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) { - res = wait_file2(chan, vms, "vm-message"); /* "message" */ - if (vms->curmsg && (vms->curmsg != vms->lastmsg)) { + if (!strcasecmp(chan->language, "he")) { /* HEBREW FORMAT */ + if (!vms->curmsg) + res = wait_file2(chan, vms, "vm-message"); + res = wait_file2(chan, vms, "vm-first"); /* "First" */ + else if (vms->curmsg == vms->lastmsg) + res = wait_file2(chan, vms, "vm-message"); + res = wait_file2(chan, vms, "vm-last"); /* "last" */ + if (!res) { + res = wait_file2(chan, vms, "vm-message"); /* "message" */ + if (vms->curmsg && (vms->curmsg != vms->lastmsg)) { + ast_log(LOG_DEBUG,"curmsg: %s\n",vms->curmsg); + ast_log(LOG_DEBUG,"lagmsg: %s\n",vms->lastmsg); + if (!res) + 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) { + res = wait_file2(chan, vms, "vm-message"); /* "message" */ + if (vms->curmsg && (vms->curmsg != vms->lastmsg)) { if (!res) - res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, (char *) NULL); - } + res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, (char *) NULL); + } + } } /* Get info from headers!! */ @@ -4568,9 +4593,20 @@ make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg); adsi_message(chan, vms); 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 (!strcasecmp(chan->language, "he")) { /* Hebrew */ + res = wait_file2(chan, vms, "vm-message"); + res = wait_file2(chan, vms, "vm-first"); + } else { + res = wait_file2(chan, vms, "vm-first"); /* "First" */ + } + else if (vms->curmsg == vms->lastmsg) { + if (!strcasecmp(chan->language, "he")) { /* Hebrew */ + res = wait_file2(chan, vms, "vm-message"); + res = wait_file2(chan, vms, "vm-last"); + } else { + res = wait_file2(chan, vms, "vm-last"); /* "last" */ + } + } if (!res) { /* POLISH syntax */ if (!strcasecmp(chan->language, "pl")) { @@ -4597,13 +4633,20 @@ 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); + if (!strcasecmp(chan->language, "se")) { /* SWEDISH syntax */ + res = wait_file2(chan, vms, "vm-meddelandet"); /* message */ + if (vms->curmsg && (vms->curmsg != vms->lastmsg)) + if (!res) + res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, (char *) NULL); + } else if (!strcasecmp(chan->language, "he")) { /* HEBREW systax */ + if (vms->curmsg && (vms->curmsg != vms->lastmsg)) + if (!res) + res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, "f"); + } else { /* ENGLISH syntax */ + res = wait_file2(chan, vms, "vm-message"); /* message */ + if (vms->curmsg && (vms->curmsg != vms->lastmsg)) + if (!res) + res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, (char *) NULL); } } } @@ -4969,6 +5012,9 @@ return vm_play_folder_name_pl(chan, mbox); } else if (!strcasecmp(chan->language, "ua")){ /* Ukrainian syntax */ return vm_play_folder_name_ua(chan, mbox); + } else if (!strcasecmp(chan->language, "he")){ + cmd = ast_play_and_wait(chan, mbox); + return cmd; } else { /* Default English */ cmd = ast_play_and_wait(chan, mbox); return cmd ? cmd : ast_play_and_wait(chan, "vm-messages"); /* "messages */ @@ -5023,51 +5069,118 @@ res = ast_play_and_wait(chan, "vm-denExeteMynhmata"); return res; } - -/* Default English syntax */ -static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms) + +/* Hebrew syntax */ +static int vm_intro_he(struct ast_channel *chan, struct vm_state *vms) { - int res; + int res = 0; /* Introduce messages they have */ - res = ast_play_and_wait(chan, "vm-youhave"); if (!res) { + if ((vms->newmessages) || (vms->oldmessages)) + res = ast_play_and_wait(chan, "vm-youhave"); if (vms->newmessages) { - res = say_and_wait(chan, vms->newmessages, chan->language); - if (!res) - res = ast_play_and_wait(chan, "vm-INBOX"); - if (vms->oldmessages && !res) + if (!res) { + if (vms->newmessages == 1) { + res = ast_play_and_wait(chan, "vm-INBOX1"); + } else { + if (vms->newmessages == 2) { + /* + TODO: figure how to say Shtei! + The below is a shameless hack, as the current imlementaion of say.c + doesn't support smichuiut properly. Note to self: sit down and figure out + a better way of doing this. + */ + res = ast_play_and_wait(chan, "vm-shtei"); + } else { + res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, chan->language, "f"); + } + res = ast_play_and_wait(chan, "vm-INBOX"); + } + } + if (vms->oldmessages && !res) { res = ast_play_and_wait(chan, "vm-and"); - else if (!res) { - if ((vms->newmessages == 1)) - res = ast_play_and_wait(chan, "vm-message"); - else - res = ast_play_and_wait(chan, "vm-messages"); + if (vms->oldmessages == 1) { + res = ast_play_and_wait(chan, "vm-Old1"); + } else { + if (vms->oldmessages == 2) { + /* TODO: figure out how to say Shtei! */ + res = ast_play_and_wait(chan, "vm-shtei"); + } else { + res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, chan->language, "f"); + } + res = ast_play_and_wait(chan, "vm-Old"); + } } - } - if (!res && vms->oldmessages) { - res = say_and_wait(chan, vms->oldmessages, chan->language); - if (!res) - res = ast_play_and_wait(chan, "vm-Old"); + if (!res && vms->oldmessages && !vms->newmessages) { if (!res) { - if (vms->oldmessages == 1) - res = ast_play_and_wait(chan, "vm-message"); - else - res = ast_play_and_wait(chan, "vm-messages"); - } + if (vms->oldmessages == 1) { + res = ast_play_and_wait(chan, "vm-Old1"); + } else { + if (vms->oldmessages == 2) { + // TODO: figure how to say Shtei! + res = ast_play_and_wait(chan, "vm-shtei"); + } else { + res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, chan->language, "f"); + } + res = ast_play_and_wait(chan, "vm-Old"); + } + } } if (!res) { if (!vms->oldmessages && !vms->newmessages) { - res = ast_play_and_wait(chan, "vm-no"); if (!res) - res = ast_play_and_wait(chan, "vm-messages"); + res = ast_play_and_wait(chan, "vm-nomessages"); } } } return res; } +static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms) +{ + int res; + + /* Introduce messages they have */ + res = ast_play_and_wait(chan, "vm-youhave"); + if (!res) { + if (vms->newmessages) { + res = say_and_wait(chan, vms->newmessages, chan->language); + if (!res) + res = ast_play_and_wait(chan, "vm-INBOX"); + if (vms->oldmessages && !res) + res = ast_play_and_wait(chan, "vm-and"); + else if (!res) { + if ((vms->newmessages == 1)) + res = ast_play_and_wait(chan, "vm-message"); + else + res = ast_play_and_wait(chan, "vm-messages"); + } + + } + if (!res && vms->oldmessages) { + res = say_and_wait(chan, vms->oldmessages, chan->language); + if (!res) + res = ast_play_and_wait(chan, "vm-Old"); + if (!res) { + if (vms->oldmessages == 1) + res = ast_play_and_wait(chan, "vm-message"); + else + res = ast_play_and_wait(chan, "vm-messages"); + } + } + if (!res) { + if (!vms->oldmessages && !vms->newmessages) { + res = ast_play_and_wait(chan, "vm-no"); + if (!res) + res = ast_play_and_wait(chan, "vm-messages"); + } + } + } + return res; +} + /* ITALIAN syntax */ static int vm_intro_it(struct ast_channel *chan, struct vm_state *vms) { @@ -5815,6 +5928,8 @@ return vm_intro_ru(chan, vms); } else if (!strcasecmp(chan->language, "ua")) { /* UKRAINIAN syntax */ return vm_intro_ua(chan, vms); + } else if (!strcasecmp(chan->language, "he")) { /* HEBREW syntax */ + return vm_intro_he(chan, vms); } else { /* Default to ENGLISH */ return vm_intro_en(chan, vms); } @@ -5828,8 +5943,15 @@ if (vms->starting) { if (vms->lastmsg > -1) { res = ast_play_and_wait(chan, "vm-onefor"); - if (!res) - res = vm_play_folder_name(chan, vms->vmbox); + if (!res) { + if (!strcasecmp(chan->language, "he")) { + res = ast_play_and_wait(chan, "vm-for"); + //res = ast_play_and_wait(chan, "vm-INBOX"); + res = vm_play_folder_name(chan, vms->vmbox); + } else { + res = vm_play_folder_name(chan, vms->vmbox); + } + } } if (!res) res = ast_play_and_wait(chan, "vm-opts"); @@ -6176,6 +6298,23 @@ return cmd; } +/* Hebrew Syntax */ +static int vm_browse_messages_he(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) +{ + int cmd=0; + + if (vms->lastmsg > -1) { + cmd = play_message(chan, vmu, vms); + } else { + if (!strcasecmp(vms->fn, "INBOX")) { + cmd = ast_play_and_wait(chan, "vm-nonewmessages"); + } else { + cmd = ast_play_and_wait(chan, "vm-nomessages"); + } + } + return cmd; +} + /* Default English syntax */ static int vm_browse_messages_en(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) { @@ -6264,6 +6403,8 @@ return vm_browse_messages_pt(chan, vms, vmu); } else if (!strcasecmp(chan->language, "gr")){ return vm_browse_messages_gr(chan, vms, vmu); /* GREEK */ + } else if (!strcasecmp(chan->language, "he")){ + return vm_browse_messages_he(chan, vms, vmu); /* HEBREW */ } else { /* Default to English syntax */ return vm_browse_messages_en(chan, vms, vmu); } @@ -6633,9 +6774,13 @@ if (useadsi) adsi_status2(chan, &vms); - if (!cmd) - cmd = vm_play_folder_name(chan, vms.vmbox); - + if (!cmd) { + ast_log(LOG_DEBUG, "Language is now: %s \n",chan->language); + if (strcasecmp(chan->language,"he")) { + ast_log(LOG_DEBUG, "Playing back: %s\n",vms.vmbox); + cmd = vm_play_folder_name(chan, vms.vmbox); + } + } vms.starting = 1; break; case '3': /* Advanced options */