MT#61440 refresh patches

NGCP-Flow: mr10.5

Change-Id: I96d96e9a9f6db823ca30de34f92b8a75a3c878d5
mr10.5
Victor Seva 7 months ago
parent 0cd09b609f
commit 7527a26738

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_app_playback_timezone
---
apps/app_playback.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 48ade9f..2e85d4c 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -230,6 +230,15 @@ static int do_say(say_args_t *a, const c
@@ -236,6 +236,15 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
}
AST_LIST_INSERT_HEAD(&head, n, entries);
@ -16,7 +26,7 @@
/* scan the body, one piece at a time */
while ( !ret && (x = strsep(&rule, ",")) ) { /* exit on key */
char fn[128];
@@ -243,6 +252,15 @@ static int do_say(say_args_t *a, const c
@@ -249,6 +258,15 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
pbx_substitute_variables_varshead(&head, x, fn, sizeof(fn));
ast_debug(2, "doing [%s]\n", fn);
@ -32,7 +42,7 @@
/* locate prefix and data, if any */
fmt = strchr(fn, ':');
if (!fmt || fmt == fn) { /* regular filename */
@@ -326,10 +344,34 @@ static int say_date_generic(struct ast_c
@@ -332,10 +350,34 @@ static int say_date_generic(struct ast_channel *chan, time_t t,
struct ast_tm tm;
struct timeval when = { t, 0 };
say_args_t a = { chan, ints, lang, -1, -1 };
@ -67,7 +77,7 @@
snprintf(buf, sizeof(buf), "%s:%s:%04d%02d%02d%02d%02d.%02d-%d-%3d",
prefix,
format,
@@ -341,7 +383,7 @@ static int say_date_generic(struct ast_c
@@ -347,7 +389,7 @@ static int say_date_generic(struct ast_channel *chan, time_t t,
tm.tm_sec,
tm.tm_wday,
tm.tm_yday);

@ -1,14 +1,14 @@
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -100,6 +100,8 @@
#endif
#endif
+#define AST_MODULE "voicemail"
+
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
#include <sys/time.h>
#include <sys/stat.h>
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:28 +0100
Subject: sipwise_define_module
---
apps/app_playback.c | 2 ++
apps/app_voicemail.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 56c2a86..48ade9f 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -31,6 +31,8 @@
@ -20,3 +20,16 @@
#include "asterisk/file.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 023d720..a9f4156 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -100,6 +100,8 @@
#endif
#endif
+#define AST_MODULE "voicemail"
+
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
#include <sys/time.h>
#include <sys/stat.h>

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_fix_app_voicemail_bugs
---
apps/app_voicemail.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 6510b8f..68fbe93 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1316,7 +1316,7 @@ static int findreplen(const char *rep, i
@@ -1326,7 +1326,7 @@ static int findreplen(const char *rep, int nmat, const int *replen)
while(*cp) {
if (*cp == '$' && isdigit(cp[1])) {
val = strtoul(&cp[1], &cp, 10);
@ -9,7 +19,7 @@
len += replen[val -1];
else
fprintf(stderr, "repl %d out of range\n", val);
@@ -1336,7 +1336,7 @@ static void doreplace(char *out, const c
@@ -1346,7 +1346,7 @@ static void doreplace(char *out, const char *rep,
while(*cp) {
if (*cp == '$' && isdigit(cp[1])) {
val = strtoul(&cp[1], &cp, 10);
@ -18,7 +28,7 @@
strncpy(out, repstr[val - 1], replen[val - 1]);
out += replen[val -1];
}
@@ -1383,7 +1383,7 @@ static char *pcre_subst(const pcre *ppat
@@ -1393,7 +1393,7 @@ static char *pcre_subst(const pcre *ppat, const pcre_extra *extra,
int nmat;
int ovec[MAXCAPTURE * 3];
nmat = pcre_exec(ppat, extra, str, len, offset, options,

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_fix_chan_usage
---
apps/app_voicemail.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index df669f9..565f873 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -15516,7 +15516,9 @@ AST_TEST_DEFINE(test_voicemail_msgcount)
@@ -15456,7 +15456,9 @@ AST_TEST_DEFINE(test_voicemail_msgcount)
break;
}
open_mailbox(&vms, vmu, folder2mbox[i]);

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:28 +0100
Subject: sipwise_rename_apps
---
Makefile | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 5b96cba..67ec08d 100644
--- a/Makefile
+++ b/Makefile
@@ -45,13 +45,19 @@ apps/app_playback.so: apps/app_playback.
@@ -45,13 +45,19 @@ apps/app_playback.so: apps/app_playback.o
clean:
rm -f apps/app_voicemail.o apps/app_voicemail.so \
apps/app_playback.o apps/app_playback.so

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_add_arabic_support
---
apps/app_voicemail.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 94 insertions(+), 2 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 305f558..12f80af 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9397,8 +9397,10 @@ static int play_message(struct ast_chann
@@ -9273,8 +9273,10 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg);
adsi_message(chan, vms);
@ -13,7 +23,7 @@
if (!vms->curmsg) {
res = wait_file2(chan, vms, "vm-first"); /* "First" */
} else if (vms->curmsg == vms->lastmsg) {
@@ -9446,6 +9448,18 @@ static int play_message(struct ast_chann
@@ -9322,6 +9324,18 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
}
if (!res)
res = wait_file2(chan, vms, "vm-message");
@ -32,7 +42,7 @@
/* HEBREW syntax */
} else if (!strncasecmp(ast_channel_language(chan), "he", 2)) {
if (!vms->curmsg) {
@@ -9888,6 +9902,8 @@ static int vm_play_folder_name(struct as
@@ -9764,6 +9778,8 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
return cmd ? cmd : ast_play_and_wait(chan, box);
} else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) {
return vm_play_folder_name_gr(chan, box);
@ -41,7 +51,7 @@
} else if (!strncasecmp(ast_channel_language(chan), "he", 2)) { /* Hebrew syntax */
return ast_play_and_wait(chan, box);
} else if (!strncasecmp(ast_channel_language(chan), "ja", 2)) { /* Japanese syntax */
@@ -10049,6 +10065,59 @@ static int vm_intro_multilang(struct ast
@@ -9925,6 +9941,59 @@ static int vm_intro_multilang(struct ast_channel *chan, struct vm_state *vms, co
return res;
}
@ -101,7 +111,7 @@
/* Default Hebrew syntax */
static int vm_intro_he(struct ast_channel *chan, struct vm_state *vms)
{
@@ -10989,6 +11058,8 @@ static int vm_intro(struct ast_channel *
@@ -10910,6 +10979,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
return vm_intro_fr(chan, vms);
} else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) { /* GREEK syntax */
return vm_intro_gr(chan, vms);
@ -110,7 +120,7 @@
} else if (!strncasecmp(ast_channel_language(chan), "he", 2)) { /* HEBREW syntax */
return vm_intro_he(chan, vms);
} else if (!strncasecmp(ast_channel_language(chan), "is", 2)) { /* ICELANDIC syntax */
@@ -11591,6 +11662,23 @@ static int vm_browse_messages_gr(struct
@@ -11516,6 +11587,23 @@ static int vm_browse_messages_gr(struct ast_channel *chan, struct vm_state *vms,
return cmd;
}
@ -134,7 +144,7 @@
/* Hebrew Syntax */
static int vm_browse_messages_he(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
@@ -11829,6 +11917,8 @@ static int vm_browse_messages(struct ast
@@ -11754,6 +11842,8 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st
return vm_browse_messages_es(chan, vms, vmu);
} else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) { /* GREEK */
return vm_browse_messages_gr(chan, vms, vmu);
@ -143,7 +153,7 @@
} else if (!strncasecmp(ast_channel_language(chan), "he", 2)) { /* HEBREW */
return vm_browse_messages_he(chan, vms, vmu);
} else if (!strncasecmp(ast_channel_language(chan), "it", 2)) { /* ITALIAN */
@@ -12881,6 +12971,8 @@ static int vm_execmain(struct ast_channe
@@ -12816,6 +12906,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
if (folder_change && vms.lastmsg == -1) {
if(!strcasecmp(ast_channel_language(chan), "ro")) {
ast_play_and_wait(chan, "vm-dir-empty");

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_add_callid
---
apps/app_voicemail.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 122bcff..6fb44ad 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -930,7 +930,7 @@ static char odbc_database[80] = "asteris
@@ -940,7 +940,7 @@ static char odbc_database[80] = "asterisk";
static char odbc_table[80] = "voicemessages";
#define RETRIEVE(a,b,c,d) retrieve_file(a,b)
#define DISPOSE(a,b) remove_file(a,b)
@ -9,7 +19,7 @@
#define EXISTS(a,b,c,d) (message_exists(a,b))
#define RENAME(a,b,c,d,e,f,g,h) (rename_file(a,b,c,d,e,f))
#define COPY(a,b,c,d,e,f,g,h) (copy_file(a,b,c,d,e,f))
@@ -4567,6 +4567,7 @@ struct insert_data {
@@ -4560,6 +4560,7 @@ struct insert_data {
const char *category;
const char *flag;
const char *msg_id;
@ -17,7 +27,7 @@
};
static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4595,6 +4596,9 @@ static SQLHSTMT insert_data_cb(struct od
@@ -4588,6 +4589,9 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
SQLBindParameter(stmt, 12, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->msg_id), 0, (void *) data->msg_id, 0, NULL);
if (!ast_strlen_zero(data->category)) {
SQLBindParameter(stmt, 13, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->category), 0, (void *) data->category, 0, NULL);
@ -27,7 +37,7 @@
}
res = ast_odbc_execute_sql(obj, stmt, data->sql);
if (!SQL_SUCCEEDED(res)) {
@@ -4619,7 +4623,7 @@ static SQLHSTMT insert_data_cb(struct od
@@ -4612,7 +4616,7 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
*
* \return the zero on success -1 on error.
*/
@ -36,7 +46,7 @@
{
int res = 0;
int fd = -1;
@@ -4634,8 +4638,9 @@ static int store_file(const char *dir, c
@@ -4627,8 +4631,9 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
char *c;
struct ast_config *cfg = NULL;
struct odbc_obj *obj;
@ -47,7 +57,7 @@
struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
delete_file(dir, msgnum);
@@ -4708,10 +4713,15 @@ static int store_file(const char *dir, c
@@ -4701,10 +4706,15 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
idata.data = fdm;
idata.datalen = idata.indlen = fdlen;
@ -65,7 +75,7 @@
if (ast_strlen_zero(idata.origtime)) {
idata.origtime = "0";
@@ -7189,7 +7199,7 @@ static int leave_voicemail(struct ast_ch
@@ -7061,7 +7071,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
if (success == -1) {
/* We couldn't retrieve the file from the database, but we found it on the file system. Let's put it in the database. */
ast_debug(1, "Greeting not retrieved from database, but found in file storage. Inserting into database\n");

@ -1,3 +1,14 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_add_pcre_support
---
Makefile | 2 +-
apps/app_voicemail.c | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 169 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 67ec08d..ad0c960 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ CC?=gcc
@ -9,12 +20,14 @@
CFLAGS+=-pipe -fPIC
CFLAGS+=-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
CFLAGS+=-D_REENTRANT -D_GNU_SOURCE -DODBC_STORAGE
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 8769654..692e796 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -50,6 +50,7 @@
<defaultenabled>yes</defaultenabled>
<use type="module">res_adsi</use>
<use type="module">res_smdi</use>
<defaultenabled>yes</defaultenabled>
+ <depend>pcre</depend>
<support_level>core</support_level>
***/
@ -29,7 +42,7 @@
/*** DOCUMENTATION
<application name="VoiceMail" language="en_US">
<synopsis>
@@ -1014,6 +1018,8 @@ static int maxlogins = 3;
@@ -1024,6 +1028,8 @@ static int maxlogins = 3;
static int minpassword = MINPASSWORD;
static int passwordlocation;
static char aliasescontext[MAX_VM_CONTEXT_LEN];
@ -38,7 +51,7 @@
/*! Poll mailboxes for changes since there is something external to
* app_voicemail that may change them. */
@@ -1270,6 +1276,114 @@ static int inprocess_count(const char *c
@@ -1280,6 +1286,114 @@ static int inprocess_count(const char *context, const char *mailbox, int delta)
static int __has_voicemail(const char *context, const char *mailbox, const char *folder, int shortcircuit);
#endif
@ -153,7 +166,7 @@
/*!
* \brief Strips control and non 7-bit clean characters from input string.
*
@@ -8136,6 +8250,8 @@ static int get_folder2(struct ast_channe
@@ -8011,6 +8125,8 @@ static int get_folder2(struct ast_channel *chan, char *fn, int start)
* This is invoked from forward_message() when performing a forward operation (option 8 from main menu).
* \return zero on success, -1 on error.
*/
@ -162,7 +175,7 @@
static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, char *curdir, int curmsg, char *vm_fmts,
char *context, signed char record_gain, long *duration, struct vm_state *vms, char *flag)
{
@@ -8297,6 +8413,7 @@ static int vm_forwardoptions(struct ast_
@@ -8172,6 +8288,7 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
cmd = 0;
return cmd;
}
@ -170,7 +183,7 @@
static void queue_mwi_event(const char *channel_id, const char *box, int urgent, int new, int old)
{
@@ -8457,6 +8574,8 @@ static int notify_new_message(struct ast
@@ -8332,6 +8449,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
*
* \return zero on success, -1 on error.
*/
@ -179,7 +192,7 @@
static int forward_message(struct ast_channel *chan, char *context, struct vm_state *vms, struct ast_vm_user *sender, char *fmt, int is_new_message, signed char record_gain, int urgent)
{
#ifdef IMAP_STORAGE
@@ -8795,6 +8914,7 @@ static int forward_message(struct ast_ch
@@ -8671,6 +8790,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
}
return res ? res : cmd;
}
@ -187,7 +200,7 @@
static int wait_file2(struct ast_channel *chan, struct vm_state *vms, char *file)
{
@@ -11496,6 +11616,11 @@ static int vm_authenticate(struct ast_ch
@@ -11421,6 +11541,11 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
int useadsi = 0, valid = 0, logretries = 0;
char password[AST_MAX_EXTENSION], *passptr = NULL;
struct ast_vm_user vmus, *vmu = NULL;
@ -199,7 +212,7 @@
/* If ADSI is supported, setup login screen */
adsi_begin(chan, &useadsi);
@@ -11506,6 +11631,22 @@ static int vm_authenticate(struct ast_ch
@@ -11431,6 +11556,22 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
return -1;
}
@ -222,7 +235,7 @@
/* Authenticate them and get their mailbox/password */
while (!valid && (logretries < max_logins)) {
@@ -11535,6 +11676,18 @@ static int vm_authenticate(struct ast_ch
@@ -11460,6 +11601,18 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
if (useadsi)
adsi_password(chan);
@ -241,7 +254,7 @@
if (!ast_strlen_zero(prefix)) {
char fullusername[80];
@@ -14117,6 +14270,8 @@ static int actual_load_config(int reload
@@ -14057,6 +14210,8 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
char secretfn[PATH_MAX] = "";
long tps_queue_low;
long tps_queue_high;
@ -250,7 +263,7 @@
#ifdef IMAP_STORAGE
ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder));
@@ -14181,6 +14336,19 @@ static int actual_load_config(int reload
@@ -14121,6 +14276,19 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
ast_copy_string(odbc_table, val, sizeof(odbc_table));
}
#endif

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_ast_load_realtime_use_uuid
---
apps/app_voicemail.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index d2ed8d6..fffbad9 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1848,7 +1848,7 @@ static int is_valid_dtmf(const char *key
@@ -1858,7 +1858,7 @@ static int is_valid_dtmf(const char *key)
*
* \return The ast_vm_user structure for the user that was found.
*/
@ -9,7 +19,7 @@
{
struct ast_variable *var;
struct ast_vm_user *retval;
@@ -1865,9 +1865,15 @@ static struct ast_vm_user *find_user_rea
@@ -1875,9 +1875,15 @@ static struct ast_vm_user *find_user_realtime(struct ast_vm_user *ivm, const cha
ast_copy_string(retval->mailbox, mailbox, sizeof(retval->mailbox));
}
if (!context && ast_test_flag((&globalflags), VM_SEARCH)) {
@ -27,7 +37,7 @@
}
if (var) {
// ast_log (LOG_DEBUG,"call apply_options_full\n");
@@ -1931,7 +1937,7 @@ static struct ast_vm_user *find_user(str
@@ -1941,7 +1947,7 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
#ifdef ODBC_STORAGE
vmu = find_user_realtime_by_alias(ivm, context, mailbox);
#else
@ -36,7 +46,7 @@
#endif
}
if (!vmu && !ast_strlen_zero(aliasescontext)) {
@@ -4242,6 +4248,7 @@ static struct ast_vm_user *find_user_rea
@@ -4237,6 +4243,7 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
"where customer_id = ?";
struct generic_prepare_struct gps_uuid = { .sql = sql_uuid, .argc = 1, .argv = argv };
struct odbc_obj *obj = NULL;
@ -44,7 +54,7 @@
SQLHSTMT stmt = NULL;
obj = ast_odbc_request_obj(odbc_database, 0);
@@ -4256,6 +4263,8 @@ static struct ast_vm_user *find_user_rea
@@ -4251,6 +4258,8 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
ast_log(LOG_NOTICE, "Failed to fetch mailbox for uuid '%s', falling back to alias search\n", alias);
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
@ -53,7 +63,7 @@
stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
if (!stmt) {
ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
@@ -4282,7 +4291,11 @@ static struct ast_vm_user *find_user_rea
@@ -4277,7 +4286,11 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
ast_odbc_release_obj(obj);
ast_log(LOG_NOTICE, "Found mailbox '%s' for alias '%s'\n", mailbox, alias);

@ -1,3 +1,45 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_asterisk_16_support
---
Makefile | 2 +-
apps/app_playback.c | 5 +++--
apps/app_voicemail.c | 15 +++++++++------
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index fc52c48..1a62428 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ DEBUG=-g
LIBS+=-lpcre
CFLAGS+=-pipe -fPIC
CFLAGS+=-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
- -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable
+ -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-format-truncation
CFLAGS+=-D_REENTRANT -D_GNU_SOURCE -DODBC_STORAGE
all: _all
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 2e85d4c..e7ad660 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -29,9 +29,10 @@
<support_level>core</support_level>
***/
-#include "asterisk.h"
-
#define AST_MODULE "app_playback"
+#define AST_MODULE_SELF_SYM __app_playback_sym
+
+#include "asterisk.h"
#include "asterisk/file.h"
#include "asterisk/pbx.h"
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index aabb725..21515f8 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -80,6 +80,9 @@
@ -19,7 +61,7 @@
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
#include <sys/time.h>
#include <sys/stat.h>
@@ -11918,7 +11919,7 @@ static int vm_authenticate(struct ast_ch
@@ -11843,7 +11844,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
ast_log(LOG_NOTICE, "Rewrote mailbox user input '%s' to %s\n",
mailbox, normalized_mailbox);
ast_copy_string(mailbox, normalized_mailbox, mailbox_size);
@ -28,7 +70,7 @@
}
}
@@ -12166,8 +12167,8 @@ static int vm_execmain(struct ast_channe
@@ -12091,8 +12092,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
int box;
int useadsi = 0;
int skipuser = 0;
@ -39,7 +81,7 @@
char *context = NULL;
int silentexit = 0;
struct ast_flags flags = { 0 };
@@ -13510,7 +13511,7 @@ static struct ast_custom_function vm_inf
@@ -13450,7 +13451,7 @@ static struct ast_custom_function vm_info_acf = {
static int vmauthenticate(struct ast_channel *chan, const char *data)
{
char *s, *user = NULL, *context = NULL, mailbox[AST_MAX_EXTENSION] = "";
@ -48,7 +90,7 @@
char *options = NULL;
int silent = 0, skipuser = 0;
int res = -1;
@@ -17473,5 +17474,7 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MO
@@ -17420,5 +17421,7 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,
.load = load_module,
.unload = unload_module,
.reload = reload,
@ -56,29 +98,3 @@
.optional_modules = "res_adsi,res_smdi",
+#endif
);
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -29,9 +29,10 @@
<support_level>core</support_level>
***/
-#include "asterisk.h"
-
#define AST_MODULE "app_playback"
+#define AST_MODULE_SELF_SYM __app_playback_sym
+
+#include "asterisk.h"
#include "asterisk/file.h"
#include "asterisk/pbx.h"
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ DEBUG=-g
LIBS+=-lpcre
CFLAGS+=-pipe -fPIC
CFLAGS+=-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
- -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable
+ -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-format-truncation
CFLAGS+=-D_REENTRANT -D_GNU_SOURCE -DODBC_STORAGE
all: _all

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_change_password_use_customer_id
---
apps/app_voicemail.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index a605516..ddf4e9c 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1711,7 +1711,7 @@ static int change_password_realtime(stru
@@ -1721,7 +1721,7 @@ static int change_password_realtime(struct ast_vm_user *vmu, const char *passwor
if (strlen(password) > 10) {
ast_realtime_require_field("voicemail", "password", RQ_CHAR, strlen(password), SENTINEL);
}

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_envelope_behaviour
---
apps/app_voicemail.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 47a7e55..ce6fb78 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1527,8 +1527,10 @@ static void apply_option(struct ast_vm_u
@@ -1537,8 +1537,10 @@ static void apply_option(struct ast_vm_user *vmu, const char *var, const char *v
ast_set2_flag(vmu, ast_true(value), VM_MESSAGEWRAP);
} else if (!strcasecmp(var, "operator")) {
ast_set2_flag(vmu, ast_true(value), VM_OPERATOR);
@ -13,7 +23,7 @@
} else if (!strcasecmp(var, "moveheard")){
ast_set2_flag(vmu, ast_true(value), VM_MOVEHEARD);
} else if (!strcasecmp(var, "sayduration")){
@@ -15952,7 +15954,7 @@ static int advanced_options(struct ast_c
@@ -15892,7 +15894,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
context = ast_variable_retrieve(msg_cfg, "message", "macrocontext");
switch (option) {
case 3: /* Play message envelope */

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_ext_timezone
---
apps/app_voicemail.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 03eb8bc..84ad5e9 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1021,6 +1021,8 @@ static int passwordlocation;
@@ -1031,6 +1031,8 @@ static int passwordlocation;
static char aliasescontext[MAX_VM_CONTEXT_LEN];
static char sw_normalize_user_match[256];
static char sw_normalize_user_replace[256];
@ -9,7 +19,7 @@
/*! Poll mailboxes for changes since there is something external to
* app_voicemail that may change them. */
@@ -1186,6 +1188,7 @@ static int vm_msg_remove(const char *mai
@@ -1196,6 +1198,7 @@ static int vm_msg_remove(const char *mailbox, const char *context, size_t num_ms
static int vm_msg_play(struct ast_channel *chan, const char *mailbox, const char *context, const char *folder, const char *msg_num, ast_vm_msg_play_cb cb);
static struct vm_zone *get_vmu_timezone(struct ast_vm_user *vmu);
@ -17,7 +27,7 @@
#ifdef TEST_FRAMEWORK
static int vm_test_destroy_user(const char *context, const char *mailbox);
@@ -1783,6 +1786,8 @@ static void apply_options_full(struct as
@@ -1793,6 +1796,8 @@ static void apply_options_full(struct ast_vm_user *retval, struct ast_variable *
} else if (!strcasecmp(var->name, "mailbox")) { /* granig: but save number for announcement */
ast_copy_string(retval->dialed_num, var->value, sizeof(retval->dialed_num));
// ast_log (LOG_DEBUG,"setting dialed_num to '%s'\n", var->value);
@ -26,7 +36,7 @@
#ifdef IMAP_STORAGE
} else if (!strcasecmp(var->name, "imapuser")) {
ast_copy_string(retval->imapuser, var->value, sizeof(retval->imapuser));
@@ -8593,6 +8598,58 @@ static struct vm_zone * get_vmu_timezone
@@ -8468,6 +8473,58 @@ static struct vm_zone * get_vmu_timezone(struct ast_vm_user *vmu)
return tz;
}
@ -85,7 +95,7 @@
/*!
* \brief Sends email notification that a user has a new voicemail waiting for them.
* \param chan
@@ -14423,6 +14480,9 @@ static int actual_load_config(int reload
@@ -14363,6 +14420,9 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
long tps_queue_high;
const char *ast_sw_normalize_user_match = NULL;
const char *ast_sw_normalize_user_replace = NULL;
@ -95,7 +105,7 @@
#ifdef IMAP_STORAGE
ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder));
@@ -14500,6 +14560,13 @@ static int actual_load_config(int reload
@@ -14440,6 +14500,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
sw_normalize_user_replace[0] = '\0';
}

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_externnotify_by_uuid
---
apps/app_voicemail.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 68fbe93..eb2276b 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -6701,15 +6701,15 @@ static void run_externnotify(char *conte
@@ -6566,15 +6566,15 @@ static void run_externnotify(char *context, char *extension, const char *flag, c
if (msg_time) {
ast_localtime(msg_time, &tm, timezonename);
ast_strftime(date, sizeof(date), "%Y-%m-%dT%H:%M:%S%z", &tm);

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_find_user_by_alias
---
apps/app_voicemail.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 3cecd23..8769654 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1129,6 +1129,9 @@ static char emaildateformat[32] = "%A, %
@@ -1139,6 +1139,9 @@ static char emaildateformat[32] = "%A, %B %d, %Y at %r";
static char pagerdateformat[32] = "%A, %B %d, %Y at %r";
/* Forward declarations - generic */
@ -10,7 +20,7 @@
static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box);
static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu);
static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int msg, int option, signed char record_gain);
@@ -1800,7 +1803,12 @@ static struct ast_vm_user *find_user(str
@@ -1810,7 +1813,12 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
AST_LIST_UNLOCK(&users);
if (!vmu) {
ast_log(LOG_DEBUG,"call find_user_realtime for '%s@%s'\n", mailbox, context);
@ -23,7 +33,7 @@
}
if (!vmu && !ast_strlen_zero(aliasescontext)) {
struct alias_mailbox_mapping *mapping;
@@ -4095,6 +4103,65 @@ bail:
@@ -4090,6 +4098,65 @@ bail:
return x - 1;
}

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_find_user_by_alias_prio_uuid
---
apps/app_voicemail.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 6fb44ad..d2ed8d6 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4245,26 +4245,26 @@ static struct ast_vm_user *find_user_rea
@@ -4240,26 +4240,26 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
SQLHSTMT stmt = NULL;
obj = ast_odbc_request_obj(odbc_database, 0);

@ -1,3 +1,14 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_fix_compile_warnings
---
Makefile | 3 ++-
apps/app_voicemail.c | 9 ++-------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index ad0c960..fc52c48 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,8 @@ DEBUG=-g
@ -10,9 +21,11 @@
CFLAGS+=-D_REENTRANT -D_GNU_SOURCE -DODBC_STORAGE
all: _all
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 84ad5e9..122bcff 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5194,16 +5194,11 @@ static int base_encode(char *filename, F
@@ -5059,16 +5059,11 @@ static int vm_delete(char *file)
static void prep_pager_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, char *cidnum, char *dur, char *date)
{
@ -29,7 +42,7 @@
}
static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, char *dur, char *date, const char *category, const char *flag)
@@ -5252,7 +5247,7 @@ static void prep_email_sub_vars(struct a
@@ -5117,7 +5112,7 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
}
if ((origtime = ast_variable_retrieve(msg_cfg, "message", "origtime")) && sscanf(origtime, "%30d", &inttime) == 1) {
@ -38,7 +51,7 @@
struct ast_tm tm;
ast_localtime(&tv, &tm, NULL);
ast_strftime_locale(origdate, sizeof(origdate), emaildateformat, &tm, S_OR(vmu->locale, NULL));
@@ -5653,7 +5648,7 @@ static void make_email_file(FILE *p,
@@ -5518,7 +5513,7 @@ static void make_email_file(FILE *p,
/* You might be tempted to do origdate, except that a) it's in the wrong
* format, and b) it's missing for IMAP recordings. */
if ((v = ast_variable_retrieve(msg_cfg, "message", "origtime")) && sscanf(v, "%30d", &inttime) == 1) {

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_fix_envelope_play
---
apps/app_voicemail.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 0b78238..aabb725 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -12503,8 +12503,10 @@ static int vm_execmain(struct ast_channe
@@ -12438,8 +12438,10 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
@ -11,7 +21,7 @@
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 3, record_gain);
if (cmd == ERROR_LOCK_PATH) {
res = cmd;
@@ -12515,6 +12517,7 @@ static int vm_execmain(struct ast_channe
@@ -12450,6 +12452,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
@ -19,7 +29,7 @@
case '4': // Dialout
if (!ast_strlen_zero(vmu->dialout)) {
cmd = dialout(chan, vmu, NULL, vmu->dialout);
@@ -12547,6 +12550,7 @@ static int vm_execmain(struct ast_channe
@@ -12482,6 +12485,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
break;
default:

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_fix_odbc_retreive_file
---
apps/app_voicemail.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index fffbad9..df669f9 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4033,7 +4033,7 @@ static void odbc_update_msg_id(char *dir
@@ -4028,7 +4028,7 @@ static void odbc_update_msg_id(char *dir, int msg_num, char *msg_id)
char *argv[] = { msg_id, dir, msg_num_str };
struct generic_prepare_struct gps = { .sql = sql, .argc = 3, .argv = argv };
@ -9,7 +19,7 @@
if (!obj) {
ast_log(LOG_WARNING, "Unable to update message ID for message %d in %s\n", msg_num, dir);
return;
@@ -4204,6 +4204,9 @@ static int retrieve_file(char *dir, int
@@ -4199,6 +4199,9 @@ static int retrieve_file(char *dir, int msgnum)
continue;
} else if (!SQL_SUCCEEDED(res)) {
ast_log(AST_LOG_WARNING, "SQL Get Data error! coltitle=%s\n[%s]\n\n", coltitle, sql);
@ -19,7 +29,7 @@
goto bail_with_handle;
}
if (strcasecmp(coltitle, "msgnum") && strcasecmp(coltitle, "dir")) {
@@ -9527,7 +9530,9 @@ static int play_message(struct ast_chann
@@ -9403,7 +9406,9 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
}
#endif
if ((res = wait_file(chan, vms, vms->fn)) < 0) {

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_fix_prev_message
---
apps/app_voicemail.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 12f80af..64f59b5 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -12276,6 +12276,7 @@ static int vm_execmain(struct ast_channe
@@ -12202,6 +12202,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
#endif
/* Add the vm_state to the active list and keep it active */

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_hebrew_language_fixups
---
apps/app_voicemail.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index eb2276b..305f558 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9396,10 +9396,14 @@ static int play_message(struct ast_chann
@@ -9272,10 +9272,14 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
vms->starting = 0;
make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg);
adsi_message(chan, vms);

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_play_anonymous
---
apps/app_voicemail.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ddf4e9c..47a7e55 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9045,7 +9045,7 @@ static int play_message_callerid(struct
@@ -8921,7 +8921,7 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
/* Strip off caller ID number from name */
ast_debug(1, "VM-CID: composite caller ID received: %s, context: %s\n", cid, context);
ast_callerid_parse(cid, &name, &callerid);

@ -1,14 +1,24 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_play_prompt_on_change_to_empty_folder
---
apps/app_voicemail.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 692e796..a605516 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11940,6 +11940,7 @@ static int vm_execmain(struct ast_channe
@@ -11865,6 +11865,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
signed char record_gain = 0;
int play_auto = 0;
int play_folder = 0;
+ int folder_change = 0;
int in_urgent = 0;
int nodelete = 0;
#ifdef IMAP_STORAGE
int deleted = 0;
@@ -12199,6 +12200,7 @@ static int vm_execmain(struct ast_channe
@@ -12134,6 +12135,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
cmd = vm_browse_messages(chan, &vms, vmu);
break;
case '2': /* Change folders */
@ -16,7 +26,7 @@
ast_test_suite_event_notify("CHANGEFOLDER", "Message: browsing to a different folder");
if (useadsi)
adsi_folders(chan, 0, "Change to folder...");
@@ -12631,6 +12633,16 @@ static int vm_execmain(struct ast_channe
@@ -12566,6 +12568,16 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
vms.starting = 1;
break;
default: /* Nothing */
@ -31,5 +41,5 @@
+ }
+ folder_change = 0;
ast_test_suite_event_notify("PLAYBACK", "Message: instructions");
cmd = vm_instructions(chan, vmu, &vms, 0, in_urgent);
cmd = vm_instructions(chan, vmu, &vms, 0, in_urgent, nodelete);
break;

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_pointers_malloc
---
apps/app_voicemail.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 21515f8..6510b8f 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1363,7 +1363,7 @@ static char *edit(const char *str, int l
@@ -1373,7 +1373,7 @@ static char *edit(const char *str, int len, const char *rep,
slen = len;
len -= mvec[1] - mvec[0];
len += rlen = findreplen(rep, nmat, replen);
@ -9,7 +19,7 @@
if (mvec[0] > 0) {
strncpy(cp, str, mvec[0]);
cp += mvec[0];
@@ -12183,6 +12183,8 @@ static int vm_execmain(struct ast_channe
@@ -12109,6 +12109,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
/* Add the vm_state to the active list and keep it active */
vms.lastmsg = -1;

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_romanian_syntax
---
apps/app_voicemail.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 84 insertions(+), 7 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 29fd37f..3cecd23 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -730,6 +730,7 @@ static int actual_load_config(int reload
@@ -748,6 +748,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
@ -8,7 +18,7 @@
\arg \b nl - Dutch
\arg \b pt - Portuguese
\arg \b pt_BR - Portuguese (Brazil)
@@ -5865,13 +5866,17 @@ static int invent_message(struct ast_cha
@@ -5730,13 +5731,17 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, ch
} else {
/* Dispose just in case */
DISPOSE(fn, -1);
@ -32,7 +42,7 @@
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);
@@ -8804,6 +8809,8 @@ static int play_message_datetime(struct
@@ -8680,6 +8685,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);
@ -41,7 +51,7 @@
} 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 */
@@ -9448,8 +9455,9 @@ static int vm_play_folder_name(struct as
@@ -9324,8 +9331,9 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
int cmd;
if ( !strncasecmp(ast_channel_language(chan), "it", 2) ||
@ -52,7 +62,7 @@
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)) {
@@ -9721,6 +9729,52 @@ static int vm_intro_ja(struct ast_channe
@@ -9597,6 +9605,52 @@ static int vm_intro_ja(struct ast_channel *chan,struct vm_state *vms)
return res;
} /* Japanese */
@ -105,7 +115,7 @@
/* Default English syntax */
static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
{
@@ -10515,6 +10569,8 @@ static int vm_intro(struct ast_channel *
@@ -10436,6 +10490,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);
@ -114,7 +124,7 @@
} 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 */
@@ -11207,6 +11263,25 @@ static int vm_browse_messages_ja(struct
@@ -11132,6 +11188,25 @@ static int vm_browse_messages_ja(struct ast_channel *chan, struct vm_state *vms,
return cmd;
}
@ -140,7 +150,7 @@
/*!
* \brief Spanish syntax for 'You have N messages' greeting.
* \param chan
@@ -11332,6 +11407,8 @@ static int vm_browse_messages(struct ast
@@ -11257,6 +11332,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);

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_sms_notify
---
apps/app_voicemail.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 80 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ce6fb78..83def1d 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1007,6 +1007,7 @@ static int silencethreshold = 128;
@@ -1017,6 +1017,7 @@ static int silencethreshold = 128;
static char serveremail[80] = ASTERISK_USERNAME;
static char mailcmd[160] = SENDMAIL; /* Configurable mail cmd */
static char externnotify[160];
@ -8,8 +18,8 @@
static struct ast_smdi_interface *smdi_iface = NULL;
static char vmfmts[80] = "wav";
static double volgain;
@@ -5184,6 +5185,20 @@ static int base_encode(char *filename, F
return 1;
@@ -5049,6 +5050,20 @@ static int vm_delete(char *file)
return ast_filedelete(file, NULL);
}
+static void prep_pager_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, char *cidnum, char *dur, char *date)
@ -29,7 +39,7 @@
static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, char *dur, char *date, const char *category, const char *flag)
{
char callerid[256];
@@ -5861,6 +5876,59 @@ static int sendmail(char *srcemail,
@@ -5726,6 +5741,59 @@ static int sendmail(char *srcemail,
return 0;
}
@ -89,7 +99,7 @@
static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, int duration, struct ast_vm_user *vmu, const char *category, const char *flag)
{
char enc_cidnum[256], enc_cidname[256];
@@ -5874,6 +5942,8 @@ static int sendpage(char *srcemail, char
@@ -5739,6 +5807,8 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
FILE *p;
struct ast_str *str1 = ast_str_create(16), *str2 = ast_str_create(16);
@ -98,7 +108,7 @@
if (!str1 || !str2) {
ast_free(str1);
ast_free(str2);
@@ -6006,6 +6076,7 @@ static int sendpage(char *srcemail, char
@@ -5871,6 +5941,7 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
ast_free(str2);
return 0;
}
@ -106,7 +116,7 @@
/*!
* \brief Gets the current date and time, as formatted string.
@@ -8525,7 +8596,8 @@ static int notify_new_message(struct ast
@@ -8400,7 +8471,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
}
if (!ast_strlen_zero(vmu->pager)) {
@ -116,7 +126,7 @@
}
if (ast_test_flag(vmu, VM_DELETE))
@@ -14533,6 +14605,13 @@ static int actual_load_config(int reload
@@ -14473,6 +14545,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
externnotify[0] = '\0';
}

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_store_message_add_diag_info
---
apps/app_voicemail.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 565f873..0b78238 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4592,6 +4592,10 @@ static SQLHSTMT insert_data_cb(struct od
@@ -4585,6 +4585,10 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
int res;
SQLHSTMT stmt;
@ -11,7 +21,7 @@
res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
if (!SQL_SUCCEEDED(res)) {
ast_log(AST_LOG_WARNING, "SQL Alloc Handle failed!\n");
@@ -4618,7 +4622,8 @@ static SQLHSTMT insert_data_cb(struct od
@@ -4611,7 +4615,8 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
}
res = ast_odbc_execute_sql(obj, stmt, data->sql);
if (!SQL_SUCCEEDED(res)) {
@ -21,7 +31,7 @@
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
return NULL;
}
@@ -4751,6 +4756,13 @@ static int store_file(const char *dir, c
@@ -4744,6 +4749,13 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
} else {
ast_log(AST_LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);

@ -1,3 +1,13 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_uuid_mailbox
---
apps/app_voicemail.c | 145 +++++++++++++++++++++++++++++++--------------------
1 file changed, 89 insertions(+), 56 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index a9f4156..29fd37f 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -58,14 +58,14 @@
@ -17,7 +27,7 @@
<support_level>core</support_level>
</member>
<member name="IMAP_STORAGE" displayname="Storage of Voicemail using IMAP4">
@@ -831,7 +831,8 @@ struct baseio {
@@ -841,7 +841,8 @@ and vm-Old are spelled plural, to make them sound more as folder name than an ad
* Use ast_vm_user_destroy() to free one of these structures. */
struct ast_vm_user {
char context[MAX_VM_CONTEXT_LEN];/*!< Voicemail context */
@ -27,7 +37,7 @@
char password[80]; /*!< Secret pin code, numbers only */
char fullname[80]; /*!< Full name, for directory app */
char *email; /*!< E-mail address */
@@ -1653,6 +1654,12 @@ static void apply_options_full(struct as
@@ -1663,6 +1664,12 @@ static void apply_options_full(struct ast_vm_user *retval, struct ast_variable *
} else if (!strcasecmp(var->name, "emailbody")) {
ast_free(retval->emailbody);
retval->emailbody = ast_strdup(substitute_escapes(var->value));
@ -40,7 +50,7 @@
#ifdef IMAP_STORAGE
} else if (!strcasecmp(var->name, "imapuser")) {
ast_copy_string(retval->imapuser, var->value, sizeof(retval->imapuser));
@@ -1735,6 +1742,7 @@ static struct ast_vm_user *find_user_rea
@@ -1745,6 +1752,7 @@ static struct ast_vm_user *find_user_realtime(struct ast_vm_user *ivm, const cha
var = ast_load_realtime("voicemail", "mailbox", mailbox, "context", context, SENTINEL);
}
if (var) {
@ -48,7 +58,7 @@
apply_options_full(retval, var);
ast_variables_destroy(var);
} else {
@@ -1790,6 +1798,7 @@ static struct ast_vm_user *find_user(str
@@ -1800,6 +1808,7 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
}
AST_LIST_UNLOCK(&users);
if (!vmu) {
@ -56,7 +66,7 @@
vmu = find_user_realtime(ivm, context, mailbox);
}
if (!vmu && !ast_strlen_zero(aliasescontext)) {
@@ -3154,7 +3163,7 @@ static int open_mailbox(struct vm_state
@@ -3149,7 +3158,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
return -1;
}
@ -65,7 +75,7 @@
/* Check Quota */
if (box == 0) {
@@ -5008,7 +5017,8 @@ static void prep_email_sub_vars(struct a
@@ -4873,7 +4882,8 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
snprintf(num, sizeof(num), "%d", msgnum);
pbx_builtin_setvar_helper(ast, "VM_MSGNUM", num);
pbx_builtin_setvar_helper(ast, "VM_CONTEXT", context);
@ -75,7 +85,7 @@
pbx_builtin_setvar_helper(ast, "VM_CALLERID", (!ast_strlen_zero(cidname) || !ast_strlen_zero(cidnum)) ?
ast_callerid_merge(callerid, sizeof(callerid), cidname, cidnum, NULL) : "an unknown caller");
pbx_builtin_setvar_helper(ast, "VM_CIDNAME", (!ast_strlen_zero(cidname) ? cidname : "an unknown caller"));
@@ -5832,7 +5842,7 @@ static int get_date(char *s, int len)
@@ -5697,7 +5707,7 @@ static int get_date(char *s, int len)
return ast_strftime(s, len, "%a %b %e %r UTC %Y", &tm);
}
@ -84,7 +94,7 @@
{
int res;
char fn[PATH_MAX];
@@ -5855,12 +5865,18 @@ static int invent_message(struct ast_cha
@@ -5720,12 +5730,18 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, in
} else {
/* Dispose just in case */
DISPOSE(fn, -1);
@ -106,7 +116,7 @@
}
res = ast_stream_and_wait(chan, busy ? "vm-isonphone" : "vm-isunavail", ecodes);
return res;
@@ -5904,6 +5920,7 @@ static int count_messages_in_folder(stru
@@ -5769,6 +5785,7 @@ static int count_messages_in_folder(struct odbc_obj *odbc, const char *context,
}
*messages = atoi(rowdata);
@ -114,7 +124,7 @@
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
return 0;
@@ -6330,10 +6347,11 @@ static int inboxcount(const char *mailbo
@@ -6195,10 +6212,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
return res;
}
@ -127,7 +137,7 @@
int newvoicemails = 0, oldvoicemails = 0, urgentvoicemails = 0;
struct ast_smdi_mwi_message *mwi_msg;
@@ -6342,6 +6360,9 @@ static void run_externnotify(char *conte
@@ -6207,6 +6225,9 @@ static void run_externnotify(char *context, char *extension, const char *flag)
else
ast_copy_string(ext_context, extension, sizeof(ext_context));
@ -137,7 +147,7 @@
if (smdi_iface) {
if (ast_app_has_voicemail(ext_context, NULL))
ast_smdi_mwi_set(smdi_iface, extension);
@@ -6362,12 +6383,15 @@ static void run_externnotify(char *conte
@@ -6227,12 +6248,15 @@ static void run_externnotify(char *context, char *extension, const char *flag)
}
if (!ast_strlen_zero(externnotify)) {
@ -154,7 +164,7 @@
oldvoicemails, urgentvoicemails);
ast_debug(1, "Executing %s\n", arguments);
ast_safe_system(arguments);
@@ -6784,7 +6808,7 @@ static int leave_voicemail(struct ast_ch
@@ -6650,7 +6674,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
/* Setup pre-file if appropriate */
if (strcmp(vmu->context, "default"))
@ -163,7 +173,7 @@
else
ast_copy_string(ext_context, vmu->mailbox, sizeof(ext_context));
@@ -6794,16 +6818,16 @@ static int leave_voicemail(struct ast_ch
@@ -6660,16 +6684,16 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
Depending on the flag set in options.
*/
if (ast_test_flag(options, OPT_BUSY_GREETING)) {
@ -184,7 +194,7 @@
ast_log(AST_LOG_WARNING, "Failed to make directory (%s)\n", tempfile);
free_user(vmu);
ast_free(tmp);
@@ -6816,7 +6840,7 @@ static int leave_voicemail(struct ast_ch
@@ -6682,7 +6706,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
DISPOSE(tempfile, -1);
/* It's easier just to try to make it than to check for its existence */
#ifndef IMAP_STORAGE
@ -193,16 +203,16 @@
#else
snprintf(dir, sizeof(dir), "%simap", VM_SPOOL_DIR);
if (mkdir(dir, VOICEMAIL_DIR_MODE) && errno != EEXIST) {
@@ -6877,7 +6901,7 @@ static int leave_voicemail(struct ast_ch
@@ -6743,7 +6767,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
#ifdef ODBC_STORAGE
int success =
#endif
- RETRIEVE(prefile, -1, ext, context);
+ RETRIEVE(prefile, -1, vmu->mailbox, context);
if (ast_fileexists(prefile, NULL, NULL) > 0) {
if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1)
res = ast_waitstream(chan, ecodes);
@@ -6890,7 +6914,7 @@ static int leave_voicemail(struct ast_ch
if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1) {
/* We know we have a greeting at this point, so squelch the instructions
@@ -6762,7 +6786,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
#endif
} else {
ast_debug(1, "%s doesn't exist, doing what we can\n", prefile);
@ -211,7 +221,7 @@
}
DISPOSE(prefile, -1);
if (res < 0) {
@@ -6993,7 +7017,7 @@ static int leave_voicemail(struct ast_ch
@@ -6865,7 +6889,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
ast_free(tmp);
return -1;
}
@ -220,7 +230,7 @@
/* It is possible under certain circumstances that inboxcount did not
* create a vm_state when it was needed. This is a catchall which will
* rarely be used.
@@ -7058,7 +7082,7 @@ static int leave_voicemail(struct ast_ch
@@ -6933,7 +6957,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL),
"Unknown");
ast_store_realtime("voicemail_data",
@ -229,7 +239,7 @@
"context", ast_channel_context(chan),
"macrocontext", ast_channel_macrocontext(chan),
"exten", ast_channel_exten(chan),
@@ -7098,7 +7122,7 @@ static int leave_voicemail(struct ast_ch
@@ -6973,7 +6997,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
"origtime=%ld\n"
"category=%s\n"
"msg_id=%s\n",
@ -238,7 +248,7 @@
ast_channel_context(chan),
ast_channel_macrocontext(chan),
ast_channel_exten(chan),
@@ -7126,7 +7150,7 @@ static int leave_voicemail(struct ast_ch
@@ -7001,7 +7025,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
leaving the message. So we update the directory where we want this
message to go. */
if (!strcmp(flag, "Urgent")) {
@ -247,7 +257,7 @@
}
if (txt) {
@@ -7358,7 +7382,7 @@ static int save_to_folder(struct ast_vm_
@@ -7233,7 +7257,7 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg
return res;
#else
char *dir = vms->curdir;
@ -256,7 +266,7 @@
char *context = vmu->context;
char sfn[PATH_MAX];
char dfn[PATH_MAX];
@@ -8321,7 +8345,7 @@ static int notify_new_message(struct ast
@@ -8196,7 +8220,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
ast_app_inboxcount2(ext_context, &urgentmsgs, &newmsgs, &oldmsgs);
queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgentmsgs, newmsgs, oldmsgs);
@ -265,7 +275,7 @@
#ifdef IMAP_STORAGE
vm_delete(fn); /* Delete the file, but not the IMAP message */
@@ -8623,7 +8647,7 @@ static int forward_message(struct ast_ch
@@ -8499,7 +8523,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
ast_log(AST_LOG_ERROR, "IMAP mailstream for %s is NULL\n", vmtmp->mailbox);
} else {
copy_msg_result = STORE(vmstmp.curdir, vmtmp->mailbox, vmtmp->context, curmsg, chan, vmtmp, fmt, duration, dstvms, urgent_str, msg_id);
@ -274,7 +284,7 @@
}
} else {
ast_log(AST_LOG_ERROR, "Could not find state information for mailbox %s\n", vmtmp->mailbox);
@@ -9202,7 +9226,7 @@ static int open_mailbox(struct vm_state
@@ -9078,7 +9102,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
/* Faster to make the directory than to check if it exists. */
@ -283,7 +293,7 @@
/* traverses directory using readdir (or select query for ODBC) */
count_msg = count_messages(vmu, vms->curdir);
@@ -10457,7 +10481,7 @@ static int vm_intro(struct ast_channel *
@@ -10378,7 +10402,7 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
char prefile[256];
/* Notify the user that the temp greeting is set and give them the option to remove it */
@ -292,9 +302,9 @@
if (ast_test_flag(vmu, VM_TEMPGREETWARN)) {
RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
if (ast_fileexists(prefile, NULL, NULL) > 0) {
@@ -10583,9 +10607,11 @@ static int vm_instructions_en(struct ast
} else {
res = ast_play_and_wait(chan, "vm-undelete");
@@ -10508,9 +10532,11 @@ static int vm_instructions_en(struct ast_channel *chan, struct ast_vm_user *vmu,
res = ast_play_and_wait(chan, "vm-undelete");
}
}
+ /*
if (!res) {
@ -304,7 +314,7 @@
if (!res) {
res = ast_play_and_wait(chan, "vm-savemessage");
}
@@ -10676,9 +10702,11 @@ static int vm_instructions_ja(struct ast
@@ -10601,9 +10627,11 @@ static int vm_instructions_ja(struct ast_channel *chan, struct ast_vm_user *vmu,
} else {
res = ast_play_and_wait(chan, "vm-undelete");
}
@ -316,7 +326,7 @@
if (!res) {
res = ast_play_and_wait(chan, "vm-savemessage");
}
@@ -10760,7 +10788,7 @@ static int vm_newuser_setup(struct ast_c
@@ -10685,7 +10713,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
/* If forcename is set, have the user record their name */
if (ast_test_flag(vmu, VM_FORCENAME)) {
@ -325,7 +335,7 @@
if (ast_fileexists(prefile, NULL, NULL) < 1) {
cmd = play_record_review(chan, "vm-rec-name", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL, NULL, 0);
if (cmd < 0 || cmd == 't' || cmd == '#')
@@ -10770,14 +10798,14 @@ static int vm_newuser_setup(struct ast_c
@@ -10695,14 +10723,14 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
/* If forcegreetings is set, have the user record their greetings */
if (ast_test_flag(vmu, VM_FORCEGREET)) {
@ -342,7 +352,7 @@
if (ast_fileexists(prefile, NULL, NULL) < 1) {
cmd = play_record_review(chan, "vm-rec-busy", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL, NULL, 0);
if (cmd < 0 || cmd == 't' || cmd == '#')
@@ -10801,7 +10829,7 @@ static int vm_newuser_setup(struct ast_c
@@ -10726,7 +10754,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
return cmd;
cmd = check_password(vmu, newpassword); /* perform password validation */
if (cmd != 0) {
@ -351,7 +361,7 @@
cmd = ast_play_and_wait(chan, vm_invalid_password);
} else {
newpassword2[1] = '\0';
@@ -10815,7 +10843,7 @@ static int vm_newuser_setup(struct ast_c
@@ -10740,7 +10768,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
return cmd;
if (!strcmp(newpassword, newpassword2))
break;
@ -360,7 +370,7 @@
cmd = ast_play_and_wait(chan, vm_mismatch);
}
if (++tries == 3)
@@ -10829,7 +10857,7 @@ static int vm_newuser_setup(struct ast_c
@@ -10754,7 +10782,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
if ((pwdchange & PWDCHANGE_EXTERNAL) && !ast_strlen_zero(ext_pass_cmd))
vm_change_password_shell(vmu, newpassword);
@ -369,7 +379,7 @@
cmd = ast_play_and_wait(chan, vm_passchanged);
return cmd;
@@ -10860,15 +10888,15 @@ static int vm_options(struct ast_channel
@@ -10785,15 +10813,15 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
retries = 0;
switch (cmd) {
case '1': /* Record your unavailable message */
@ -388,7 +398,7 @@
cmd = play_record_review(chan, "vm-rec-name", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL, NULL, 0);
break;
case '4': /* manage the temporary greeting */
@@ -10892,7 +10920,7 @@ static int vm_options(struct ast_channel
@@ -10817,7 +10845,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
}
cmd = check_password(vmu, newpassword); /* perform password validation */
if (cmd != 0) {
@ -397,7 +407,7 @@
cmd = ast_play_and_wait(chan, vm_invalid_password);
if (!cmd) {
cmd = ast_play_and_wait(chan, vm_pls_try_again);
@@ -10912,7 +10940,7 @@ static int vm_options(struct ast_channel
@@ -10837,7 +10865,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
}
}
if (strcmp(newpassword, newpassword2)) {
@ -406,7 +416,7 @@
cmd = ast_play_and_wait(chan, vm_mismatch);
if (!cmd) {
cmd = ast_play_and_wait(chan, vm_pls_try_again);
@@ -10928,7 +10956,7 @@ static int vm_options(struct ast_channel
@@ -10853,7 +10881,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
}
ast_debug(1, "User %s set password to %s of length %d\n",
@ -415,7 +425,7 @@
cmd = ast_play_and_wait(chan, vm_passchanged);
break;
case '*':
@@ -10936,7 +10964,7 @@ static int vm_options(struct ast_channel
@@ -10861,7 +10889,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
break;
default:
cmd = 0;
@ -424,7 +434,7 @@
RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
if (ast_fileexists(prefile, NULL, NULL)) {
cmd = ast_play_and_wait(chan, "vm-tmpexists");
@@ -10998,7 +11026,7 @@ static int vm_tempgreeting(struct ast_ch
@@ -10923,7 +10951,7 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
}
ast_test_suite_event_notify("TEMPGREETING", "Message: entering temp greeting options");
@ -433,7 +443,7 @@
while ((cmd >= 0) && (cmd != 't')) {
if (cmd)
retries = 0;
@@ -11912,7 +11940,8 @@ static int vm_execmain(struct ast_channe
@@ -11847,7 +11875,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
vms.repeats = 0;
while ((cmd > -1) && (cmd != 't') && (cmd != '#')) {
switch (cmd) {
@ -443,7 +453,7 @@
if (vms.lastmsg > -1 && !vms.starting) {
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 1, record_gain);
if (cmd == ERROR_LOCK_PATH || cmd == OPERATOR_EXIT) {
@@ -11924,7 +11953,7 @@ static int vm_execmain(struct ast_channe
@@ -11859,7 +11888,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
@ -452,7 +462,7 @@
if (!vms.starting)
ast_verb(3, "Callback Requested\n");
if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1 && !vms.starting) {
@@ -11941,7 +11970,7 @@ static int vm_execmain(struct ast_channe
@@ -11876,7 +11905,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
@ -461,7 +471,7 @@
if (vms.lastmsg > -1 && !vms.starting) {
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 3, record_gain);
if (cmd == ERROR_LOCK_PATH) {
@@ -11953,7 +11982,7 @@ static int vm_execmain(struct ast_channe
@@ -11888,7 +11917,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
@ -470,7 +480,7 @@
if (!ast_strlen_zero(vmu->dialout)) {
cmd = dialout(chan, vmu, NULL, vmu->dialout);
if (cmd == 9) {
@@ -11966,7 +11995,7 @@ static int vm_execmain(struct ast_channe
@@ -11901,7 +11930,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
cmd = 't';
break;
@ -479,7 +489,7 @@
if (ast_test_flag(vmu, VM_SVMAIL)) {
cmd = forward_message(chan, context, &vms, vmu, vmfmts, 1, record_gain, 0);
if (cmd == ERROR_LOCK_PATH || cmd == OPERATOR_EXIT) {
@@ -11978,6 +12007,7 @@ static int vm_execmain(struct ast_channe
@@ -11913,6 +11942,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
@ -487,7 +497,7 @@
case '*': /* Return to main menu */
cmd = 't';
@@ -11985,21 +12015,25 @@ static int vm_execmain(struct ast_channe
@@ -11920,21 +11950,25 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
default:
cmd = 0;
@ -513,7 +523,7 @@
if (!cmd) {
cmd = ast_play_and_wait(chan, "vm-starmain");
}
@@ -12150,7 +12184,8 @@ static int vm_execmain(struct ast_channe
@@ -12085,7 +12119,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
#endif
break;
@ -523,7 +533,7 @@
if (vms.lastmsg > -1) {
cmd = forward_message(chan, context, &vms, vmu, vmfmts, 0, record_gain, in_urgent);
if (cmd == ERROR_LOCK_PATH) {
@@ -12158,12 +12193,7 @@ static int vm_execmain(struct ast_channe
@@ -12093,12 +12128,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
goto out;
}
} else {
@ -536,7 +546,7 @@
in_urgent = 0;
res = close_mailbox(&vms, vmu);
if (res == ERROR_LOCK_PATH)
@@ -12181,6 +12211,7 @@ static int vm_execmain(struct ast_channe
@@ -12116,6 +12146,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
}
break;
@ -544,7 +554,7 @@
case '9': /* Save message to folder */
ast_test_suite_event_notify("SAVEMSG", "Message: saving message %d\r\nVoicemail: %d", vms.curmsg, vms.curmsg);
if (vms.curmsg < 0 || vms.curmsg > vms.lastmsg) {
@@ -12291,6 +12322,7 @@ static int vm_execmain(struct ast_channe
@@ -12226,6 +12257,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
cmd = 0;
break;
case '0': /* Mailbox options */
@ -552,7 +562,7 @@
cmd = vm_options(chan, vmu, &vms, vmfmts, record_gain);
if (useadsi)
adsi_status(chan, &vms);
@@ -12337,7 +12369,7 @@ out:
@@ -12272,7 +12304,7 @@ out:
int new = 0, old = 0, urgent = 0;
snprintf(ext_context, sizeof(ext_context), "%s@%s", vms.username, vmu->context);
/* Urgent flag not passwd to externnotify here */
@ -561,7 +571,7 @@
ast_app_inboxcount2(ext_context, &urgent, &new, &old);
queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgent, new, old);
}
@@ -13229,7 +13261,8 @@ static void poll_subscribed_mailbox(stru
@@ -13169,7 +13201,8 @@ static void poll_subscribed_mailbox(struct mwi_sub *mwi_sub)
mwi_sub->old_new = new;
mwi_sub->old_old = old;
queue_mwi_event(NULL, mwi_sub->mailbox, urgent, new, old);
@ -571,7 +581,7 @@
}
}
@@ -16389,7 +16422,7 @@ static void notify_new_state(struct ast_
@@ -16336,7 +16369,7 @@ static void notify_new_state(struct ast_vm_user *vmu)
char ext_context[1024];
snprintf(ext_context, sizeof(ext_context), "%s@%s", vmu->mailbox, vmu->context);

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_vmnotify_ext_format
---
apps/app_voicemail.c | 137 +++++++++++++++++++++++++++++++++++++--------------
1 file changed, 99 insertions(+), 38 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 49f5c0c..03eb8bc 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1185,6 +1185,8 @@ static int vm_msg_move(const char *mailb
@@ -1195,6 +1195,8 @@ static int vm_msg_move(const char *mailbox, const char *context, size_t num_msgs
static int vm_msg_remove(const char *mailbox, const char *context, size_t num_msgs, const char *folder, const char *msgs[]);
static int vm_msg_play(struct ast_channel *chan, const char *mailbox, const char *context, const char *folder, const char *msg_num, ast_vm_msg_play_cb cb);
@ -9,7 +19,7 @@
#ifdef TEST_FRAMEWORK
static int vm_test_destroy_user(const char *context, const char *mailbox);
static int vm_test_create_user(const char *context, const char *mailbox);
@@ -5876,7 +5878,7 @@ static int sendmail(char *srcemail,
@@ -5741,7 +5743,7 @@ static int sendmail(char *srcemail,
return 0;
}
@ -18,7 +28,7 @@
{
char arguments[2048];
char date[256];
@@ -5885,6 +5887,7 @@ static void run_externpager(char *pager,
@@ -5750,6 +5752,7 @@ static void run_externpager(char *pager, char *dialed_num, char *cidnum, int dur
char dur[PATH_MAX];
struct ast_tm tm;
struct ast_str *str1 = ast_str_create(16);
@ -26,7 +36,7 @@
if (!str1) {
return;
@@ -5900,8 +5903,14 @@ static void run_externpager(char *pager,
@@ -5765,8 +5768,14 @@ static void run_externpager(char *pager, char *dialed_num, char *cidnum, int dur
snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
@ -43,7 +53,7 @@
if (pagerbody) {
struct ast_channel *ast;
@@ -6606,9 +6615,11 @@ static int inboxcount(const char *mailbo
@@ -6471,9 +6480,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
return res;
}
@ -57,7 +67,7 @@
char ext_context[256] = "";
char number[256] = "";
int newvoicemails = 0, oldvoicemails = 0, urgentvoicemails = 0;
@@ -6648,10 +6659,20 @@ static void run_externnotify(char *conte
@@ -6513,10 +6524,20 @@ static void run_externnotify(char *context, char *extension, const char *flag, c
} else if (ast_strlen_zero(number) || !strcmp(extension, number)) {
ast_log(AST_LOG_WARNING, "Missing user number to run externnotify on context '%s'\n", ext_context);
} else {
@ -82,7 +92,7 @@
ast_debug(1, "Executing %s\n", arguments);
ast_safe_system(arguments);
}
@@ -8519,6 +8540,59 @@ static void queue_mwi_event(const char *
@@ -8394,6 +8415,59 @@ static void queue_mwi_event(const char *channel_id, const char *box, int urgent,
}
}
@ -142,7 +152,7 @@
/*!
* \brief Sends email notification that a user has a new voicemail waiting for them.
* \param chan
@@ -8539,6 +8613,8 @@ static int notify_new_message(struct ast
@@ -8414,6 +8488,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
int newmsgs = 0, oldmsgs = 0, urgentmsgs = 0;
const char *category;
char *myserveremail = serveremail;
@ -151,7 +161,7 @@
ast_channel_lock(chan);
if ((category = pbx_builtin_getvar_helper(chan, "VM_CATEGORY"))) {
@@ -8597,7 +8673,7 @@ static int notify_new_message(struct ast
@@ -8472,7 +8548,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
if (!ast_strlen_zero(vmu->pager)) {
//sendpage(myserveremail, vmu->pager, msgnum, vmu->context, vmu->mailbox, mbox(vmu, 0), cidnum, cidname, duration, vmu, category, flag);
@ -160,7 +170,7 @@
}
if (ast_test_flag(vmu, VM_DELETE))
@@ -8608,7 +8684,7 @@ static int notify_new_message(struct ast
@@ -8483,7 +8559,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
ast_app_inboxcount2(ext_context, &urgentmsgs, &newmsgs, &oldmsgs);
queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgentmsgs, newmsgs, oldmsgs);
@ -169,7 +179,7 @@
#ifdef IMAP_STORAGE
vm_delete(fn); /* Delete the file, but not the IMAP message */
@@ -8912,7 +8988,7 @@ static int forward_message(struct ast_ch
@@ -8788,7 +8864,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
ast_log(AST_LOG_ERROR, "IMAP mailstream for %s is NULL\n", vmtmp->mailbox);
} else {
copy_msg_result = STORE(vmstmp.curdir, vmtmp->mailbox, vmtmp->context, curmsg, chan, vmtmp, fmt, duration, dstvms, urgent_str, msg_id);
@ -178,7 +188,7 @@
}
} else {
ast_log(AST_LOG_ERROR, "Could not find state information for mailbox %s\n", vmtmp->mailbox);
@@ -9022,35 +9098,20 @@ static int play_message_category(struct
@@ -8898,35 +8974,20 @@ static int play_message_category(struct ast_channel *chan, const char *category)
static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, const char *origtime, const char *filename)
{
int res = 0;
@ -220,7 +230,7 @@
/* No internal variable parsing for now, so we'll comment it out for the time being */
#if 0
/* Set the DIFF_* variables */
@@ -9067,8 +9128,8 @@ static int play_message_datetime(struct
@@ -8943,8 +9004,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
/* Can't think of how other diffs might be helpful, but I'm sure somebody will think of something. */
#endif
@ -231,7 +241,7 @@
} else if (!strncasecmp(ast_channel_language(chan), "de", 2)) { /* GERMAN syntax */
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), "gr", 2)) { /* GREEK syntax */
@@ -12759,7 +12820,7 @@ out:
@@ -12694,7 +12755,7 @@ out:
int new = 0, old = 0, urgent = 0;
snprintf(ext_context, sizeof(ext_context), "%s@%s", vms.username, vmu->context);
/* Urgent flag not passwd to externnotify here */
@ -240,7 +250,7 @@
ast_app_inboxcount2(ext_context, &urgent, &new, &old);
queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgent, new, old);
}
@@ -13652,7 +13713,7 @@ static void poll_subscribed_mailbox(stru
@@ -13592,7 +13653,7 @@ static void poll_subscribed_mailbox(struct mwi_sub *mwi_sub)
mwi_sub->old_old = old;
queue_mwi_event(NULL, mwi_sub->mailbox, urgent, new, old);
// ksolomko: disabled as we do not have the number here
@ -249,7 +259,7 @@
}
}
@@ -16831,7 +16892,7 @@ static void notify_new_state(struct ast_
@@ -16778,7 +16839,7 @@ static void notify_new_state(struct ast_vm_user *vmu)
char ext_context[1024];
snprintf(ext_context, sizeof(ext_context), "%s@%s", vmu->mailbox, vmu->context);

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 4 Nov 2024 15:37:29 +0100
Subject: sipwise_vm_zonemessages
---
apps/app_voicemail.c | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 83def1d..49f5c0c 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9022,7 +9022,7 @@ static int play_message_category(struct
@@ -8898,7 +8898,7 @@ static int play_message_category(struct ast_channel *chan, const char *category)
static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, const char *origtime, const char *filename)
{
int res = 0;
@ -9,7 +19,7 @@
time_t t;
if (ast_get_time_t(origtime, &t, 0, NULL)) {
@@ -9037,13 +9037,20 @@ static int play_message_datetime(struct
@@ -8913,13 +8913,20 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
AST_LIST_LOCK(&zones);
AST_LIST_TRAVERSE(&zones, z, list) {
if (!strcmp(z->name, vmu->zonetag)) {
@ -31,7 +41,7 @@
/* No internal variable parsing for now, so we'll comment it out for the time being */
#if 0
/* Set the DIFF_* variables */
@@ -9060,8 +9067,8 @@ static int play_message_datetime(struct
@@ -8936,8 +8943,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
/* Can't think of how other diffs might be helpful, but I'm sure somebody will think of something. */
#endif
@ -42,7 +52,7 @@
} else if (!strncasecmp(ast_channel_language(chan), "de", 2)) { /* GERMAN syntax */
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), "gr", 2)) { /* GREEK syntax */
@@ -14309,17 +14316,14 @@ static void load_zonemessages(struct ast
@@ -14249,17 +14256,14 @@ static void load_zonemessages(struct ast_config *cfg)
strcpy(storage, var->value); /* safe */
msg_format = storage;
tzone = strsep(&msg_format, "|,");

Loading…
Cancel
Save