*** ./apps/app_voicemail.c.org 2007-03-16 10:41:00.000000000 +0900 --- ./apps/app_voicemail.c 2007-04-17 15:23:48.000000000 +0900 *************** *** 3781,3797 **** 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; } static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, char *curdir, int curmsg, char *vmfmts, char *context, signed char record_gain, long *duration, struct vm_state *vms) { --- 3781,3829 ---- return d; } + /* Japanese Syntax */ + static int get_folder_jp(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,"jp")) /* Japanese syntax */ ! res = get_folder_jp(chan, 0); ! else /* Default syntax */ ! res = get_folder(chan, 0); } return res; } + static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, char *curdir, int curmsg, char *vmfmts, char *context, signed char record_gain, long *duration, struct vm_state *vms) { *************** *** 4258,4263 **** --- 4290,4297 ---- 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); + else if (!strcasecmp(chan->language,"jp")) + 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); #if 0 *************** *** 4948,4953 **** --- 4982,5031 ---- res = ast_play_and_wait(chan, "vm-denExeteMynhmata"); return res; } + + /* Japanese syntax */ + static int vm_intro_jp(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, "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) *************** *** 5666,5671 **** --- 5744,5751 ---- return vm_intro_no(chan, vms); } else if (!strcasecmp(chan->language, "ru")) { /* RUSSIAN syntax */ return vm_intro_ru(chan, vms); + } else if (!strcasecmp(chan->language, "jp")) { /* JAPANESE syntax */ + return vm_intro_jp(chan, vms); } else { /* Default to ENGLISH */ return vm_intro_en(chan, vms); }