<p>Kevin Harwell <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/17680">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail.c: Support for Danish syntax in VM<br><br>added support for playing the correct plural sound file<br>dependen on where you have 1 or multipe messages<br>based on the existing SE/NO code<br><br>ASTERISK-29797<br><br>Change-Id: I88aa814d02f3772bb80b474204b1ffb26fe438c2<br>---<br>M apps/app_voicemail.c<br>A doc/CHANGES-staging/app_voicemail_danish_syntax.txt<br>2 files changed, 53 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c</span><br><span>index ebfa196..6dec471 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -9780,6 +9780,51 @@</span><br><span> return res;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Danish syntax */</span><br><span style="color: hsl(120, 100%, 40%);">+static int vm_intro_da(struct ast_channel *chan, struct vm_state *vms)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Introduce messages they have */</span><br><span style="color: hsl(120, 100%, 40%);">+ int res;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ res = ast_play_and_wait(chan, "vm-youhave");</span><br><span style="color: hsl(120, 100%, 40%);">+ if (res)</span><br><span style="color: hsl(120, 100%, 40%);">+ return res;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!vms->oldmessages && !vms->newmessages && !vms->urgentmessages) {</span><br><span style="color: hsl(120, 100%, 40%);">+ res = ast_play_and_wait(chan, "vm-no");</span><br><span style="color: hsl(120, 100%, 40%);">+ res = res ? res : ast_play_and_wait(chan, "vm-messages");</span><br><span style="color: hsl(120, 100%, 40%);">+ return res;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (vms->newmessages) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if ((vms->newmessages == 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ res = ast_play_and_wait(chan, "digits/1");</span><br><span style="color: hsl(120, 100%, 40%);">+ res = res ? res : ast_play_and_wait(chan, "vm-INBOX");</span><br><span style="color: hsl(120, 100%, 40%);">+ res = res ? res : ast_play_and_wait(chan, "vm-message");</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));</span><br><span style="color: hsl(120, 100%, 40%);">+ res = res ? res : ast_play_and_wait(chan, "vm-INBOXs");</span><br><span style="color: hsl(120, 100%, 40%);">+ res = res ? res : ast_play_and_wait(chan, "vm-messages");</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!res && vms->oldmessages)</span><br><span style="color: hsl(120, 100%, 40%);">+ res = ast_play_and_wait(chan, "vm-and");</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!res && vms->oldmessages) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (vms->oldmessages == 1) {</span><br><span style="color: hsl(120, 100%, 40%);">+ res = ast_play_and_wait(chan, "digits/1");</span><br><span style="color: hsl(120, 100%, 40%);">+ res = res ? res : ast_play_and_wait(chan, "vm-Old");</span><br><span style="color: hsl(120, 100%, 40%);">+ res = res ? res : ast_play_and_wait(chan, "vm-message");</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));</span><br><span style="color: hsl(120, 100%, 40%);">+ res = res ? res : ast_play_and_wait(chan, "vm-Olds");</span><br><span style="color: hsl(120, 100%, 40%);">+ res = res ? res : ast_play_and_wait(chan, "vm-messages");</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ return res;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* GERMAN syntax */</span><br><span> static int vm_intro_de(struct ast_channel *chan, struct vm_state *vms)</span><br><span> {</span><br><span>@@ -10260,6 +10305,8 @@</span><br><span> return vm_intro_nl(chan, vms);</span><br><span> } else if (!strncasecmp(ast_channel_language(chan), "no", 2)) { /* NORWEGIAN syntax */</span><br><span> return vm_intro_no(chan, vms);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strncasecmp(ast_channel_language(chan), "da", 2)) { /* DANISH syntax */</span><br><span style="color: hsl(120, 100%, 40%);">+ return vm_intro_da(chan, vms);</span><br><span> } else if (!strncasecmp(ast_channel_language(chan), "pl", 2)) { /* POLISH syntax */</span><br><span> return vm_intro_pl(chan, vms);</span><br><span> } else if (!strncasecmp(ast_channel_language(chan), "pt_BR", 5)) { /* BRAZILIAN PORTUGUESE syntax */</span><br><span>diff --git a/doc/CHANGES-staging/app_voicemail_danish_syntax.txt b/doc/CHANGES-staging/app_voicemail_danish_syntax.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..5e6cdd3</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/app_voicemail_danish_syntax.txt</span><br><span>@@ -0,0 +1,6 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_voicemail</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: Applications</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+added support for Danish syntax, playing the correct plural sound file</span><br><span style="color: hsl(120, 100%, 40%);">+dependen on where you have 1 or multipe messages</span><br><span style="color: hsl(120, 100%, 40%);">+based on the existing SE/NO code</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/17680">change 17680</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/17680"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I88aa814d02f3772bb80b474204b1ffb26fe438c2 </div>
<div style="display:none"> Gerrit-Change-Number: 17680 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Mark Petersen <bugs.digium.com@zombie.dk> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>