--- app_voicemail.c-original	2005-05-10 13:13:24.000000000 +0200
+++ app_voicemail.c	2005-05-10 15:14:21.000000000 +0200
@@ -12,6 +12,7 @@
  *
  * 12-16 - 2005 : Support for Greek added by InAccess Networks (work funded by HOL, www.hol.gr)
  *				 George Konstantoulakis <gkon@inaccessnetworks.com>
+ * 2005-05-10 : Support for Swedish and Norwegian added by Daniel Nylander, http://www.danielnylander.se/
  */
 
 #include "asterisk/lock.h"
@@ -96,6 +97,8 @@
 	nl - Dutch
 	pt - Portuguese
 	gr - Greek
+	no - Norwegian
+	se - Swedish
 
 German requires the following additional soundfile:
 1F	einE (feminine)
@@ -111,6 +114,19 @@
 vm-INBOX	nieuwe (nl)
 vm-Old		oude (nl)
 
+Swedish uses:
+vm-nytt		singular of 'new'
+vm-nya		pluralis of 'new'
+vm-gammalt	singular of 'old'
+vm-gamla	pluralis of 'old'
+digits/ett	'one', not always same as 'digits/1'
+
+Norwegian uses:
+vm-ny		singular of 'new'
+vm-nye		pluralis of 'new'
+vm-gammel	singular of 'old'
+vm-gamle	pluralis of 'old'
+
 Dutch also uses:
 nl-om		'at'?
 
@@ -3634,6 +3650,113 @@
 }
 
 
+/* SWEDISH syntax */
+static int vm_intro_se(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-youhave");
+		res = ast_play_and_wait(chan, "vm-no");
+		if (!res)
+			res = ast_play_and_wait(chan, "vm-messages");
+        } 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/ett");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-nytt");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-message");
+                                } else {
+                                        res = say_and_wait(chan, vms->newmessages, chan->language);
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-nya");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-messages");
+                                }
+                        }
+                        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/ett");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-gammalt");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-message");
+                                } else {
+                                        res = say_and_wait(chan, vms->oldmessages, chan->language);
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-gamla");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-messages");
+                                }
+                        }
+                }
+        }
+	return res;
+}
+
+/* NORWEGIAN syntax */
+static int vm_intro_no(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-youhave");
+		res = ast_play_and_wait(chan, "vm-no");
+		if (!res)
+			res = ast_play_and_wait(chan, "vm-messages");
+        } 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/1");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-ny");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-message");
+                                } else {
+                                        res = say_and_wait(chan, vms->newmessages, chan->language);
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-nye");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-messages");
+                                }
+                        }
+                        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/1");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-gammel");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-message");
+                                } else {
+                                        res = say_and_wait(chan, vms->oldmessages, chan->language);
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-gamle");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-messages");
+                                }
+                        }
+                }
+        }
+	return res;
+}
+
+
 /* GERMAN syntax */
 static int vm_intro_de(struct ast_channel *chan,struct vm_state *vms)
 {
@@ -3973,6 +4096,10 @@
 		return vm_intro_cz(chan, vms);
 	} else if (!strcasecmp(chan->language, "gr")){ /*	GREEK syntax */
 		return vm_intro_gr(chan, vms);
+	} else if (!strcasecmp(chan->language, "se")){ /* SWEDISH syntax */
+		return vm_intro_se(chan, vms);
+	} else if (!strcasecmp(chan->language, "no")){ /* SWEDISH syntax */
+		return vm_intro_no(chan, vms);
 	} else {	/* Default to ENGLISH */
 		return vm_intro_en(chan, vms);
 	}
