[Asterisk-cvs] asterisk/apps app_voicemail.c,1.185,1.186

markster at lists.digium.com markster at lists.digium.com
Wed Dec 22 22:08:31 CST 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv28664/apps

Modified Files:
	app_voicemail.c 
Log Message:
Merge remainder of Greek support (bug 3107)


Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -d -r1.185 -r1.186
--- app_voicemail.c	23 Dec 2004 01:37:48 -0000	1.185
+++ app_voicemail.c	23 Dec 2004 03:04:12 -0000	1.186
@@ -3139,6 +3139,8 @@
 		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/nl-om' HM", NULL);
  	else if (!strcasecmp(chan->language,"it"))      /* ITALIAN syntax */
 		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' 'digits/hours' k 'digits/e' M 'digits/minutes'", NULL);
+	else if (!strcasecmp(chan->language,"gr"))
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q  H 'digits/kai' M ", NULL);
 	else
 		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' IMp", NULL);
 #if 0
@@ -3358,6 +3360,34 @@
 	memset(vms->heard, 0, sizeof(vms->heard)); 
 }
 
+/* In Greek even though we CAN use a syntax like "friends messages"
+ * ("filika mynhmata") it is not elegant. This also goes for "work/family messages"
+ * ("ergasiaka/oikogeniaka mynhmata"). Therefore it is better to use a reversed 
+ * syntax for the above three categories which is more elegant. 
+*/
+
+static int vm_play_folder_name_gr(struct ast_channel *chan, char *mbox)
+{
+	int cmd;
+	char buf[sizeof(mbox)+1]; 
+
+	memset(buf, '\0', sizeof(char)*(sizeof(buf)));
+	strcpy(buf, mbox);
+	strcat(buf,"s");
+
+	if (!strcasecmp(mbox, "vm-INBOX") || !strcasecmp(mbox, "vm-Old")){
+		cmd = ast_play_and_wait(chan, buf); /* "NEA / PALIA" */
+		if (cmd)
+		return cmd;
+		return ast_play_and_wait(chan, "vm-messages"); /* "messages" -> "MYNHMATA" */
+	} else {
+		cmd = ast_play_and_wait(chan, "vm-messages"); /* "messages" -> "MYNHMATA" */
+	  	if (cmd)
+			return cmd;
+	  	return ast_play_and_wait(chan, mbox); /* friends/family/work... -> "FILWN"/"OIKOGENIAS"/"DOULEIAS"*/
+	}
+}
+
 static int vm_play_folder_name(struct ast_channel *chan, char *mbox)
 {
 	int cmd;
@@ -3367,6 +3397,8 @@
 		if (cmd)
 			return cmd;
 		return ast_play_and_wait(chan, mbox);
+	} else if (!strcasecmp(chan->language, "gr")){
+		return vm_play_folder_name_gr(chan, mbox);
 	} else {  /* Default English */
 		cmd = ast_play_and_wait(chan, mbox);
 		if (cmd)
@@ -3405,8 +3437,7 @@
 					res = ast_play_and_wait(chan, "vm-messages");
 		 	}
 		}	  
-	 }
-	 else if (vms->oldmessages){
+	} 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);




More information about the svn-commits mailing list