*** apps/app_voicemail.c.org 2009-02-06 08:30:58.000000000 +0900 --- apps/app_voicemail.c 2009-04-07 01:02:57.000000000 +0900 *************** *** 5219,5231 **** return d; } static int get_folder2(struct ast_channel *chan, char *fn, int start) { int res = 0; res = ast_play_and_wait(chan, fn); /* Folder name */ while (((res < '0') || (res > '9')) && (res != '#') && (res >= 0)) { ! res = get_folder(chan, 0); } return res; } --- 5219,5262 ---- return d; } + /* Japanese Syntax */ + static int get_folder_ja(struct ast_channel *chan, int start) + { + int x; + int d; + char fn[256]; + 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; + snprintf(fn, sizeof(fn), "vm-%s", mbox(x)); /* Folder name */ + d = vm_play_folder_name(chan, fn); + if (d) + return d; + d = ast_waitfordigit(chan, 500); + if (d) + return d; + } + d = ast_play_and_wait(chan, "vm-tocancel"); /* "or pound to cancel" */ + if (d) + return d; + d = ast_play_and_wait(chan, "jp-oshitekudasai"); + if (d) + return d; + d = ast_waitfordigit(chan, 4000); + return d; + } + static int get_folder2(struct ast_channel *chan, char *fn, int start) { int res = 0; res = ast_play_and_wait(chan, fn); /* Folder name */ while (((res < '0') || (res > '9')) && (res != '#') && (res >= 0)) { ! /* res = get_folder(chan, 0); */ ! if (!strcasecmp(chan->language,"ja")) /* Japanese syntax */ ! res = get_folder_ja(chan, 0); ! else /* Default syntax */ ! res = get_folder(chan, 0); } return res; } *************** *** 5742,5747 **** --- 5773,5780 ---- 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, "tw")) /* CHINESE (Taiwan) syntax */ res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "qR 'vm-received'", NULL); + else if (!strcasecmp(chan->language, "ja")) /* Japanese syntax */ + res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "PHM q 'jp-ni' 'vm-received'", NULL); else { res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' IMp", NULL); } *************** *** 6380,6385 **** --- 6413,6465 ---- return res; } + /* Japanese syntax */ + static int vm_intro_ja(struct ast_channel *chan,struct vm_state *vms) + { + /* Introduce messages they have */ + int res; + res = ast_play_and_wait(chan, "vm-youhave"); + if (!res) { + if (vms->newmessages) { + res = ast_play_and_wait(chan, "vm-INBOX"); + if (!res) + res = ast_play_and_wait(chan, "vm-message"); + if (!res) + res = ast_play_and_wait(chan, "jp-ga"); + if (!res) + res = say_and_wait(chan, vms->newmessages, chan->language); + if (vms->oldmessages && !res) + res = ast_play_and_wait(chan, "vm-and"); + + } + if (!res && vms->oldmessages) { + res = ast_play_and_wait(chan, "vm-Old"); + if (!res) + res = ast_play_and_wait(chan, "vm-message"); + if (!res) + res = ast_play_and_wait(chan, "jp-ga"); + if (!res) + res = say_and_wait(chan, vms->oldmessages, chan->language); + } + if (!res) { + if (!vms->oldmessages && !vms->newmessages) { + res = ast_play_and_wait(chan, "vm-messages"); + if (!res) + res = ast_play_and_wait(chan, "jp-wa"); + if (!res) + res = ast_play_and_wait(chan, "jp-wa"); + if (!res) + res = ast_play_and_wait(chan, "vm-no"); + } + else if (!res) { + res = ast_play_and_wait(chan, "jp-arimasu"); + } + } + } + return res; + } /* Japanese */ + + /* Default English syntax */ static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms) { *************** *** 7067,7072 **** --- 7147,7154 ---- return vm_intro_tw(chan, vms); } else if (!strcasecmp(chan->language, "ua")) { /* UKRAINIAN syntax */ return vm_intro_multilang(chan, vms, "n"); + } else if (!strcasecmp(chan->language, "ja")) { /* Japanese syntax */ + return vm_intro_ja(chan, vms); } else { /* Default to ENGLISH */ return vm_intro_en(chan, vms); }