[Asterisk-code-review] app_voicemail.c: Support for Danish syntax in VM (asterisk[16])

Friendly Automation asteriskteam at digium.com
Tue Dec 14 18:03:02 CST 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/17599 )

Change subject: app_voicemail.c: Support for Danish syntax in VM
......................................................................

app_voicemail.c: Support for Danish syntax in VM

added support for playing the correct plural sound file
dependen on where you have 1 or multipe messages
based on the existing SE/NO code

ASTERISK-29797

Change-Id: I88aa814d02f3772bb80b474204b1ffb26fe438c2
---
M apps/app_voicemail.c
A doc/CHANGES-staging/app_voicemail_danish_syntax.txt
2 files changed, 53 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  George Joseph: Looks good to me, but someone else must approve
  Friendly Automation: Approved for Submit



diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ec07f30..32d867d 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9885,6 +9885,51 @@
 	return res;
 }
 
+/* Danish syntax */
+static int vm_intro_da(struct ast_channel *chan, struct vm_state *vms)
+{
+	/* Introduce messages they have */
+	int res;
+
+	res = ast_play_and_wait(chan, "vm-youhave");
+	if (res)
+		return res;
+
+	if (!vms->oldmessages && !vms->newmessages && !vms->urgentmessages) {
+		res = ast_play_and_wait(chan, "vm-no");
+		res = res ? res : ast_play_and_wait(chan, "vm-messages");
+		return res;
+	}
+
+	if (vms->newmessages) {
+		if ((vms->newmessages == 1)) {
+			res = ast_play_and_wait(chan, "digits/1");
+			res = res ? res : ast_play_and_wait(chan, "vm-INBOX");
+			res = res ? res : ast_play_and_wait(chan, "vm-message");
+		} else {
+			res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
+			res = res ? res : ast_play_and_wait(chan, "vm-INBOXs");
+			res = res ? res : ast_play_and_wait(chan, "vm-messages");
+		}
+		if (!res && vms->oldmessages)
+			res = ast_play_and_wait(chan, "vm-and");
+	}
+	if (!res && vms->oldmessages) {
+		if (vms->oldmessages == 1) {
+			res = ast_play_and_wait(chan, "digits/1");
+			res = res ? res : ast_play_and_wait(chan, "vm-Old");
+			res = res ? res : ast_play_and_wait(chan, "vm-message");
+		} else {
+			res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
+			res = res ? res : ast_play_and_wait(chan, "vm-Olds");
+			res = 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)
 {
@@ -10365,6 +10410,8 @@
 		return vm_intro_nl(chan, vms);
 	} else if (!strncasecmp(ast_channel_language(chan), "no", 2)) {  /* NORWEGIAN syntax */
 		return vm_intro_no(chan, vms);
+	} else if (!strncasecmp(ast_channel_language(chan), "da", 2)) {  /* DANISH syntax */
+		return vm_intro_da(chan, vms);
 	} else if (!strncasecmp(ast_channel_language(chan), "pl", 2)) {  /* POLISH syntax */
 		return vm_intro_pl(chan, vms);
 	} else if (!strncasecmp(ast_channel_language(chan), "pt_BR", 5)) {  /* BRAZILIAN PORTUGUESE syntax */
diff --git a/doc/CHANGES-staging/app_voicemail_danish_syntax.txt b/doc/CHANGES-staging/app_voicemail_danish_syntax.txt
new file mode 100644
index 0000000..5e6cdd3
--- /dev/null
+++ b/doc/CHANGES-staging/app_voicemail_danish_syntax.txt
@@ -0,0 +1,6 @@
+Subject: app_voicemail
+Subject: Applications
+
+added support for Danish syntax, playing the correct plural sound file
+dependen on where you have 1 or multipe messages
+based on the existing SE/NO code

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17599
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I88aa814d02f3772bb80b474204b1ffb26fe438c2
Gerrit-Change-Number: 17599
Gerrit-PatchSet: 5
Gerrit-Owner: Mark Petersen <bugs.digium.com at zombie.dk>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20211214/fe676b15/attachment.html>


More information about the asterisk-code-review mailing list