[Asterisk-cvs] asterisk/apps app_voicemail.c,1.183,1.184
markster at lists.digium.com
markster at lists.digium.com
Tue Dec 21 19:13:04 CST 2004
Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv20823/apps
Modified Files:
app_voicemail.c
Log Message:
Add partial greek support (bug #3107)
Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -d -r1.183 -r1.184
--- app_voicemail.c 21 Dec 2004 23:11:40 -0000 1.183
+++ app_voicemail.c 22 Dec 2004 00:08:53 -0000 1.184
@@ -9,6 +9,9 @@
*
* This program is free software, distributed under the terms of
* the GNU General Public License
+ *
+ * 12-16-2004 : Support for Greek added by InAccess Networks (work funded by HOL, www.hol.gr)
+ * George Konstantoulakis <gkon at inaccessnetworks.com>
*/
#include <asterisk/lock.h>
@@ -80,6 +83,7 @@
it = Italian
nl - Dutch
pt - Portuguese
+ gr - Greek
German requires the following additional soundfile:
1F einE (feminine)
@@ -3423,6 +3427,55 @@
}
}
+ /* GREEK SYNTAX
+ In greek the plural for old/new is
+ different so we need the following files
+ We also need vm-denExeteMynhmata because
+ this syntax is different.
+
+ -> vm-Olds.wav : "Palia"
+ -> vm-INBOXs.wav : "Nea"
+ -> vm-denExeteMynhmata : "den exete mynhmata"
+ */
+
+
+static int vm_intro_gr(struct ast_channel *chan, struct vm_state *vms)
+{
+ int res;
+ if (vms->newmessages) {
+ res =ast_play_and_wait(chan, "vm-youhave");
+ if (!res)
+ res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, chan->language, NULL);
+ if (!res) {
+ if ((vms->newmessages == 1)) {
+ res = ast_play_and_wait(chan, "vm-INBOX");
+ if (!res)
+ res = ast_play_and_wait(chan, "vm-message");
+ } else {
+ res = ast_play_and_wait(chan, "vm-INBOXs");
+ if (!res)
+ res = ast_play_and_wait(chan, "vm-messages");
+ }
+ }
+ }
+ else if (vms->oldmessages){
+ res = ast_play_and_wait(chan, "vm-youhave");
+ if (!res)
+ res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, chan->language, NULL);
+ if ((vms->oldmessages == 1)){
+ res = ast_play_and_wait(chan, "vm-Old");
+ if (!res)
+ res = ast_play_and_wait(chan, "vm-message");
+ } else {
+ res = ast_play_and_wait(chan, "vm-Olds");
+ if (!res)
+ res = ast_play_and_wait(chan, "vm-messages");
+ }
+ } else if (!vms->oldmessages && !vms->newmessages)
+ res = ast_play_and_wait(chan, "vm-denExeteMynhmata");
+ return res;
+}
+
/* Default English syntax */
static int vm_intro_en(struct ast_channel *chan,struct vm_state *vms)
{
@@ -3857,6 +3910,8 @@
return vm_intro_pt(chan, vms);
} else if (!strcasecmp(chan->language, "cz")) { /* CZECH syntax */
return vm_intro_cz(chan, vms);
+ } else if (!strcasecmp(chan->language, "gr")){ /* GREEK syntax */
+ return vm_intro_gr(chan, vms);
} else { /* Default to ENGLISH */
return vm_intro_en(chan, vms);
}
@@ -4137,6 +4192,35 @@
return cmd;
}
+/* GREEK SYNTAX */
+
+static int vm_browse_messages_gr(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-youhaveno");
+ if (!strcasecmp(vms->vmbox, "vm-INBOX") ||!strcasecmp(vms->vmbox, "vm-Old")){
+ if (!cmd) {
+ snprintf(vms->fn, sizeof(vms->fn), "vm-%ss", vms->curbox);
+ cmd = ast_play_and_wait(chan, vms->fn);
+ }
+ if (!cmd)
+ cmd = ast_play_and_wait(chan, "vm-messages");
+ } else {
+ if (!cmd)
+ cmd = ast_play_and_wait(chan, "vm-messages");
+ if (!cmd) {
+ snprintf(vms->fn, sizeof(vms->fn), "vm-%s", vms->curbox);
+ cmd = ast_play_and_wait(chan, vms->fn);
+ }
+ }
+ }
+ return cmd;
+}
+
/* Default English syntax */
static int vm_browse_messages_en(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
@@ -4223,6 +4307,8 @@
return vm_browse_messages_it(chan, vms, vmu);
} else if (!strcasecmp(chan->language, "pt")) { /* PORTUGUESE */
return vm_browse_messages_pt(chan, vms, vmu);
+ } else if (!strcasecmp(chan->language, "gr")){
+ return vm_browse_messages_gr(chan, vms, vmu); /* GREEK */
} else { /* Default to English syntax */
return vm_browse_messages_en(chan, vms, vmu);
}
More information about the svn-commits
mailing list