--- app_voicemail.c 2004-11-08 01:30:21.000000000 +0100 +++ app_voicemail.c 2004-11-11 23:31:20.000000000 +0100 @@ -92,6 +92,7 @@ de - German es - Spanish fr - French + it = Italian nl - Dutch pt - Portuguese @@ -115,6 +116,17 @@ Spanish also uses: vm-youhaveno + +Italian requires the following additional soundfile: + +For vm_intro_it: +vm-nuovo new +vm-nuovi new plural +vm-vecchio old +vm-vecchi old plural +Don't use vm-INBOX or vm-Old, because they are the name of the INBOX and Old folderS, spelled among others when you have to change folder. +For the above reasons, vm-INBOX and vm-Old are spelled plural, to make them sound more as folder name than an adjective. + */ struct baseio { @@ -2134,7 +2146,7 @@ d = ast_play_and_wait(chan, "vm-for"); /* "for" */ if (d) return d; - if (!strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "fr") || !strcasecmp(chan->language, "pt")) { /* Spanish, French or Portuguese syntax */ + if (!strcasecmp(chan->language, "it") || !strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "fr") || !strcasecmp(chan->language, "pt")) { /* Italian, Spanish, French or Portuguese syntax */ d = ast_play_and_wait(chan, "vm-messages"); /* "messages */ if (d) return d; @@ -2471,6 +2483,8 @@ res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, the_zone->msg_format, the_zone->timezone); else if (!strcasecmp(chan->language,"nl")) /* DUTCH syntax */ res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/nl-om' HM", NULL); + else if (!strcasecmp(chan->language,"it")) /* ITALIAN syntax */ + res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' 'digits/hours' k 'digits/e' M 'digits/minutes'", NULL); else res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' IMp", NULL); #if 0 @@ -2704,6 +2718,60 @@ return res; } +/* ITALIAN syntax */ +static int vm_intro_it(struct ast_channel *chan,struct vm_state *vms) +{ + /* Introduce messages they have */ + int res; + if (!vms->oldmessages && !vms->newmessages) { + res = ast_play_and_wait(chan, "vm-no"); + if (!res) + res = ast_play_and_wait(chan, "vm-message"); + } else { + res = ast_play_and_wait(chan, "vm-youhave"); + } + if (!res) { + if (vms->newmessages) { + if (!res) { + if ((vms->newmessages == 1)) { + res = ast_play_and_wait(chan, "digits/un"); + if (!res) + res = ast_play_and_wait(chan, "vm-message"); + if (!res) + res = ast_play_and_wait(chan, "vm-nuovo"); + } else { + res = say_and_wait(chan, vms->newmessages, chan->language); + if (!res) + res = ast_play_and_wait(chan, "vm-messages"); + if (!res) + res = ast_play_and_wait(chan, "vm-nuovi"); + } + } + if (vms->oldmessages && !res) + res = ast_play_and_wait(chan, "vm-and"); + } + if (vms->oldmessages) { + if (!res) { + if (vms->oldmessages == 1) { + res = ast_play_and_wait(chan, "digits/un"); + if (!res) + res = ast_play_and_wait(chan, "vm-message"); + if (!res) + res = ast_play_and_wait(chan, "vm-vecchio"); + } else { + res = say_and_wait(chan, vms->oldmessages, chan->language); + if (!res) + res = ast_play_and_wait(chan, "vm-messages"); + if (!res) + res = ast_play_and_wait(chan, "vm-vecchi"); + } + } + } + } + return res; +} + + /* GERMAN syntax */ static int vm_intro_de(struct ast_channel *chan,struct vm_state *vms) { @@ -3032,7 +3100,7 @@ if (vms->starting) { if (vms->lastmsg > -1) { res = ast_play_and_wait(chan, "vm-onefor"); - if (!strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "fr") || !strcasecmp(chan->language, "pt")) { /* Spanish, French & Portuguese Syntax */ + if (!strcasecmp(chan->language, "it") || !strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "fr") || !strcasecmp(chan->language, "pt")) { /* Italian, Spanish, French & Portuguese Syntax */ if (!res) res = ast_play_and_wait(chan, "vm-messages"); if (!res) @@ -3187,6 +3255,25 @@ return cmd; } +/* ITALIAN syntax */ +static int vm_browse_messages_it(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 { + cmd = ast_play_and_wait(chan, "vm-no"); + if (!cmd) + cmd = ast_play_and_wait(chan, "vm-message"); + if (!cmd) { + snprintf(vms->fn, sizeof(vms->fn), "vm-%s", vms->curbox); + cmd = ast_play_and_wait(chan, vms->fn); + } + } + return cmd; +} + /* SPANISH syntax */ static int vm_browse_messages_es(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) { @@ -3413,6 +3500,8 @@ cmd = vm_intro_de(chan, &vms); } else if (!strcasecmp(chan->language, "es")) { /* SPANISH syntax */ cmd = vm_intro_es(chan, &vms); + } else if (!strcasecmp(chan->language, "it")) { /* ITALIAN syntax */ + cmd = vm_intro_it(chan, &vms); } else if (!strcasecmp(chan->language, "fr")) { /* FRENCH syntax */ cmd = vm_intro_fr(chan, &vms); } else if (!strcasecmp(chan->language, "nl")) { /* DUTCH syntax */ @@ -3435,6 +3524,8 @@ case '5': if (!strcasecmp(chan->language, "es")) { /* SPANISH */ cmd = vm_browse_messages_es(chan, &vms, vmu); + } else if (!strcasecmp(chan->language, "it")) { /* ITALIAN */ + cmd = vm_browse_messages_it(chan, &vms, vmu); } else if (!strcasecmp(chan->language, "pt")) { /* PORTUGUESE */ cmd = vm_browse_messages_pt(chan, &vms, vmu); } else { /* Default to English syntax */ @@ -3455,7 +3546,7 @@ } if (useadsi) adsi_status2(chan, &vms); - if (!strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "pt")) { /* SPANISH or PORTUGUESE */ + if (!strcasecmp(chan->language, "it") || !strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "pt")) { /* ITALIAN or SPANISH or PORTUGUESE */ if (!cmd) cmd = ast_play_and_wait(chan, "vm-messages"); if (!cmd) @@ -3624,7 +3715,7 @@ cmd = say_and_wait(chan, vms.curmsg + 1, chan->language); if (!cmd) cmd = ast_play_and_wait(chan, "vm-savedto"); - if (!strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "pt")) { /* SPANISH or PORTUGUESE */ + if (!strcasecmp(chan->language, "it") || !strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "pt")) { /* ITALIAN or SPANISH or PORTUGUESE */ if (!cmd) cmd = ast_play_and_wait(chan, "vm-messages"); if (!cmd) { @@ -3652,7 +3743,7 @@ case '*': if (!vms.starting) { cmd = ast_play_and_wait(chan, "vm-onefor"); - if (!strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "pt")) { /* Spanish or Portuguese syntax */ + if (!strcasecmp(chan->language, "it") || !strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "pt")) { /* Italian or Spanish or Portuguese syntax */ if (!cmd) cmd = ast_play_and_wait(chan, "vm-messages"); if (!cmd)