You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asterisk-voicemail/debian/patches/sipwise_vm_romanian_syntax....

156 lines
6.5 KiB

From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_romanian_syntax
---
apps/app_voicemail.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 85 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index a03fe25..1ea9580 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -801,6 +801,7 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
\arg \b es - Spanish
\arg \b fr - French
\arg \b it - Italian
+ \arg \b ro - Romanian
\arg \b nl - Dutch
\arg \b pt - Portuguese
\arg \b pt_BR - Portuguese (Brazil)
@@ -6123,6 +6124,17 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, ch
} else {
/* Dispose just in case */
DISPOSE(fn, -1);
+
+ if(!strcasecmp(ast_channel_language(chan), "ro")) { /* ROMANIAN */
+ res = ast_stream_and_wait(chan, "vm-theperson", ecodes);
+ if (res)
+ {
+ ast_log(LOG_WARNING, "failed to stream/wait vm-theperson\n");
+ return res;
+ }
+ }
+
+ ast_log(LOG_DEBUG, "stream/wait dialed_num\n");
res = ast_say_digit_str(chan, dialed_num, ecodes, ast_channel_language(chan));
if (res) {
ast_log(LOG_WARNING, "failed to stream/wait '%s'\n", dialed_num);
@@ -8567,6 +8579,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' Q 'digits/at' HM", NULL);
} else if (!strncasecmp(ast_channel_language(chan), "it", 2)) { /* ITALIAN syntax */
res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' q 'digits/at' 'digits/hours' k 'digits/e' M 'digits/minutes'", NULL);
+ } else if (!strncasecmp(ast_channel_language(chan), "ro", 2)) { /* ROMANIAN syntax */
+ res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' q 'digits/at' 'digits/hours' k 'vm-and' M 'digits/minutes'", NULL);
} else if (!strcasecmp(ast_channel_language(chan),"ja")) { /* Japanese syntax */
res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "PHM q 'jp-ni' 'vm-received'", NULL);
} else if (!strncasecmp(ast_channel_language(chan), "nl", 2)) { /* DUTCH syntax */
@@ -9218,8 +9232,9 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
int cmd;
if ( !strncasecmp(ast_channel_language(chan), "it", 2) ||
+ !strncasecmp(ast_channel_language(chan), "ro", 2) ||
!strncasecmp(ast_channel_language(chan), "es", 2) ||
- !strncasecmp(ast_channel_language(chan), "pt", 2)) { /* Italian, Spanish, or Portuguese syntax */
+ !strncasecmp(ast_channel_language(chan), "pt", 2)) { /* Italian, Romanian, Spanish, or Portuguese syntax */
cmd = ast_play_and_wait(chan, "vm-messages"); /* "messages */
return cmd ? cmd : ast_play_and_wait(chan, box);
} else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) {
@@ -9491,6 +9506,52 @@ static int vm_intro_ja(struct ast_channel *chan,struct vm_state *vms)
return res;
} /* Japanese */
+/* ROMANIAN syntax */
+static int vm_intro_ro(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") ||
+ ast_play_and_wait(chan, "vm-youhave") ||
+ ast_play_and_wait(chan, "vm-messages");
+ else
+ res = ast_play_and_wait(chan, "vm-youhave");
+ if (!res && vms->newmessages) {
+ if(vms->newmessages == 1) {
+ res =
+ ast_play_and_wait(chan, "digits/1a") ||
+ ast_play_and_wait(chan, "vm-message") ||
+ ast_play_and_wait(chan, "vm-INBOXa");
+ } else {
+ if(vms->newmessages == 2)
+ res = ast_play_and_wait(chan, "digits/2f");
+ else
+ res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
+ if(!res)
+ res = ast_play_and_wait(chan, "vm-messages") ||
+ ast_play_and_wait(chan, "vm-INBOX");
+ }
+ }
+ if (!res && vms->oldmessages) {
+ if(vms->oldmessages == 1) {
+ res =
+ ast_play_and_wait(chan, "digits/1a") ||
+ ast_play_and_wait(chan, "vm-message") ||
+ ast_play_and_wait(chan, "vm-Old");
+ } else {
+ if(vms->oldmessages == 2)
+ res = ast_play_and_wait(chan, "digits/2f");
+ else
+ res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
+ if(!res)
+ res = ast_play_and_wait(chan, "vm-messages") ||
+ ast_play_and_wait(chan, "vm-Old");
+ }
+ }
+ return res;
+}
+
/* Default English syntax */
static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
{
@@ -10330,6 +10391,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
return vm_intro_is(chan, vms);
} else if (!strncasecmp(ast_channel_language(chan), "it", 2)) { /* ITALIAN syntax */
return vm_intro_it(chan, vms);
+ } else if (!strncasecmp(ast_channel_language(chan), "ro", 2)) { /* ITALIAN syntax */
+ return vm_intro_ro(chan, vms);
} else if (!strncasecmp(ast_channel_language(chan), "ja", 2)) { /* JAPANESE syntax */
return vm_intro_ja(chan, vms);
} else if (!strncasecmp(ast_channel_language(chan), "nl", 2)) { /* DUTCH syntax */
@@ -11017,6 +11080,25 @@ static int vm_browse_messages_ja(struct ast_channel *chan, struct vm_state *vms,
return cmd;
}
+/* ROMANIAN syntax */
+static int vm_browse_messages_ro(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
+{
+ int cmd=0;
+
+ if (vms->lastmsg > -1) {
+ cmd = play_message(chan, vmu, vms);
+ } else {
+ cmd = ast_play_and_wait(chan, "vm-no");
+ if (!cmd)
+ cmd = ast_play_and_wait(chan, "vm-message");
+ if (!cmd) {
+ snprintf(vms->fn, sizeof(vms->fn), "vm-%s", vms->curbox);
+ cmd = ast_play_and_wait(chan, vms->fn);
+ }
+ }
+ return cmd;
+}
+
/*!
* \brief Spanish syntax for 'You have N messages' greeting.
* \param chan
@@ -11142,6 +11224,8 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st
return vm_browse_messages_he(chan, vms, vmu);
} else if (!strncasecmp(ast_channel_language(chan), "it", 2)) { /* ITALIAN */
return vm_browse_messages_it(chan, vms, vmu);
+ } else if (!strncasecmp(ast_channel_language(chan), "ro", 2)) { /* ROMANIAN */
+ return vm_browse_messages_ro(chan, vms, vmu);
} else if (!strncasecmp(ast_channel_language(chan), "ja", 2)) { /* JAPANESE */
return vm_browse_messages_ja(chan, vms, vmu);
} else if (!strncasecmp(ast_channel_language(chan), "pt", 2)) { /* PORTUGUESE */