aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-06 15:43:43 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-06 15:43:43 +0000
commit2184e527649e2165fb010f06dc359c7ccb6e1616 (patch)
tree02c0b835043c20126724585d6542ba52a5f7104f /apps/app_voicemail.c
parent93ab11ea6151a5bf27ff21df91c65b041d8da761 (diff)
Add Czech digit/voicemail support
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3731 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rwxr-xr-xapps/app_voicemail.c78
1 files changed, 78 insertions, 0 deletions
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);
}