Bug#301490: asterisk: Please add patch for Italian syntax

Alessandro Polverini Alessandro Polverini <alex@nibbles.it>, 301490@bugs.debian.org
Sat, 26 Mar 2005 11:25:26 +0100


This is a multi-part MIME message sent by reportbug.

--===============0930307357==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: asterisk
Severity: wishlist
Tags: patch

Hello,
attached is a trivial backport I did from devel branch which supports
italian syntax for voicemail.

Please consider applying it to debian relase.

Thanks,
Alex

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-k7
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

--===============0930307357==
Content-Type: text/x-c; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="app_voicemail.diff"

--- app_voicemail.c	2005-03-02 23:24:02.000000000 +0100
+++ app_voicemail-tmp.c	2005-03-26 11:12:41.331409862 +0100
@@ -2723,6 +2723,59 @@
 	return res;
 }
 
+/* ITALIAN syntax */
+static int vm_intro_it(struct ast_channel *chan,struct vm_state *vms)
+{
+        /* Introduce messages they have */
+        int res;
+        if (!vms->oldmessages && !vms->newmessages) {
+		res = ast_play_and_wait(chan, "vm-no");
+		if (!res)
+			res = ast_play_and_wait(chan, "vm-message");
+        } else {
+                res = ast_play_and_wait(chan, "vm-youhave");
+        }
+        if (!res) {
+                if (vms->newmessages) {
+                        if (!res) {
+                                if ((vms->newmessages == 1)) {
+                                        res = ast_play_and_wait(chan, "digits/un");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-message");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-nuovo");
+                                } else {
+                                        res = say_and_wait(chan, vms->newmessages, chan->language);
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-messages");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-nuovi");
+                                }
+                        }
+                        if (vms->oldmessages && !res)
+                                res = ast_play_and_wait(chan, "vm-and");
+                }
+                if (vms->oldmessages) {
+                        if (!res) {
+                                if (vms->oldmessages == 1) {
+                                        res = ast_play_and_wait(chan, "digits/un");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-message");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-vecchio");
+                                } else {
+                                        res = say_and_wait(chan, vms->oldmessages, chan->language);
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-messages");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-vecchi");
+                                }
+                        }
+                }
+        }
+	return res;
+}
+
 /* GERMAN syntax */
 static int vm_intro_de(struct ast_channel *chan,struct vm_state *vms)
 {
@@ -3050,6 +3103,8 @@
 		return vm_intro_de(chan, vms);
 	} else if (!strcasecmp(chan->language, "es")) { /* SPANISH syntax */
 		return vm_intro_es(chan, vms);
+	} else if (!strcasecmp(chan->language, "it")) { /* ITALIAN syntax */
+		return vm_intro_it(chan, vms);
 	} else if (!strcasecmp(chan->language, "fr")) {	/* FRENCH syntax */
 		return vm_intro_fr(chan, vms);
 	} else if (!strcasecmp(chan->language, "nl")) {	/* DUTCH syntax */

--===============0930307357==--