From 2184e527649e2165fb010f06dc359c7ccb6e1616 Mon Sep 17 00:00:00 2001 From: markster Date: Mon, 6 Sep 2004 15:43:43 +0000 Subject: Add Czech digit/voicemail support git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3731 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_voicemail.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'apps/app_voicemail.c') diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 11188afd9..42e0349fa 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3318,6 +3318,82 @@ static int vm_intro_pt(struct ast_channel *chan,struct vm_state *vms) return res; } + +/* CZECH syntax */ +/* in czech there must be declension of word new and message + * czech : english : czech : english + * -------------------------------------------------------- + * vm-youhave : you have + * vm-novou : one new : vm-zpravu : message + * vm-nove : 2-4 new : vm-zpravy : messages + * vm-novych : 5-infinite new : vm-zprav : messages + * vm-starou : one old + * vm-stare : 2-4 old + * vm-starych : 5-infinite old + * jednu : one - falling 4. + * vm-no : no ( no messages ) + */ + +static int vm_intro_cz(struct ast_channel *chan,struct vm_state *vms) +{ + int res; + res = play_and_wait(chan, "vm-youhave"); + if (!res) { + if (vms->newmessages) { + if (vms->newmessages == 1) { + res = play_and_wait(chan, "digits/jednu"); + } else { + res = say_and_wait(chan, vms->newmessages, chan->language); + } + if (!res) { + if ((vms->newmessages == 1)) + res = play_and_wait(chan, "vm-novou"); + if ((vms->newmessages) > 1 && (vms->newmessages < 5)) + res = play_and_wait(chan, "vm-nove"); + if (vms->newmessages > 4) + res = play_and_wait(chan, "vm-novych"); + } + if (vms->oldmessages && !res) + res = play_and_wait(chan, "vm-and"); + else if (!res) { + if ((vms->newmessages == 1)) + res = play_and_wait(chan, "vm-zpravu"); + if ((vms->newmessages) > 1 && (vms->newmessages < 5)) + res = play_and_wait(chan, "vm-zpravy"); + if (vms->newmessages > 4) + res = play_and_wait(chan, "vm-zprav"); + } + } + if (!res && vms->oldmessages) { + res = say_and_wait(chan, vms->oldmessages, chan->language); + if (!res) { + if ((vms->oldmessages == 1)) + res = play_and_wait(chan, "vm-starou"); + if ((vms->oldmessages) > 1 && (vms->oldmessages < 5)) + res = play_and_wait(chan, "vm-stare"); + if (vms->oldmessages > 4) + res = play_and_wait(chan, "vm-starych"); + } + if (!res) { + if ((vms->oldmessages == 1)) + res = play_and_wait(chan, "vm-zpravu"); + if ((vms->oldmessages) > 1 && (vms->oldmessages < 5)) + res = play_and_wait(chan, "vm-zpravy"); + if (vms->oldmessages > 4) + res = play_and_wait(chan, "vm-zprav"); + } + } + if (!res) { + if (!vms->oldmessages && !vms->newmessages) { + res = play_and_wait(chan, "vm-no"); + if (!res) + res = play_and_wait(chan, "vm-zpravy"); + } + } + } + return res; +} + static int vm_instructions(struct ast_channel *chan, struct vm_state *vms, int skipadvanced) { int res = 0; @@ -3712,6 +3788,8 @@ static int vm_execmain(struct ast_channel *chan, void *data) cmd = vm_intro_nl(chan, &vms); } else if (!strcasecmp(chan->language, "pt")) { /* PORTUGUESE syntax */ cmd = vm_intro_pt(chan, &vms); + } else if (!strcasecmp(chan->language, "cz")) { /* CZECH syntax */ + cmd = vm_intro_cz(chan, &vms); } else { /* Default to ENGLISH */ cmd = vm_intro(chan, &vms); } -- cgit v1.2.3