MT#61440 sipwise_vm_find_user_by_alias: don't crash if odbc fails

> #1  0x00007fb757f99af9 in find_user_realtime_by_alias (ivm=ivm@entry=0x7fb794f21a20, context=context@entry=0x7fb757fb26c8 "default", alias=alias@entry=0x5585a7c58e18 "11d949a1-051c-40cc-b44e-18ce10976318")
>     at apps/app_voicemail.c:4254
> 4254    apps/app_voicemail.c: No such file or directory.
> (gdb) p obj
> $1 = (struct odbc_obj *) 0x0

Change-Id: I8fb13d5e53d534bf2324c3324ebc99667b8c06c8
(cherry picked from commit d21e211457)
(cherry picked from commit 9d0841080b)
mr10.5.6
Victor Seva 7 months ago
parent c803c16e37
commit 6cbf76ebd6

@ -7,7 +7,7 @@ Subject: sipwise_fix_app_voicemail_bugs
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 6510b8f..68fbe93 100644
index 1c36c7e..97359f8 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1326,7 +1326,7 @@ static int findreplen(const char *rep, int nmat, const int *replen)

@ -7,10 +7,10 @@ Subject: sipwise_fix_chan_usage
1 file changed, 2 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index df669f9..565f873 100644
index 691b730..8320012 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -15456,7 +15456,9 @@ AST_TEST_DEFINE(test_voicemail_msgcount)
@@ -15460,7 +15460,9 @@ AST_TEST_DEFINE(test_voicemail_msgcount)
break;
}
open_mailbox(&vms, vmu, folder2mbox[i]);

@ -7,10 +7,10 @@ Subject: sipwise_vm_add_arabic_support
1 file changed, 94 insertions(+), 2 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 305f558..12f80af 100644
index c969cc2..70efc6c 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9273,8 +9273,10 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -9277,8 +9277,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);
@ -23,7 +23,7 @@ index 305f558..12f80af 100644
if (!vms->curmsg) {
res = wait_file2(chan, vms, "vm-first"); /* "First" */
} else if (vms->curmsg == vms->lastmsg) {
@@ -9322,6 +9324,18 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -9326,6 +9328,18 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
}
if (!res)
res = wait_file2(chan, vms, "vm-message");
@ -42,7 +42,7 @@ index 305f558..12f80af 100644
/* HEBREW syntax */
} else if (!strncasecmp(ast_channel_language(chan), "he", 2)) {
if (!vms->curmsg) {
@@ -9764,6 +9778,8 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
@@ -9768,6 +9782,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);
@ -51,7 +51,7 @@ index 305f558..12f80af 100644
} 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 */
@@ -9925,6 +9941,59 @@ static int vm_intro_multilang(struct ast_channel *chan, struct vm_state *vms, co
@@ -9929,6 +9945,59 @@ static int vm_intro_multilang(struct ast_channel *chan, struct vm_state *vms, co
return res;
}
@ -111,7 +111,7 @@ index 305f558..12f80af 100644
/* Default Hebrew syntax */
static int vm_intro_he(struct ast_channel *chan, struct vm_state *vms)
{
@@ -10910,6 +10979,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
@@ -10914,6 +10983,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);
@ -120,7 +120,7 @@ index 305f558..12f80af 100644
} 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 */
@@ -11516,6 +11587,23 @@ static int vm_browse_messages_gr(struct ast_channel *chan, struct vm_state *vms,
@@ -11520,6 +11591,23 @@ static int vm_browse_messages_gr(struct ast_channel *chan, struct vm_state *vms,
return cmd;
}
@ -144,7 +144,7 @@ index 305f558..12f80af 100644
/* Hebrew Syntax */
static int vm_browse_messages_he(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
@@ -11754,6 +11842,8 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st
@@ -11758,6 +11846,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);
@ -153,7 +153,7 @@ index 305f558..12f80af 100644
} 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 */
@@ -12816,6 +12906,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12820,6 +12910,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");

@ -7,7 +7,7 @@ Subject: sipwise_vm_add_callid
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 122bcff..6fb44ad 100644
index fb2e82e..fb2359c 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -940,7 +940,7 @@ static char odbc_database[80] = "asterisk";
@ -19,7 +19,7 @@ index 122bcff..6fb44ad 100644
#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))
@@ -4560,6 +4560,7 @@ struct insert_data {
@@ -4564,6 +4564,7 @@ struct insert_data {
const char *category;
const char *flag;
const char *msg_id;
@ -27,7 +27,7 @@ index 122bcff..6fb44ad 100644
};
static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4588,6 +4589,9 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4592,6 +4593,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);
@ -37,7 +37,7 @@ index 122bcff..6fb44ad 100644
}
res = ast_odbc_execute_sql(obj, stmt, data->sql);
if (!SQL_SUCCEEDED(res)) {
@@ -4612,7 +4616,7 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4616,7 +4620,7 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
*
* \return the zero on success -1 on error.
*/
@ -46,7 +46,7 @@ index 122bcff..6fb44ad 100644
{
int res = 0;
int fd = -1;
@@ -4627,8 +4631,9 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
@@ -4631,8 +4635,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;
@ -57,7 +57,7 @@ index 122bcff..6fb44ad 100644
struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
delete_file(dir, msgnum);
@@ -4701,10 +4706,15 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
@@ -4705,10 +4710,15 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
idata.data = fdm;
idata.datalen = idata.indlen = fdlen;
@ -75,7 +75,7 @@ index 122bcff..6fb44ad 100644
if (ast_strlen_zero(idata.origtime)) {
idata.origtime = "0";
@@ -7061,7 +7071,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -7065,7 +7075,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");

@ -21,7 +21,7 @@ index 67ec08d..ad0c960 100644
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
index 94ba82f..211c4af 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -50,6 +50,7 @@
@ -166,7 +166,7 @@ index 8769654..692e796 100644
/*!
* \brief Strips control and non 7-bit clean characters from input string.
*
@@ -8011,6 +8125,8 @@ static int get_folder2(struct ast_channel *chan, char *fn, int start)
@@ -8015,6 +8129,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.
*/
@ -175,7 +175,7 @@ index 8769654..692e796 100644
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)
{
@@ -8172,6 +8288,7 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8176,6 +8292,7 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
cmd = 0;
return cmd;
}
@ -183,7 +183,7 @@ index 8769654..692e796 100644
static void queue_mwi_event(const char *channel_id, const char *box, int urgent, int new, int old)
{
@@ -8332,6 +8449,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8336,6 +8453,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
*
* \return zero on success, -1 on error.
*/
@ -192,7 +192,7 @@ index 8769654..692e796 100644
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
@@ -8671,6 +8790,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
@@ -8675,6 +8794,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
}
return res ? res : cmd;
}
@ -200,7 +200,7 @@ index 8769654..692e796 100644
static int wait_file2(struct ast_channel *chan, struct vm_state *vms, char *file)
{
@@ -11421,6 +11541,11 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
@@ -11425,6 +11545,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;
@ -212,7 +212,7 @@ index 8769654..692e796 100644
/* If ADSI is supported, setup login screen */
adsi_begin(chan, &useadsi);
@@ -11431,6 +11556,22 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
@@ -11435,6 +11560,22 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
return -1;
}
@ -235,7 +235,7 @@ index 8769654..692e796 100644
/* Authenticate them and get their mailbox/password */
while (!valid && (logretries < max_logins)) {
@@ -11460,6 +11601,18 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
@@ -11464,6 +11605,18 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
if (useadsi)
adsi_password(chan);
@ -254,7 +254,7 @@ index 8769654..692e796 100644
if (!ast_strlen_zero(prefix)) {
char fullusername[80];
@@ -14057,6 +14210,8 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -14061,6 +14214,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;
@ -263,7 +263,7 @@ index 8769654..692e796 100644
#ifdef IMAP_STORAGE
ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder));
@@ -14121,6 +14276,19 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -14125,6 +14280,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

@ -7,7 +7,7 @@ Subject: sipwise_vm_ast_load_realtime_use_uuid
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index d2ed8d6..fffbad9 100644
index 523a725..f6432de 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1858,7 +1858,7 @@ static int is_valid_dtmf(const char *key)
@ -54,7 +54,7 @@ index d2ed8d6..fffbad9 100644
SQLHSTMT stmt = NULL;
obj = ast_odbc_request_obj(odbc_database, 0);
@@ -4251,6 +4258,8 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
@@ -4255,6 +4262,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);
@ -63,7 +63,7 @@ index d2ed8d6..fffbad9 100644
stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
if (!stmt) {
ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
@@ -4277,7 +4286,11 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
@@ -4281,7 +4290,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);

@ -39,7 +39,7 @@ index 2e85d4c..e7ad660 100644
#include "asterisk/file.h"
#include "asterisk/pbx.h"
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index aabb725..21515f8 100644
index d89fd8b..80688c8 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -80,6 +80,9 @@
@ -61,7 +61,7 @@ index aabb725..21515f8 100644
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
#include <sys/time.h>
#include <sys/stat.h>
@@ -11843,7 +11844,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
@@ -11847,7 +11848,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);
@ -70,7 +70,7 @@ index aabb725..21515f8 100644
}
}
@@ -12091,8 +12092,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12095,8 +12096,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
int box;
int useadsi = 0;
int skipuser = 0;
@ -81,7 +81,7 @@ index aabb725..21515f8 100644
char *context = NULL;
int silentexit = 0;
struct ast_flags flags = { 0 };
@@ -13450,7 +13451,7 @@ static struct ast_custom_function vm_info_acf = {
@@ -13454,7 +13455,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] = "";
@ -90,7 +90,7 @@ index aabb725..21515f8 100644
char *options = NULL;
int silent = 0, skipuser = 0;
int res = -1;
@@ -17420,5 +17421,7 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,
@@ -17424,5 +17425,7 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,
.load = load_module,
.unload = unload_module,
.reload = reload,

@ -7,7 +7,7 @@ Subject: sipwise_vm_change_password_use_customer_id
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index a605516..ddf4e9c 100644
index a77271a..fa9b42e 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1721,7 +1721,7 @@ static int change_password_realtime(struct ast_vm_user *vmu, const char *passwor

@ -7,7 +7,7 @@ Subject: sipwise_vm_envelope_behaviour
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 47a7e55..ce6fb78 100644
index faf8f9f..39682af 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1537,8 +1537,10 @@ static void apply_option(struct ast_vm_user *vmu, const char *var, const char *v
@ -23,7 +23,7 @@ index 47a7e55..ce6fb78 100644
} else if (!strcasecmp(var, "moveheard")){
ast_set2_flag(vmu, ast_true(value), VM_MOVEHEARD);
} else if (!strcasecmp(var, "sayduration")){
@@ -15892,7 +15894,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -15896,7 +15898,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 */

@ -7,7 +7,7 @@ Subject: sipwise_vm_ext_timezone
1 file changed, 67 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 03eb8bc..84ad5e9 100644
index 79cb895..10034f7 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1031,6 +1031,8 @@ static int passwordlocation;
@ -36,7 +36,7 @@ index 03eb8bc..84ad5e9 100644
#ifdef IMAP_STORAGE
} else if (!strcasecmp(var->name, "imapuser")) {
ast_copy_string(retval->imapuser, var->value, sizeof(retval->imapuser));
@@ -8468,6 +8473,58 @@ static struct vm_zone * get_vmu_timezone(struct ast_vm_user *vmu)
@@ -8472,6 +8477,58 @@ static struct vm_zone * get_vmu_timezone(struct ast_vm_user *vmu)
return tz;
}
@ -95,7 +95,7 @@ index 03eb8bc..84ad5e9 100644
/*!
* \brief Sends email notification that a user has a new voicemail waiting for them.
* \param chan
@@ -14363,6 +14420,9 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -14367,6 +14424,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;
@ -105,7 +105,7 @@ index 03eb8bc..84ad5e9 100644
#ifdef IMAP_STORAGE
ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder));
@@ -14440,6 +14500,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -14444,6 +14504,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
sw_normalize_user_replace[0] = '\0';
}

@ -7,10 +7,10 @@ Subject: sipwise_vm_externnotify_by_uuid
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 68fbe93..eb2276b 100644
index 97359f8..c825fee 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -6566,15 +6566,15 @@ static void run_externnotify(char *context, char *extension, const char *flag, c
@@ -6570,15 +6570,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);

@ -3,11 +3,11 @@ 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(+)
apps/app_voicemail.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 3cecd23..8769654 100644
index 3cecd23..94ba82f 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1139,6 +1139,9 @@ static char emaildateformat[32] = "%A, %B %d, %Y at %r";
@ -33,7 +33,7 @@ index 3cecd23..8769654 100644
}
if (!vmu && !ast_strlen_zero(aliasescontext)) {
struct alias_mailbox_mapping *mapping;
@@ -4090,6 +4098,65 @@ bail:
@@ -4090,6 +4098,69 @@ bail:
return x - 1;
}
@ -55,6 +55,10 @@ index 3cecd23..8769654 100644
+ SQLHSTMT stmt = NULL;
+
+ obj = ast_odbc_request_obj(odbc_database, 0);
+ if (!obj) {
+ ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
+ return NULL;
+ }
+ stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
+ if (!stmt) {
+ ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);

@ -7,13 +7,13 @@ Subject: sipwise_vm_find_user_by_alias_prio_uuid
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 6fb44ad..d2ed8d6 100644
index fb2359c..523a725 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -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);
@@ -4244,26 +4244,26 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
return NULL;
}
- stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
+ stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps_uuid);
if (!stmt) {

@ -22,10 +22,10 @@ index ad0c960..fc52c48 100644
all: _all
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 84ad5e9..122bcff 100644
index 10034f7..fb2e82e 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5059,16 +5059,11 @@ static int vm_delete(char *file)
@@ -5063,16 +5063,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)
{
@ -42,7 +42,7 @@ index 84ad5e9..122bcff 100644
}
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)
@@ -5117,7 +5112,7 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
@@ -5121,7 +5116,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) {
@ -51,7 +51,7 @@ index 84ad5e9..122bcff 100644
struct ast_tm tm;
ast_localtime(&tv, &tm, NULL);
ast_strftime_locale(origdate, sizeof(origdate), emaildateformat, &tm, S_OR(vmu->locale, NULL));
@@ -5518,7 +5513,7 @@ static void make_email_file(FILE *p,
@@ -5522,7 +5517,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) {

@ -7,10 +7,10 @@ Subject: sipwise_vm_fix_envelope_play
1 file changed, 4 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 0b78238..aabb725 100644
index 4bb1321..d89fd8b 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -12438,8 +12438,10 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12442,8 +12442,10 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
@ -21,7 +21,7 @@ index 0b78238..aabb725 100644
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 3, record_gain);
if (cmd == ERROR_LOCK_PATH) {
res = cmd;
@@ -12450,6 +12452,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12454,6 +12456,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
@ -29,7 +29,7 @@ index 0b78238..aabb725 100644
case '4': // Dialout
if (!ast_strlen_zero(vmu->dialout)) {
cmd = dialout(chan, vmu, NULL, vmu->dialout);
@@ -12482,6 +12485,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12486,6 +12489,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
break;
default:

@ -7,7 +7,7 @@ Subject: sipwise_vm_fix_odbc_retreive_file
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index fffbad9..df669f9 100644
index f6432de..691b730 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4028,7 +4028,7 @@ static void odbc_update_msg_id(char *dir, int msg_num, char *msg_id)
@ -29,7 +29,7 @@ index fffbad9..df669f9 100644
goto bail_with_handle;
}
if (strcasecmp(coltitle, "msgnum") && strcasecmp(coltitle, "dir")) {
@@ -9403,7 +9406,9 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -9407,7 +9410,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) {

@ -7,10 +7,10 @@ Subject: sipwise_vm_fix_prev_message
1 file changed, 1 insertion(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 12f80af..64f59b5 100644
index 70efc6c..1f39eb2 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -12202,6 +12202,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12206,6 +12206,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 */

@ -7,10 +7,10 @@ Subject: sipwise_vm_hebrew_language_fixups
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index eb2276b..305f558 100644
index c825fee..c969cc2 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9272,10 +9272,14 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -9276,10 +9276,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);

@ -7,10 +7,10 @@ Subject: sipwise_vm_play_anonymous
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ddf4e9c..47a7e55 100644
index fa9b42e..faf8f9f 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -8921,7 +8921,7 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
@@ -8925,7 +8925,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);

@ -7,10 +7,10 @@ Subject: sipwise_vm_play_prompt_on_change_to_empty_folder
1 file changed, 12 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 692e796..a605516 100644
index 211c4af..a77271a 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11865,6 +11865,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -11869,6 +11869,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;
@ -18,7 +18,7 @@ index 692e796..a605516 100644
int in_urgent = 0;
int nodelete = 0;
#ifdef IMAP_STORAGE
@@ -12134,6 +12135,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12138,6 +12139,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
cmd = vm_browse_messages(chan, &vms, vmu);
break;
case '2': /* Change folders */
@ -26,7 +26,7 @@ index 692e796..a605516 100644
ast_test_suite_event_notify("CHANGEFOLDER", "Message: browsing to a different folder");
if (useadsi)
adsi_folders(chan, 0, "Change to folder...");
@@ -12566,6 +12568,16 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12570,6 +12572,16 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
vms.starting = 1;
break;
default: /* Nothing */

@ -7,7 +7,7 @@ Subject: sipwise_vm_pointers_malloc
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 21515f8..6510b8f 100644
index 80688c8..1c36c7e 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1373,7 +1373,7 @@ static char *edit(const char *str, int len, const char *rep,
@ -19,7 +19,7 @@ index 21515f8..6510b8f 100644
if (mvec[0] > 0) {
strncpy(cp, str, mvec[0]);
cp += mvec[0];
@@ -12109,6 +12109,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12113,6 +12113,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;

@ -7,7 +7,7 @@ Subject: sipwise_vm_sms_notify
1 file changed, 80 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ce6fb78..83def1d 100644
index 39682af..dd4a48b 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1017,6 +1017,7 @@ static int silencethreshold = 128;
@ -18,7 +18,7 @@ index ce6fb78..83def1d 100644
static struct ast_smdi_interface *smdi_iface = NULL;
static char vmfmts[80] = "wav";
static double volgain;
@@ -5049,6 +5050,20 @@ static int vm_delete(char *file)
@@ -5053,6 +5054,20 @@ static int vm_delete(char *file)
return ast_filedelete(file, NULL);
}
@ -39,7 +39,7 @@ index ce6fb78..83def1d 100644
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];
@@ -5726,6 +5741,59 @@ static int sendmail(char *srcemail,
@@ -5730,6 +5745,59 @@ static int sendmail(char *srcemail,
return 0;
}
@ -99,7 +99,7 @@ index ce6fb78..83def1d 100644
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];
@@ -5739,6 +5807,8 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
@@ -5743,6 +5811,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);
@ -108,7 +108,7 @@ index ce6fb78..83def1d 100644
if (!str1 || !str2) {
ast_free(str1);
ast_free(str2);
@@ -5871,6 +5941,7 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
@@ -5875,6 +5945,7 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
ast_free(str2);
return 0;
}
@ -116,7 +116,7 @@ index ce6fb78..83def1d 100644
/*!
* \brief Gets the current date and time, as formatted string.
@@ -8400,7 +8471,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8404,7 +8475,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
}
if (!ast_strlen_zero(vmu->pager)) {
@ -126,7 +126,7 @@ index ce6fb78..83def1d 100644
}
if (ast_test_flag(vmu, VM_DELETE))
@@ -14473,6 +14545,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -14477,6 +14549,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
externnotify[0] = '\0';
}

@ -7,10 +7,10 @@ Subject: sipwise_vm_store_message_add_diag_info
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 565f873..0b78238 100644
index 8320012..4bb1321 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4585,6 +4585,10 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4589,6 +4589,10 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
int res;
SQLHSTMT stmt;
@ -21,7 +21,7 @@ index 565f873..0b78238 100644
res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
if (!SQL_SUCCEEDED(res)) {
ast_log(AST_LOG_WARNING, "SQL Alloc Handle failed!\n");
@@ -4611,7 +4615,8 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4615,7 +4619,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)) {
@ -31,7 +31,7 @@ index 565f873..0b78238 100644
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
return NULL;
}
@@ -4744,6 +4749,13 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
@@ -4748,6 +4753,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);

@ -7,7 +7,7 @@ Subject: sipwise_vm_vmnotify_ext_format
1 file changed, 99 insertions(+), 38 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 49f5c0c..03eb8bc 100644
index f621b72..79cb895 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1195,6 +1195,8 @@ static int vm_msg_move(const char *mailbox, const char *context, size_t num_msgs
@ -19,7 +19,7 @@ index 49f5c0c..03eb8bc 100644
#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);
@@ -5741,7 +5743,7 @@ static int sendmail(char *srcemail,
@@ -5745,7 +5747,7 @@ static int sendmail(char *srcemail,
return 0;
}
@ -28,7 +28,7 @@ index 49f5c0c..03eb8bc 100644
{
char arguments[2048];
char date[256];
@@ -5750,6 +5752,7 @@ static void run_externpager(char *pager, char *dialed_num, char *cidnum, int dur
@@ -5754,6 +5756,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);
@ -36,7 +36,7 @@ index 49f5c0c..03eb8bc 100644
if (!str1) {
return;
@@ -5765,8 +5768,14 @@ static void run_externpager(char *pager, char *dialed_num, char *cidnum, int dur
@@ -5769,8 +5772,14 @@ static void run_externpager(char *pager, char *dialed_num, char *cidnum, int dur
snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
@ -53,7 +53,7 @@ index 49f5c0c..03eb8bc 100644
if (pagerbody) {
struct ast_channel *ast;
@@ -6471,9 +6480,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
@@ -6475,9 +6484,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
return res;
}
@ -67,7 +67,7 @@ index 49f5c0c..03eb8bc 100644
char ext_context[256] = "";
char number[256] = "";
int newvoicemails = 0, oldvoicemails = 0, urgentvoicemails = 0;
@@ -6513,10 +6524,20 @@ static void run_externnotify(char *context, char *extension, const char *flag, c
@@ -6517,10 +6528,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 {
@ -92,7 +92,7 @@ index 49f5c0c..03eb8bc 100644
ast_debug(1, "Executing %s\n", arguments);
ast_safe_system(arguments);
}
@@ -8394,6 +8415,59 @@ static void queue_mwi_event(const char *channel_id, const char *box, int urgent,
@@ -8398,6 +8419,59 @@ static void queue_mwi_event(const char *channel_id, const char *box, int urgent,
}
}
@ -152,7 +152,7 @@ index 49f5c0c..03eb8bc 100644
/*!
* \brief Sends email notification that a user has a new voicemail waiting for them.
* \param chan
@@ -8414,6 +8488,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8418,6 +8492,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;
@ -161,7 +161,7 @@ index 49f5c0c..03eb8bc 100644
ast_channel_lock(chan);
if ((category = pbx_builtin_getvar_helper(chan, "VM_CATEGORY"))) {
@@ -8472,7 +8548,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8476,7 +8552,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);
@ -170,7 +170,7 @@ index 49f5c0c..03eb8bc 100644
}
if (ast_test_flag(vmu, VM_DELETE))
@@ -8483,7 +8559,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8487,7 +8563,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);
@ -179,7 +179,7 @@ index 49f5c0c..03eb8bc 100644
#ifdef IMAP_STORAGE
vm_delete(fn); /* Delete the file, but not the IMAP message */
@@ -8788,7 +8864,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
@@ -8792,7 +8868,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);
@ -188,7 +188,7 @@ index 49f5c0c..03eb8bc 100644
}
} else {
ast_log(AST_LOG_ERROR, "Could not find state information for mailbox %s\n", vmtmp->mailbox);
@@ -8898,35 +8974,20 @@ static int play_message_category(struct ast_channel *chan, const char *category)
@@ -8902,35 +8978,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;
@ -230,7 +230,7 @@ index 49f5c0c..03eb8bc 100644
/* No internal variable parsing for now, so we'll comment it out for the time being */
#if 0
/* Set the DIFF_* variables */
@@ -8943,8 +9004,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8947,8 +9008,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
@ -241,7 +241,7 @@ index 49f5c0c..03eb8bc 100644
} 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 */
@@ -12694,7 +12755,7 @@ out:
@@ -12698,7 +12759,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 */
@ -250,7 +250,7 @@ index 49f5c0c..03eb8bc 100644
ast_app_inboxcount2(ext_context, &urgent, &new, &old);
queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgent, new, old);
}
@@ -13592,7 +13653,7 @@ static void poll_subscribed_mailbox(struct mwi_sub *mwi_sub)
@@ -13596,7 +13657,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
@ -259,7 +259,7 @@ index 49f5c0c..03eb8bc 100644
}
}
@@ -16778,7 +16839,7 @@ static void notify_new_state(struct ast_vm_user *vmu)
@@ -16782,7 +16843,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);

@ -7,10 +7,10 @@ Subject: sipwise_vm_zonemessages
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 83def1d..49f5c0c 100644
index dd4a48b..f621b72 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -8898,7 +8898,7 @@ static int play_message_category(struct ast_channel *chan, const char *category)
@@ -8902,7 +8902,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;
@ -19,7 +19,7 @@ index 83def1d..49f5c0c 100644
time_t t;
if (ast_get_time_t(origtime, &t, 0, NULL)) {
@@ -8913,13 +8913,20 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8917,13 +8917,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)) {
@ -41,7 +41,7 @@ index 83def1d..49f5c0c 100644
/* No internal variable parsing for now, so we'll comment it out for the time being */
#if 0
/* Set the DIFF_* variables */
@@ -8936,8 +8943,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8940,8 +8947,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
@ -52,7 +52,7 @@ index 83def1d..49f5c0c 100644
} 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 */
@@ -14249,17 +14256,14 @@ static void load_zonemessages(struct ast_config *cfg)
@@ -14253,17 +14260,14 @@ static void load_zonemessages(struct ast_config *cfg)
strcpy(storage, var->value); /* safe */
msg_format = storage;
tzone = strsep(&msg_format, "|,");

Loading…
Cancel
Save