MT#61862 support bookworm 22.1.1~dfsg+~cs6.14.60671435-1~bpo12+1

* apps:*.c from upstream 22.1.1~dfsg+~cs6.14.60671435-1
* debian/patches: refresh and resolve conflicts

Change-Id: I9a7dad84e06bc4e2834df71c9a3ecd955985d470
mr13.2
Victor Seva 3 months ago
parent 447c63c4fc
commit 05e2f05748

@ -48,6 +48,13 @@
</synopsis>
<syntax>
<parameter name="filenames" required="true" argsep="&amp;">
<para>Ampersand separated list of filenames. If the filename
is a relative filename (it does not begin with a slash), it
will be searched for in the Asterisk sounds directory. If the
filename is able to be parsed as a URL, Asterisk will
download the file and then begin playback on it. To include a
literal <literal>&amp;</literal> in the URL you can enclose
the URL in single quotes.</para>
<argument name="filename" required="true" />
<argument name="filename2" multiple="true" />
</parameter>
@ -87,7 +94,7 @@
<para>WaitExten (application) -- wait for digits from caller, optionally play music on hold</para>
</description>
<see-also>
<ref type="application">Background</ref>
<ref type="application">BackGround</ref>
<ref type="application">WaitExten</ref>
<ref type="application">ControlPlayback</ref>
<ref type="agi">stream file</ref>
@ -492,7 +499,7 @@ static int playback_exec(struct ast_channel *chan, const char *data)
char *front;
ast_stopstream(chan);
while (!res && (front = strsep(&back, "&"))) {
while (!res && (front = ast_strsep(&back, '&', AST_STRSEP_STRIP | AST_STRSEP_TRIM))) {
if (option_say)
res = say_full(chan, front, "", ast_channel_language(chan), NULL, -1, -1);
else if (option_mix){
@ -507,8 +514,7 @@ static int playback_exec(struct ast_channel *chan, const char *data)
if (!res) {
res = ast_waitstream(chan, "");
ast_stopstream(chan);
}
if (res) {
} else {
if (!ast_check_hangup(chan)) {
ast_log(LOG_WARNING, "Playback failed on %s for %s\n", ast_channel_name(chan), (char *)data);
}

File diff suppressed because it is too large Load Diff

@ -8,7 +8,7 @@ Subject: sipwise_define_module
2 files changed, 6 insertions(+)
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 56c2a86..b9caab5 100644
index 6b93b03..613e8c8 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -29,6 +29,9 @@
@ -22,7 +22,7 @@ index 56c2a86..b9caab5 100644
#include "asterisk/file.h"
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 1aca59b..69371b0 100644
index 714e4d9..e7d0be2 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -46,6 +46,9 @@

@ -26,10 +26,10 @@ index 393aefc..9ee80e1 100644
all: _all
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 69371b0..8cc4c93 100644
index e7d0be2..138645b 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4800,7 +4800,7 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
@@ -5289,7 +5289,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 +38,7 @@ index 69371b0..8cc4c93 100644
struct ast_tm tm;
ast_localtime(&tv, &tm, NULL);
ast_strftime_locale(origdate, sizeof(origdate), emaildateformat, &tm, S_OR(vmu->locale, NULL));
@@ -5201,7 +5201,7 @@ static void make_email_file(FILE *p,
@@ -5690,7 +5690,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) {

@ -3,14 +3,14 @@ Date: Thu, 26 Sep 2024 01:07:31 +0200
Subject: sipwise_vm_add_actions_wmi
---
apps/app_voicemail.c | 296 +++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 277 insertions(+), 19 deletions(-)
apps/app_voicemail.c | 297 +++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 276 insertions(+), 21 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 8f4f3af..dbf21ca 100644
index 6823da2..080d378 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1043,6 +1043,52 @@ static int adsiver = 1;
@@ -1182,6 +1182,52 @@ static int adsiver = 1;
static char emaildateformat[32] = "%A, %B %d, %Y at %r";
static char pagerdateformat[32] = "%A, %B %d, %Y at %r";
@ -63,44 +63,53 @@ index 8f4f3af..dbf21ca 100644
/* Forward declarations - generic */
#ifdef ODBC_STORAGE
static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm, const char *context, const char *alias);
@@ -1065,8 +1111,9 @@ static void read_password_from_file(const char *secretfn, char *password, int pa
@@ -1204,9 +1250,10 @@ static void read_password_from_file(const char *secretfn, char *password, int pa
static int write_password_to_file(const char *secretfn, const char *password);
static const char *substitute_escapes(const char *value);
static int message_range_and_existence_check(struct vm_state *vms, const char *msg_ids [], size_t num_msgs, int *msg_nums, struct ast_vm_user *vmu);
-static void notify_new_state(struct ast_vm_user *vmu);
+static void notify_new_state(struct ast_vm_user *vmu, vm_node *vm_actions);
static int append_vmu_info_astman(struct mansession *s, struct ast_vm_user *vmu, const char* event_name, const char* actionid);
static int append_vmbox_info_astman(struct mansession *s, const struct message *m, struct ast_vm_user *vmu, const char* event_name, const char* actionid);
+static void get_id_callid(char *dir, int msg_num, char *msg_id, char *callid);
/*!
@@ -4451,9 +4498,11 @@ static void copy_file(char *sdir, int smsg, char *ddir, int dmsg, char *dmailbox
@@ -4866,8 +4913,8 @@ static void odbc_delete_message(const char *sdir, int smsg)
* This method is used for the COPY macro when mailboxes are stored in an ODBC back end.
*/
#define COPY_SQL_FMT "INSERT INTO %s (dir, msgnum, msg_id, context, callerid, origtime, " \
- "duration, recording, flag, mailboxuser, mailboxcontext) " \
- "SELECT ?,?,msg_id,context,callerid,origtime,duration,recording,flag,?,? " \
+ "duration, recording, flag, mailboxuser, mailboxcontext, call_id) " \
+ "SELECT ?,?,msg_id,context,callerid,origtime,duration,recording,flag,?,?,? " \
"FROM %s WHERE dir=? AND msgnum=?"
static void odbc_copy_message(char *sdir, int smsg, char *ddir, int dmsg, char *dmailboxuser, char *dmailboxcontext)
{
@@ -4875,9 +4922,11 @@ static void odbc_copy_message(char *sdir, int smsg, char *ddir, int dmsg, char *
char *sql = MAKE_SQL_PTRA2(COPY_SQL_FMT);
char msgnums[20];
char msgnumd[20];
char msg_id[MSG_ID_LEN];
+ char mid[256] = "";
+ char callid[256] = "";
struct odbc_obj *obj;
- char *argv[] = { ddir, msgnumd, msg_id, dmailboxuser, dmailboxcontext, sdir, msgnums };
- struct generic_prepare_struct gps = { .sql = sql, .argc = 7, .argv = argv };
+ char *argv[] = { ddir, msgnumd, msg_id, dmailboxuser, dmailboxcontext, callid, sdir, msgnums };
+ struct generic_prepare_struct gps = { .sql = sql, .argc = 8, .argv = argv };
- char *argv[] = { ddir, msgnumd, dmailboxuser, dmailboxcontext, sdir, msgnums };
- struct generic_prepare_struct gps = { .sql = sql, .argc = 6, .argv = argv };
+ char *argv[] = { ddir, msgnumd, dmailboxuser, dmailboxcontext, callid, sdir, msgnums };
+ struct generic_prepare_struct gps = { .sql = sql, .argc = 7, .argv = argv };
SCOPE_ENTER(3, "sdir: %s smsg: %d duser: %s dcontext: %s ddir: %s dmsg: %d\n",
sdir, smsg, dmailboxuser, dmailboxcontext, ddir, dmsg);
generate_msg_id(msg_id);
delete_file(ddir, dmsg);
@@ -4465,7 +4514,10 @@ static void copy_file(char *sdir, int smsg, char *ddir, int dmsg, char *dmailbox
@@ -4890,7 +4939,7 @@ static void odbc_copy_message(char *sdir, int smsg, char *ddir, int dmsg, char *
snprintf(msgnums, sizeof(msgnums), "%d", smsg);
snprintf(msgnumd, sizeof(msgnumd), "%d", dmsg);
- snprintf(sql, sizeof(sql), "INSERT INTO %s (dir, msgnum, msg_id, context, macrocontext, callerid, origtime, duration, recording, flag, mailboxuser, mailboxcontext) SELECT ?,?,?,context,macrocontext,callerid,origtime,duration,recording,flag,?,? FROM %s WHERE dir=? AND msgnum=?", odbc_table, odbc_table);
+
-
+ get_id_callid(sdir, smsg, mid, callid);
+
+ snprintf(sql, sizeof(sql), "INSERT INTO %s (dir, msgnum, msg_id, context, macrocontext, callerid, origtime, duration, recording, flag, mailboxuser, mailboxcontext, call_id) SELECT ?,?,?,context,macrocontext,callerid,origtime,duration,recording,flag,?,?,? FROM %s WHERE dir=? AND msgnum=?", odbc_table, odbc_table);
stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
if (!stmt)
ast_log(AST_LOG_WARNING, "SQL Execute error!\n[%s] (You probably don't have MySQL 4.1 or later installed)\n\n", sql);
@@ -6285,8 +6337,9 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
@@ -6785,8 +6834,9 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
return res;
}
@ -111,7 +120,7 @@ index 8f4f3af..dbf21ca 100644
char arguments[2048];
char date[256];
struct ast_tm tm;
@@ -6329,14 +6382,39 @@ static void run_externnotify(const char *context, const char *extension, const c
@@ -6829,14 +6879,39 @@ static void run_externnotify(const char *context, const char *extension, const 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 {
@ -156,7 +165,7 @@ index 8f4f3af..dbf21ca 100644
} else { // original short notify + extension
snprintf(arguments, sizeof(arguments), "%s %s %s %s %d %d %d &",
externnotify, S_OR(context, "\"\""),
@@ -6422,6 +6500,9 @@ static int msg_create_from_file(struct ast_vm_recording_data *recdata)
@@ -6921,6 +6996,9 @@ static int msg_create_from_file(struct ast_vm_recording_data *recdata)
const char *category = NULL; /* pointless for now */
char msg_id[MSG_ID_LEN];
@ -166,7 +175,7 @@ index 8f4f3af..dbf21ca 100644
/* Start by checking to see if the file actually exists... */
if (!(ast_fileexists(recdata->recording_file, recdata->recording_ext, NULL))) {
ast_log(LOG_ERROR, "File: %s not found.\n", recdata->recording_file);
@@ -6678,7 +6759,9 @@ static int msg_create_from_file(struct ast_vm_recording_data *recdata)
@@ -7174,7 +7252,9 @@ static int msg_create_from_file(struct ast_vm_recording_data *recdata)
if (send_email) { /* We tried and failed. */
ast_log(LOG_WARNING, "Failed to allocate dummy channel, email will not be sent\n");
}
@ -177,7 +186,7 @@ index 8f4f3af..dbf21ca 100644
}
}
@@ -8168,6 +8251,74 @@ static void load_vmu_timezone(struct ast_vm_user *vmu)
@@ -8669,6 +8749,74 @@ static void load_vmu_timezone(struct ast_vm_user *vmu)
return;
}
@ -252,7 +261,7 @@ index 8f4f3af..dbf21ca 100644
/*!
* \brief Sends email notification that a user has a new voicemail waiting for them.
* \param chan
@@ -8191,6 +8342,9 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8692,6 +8840,9 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
struct timeval msg_time = ast_tvnow();
struct vm_zone *tz = get_vmu_timezone(vmu);
@ -262,7 +271,7 @@ index 8f4f3af..dbf21ca 100644
ast_channel_lock(chan);
if ((category = pbx_builtin_getvar_helper(chan, "VM_CATEGORY"))) {
category = ast_strdupa(category);
@@ -8258,7 +8412,9 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8759,7 +8910,9 @@ 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);
@ -273,17 +282,17 @@ index 8f4f3af..dbf21ca 100644
#ifdef IMAP_STORAGE
vm_delete(fn); /* Delete the file, but not the IMAP message */
@@ -11424,6 +11580,9 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
#ifdef IMAP_STORAGE
@@ -12311,6 +12464,9 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
int deleted = 0;
#endif
SCOPE_ENTER(3, "%s:\n", ast_channel_name(chan));
+ int mt = -1;
+ vm_node messages[50];
+ vm_node_create(messages, 50);
/* Add the vm_state to the active list and keep it active */
vms.curmsg = -1;
@@ -11614,6 +11773,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12510,6 +12666,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
if (vms.lastmsg == -1) {
in_urgent = 0;
cmd = vm_browse_messages(chan, &vms, vmu);
@ -295,7 +304,7 @@ index 8f4f3af..dbf21ca 100644
res = 0;
goto out;
}
@@ -11689,6 +11853,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12588,6 +12749,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
case '5': /* Play current message */
ast_test_suite_event_notify("BROWSE", "Message: browsing message %d\r\nVoicemail: %d", vms.curmsg, vms.curmsg);
cmd = vm_browse_messages(chan, &vms, vmu);
@ -307,10 +316,10 @@ index 8f4f3af..dbf21ca 100644
break;
case '2': /* Change folders */
folder_change = 1;
@@ -11779,6 +11948,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12683,6 +12849,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
if (vms.curmsg > 0) {
vms.curmsg--;
cmd = play_message(chan, vmu, &vms);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, play_message, chan, vmu, &vms);
+ if (!cmd) {
+ vm_node_insert(messages, 'r', "", "");
+ mt = vm_node_find_avail(messages);
@ -319,10 +328,10 @@ index 8f4f3af..dbf21ca 100644
} else {
/* Check if we were listening to new
messages. If so, go to Urgent messages
@@ -11801,6 +11975,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12709,6 +12880,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
} else if (ast_test_flag(vmu, VM_MESSAGEWRAP) && vms.lastmsg > 0) {
vms.curmsg = vms.lastmsg;
cmd = play_message(chan, vmu, &vms);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, play_message, chan, vmu, &vms);
+ if (!cmd) {
+ vm_node_insert(messages, 'r', "", "");
+ mt = vm_node_find_avail(messages);
@ -331,10 +340,10 @@ index 8f4f3af..dbf21ca 100644
} else {
cmd = ast_play_and_wait(chan, "vm-nomore");
}
@@ -11811,6 +11990,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12719,6 +12895,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
if (vms.curmsg < vms.lastmsg) {
vms.curmsg++;
cmd = play_message(chan, vmu, &vms);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, play_message, chan, vmu, &vms);
+ if (!cmd) {
+ vm_node_insert(messages, 'r', "", "");
+ mt = vm_node_find_avail(messages);
@ -343,10 +352,10 @@ index 8f4f3af..dbf21ca 100644
} else {
if (in_urgent && vms.newmessages > 0) {
/* Check if we were listening to urgent
@@ -11832,6 +12016,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12744,6 +12925,11 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
} else if (ast_test_flag(vmu, VM_MESSAGEWRAP) && vms.lastmsg > 0) {
vms.curmsg = 0;
cmd = play_message(chan, vmu, &vms);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, play_message, chan, vmu, &vms);
+ if (!cmd) {
+ vm_node_insert(messages, 'r', "", "");
+ mt = vm_node_find_avail(messages);
@ -355,7 +364,7 @@ index 8f4f3af..dbf21ca 100644
} else {
cmd = ast_play_and_wait(chan, "vm-nomore");
}
@@ -11853,6 +12042,9 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12765,6 +12951,9 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
else if (play_folder == 1)
vms.oldmessages--;
cmd = ast_play_and_wait(chan, "vm-deleted");
@ -365,7 +374,7 @@ index 8f4f3af..dbf21ca 100644
} else {
if (play_folder == 0) {
if (in_urgent) {
@@ -11864,14 +12056,27 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12776,14 +12965,27 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
else if (play_folder == 1)
vms.oldmessages++;
cmd = ast_play_and_wait(chan, "vm-undeleted");
@ -376,7 +385,7 @@ index 8f4f3af..dbf21ca 100644
if (ast_test_flag(vmu, VM_SKIPAFTERCMD)) {
if (vms.curmsg < vms.lastmsg) {
vms.curmsg++;
cmd = play_message(chan, vmu, &vms);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, play_message, chan, vmu, &vms);
+ if (!cmd) {
+ vm_node_insert(messages, 'r', "", "");
+ mt = vm_node_find_avail(messages);
@ -384,7 +393,7 @@ index 8f4f3af..dbf21ca 100644
+ }
} else if (ast_test_flag(vmu, VM_MESSAGEWRAP) && vms.lastmsg > 0) {
vms.curmsg = 0;
cmd = play_message(chan, vmu, &vms);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, play_message, chan, vmu, &vms);
+ if (!cmd) {
+ vm_node_insert(messages, 'r', "", "");
+ mt = vm_node_find_avail(messages);
@ -393,10 +402,10 @@ index 8f4f3af..dbf21ca 100644
} else {
/* Check if we were listening to urgent
messages. If so, go to regular new messages
@@ -11922,6 +12127,29 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12838,6 +13040,29 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
} else if (cmd > 0) {
box = cmd = cmd - '0';
cmd = save_to_folder(vmu, &vms, vms.curmsg, cmd, NULL, 0);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, save_to_folder, vmu, &vms, vms.curmsg, cmd, NULL, 0);
+ if (!cmd) {
+ switch (box) {
+ case 0: // INBOX
@ -422,11 +431,11 @@ index 8f4f3af..dbf21ca 100644
+ }
if (cmd == ERROR_LOCK_PATH) {
res = cmd;
goto out;
@@ -11953,9 +12181,19 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
ast_trace(-1, "save to folder: %d\n", res);
@@ -12870,9 +13095,19 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
if (vms.curmsg < vms.lastmsg) {
vms.curmsg++;
cmd = play_message(chan, vmu, &vms);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, play_message, chan, vmu, &vms);
+ if (!cmd) {
+ vm_node_insert(messages, 'r', "", "");
+ mt = vm_node_find_avail(messages);
@ -434,7 +443,7 @@ index 8f4f3af..dbf21ca 100644
+ }
} else if (ast_test_flag(vmu, VM_MESSAGEWRAP) && vms.lastmsg > 0) {
vms.curmsg = 0;
cmd = play_message(chan, vmu, &vms);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, play_message, chan, vmu, &vms);
+ if (!cmd) {
+ vm_node_insert(messages, 'r', "", "");
+ mt = vm_node_find_avail(messages);
@ -443,7 +452,7 @@ index 8f4f3af..dbf21ca 100644
} else {
/* Check if we were listening to urgent
messages. If so, go to regular new messages
@@ -12072,7 +12310,7 @@ out:
@@ -12995,7 +13230,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 */
@ -452,7 +461,7 @@ index 8f4f3af..dbf21ca 100644
ast_app_inboxcount2(ext_context, &urgent, &new, &old);
queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgent, new, old);
}
@@ -15993,13 +16231,13 @@ done:
@@ -17196,13 +17431,13 @@ done:
return res;
}
@ -468,7 +477,7 @@ index 8f4f3af..dbf21ca 100644
ast_app_inboxcount2(ext_context, &urgent, &new, &old);
queue_mwi_event(NULL, ext_context, urgent, new, old);
}
@@ -16026,6 +16264,9 @@ static int vm_msg_forward(const char *from_mailbox,
@@ -17229,6 +17464,9 @@ static int vm_msg_forward(const char *from_mailbox,
int i;
int *msg_nums;
@ -478,7 +487,7 @@ index 8f4f3af..dbf21ca 100644
if (ast_strlen_zero(from_mailbox) || ast_strlen_zero(to_mailbox)) {
ast_log(LOG_WARNING, "Cannot forward message because either the from or to mailbox was not specified\n");
return -1;
@@ -16139,7 +16380,9 @@ vm_forward_cleanup:
@@ -17342,7 +17580,9 @@ vm_forward_cleanup:
#endif
if (!res) {
@ -489,7 +498,7 @@ index 8f4f3af..dbf21ca 100644
}
free_user(vmu);
@@ -16163,6 +16406,9 @@ static int vm_msg_move(const char *mailbox,
@@ -17366,6 +17606,9 @@ static int vm_msg_move(const char *mailbox,
int i;
int *old_msg_nums;
@ -499,7 +508,7 @@ index 8f4f3af..dbf21ca 100644
if (ast_strlen_zero(mailbox)) {
ast_log(LOG_WARNING, "Cannot move message because no mailbox was specified\n");
return -1;
@@ -16244,7 +16490,9 @@ vm_move_cleanup:
@@ -17447,7 +17690,9 @@ vm_move_cleanup:
#endif
if (!res) {
@ -510,7 +519,7 @@ index 8f4f3af..dbf21ca 100644
}
free_user(vmu);
@@ -16265,6 +16513,9 @@ static int vm_msg_remove(const char *mailbox,
@@ -17468,6 +17713,9 @@ static int vm_msg_remove(const char *mailbox,
int i;
int *msg_nums;
@ -520,7 +529,7 @@ index 8f4f3af..dbf21ca 100644
if (ast_strlen_zero(mailbox)) {
ast_log(LOG_WARNING, "Cannot remove message because no mailbox was specified\n");
return -1;
@@ -16342,7 +16593,9 @@ vm_remove_cleanup:
@@ -17545,7 +17793,9 @@ vm_remove_cleanup:
#endif
if (!res) {
@ -531,7 +540,7 @@ index 8f4f3af..dbf21ca 100644
}
free_user(vmu);
@@ -16367,6 +16620,9 @@ static int vm_msg_play(struct ast_channel *chan,
@@ -17570,6 +17820,9 @@ static int vm_msg_play(struct ast_channel *chan,
int duration = 0;
const char *value;
@ -541,7 +550,7 @@ index 8f4f3af..dbf21ca 100644
if (ast_strlen_zero(mailbox)) {
ast_log(LOG_WARNING, "Cannot play message because no mailbox was specified\n");
return -1;
@@ -16456,7 +16712,9 @@ play2_msg_cleanup:
@@ -17659,7 +17912,9 @@ play2_msg_cleanup:
#endif
if (!res) {

@ -7,10 +7,10 @@ Subject: sipwise_vm_add_arabic_support
1 file changed, 93 insertions(+), 2 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 7c914b8..beda819 100644
index bf46d37..da26b2b 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -8511,8 +8511,9 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -9014,8 +9014,9 @@ 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);
@ -22,7 +22,7 @@ index 7c914b8..beda819 100644
} else {
if (!vms->curmsg) {
res = wait_file2(chan, vms, "vm-first"); /* "First" */
@@ -8561,6 +8562,18 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -9064,6 +9065,18 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
}
if (!res)
res = wait_file2(chan, vms, "vm-message");
@ -41,7 +41,7 @@ index 7c914b8..beda819 100644
/* HEBREW syntax */
} else if (!strncasecmp(ast_channel_language(chan), "he", 2)) {
if (!vms->curmsg) {
@@ -9003,6 +9016,8 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
@@ -9509,6 +9522,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);
@ -50,7 +50,7 @@ index 7c914b8..beda819 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 */
@@ -9164,6 +9179,59 @@ static int vm_intro_multilang(struct ast_channel *chan, struct vm_state *vms, co
@@ -9670,6 +9685,59 @@ static int vm_intro_multilang(struct ast_channel *chan, struct vm_state *vms, co
return res;
}
@ -110,7 +110,7 @@ index 7c914b8..beda819 100644
/* Default Hebrew syntax */
static int vm_intro_he(struct ast_channel *chan, struct vm_state *vms)
{
@@ -10149,6 +10217,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
@@ -10655,6 +10723,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);
@ -119,7 +119,7 @@ index 7c914b8..beda819 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 */
@@ -10745,6 +10815,23 @@ static int vm_browse_messages_gr(struct ast_channel *chan, struct vm_state *vms,
@@ -11252,6 +11322,23 @@ static int vm_browse_messages_gr(struct ast_channel *chan, struct vm_state *vms,
return cmd;
}
@ -143,7 +143,7 @@ index 7c914b8..beda819 100644
/* Hebrew Syntax */
static int vm_browse_messages_he(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
@@ -10983,6 +11070,8 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st
@@ -11490,6 +11577,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);
@ -152,7 +152,7 @@ index 7c914b8..beda819 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 */
@@ -11938,6 +12027,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12860,6 +12949,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");

@ -3,84 +3,282 @@ Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_add_callid
---
apps/app_voicemail.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
apps/app_voicemail.c | 69 +++++++++++++++++++++++++++++-----------------------
1 file changed, 39 insertions(+), 30 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 951a9cc..d61a30e 100644
index 801b682..4ec7b83 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -858,7 +858,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)
-#define STORE(a,b,c,d,e,f,g,h,i,j,k) store_file(a,b,c,d)
+#define STORE(a,b,c,d,e,f,g,h,i,j,k) store_file(a,b,c,d,e)
#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))
@@ -4480,6 +4480,7 @@ struct insert_data {
@@ -993,9 +993,9 @@ static char odbc_table[80] = "voicemessages";
size_t odbc_table_len = sizeof(odbc_table);
#define COUNT(a, b) odbc_count_messages(a,b)
#define LAST_MSG_INDEX(a) odbc_last_message_index(a)
-#define RETRIEVE(a,b,c,d) odbc_retrieve_message(a,b)
+#define RETRIEVE(a,b,c,d,e) odbc_retrieve_message(a,b,e)
#define DISPOSE(a,b) odbc_remove_files(a,b)
-#define STORE(a,b,c,d,e,f,g,h,i,j,k) odbc_store_message(a,b,c,d)
+#define STORE(a,b,c,d,e,f,g,h,i,j,k) odbc_store_message(a,b,c,d,e)
#define EXISTS(a,b,c,d) (odbc_message_exists(a,b))
#define RENAME(a,b,c,d,e,f,g,h) (odbc_rename_message(a,b,c,d,e,f))
#define COPY(a,b,c,d,e,f,g,h) (odbc_copy_message(a,b,c,d,e,f))
@@ -1005,7 +1005,7 @@ size_t odbc_table_len = sizeof(odbc_table);
#ifdef IMAP_STORAGE
#define DISPOSE(a,b) (imap_remove_file(a,b))
#define STORE(a,b,c,d,e,f,g,h,i,j,k) (imap_store_file(a,b,c,d,e,f,g,h,i,j,k))
-#define RETRIEVE(a,b,c,d) imap_retrieve_file(a,b,c,d)
+#define RETRIEVE(a,b,c,d,e) imap_retrieve_file(a,b,c,d)
#define EXISTS(a,b,c,d) (ast_fileexists(c,NULL,d) > 0)
#define RENAME(a,b,c,d,e,f,g,h) (rename_file(g,h));
#define COPY(a,b,c,d,e,f,g,h) (copy_file(g,h));
@@ -1014,7 +1014,7 @@ size_t odbc_table_len = sizeof(odbc_table);
#else
#define COUNT(a, b) count_messages(a,b)
#define LAST_MSG_INDEX(a) last_message_index(a)
-#define RETRIEVE(a,b,c,d)
+#define RETRIEVE(a,b,c,d,e)
#define DISPOSE(a,b)
#define STORE(a,b,c,d,e,f,g,h,i,j,k)
#define EXISTS(a,b,c,d) (ast_fileexists(c,NULL,d) > 0)
@@ -4327,7 +4327,7 @@ static void odbc_update_set_audmagic(char *dir, int msg_num)
SCOPE_EXIT_RTN("Done\n");
}
-static int odbc_store_message(const char *dir, const char *mailboxuser, const char *mailboxcontext, int msgnum);
+static int odbc_store_message(const char *dir, const char *mailboxuser, const char *mailboxcontext, int msgnum, struct ast_channel *chan);
/*!
* \brief Retrieves a file from an ODBC data store.
@@ -4343,7 +4343,7 @@ static int odbc_store_message(const char *dir, const char *mailboxuser, const ch
*
* \return 0 on success, -1 on error.
*/
-static int odbc_retrieve_message(char *dir, int msgnum)
+static int odbc_retrieve_message(char *dir, int msgnum, struct ast_channel *chan)
{
int x = 0;
int res;
@@ -4552,7 +4552,7 @@ bail:
* into the database overwriting the AUDIO_ON_DISK_MAGIC
* magic number.
*/
- SCOPE_CALL(-1, odbc_store_message, dir, mailboxuser, mailboxcontext, msgnum);
+ SCOPE_CALL(-1, odbc_store_message, dir, mailboxuser, mailboxcontext, msgnum, chan);
}
}
@@ -4912,14 +4912,15 @@ struct insert_data {
const char *category;
const char *flag;
const char *msg_id;
+ const char *call_id;
};
static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4508,6 +4509,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);
#define STORE_SQL_FMT_CAT "INSERT INTO %s (dir, msgnum, recording, context, callerid, " \
- "origtime, duration, mailboxuser, mailboxcontext, flag, msg_id, category) " \
- "VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"
+ "origtime, duration, mailboxuser, mailboxcontext, flag, msg_id, callid, category) " \
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"
#define STORE_SQL_FMT "INSERT INTO %s (dir, msgnum, recording, context, callerid, "\
- "origtime, duration, mailboxuser, mailboxcontext, flag, msg_id) "\
- "VALUES (?,?,?,?,?,?,?,?,?,?,?)"
+ "origtime, duration, mailboxuser, mailboxcontext, flag, msg_id, callid) "\
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"
static SQLHSTMT odbc_insert_data_cb(struct odbc_obj *obj, void *vdata)
{
@@ -4965,6 +4966,7 @@ static SQLHSTMT odbc_insert_data_cb(struct odbc_obj *obj, void *vdata)
SQLBindParameter(stmt, 9, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->mailboxcontext), 0, (void *) data->mailboxcontext, 0, NULL);
SQLBindParameter(stmt, 10, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->flag), 0, (void *) data->flag, 0, NULL);
SQLBindParameter(stmt, 11, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->msg_id), 0, (void *) data->msg_id, 0, NULL);
+ SQLBindParameter(stmt, 12, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->call_id), 0, (void *) data->call_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);
+ SQLBindParameter(stmt, 14, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->call_id), 0, (void *) data->call_id, 0, NULL);
+ } else {
+ SQLBindParameter(stmt, 13, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->call_id), 0, (void *) data->call_id, 0, NULL);
}
res = ast_odbc_execute_sql(obj, stmt, data->sql);
if (!SQL_SUCCEEDED(res)) {
@@ -4532,7 +4536,7 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
insert_sql = MAKE_SQL_PTRA(STORE_SQL_FMT_CAT);
SQLBindParameter(stmt, 12, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->category), 0, (void *) data->category, 0, NULL);
@@ -4995,7 +4997,7 @@ static SQLHSTMT odbc_insert_data_cb(struct odbc_obj *obj, void *vdata)
*
* \return the zero on success -1 on error.
*/
-static int store_file(const char *dir, const char *mailboxuser, const char *mailboxcontext, int msgnum)
+static int store_file(const char *dir, const char *mailboxuser, const char *mailboxcontext, int msgnum, struct ast_channel *chan)
-static int odbc_store_message(const char *dir, const char *mailboxuser, const char *mailboxcontext, int msgnum)
+static int odbc_store_message(const char *dir, const char *mailboxuser, const char *mailboxcontext, int msgnum, struct ast_channel *chan)
{
int res = 0;
int fd = -1;
@@ -4547,8 +4551,9 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
@@ -5009,8 +5011,9 @@ static int odbc_store_message(const char *dir, const char *mailboxuser, const ch
char *c;
struct ast_config *cfg = NULL;
struct odbc_obj *obj;
+ const char *call_id;
struct insert_data idata = { .sql = sql, .msgnums = msgnums, .dir = dir, .mailboxuser = mailboxuser, .mailboxcontext = mailboxcontext,
- .context = "", .macrocontext = "", .callerid = "", .origtime = "", .duration = "", .category = "", .flag = "", .msg_id = "" };
+ .context = "", .macrocontext = "", .callerid = "", .origtime = "", .duration = "", .category = "", .flag = "", .msg_id = "", call_id = "" };
struct insert_data idata = { .msgnums = msgnums, .dir = dir, .mailboxuser = mailboxuser, .mailboxcontext = mailboxcontext,
- .context = "", .callerid = "", .origtime = "", .duration = "", .category = "", .flag = "", .msg_id = "" };
+ .context = "", .callerid = "", .origtime = "", .duration = "", .category = "", .flag = "", .msg_id = "", call_id = "" };
struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
SCOPE_ENTER(3, "dir: %s user: %s context: %s msgnum: %d msgtype: %s\n",
dir, mailboxuser, mailboxcontext, msgnum, msgnum < 0 ? "Greeting" : "Message");
@@ -5082,6 +5085,7 @@ static int odbc_store_message(const char *dir, const char *mailboxuser, const ch
}
}
delete_file(dir, msgnum);
@@ -4621,10 +4626,15 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
idata.data = fdm;
idata.datalen = idata.indlen = fdlen;
+
if (fd < 0) {
ast_trace(-1, "Audio stored on disk. Not reading sound file '%s' but setting magic number.\n", full_fn);
idata.data = AUDIO_ON_DISK_MAGIC;
@@ -5104,6 +5108,11 @@ static int odbc_store_message(const char *dir, const char *mailboxuser, const ch
idata.datalen = idata.indlen = fdlen;
}
+ if ((call_id = pbx_builtin_getvar_helper(chan, "IDENTIFIER"))) {
+ if (!ast_strlen_zero(call_id))
+ idata.call_id = ast_strdupa(call_id);
+ }
+
if (!ast_strlen_zero(idata.category))
- snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id,category) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);
+ snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id,category,call_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);
else
- snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);
+ snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id,call_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);
if (ast_strlen_zero(idata.origtime)) {
idata.origtime = "0";
@@ -6857,7 +6867,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
}
@@ -6243,7 +6252,7 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, ch
return -1;
}
- RETRIEVE(fn, -1, ext, context);
+ RETRIEVE(fn, -1, ext, context, chan);
if (ast_fileexists(fn, NULL, NULL) > 0) {
res = ast_stream_and_wait(chan, fn, ecodes);
if (res) {
@@ -7282,7 +7291,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
SCOPE_EXIT_LOG_RTN_VALUE(-1, LOG_WARNING,
"%s: Exten: %s: Failed to make directory (%s)\n", ast_channel_name(chan), ext, tempfile);
}
- SCOPE_CALL(-1, RETRIEVE, tempfile, -1, vmu->mailbox, vmu->context);
+ SCOPE_CALL(-1, RETRIEVE, tempfile, -1, vmu->mailbox, vmu->context, chan);
if (ast_fileexists(tempfile, NULL, NULL) > 0) {
ast_copy_string(prefile, tempfile, sizeof(prefile));
ast_trace(-1, "new prefile: %s\n", prefile);
@@ -7341,9 +7350,9 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
/* Play the beginning intro if desired */
if (!ast_strlen_zero(prefile)) {
#if defined(ODBC_STORAGE)
- int success = SCOPE_CALL_WITH_INT_RESULT(-1, RETRIEVE, prefile, -1, vmu->mailbox, context);
+ int success = SCOPE_CALL_WITH_INT_RESULT(-1, RETRIEVE, prefile, -1, vmu->mailbox, context, chan);
#elif defined(IMAP_STORAGE)
- SCOPE_CALL(-1, RETRIEVE, prefile, -1, vmu->mailbox, context);
+ SCOPE_CALL(-1, RETRIEVE, prefile, -1, vmu->mailbox, context, chan);
#endif
if (ast_fileexists(prefile, NULL, NULL) > 0) {
@@ -7359,7 +7368,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");
- store_file(prefile, vmu->mailbox, vmu->context, -1);
+ store_file(prefile, vmu->mailbox, vmu->context, -1, chan);
ast_trace(-1, "Greeting '%s' not retrieved from database, but found in file storage. Inserting into database\n", prefile);
- SCOPE_CALL(-1, odbc_store_message, prefile, vmu->mailbox, vmu->context, -1);
+ SCOPE_CALL(-1, odbc_store_message, prefile, vmu->mailbox, vmu->context, -1, chan);
}
#endif
} else {
@@ -8713,7 +8722,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
#endif
if (attach_user_voicemail)
- RETRIEVE(todir, msgnum, vmu->mailbox, vmu->context);
+ RETRIEVE(todir, msgnum, vmu->mailbox, vmu->context, chan);
/* XXX possible imap issue, should category be NULL XXX */
sendmail(myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, mbox(vmu, 0), cidnum, cidname, fn, NULL, fmt, duration, attach_user_voicemail, chan, category, flag, msg_id);
@@ -8995,7 +9004,7 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
}
snprintf(filename, sizeof(filename), "%s.txt", vms->fn);
- SCOPE_CALL(-1, RETRIEVE, vms->curdir, vms->curmsg, vmu->mailbox, vmu->context);
+ SCOPE_CALL(-1, RETRIEVE, vms->curdir, vms->curmsg, vmu->mailbox, vmu->context, chan);
msg_cfg = ast_config_load(filename, config_flags);
if (!valid_config(msg_cfg)) {
ast_log(LOG_WARNING, "No message attribute file?!! (%s)\n", filename);
@@ -10599,7 +10608,7 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
/* Notify the user that the temp greeting is set and give them the option to remove it */
snprintf(prefile, sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vmu->mailbox);
if (ast_test_flag(vmu, VM_TEMPGREETWARN)) {
- RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
+ RETRIEVE(prefile, -1, vmu->mailbox, vmu->context, chan);
if (ast_fileexists(prefile, NULL, NULL) > 0) {
ast_play_and_wait(chan, "vm-tempgreetactive");
}
@@ -11078,7 +11087,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
default:
cmd = 0;
snprintf(prefile, sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vmu->mailbox);
- SCOPE_CALL(-1, RETRIEVE, prefile, -1, vmu->mailbox, vmu->context);
+ SCOPE_CALL(-1, RETRIEVE, prefile, -1, vmu->mailbox, vmu->context, chan);
if (ast_fileexists(prefile, NULL, NULL)) {
cmd = ast_play_and_wait(chan, "vm-tmpexists");
}
@@ -11143,7 +11152,7 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
while ((cmd >= 0) && (cmd != 't')) {
if (cmd)
retries = 0;
- RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
+ RETRIEVE(prefile, -1, vmu->mailbox, vmu->context, chan);
if (ast_fileexists(prefile, NULL, NULL) <= 0) {
cmd = play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL, NULL, 0);
if (cmd == -1) {
@@ -11661,7 +11670,7 @@ static int play_message_by_id_helper(struct ast_channel *chan,
wait_file(chan, vms, vms->introfn);
}
#endif
- RETRIEVE(vms->curdir,vms->curmsg,vmu->mailbox, vmu->context);
+ RETRIEVE(vms->curdir,vms->curmsg,vmu->mailbox, vmu->context, chan);
if ((wait_file(chan, vms, vms->fn)) < 0) {
ast_log(AST_LOG_WARNING, "Playback of message %s failed\n", vms->fn);
@@ -15276,7 +15285,7 @@ static int sayname(struct ast_channel *chan, const char *mailbox, const char *co
char dir[PATH_MAX];
snprintf(dir, sizeof(dir), "%s%s/%s/greet", VM_SPOOL_DIR, context, mailbox);
ast_debug(2, "About to try retrieving name file %s\n", dir);
- RETRIEVE(dir, -1, mailbox, context);
+ RETRIEVE(dir, -1, mailbox, context, chan);
if (ast_fileexists(dir, NULL, NULL)) {
res = ast_stream_and_wait(chan, dir, AST_DIGIT_ANY);
}
@@ -16248,7 +16257,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
/* Retrieve info from VM attribute file */
snprintf(filename, sizeof(filename), "%s.txt", vms->fn);
- RETRIEVE(vms->curdir, vms->curmsg, vmu->mailbox, vmu->context);
+ RETRIEVE(vms->curdir, vms->curmsg, vmu->mailbox, vmu->context, chan);
msg_cfg = ast_config_load(filename, config_flags);
DISPOSE(vms->curdir, vms->curmsg);
if (!valid_config(msg_cfg)) {
@@ -16777,7 +16786,7 @@ static int vm_msg_snapshot_create(struct ast_vm_user *vmu,
/* Find the msg */
make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg);
snprintf(filename, sizeof(filename), "%s.txt", vms->fn);
- RETRIEVE(vms->curdir, vms->curmsg, vmu->mailbox, vmu->context);
+ RETRIEVE(vms->curdir, vms->curmsg, vmu->mailbox, vmu->context, NULL);
msg_cfg = ast_config_load(filename, config_flags);
if (!msg_cfg || msg_cfg == CONFIG_STATUS_FILEINVALID) {
DISPOSE(vms->curdir, vms->curmsg);
@@ -17038,7 +17047,7 @@ static int message_range_and_existence_check(struct vm_state *vms, const char *m
make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg);
snprintf(filename, sizeof(filename), "%s.txt", vms->fn);
- RETRIEVE(vms->curdir, vms->curmsg, vmu->mailbox, vmu->context);
+ RETRIEVE(vms->curdir, vms->curmsg, vmu->mailbox, vmu->context, NULL);
msg_cfg = ast_config_load(filename, config_flags);
if (!msg_cfg || msg_cfg == CONFIG_STATUS_FILEINVALID) {
DISPOSE(vms->curdir, vms->curmsg);
@@ -17177,7 +17186,7 @@ static int vm_msg_forward(const char *from_mailbox,
make_file(from_vms.fn, sizeof(from_vms.fn), from_vms.curdir, cur_msg);
snprintf(filename, sizeof(filename), "%s.txt", from_vms.fn);
- RETRIEVE(from_vms.curdir, cur_msg, vmu->mailbox, vmu->context);
+ RETRIEVE(from_vms.curdir, cur_msg, vmu->mailbox, vmu->context, NULL);
msg_cfg = ast_config_load(filename, config_flags);
/* XXX This likely will not fail since we previously ensured that the
* message we are looking for exists. However, there still could be some
@@ -17489,7 +17498,7 @@ static int vm_msg_play(struct ast_channel *chan,
/* Find the msg */
make_file(vms.fn, sizeof(vms.fn), vms.curdir, vms.curmsg);
snprintf(filename, sizeof(filename), "%s.txt", vms.fn);
- RETRIEVE(vms.curdir, vms.curmsg, vmu->mailbox, vmu->context);
+ RETRIEVE(vms.curdir, vms.curmsg, vmu->mailbox, vmu->context, chan);
msg_cfg = ast_config_load(filename, config_flags);
if (!msg_cfg || msg_cfg == CONFIG_STATUS_FILEINVALID) {

@ -33,7 +33,7 @@ index 9ee80e1..69eccd0 100644
all: _all
@echo " +-------- app_voicemail Build Complete --------+"
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index d863f12..7833ae1 100644
index 7667ae1..e9d5ec3 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -112,6 +112,9 @@
@ -46,7 +46,7 @@ index d863f12..7833ae1 100644
/*** DOCUMENTATION
<application name="VoiceMail" language="en_US">
<synopsis>
@@ -942,6 +945,8 @@ static int maxlogins = 3;
@@ -1081,6 +1084,8 @@ static int maxlogins = 3;
static int minpassword = MINPASSWORD;
static int passwordlocation;
static char aliasescontext[MAX_VM_CONTEXT_LEN];
@ -55,7 +55,7 @@ index d863f12..7833ae1 100644
/*! Poll mailboxes for changes since there is something external to
* app_voicemail that may change them. */
@@ -1177,6 +1182,134 @@ static int inprocess_count(const char *context, const char *mailbox, int delta)
@@ -1317,6 +1322,134 @@ 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
@ -190,7 +190,7 @@ index d863f12..7833ae1 100644
/*!
* \brief Strips control and non 7-bit clean characters from input string.
*
@@ -10797,6 +10930,10 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
@@ -11317,6 +11450,10 @@ 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;
@ -201,7 +201,7 @@ index d863f12..7833ae1 100644
/* If ADSI is supported, setup login screen */
adsi_begin(chan, &useadsi);
@@ -10807,6 +10944,17 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
@@ -11327,6 +11464,17 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
return -1;
}
@ -219,7 +219,7 @@ index d863f12..7833ae1 100644
/* Authenticate them and get their mailbox/password */
while (!valid && (logretries < max_logins)) {
@@ -10836,6 +10984,18 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
@@ -11356,6 +11504,18 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
if (useadsi)
adsi_password(chan);
@ -238,7 +238,7 @@ index d863f12..7833ae1 100644
if (!ast_strlen_zero(prefix)) {
char fullusername[80];
@@ -13171,6 +13331,8 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -14349,6 +14509,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;
@ -247,9 +247,9 @@ index d863f12..7833ae1 100644
#ifdef IMAP_STORAGE
ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder));
@@ -13235,6 +13397,19 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
ast_copy_string(odbc_table, val, sizeof(odbc_table));
}
@@ -14421,6 +14583,19 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
ast_set2_flag((&globalflags), ast_true(val), VM_ODBC_AUDIO_ON_DISK);
#endif
+
+ /* sipwise sw_normalize_user_match/replace */

@ -7,10 +7,10 @@ Subject: sipwise_vm_app_playback_timezone
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/apps/app_playback.c b/apps/app_playback.c
index b9caab5..e7ad660 100644
index 613e8c8..0a73b39 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -237,6 +237,15 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
@@ -244,6 +244,15 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
}
AST_LIST_INSERT_HEAD(&head, n, entries);
@ -26,7 +26,7 @@ index b9caab5..e7ad660 100644
/* scan the body, one piece at a time */
while ( !ret && (x = strsep(&rule, ",")) ) { /* exit on key */
char fn[128];
@@ -250,6 +259,15 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
@@ -257,6 +266,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);
@ -42,7 +42,7 @@ index b9caab5..e7ad660 100644
/* locate prefix and data, if any */
fmt = strchr(fn, ':');
if (!fmt || fmt == fn) { /* regular filename */
@@ -333,10 +351,34 @@ static int say_date_generic(struct ast_channel *chan, time_t t,
@@ -340,10 +358,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 };
@ -77,7 +77,7 @@ index b9caab5..e7ad660 100644
snprintf(buf, sizeof(buf), "%s:%s:%04d%02d%02d%02d%02d.%02d-%d-%3d",
prefix,
format,
@@ -348,7 +390,7 @@ static int say_date_generic(struct ast_channel *chan, time_t t,
@@ -355,7 +397,7 @@ static int say_date_generic(struct ast_channel *chan, time_t t,
tm.tm_sec,
tm.tm_wday,
tm.tm_yday);

@ -7,10 +7,10 @@ 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 d61a30e..beaff3a 100644
index 4ec7b83..e5bdf95 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1772,7 +1772,7 @@ static int is_valid_dtmf(const char *key)
@@ -2044,7 +2044,7 @@ static int is_valid_dtmf(const char *key)
*
* \return The ast_vm_user structure for the user that was found.
*/
@ -19,7 +19,7 @@ index d61a30e..beaff3a 100644
{
struct ast_variable *var;
struct ast_vm_user *retval;
@@ -1789,9 +1789,15 @@ static struct ast_vm_user *find_user_realtime(struct ast_vm_user *ivm, const cha
@@ -2061,9 +2061,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)) {
@ -37,7 +37,7 @@ index d61a30e..beaff3a 100644
}
if (var) {
// ast_log (LOG_DEBUG,"call apply_options_full\n");
@@ -1855,7 +1861,7 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
@@ -2127,7 +2133,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
@ -46,7 +46,7 @@ index d61a30e..beaff3a 100644
#endif
}
if (!vmu && !ast_strlen_zero(aliasescontext)) {
@@ -4153,6 +4159,7 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
@@ -4574,6 +4580,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;
@ -54,7 +54,7 @@ index d61a30e..beaff3a 100644
SQLHSTMT stmt = NULL;
obj = ast_odbc_request_obj(odbc_database, 0);
@@ -4171,6 +4178,8 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
@@ -4592,6 +4599,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 d61a30e..beaff3a 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);
@@ -4197,7 +4206,11 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
@@ -4618,7 +4627,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);

@ -7,10 +7,10 @@ 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 a73b16e..3142c99 100644
index fe73841..fcb96d7 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1639,7 +1639,7 @@ static int change_password_realtime(struct ast_vm_user *vmu, const char *passwor
@@ -1911,7 +1911,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);
}

@ -9,10 +9,10 @@ and currently ignored per user
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 5070326..14c3922 100644
index 77d81df..8dcbc73 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1455,8 +1455,6 @@ static void apply_option(struct ast_vm_user *vmu, const char *var, const char *v
@@ -1727,8 +1727,6 @@ 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);
@ -21,8 +21,8 @@ index 5070326..14c3922 100644
} else if (!strcasecmp(var, "moveheard")){
ast_set2_flag(vmu, ast_true(value), VM_MOVEHEARD);
} else if (!strcasecmp(var, "sayduration")){
@@ -15011,7 +15009,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
context = ast_variable_retrieve(msg_cfg, "message", "macrocontext");
@@ -16216,7 +16214,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
context = ast_variable_retrieve(msg_cfg, "message", "context");
switch (option) {
case 3: /* Play message envelope */
- if (!res) {

@ -7,10 +7,10 @@ Subject: sipwise_vm_ext_timezone
1 file changed, 67 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index f26bbfa..951a9cc 100644
index 72aa606..801b682 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -948,6 +948,8 @@ static int passwordlocation;
@@ -1087,6 +1087,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];
@ -19,7 +19,7 @@ index f26bbfa..951a9cc 100644
/*! Poll mailboxes for changes since there is something external to
* app_voicemail that may change them. */
@@ -1092,6 +1094,7 @@ static int vm_msg_remove(const char *mailbox, const char *context, size_t num_ms
@@ -1232,6 +1234,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);
@ -27,7 +27,7 @@ index f26bbfa..951a9cc 100644
#ifdef TEST_FRAMEWORK
static int vm_test_destroy_user(const char *context, const char *mailbox);
@@ -1707,6 +1710,8 @@ static void apply_options_full(struct ast_vm_user *retval, struct ast_variable *
@@ -1979,6 +1982,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);
@ -36,7 +36,7 @@ index f26bbfa..951a9cc 100644
#ifdef IMAP_STORAGE
} else if (!strcasecmp(var->name, "imapuser")) {
ast_copy_string(retval->imapuser, var->value, sizeof(retval->imapuser));
@@ -8076,6 +8081,58 @@ static struct vm_zone * get_vmu_timezone(struct ast_vm_user *vmu)
@@ -8587,6 +8592,58 @@ static struct vm_zone * get_vmu_timezone(struct ast_vm_user *vmu)
return tz;
}
@ -95,7 +95,7 @@ index f26bbfa..951a9cc 100644
/*!
* \brief Sends email notification that a user has a new voicemail waiting for them.
* \param chan
@@ -13324,6 +13381,9 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -14499,6 +14556,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 f26bbfa..951a9cc 100644
#ifdef IMAP_STORAGE
ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder));
@@ -13401,6 +13461,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -14584,6 +14644,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_find_user_by_alias
1 file changed, 71 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 446bb5d..d863f12 100644
index 1ea9580..7667ae1 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1036,6 +1036,9 @@ static char emaildateformat[32] = "%A, %B %d, %Y at %r";
@@ -1175,6 +1175,9 @@ static char emaildateformat[32] = "%A, %B %d, %Y at %r";
static char pagerdateformat[32] = "%A, %B %d, %Y at %r";
/* Forward declarations - generic */
@ -20,7 +20,7 @@ index 446bb5d..d863f12 100644
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);
@@ -1709,7 +1712,12 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
@@ -1981,7 +1984,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);
@ -33,8 +33,8 @@ index 446bb5d..d863f12 100644
}
if (!vmu && !ast_strlen_zero(aliasescontext)) {
struct alias_mailbox_mapping *mapping;
@@ -3991,6 +3999,69 @@ bail:
return x - 1;
@@ -4412,6 +4420,69 @@ bail:
SCOPE_EXIT_RTN_VALUE(x - 1, "Done. msg_id: %s RC: %d\n", msg_id, x - 1);
}
+#ifdef ODBC_STORAGE
@ -102,4 +102,4 @@ index 446bb5d..d863f12 100644
+
/*!
* \brief Determines the highest message number in use for a given user and mailbox folder.
* \param vmu
* \param dir the folder the mailbox folder to look for messages. Used to construct the SQL where clause.

@ -7,10 +7,10 @@ Subject: sipwise_vm_fix_chan_usage
1 file changed, 2 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index a303308..0e7fb6a 100644
index 193c9d3..5fdf7f0 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -14631,7 +14631,9 @@ AST_TEST_DEFINE(test_voicemail_msgcount)
@@ -15848,7 +15848,9 @@ AST_TEST_DEFINE(test_voicemail_msgcount)
break;
}
open_mailbox(&vms, vmu, folder2mbox[i]);

@ -7,10 +7,10 @@ Subject: sipwise_vm_fix_double_menu
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index dbf21ca..33ac414 100644
index 080d378..a6cbec3 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -12236,16 +12236,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -13154,16 +13154,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
if (!cmd)
cmd = vm_instructions(chan, vmu, &vms, 1, in_urgent, nodelete);
break;

@ -7,10 +7,10 @@ Subject: sipwise_vm_fix_envelope_play
1 file changed, 2 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 0e7fb6a..9105e1a 100644
index 5fdf7f0..425f599 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11809,6 +11809,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12743,6 +12743,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
break;
case '3': /* Envelope */
if (vms.lastmsg > -1 && !vms.starting) {
@ -18,7 +18,7 @@ index 0e7fb6a..9105e1a 100644
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 3, record_gain);
if (cmd == ERROR_LOCK_PATH) {
res = cmd;
@@ -11850,6 +11851,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12787,6 +12788,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
break;
default:

@ -7,11 +7,11 @@ Subject: sipwise_vm_fix_odbc_retreive_file
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 8cc4c93..a303308 100644
index 138645b..193c9d3 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -3949,7 +3949,9 @@ static int retrieve_file(char *dir, int msgnum)
ast_debug(3, "Ignoring null category column in ODBC voicemail retrieve_file.\n");
@@ -4350,7 +4350,9 @@ static int odbc_retrieve_message(char *dir, int msgnum)
ast_trace(-1, "Ignoring null category column in ODBC voicemail retrieve_file.\n");
continue;
} else if (!SQL_SUCCEEDED(res)) {
- ast_log(AST_LOG_WARNING, "SQL Get Data error! coltitle=%s\n[%s]\n\n", coltitle, sql);
@ -21,7 +21,7 @@ index 8cc4c93..a303308 100644
goto bail_with_handle;
}
if (strcasecmp(coltitle, "msgnum") && strcasecmp(coltitle, "dir")) {
@@ -8893,7 +8895,9 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -9421,7 +9423,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,11 +7,11 @@ Subject: sipwise_vm_fix_prev_message
1 file changed, 1 insertion(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index beda819..8f4f3af 100644
index da26b2b..6823da2 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11426,6 +11426,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
#endif
@@ -12313,6 +12313,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
SCOPE_ENTER(3, "%s:\n", ast_channel_name(chan));
/* Add the vm_state to the active list and keep it active */
+ vms.curmsg = -1;

@ -7,10 +7,10 @@ Subject: sipwise_vm_hebrew_language_fixups
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index fe13968..7c914b8 100644
index 21341bc..bf46d37 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -8510,10 +8510,15 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -9013,10 +9013,15 @@ 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 3142c99..5070326 100644
index fcb96d7..77d81df 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -8318,7 +8318,7 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
@@ -8832,7 +8832,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 7833ae1..a73b16e 100644
index e9d5ec3..fe73841 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11250,6 +11250,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12149,6 +12149,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 7833ae1..a73b16e 100644
int in_urgent = 0;
int nodelete = 0;
#ifdef IMAP_STORAGE
@@ -11519,6 +11520,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12431,6 +12432,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 7833ae1..a73b16e 100644
ast_test_suite_event_notify("CHANGEFOLDER", "Message: browsing to a different folder");
if (useadsi)
adsi_folders(chan, 0, "Change to folder...");
@@ -11852,6 +11854,16 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12787,6 +12789,16 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
vms.starting = 1;
break;
default: /* Nothing */

@ -7,10 +7,10 @@ Subject: sipwise_vm_pointers_malloc
1 file changed, 2 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index c365407..fe13968 100644
index d12f57d..21341bc 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11333,6 +11333,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12220,6 +12220,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,10 +7,10 @@ Subject: sipwise_vm_romanian_syntax
1 file changed, 85 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index c6ad060..446bb5d 100644
index a03fe25..1ea9580 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -667,6 +667,7 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -801,6 +801,7 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
\arg \b es - Spanish
\arg \b fr - French
\arg \b it - Italian
@ -18,7 +18,7 @@ index c6ad060..446bb5d 100644
\arg \b nl - Dutch
\arg \b pt - Portuguese
\arg \b pt_BR - Portuguese (Brazil)
@@ -5631,6 +5632,17 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, ch
@@ -6123,6 +6124,17 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, ch
} else {
/* Dispose just in case */
DISPOSE(fn, -1);
@ -36,7 +36,7 @@ index c6ad060..446bb5d 100644
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);
@@ -8053,6 +8065,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8567,6 +8579,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' Q 'digits/at' HM", NULL);
} else if (!strncasecmp(ast_channel_language(chan), "it", 2)) { /* ITALIAN syntax */
res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' q 'digits/at' 'digits/hours' k 'digits/e' M 'digits/minutes'", NULL);
@ -45,7 +45,7 @@ index c6ad060..446bb5d 100644
} 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 */
@@ -8699,8 +8713,9 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
@@ -9218,8 +9232,9 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
int cmd;
if ( !strncasecmp(ast_channel_language(chan), "it", 2) ||
@ -56,7 +56,7 @@ index c6ad060..446bb5d 100644
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)) {
@@ -8972,6 +8987,52 @@ static int vm_intro_ja(struct ast_channel *chan,struct vm_state *vms)
@@ -9491,6 +9506,52 @@ static int vm_intro_ja(struct ast_channel *chan,struct vm_state *vms)
return res;
} /* Japanese */
@ -109,7 +109,7 @@ index c6ad060..446bb5d 100644
/* Default English syntax */
static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
{
@@ -9811,6 +9872,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
@@ -10330,6 +10391,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
return vm_intro_is(chan, vms);
} else if (!strncasecmp(ast_channel_language(chan), "it", 2)) { /* ITALIAN syntax */
return vm_intro_it(chan, vms);
@ -118,7 +118,7 @@ index c6ad060..446bb5d 100644
} 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 */
@@ -10497,6 +10560,25 @@ static int vm_browse_messages_ja(struct ast_channel *chan, struct vm_state *vms,
@@ -11017,6 +11080,25 @@ static int vm_browse_messages_ja(struct ast_channel *chan, struct vm_state *vms,
return cmd;
}
@ -144,7 +144,7 @@ index c6ad060..446bb5d 100644
/*!
* \brief Spanish syntax for 'You have N messages' greeting.
* \param chan
@@ -10622,6 +10704,8 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st
@@ -11142,6 +11224,8 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st
return vm_browse_messages_he(chan, vms, vmu);
} else if (!strncasecmp(ast_channel_language(chan), "it", 2)) { /* ITALIAN */
return vm_browse_messages_it(chan, vms, vmu);

@ -3,14 +3,14 @@ Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_sms_notify
---
apps/app_voicemail.c | 173 ++++++++++++++-------------------------------------
1 file changed, 48 insertions(+), 125 deletions(-)
apps/app_voicemail.c | 176 ++++++++++++++-------------------------------------
1 file changed, 48 insertions(+), 128 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 14c3922..33dc99c 100644
index 8dcbc73..e3182eb 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -934,6 +934,7 @@ static int silencethreshold = 128;
@@ -1073,6 +1073,7 @@ static int silencethreshold = 128;
static char serveremail[80] = ASTERISK_USERNAME;
static char mailcmd[160] = SENDMAIL; /* Configurable mail cmd */
static char externnotify[160];
@ -18,8 +18,8 @@ index 14c3922..33dc99c 100644
static struct ast_smdi_interface *smdi_iface = NULL;
static char vmfmts[80] = "wav";
static double volgain;
@@ -4969,6 +4970,15 @@ static int vm_delete(char *file)
return ast_filedelete(file, NULL);
@@ -5458,6 +5459,15 @@ static int vm_delete(char *file)
SCOPE_EXIT_RTN_VALUE(res, "Done. RC: %d\n", res);
}
+static void prep_pager_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, char *cidnum, char *dur, char *date)
@ -34,7 +34,7 @@ index 14c3922..33dc99c 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];
@@ -5646,150 +5656,56 @@ static int sendmail(char *srcemail,
@@ -6135,153 +6145,56 @@ static int sendmail(char *srcemail,
return 0;
}
@ -54,14 +54,14 @@ index 14c3922..33dc99c 100644
struct ast_tm tm;
- FILE *p;
- struct ast_str *str1 = ast_str_create(16), *str2 = ast_str_create(16);
+ struct ast_str *str1 = ast_str_create(16);
-
- if (!str1 || !str2) {
- ast_free(str1);
- ast_free(str2);
- return -1;
- }
-
+ struct ast_str *str1 = ast_str_create(16);
- if (cidnum) {
- strip_control_and_high(cidnum, enc_cidnum, sizeof(enc_cidnum));
- }
@ -179,12 +179,15 @@ index 14c3922..33dc99c 100644
}
- } else {
- if (ast_strlen_zero(flag)) {
- fprintf(p, "Subject: New VM\n\n");
- fprintf(p, "Subject: New VM" ENDL);
- } else {
- fprintf(p, "Subject: New %s VM\n\n", flag);
- fprintf(p, "Subject: New %s VM" ENDL, flag);
- }
- }
- /* End of headers */
- fputs(ENDL, p);
-
- if (pagerbody) {
- struct ast_channel *ast;
- if ((ast = ast_dummy_channel_alloc())) {
@ -215,7 +218,7 @@ index 14c3922..33dc99c 100644
}
/*!
@@ -8163,7 +8079,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8677,7 +8590,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
}
if (!ast_strlen_zero(vmu->pager)) {
@ -224,7 +227,7 @@ index 14c3922..33dc99c 100644
}
if (ast_test_flag(vmu, VM_DELETE))
@@ -13590,6 +13506,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -14776,6 +14689,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
externnotify[0] = '\0';
}

@ -3,45 +3,31 @@ Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_store_message_add_diag_info
---
apps/app_voicemail.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
apps/app_voicemail.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index beaff3a..c365407 100644
index e5bdf95..d12f57d 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4502,6 +4502,10 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4942,6 +4942,9 @@ static SQLHSTMT odbc_insert_data_cb(struct odbc_obj *obj, void *vdata)
char *delete_sql;
int res;
SQLHSTMT stmt;
+ SQLSMALLINT msg_len = 0;
+ SQLCHAR sql_state[6], message[256];
+ SQLINTEGER native_error = 0;
+
res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
if (!SQL_SUCCEEDED(res)) {
ast_log(AST_LOG_WARNING, "SQL Alloc Handle failed!\n");
@@ -4528,7 +4532,8 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
SCOPE_ENTER(3, "dir: %s msgnums: %s msg_id: %s\n", data->dir, data->msgnums,
data->msg_id);
@@ -4988,8 +4991,8 @@ static SQLHSTMT odbc_insert_data_cb(struct odbc_obj *obj, void *vdata)
}
res = ast_odbc_execute_sql(obj, stmt, data->sql);
res = ast_odbc_execute_sql(obj, stmt, insert_sql);
if (!SQL_SUCCEEDED(res)) {
- ast_log(AST_LOG_WARNING, "SQL Direct Execute failed!\n");
- ast_log(AST_LOG_WARNING, "SQL Execute error!\n[%s]\n", insert_sql);
- ast_odbc_print_errors(SQL_HANDLE_STMT, stmt, "SQL Execute");
+ res = SQLGetDiagRec(SQL_HANDLE_STMT, stmt, 1, sql_state, &native_error, message, sizeof(message), &msg_len);
+ ast_log(AST_LOG_WARNING, "SQL Direct Execute failed: code: %d msg: %s!\n", (int)native_error, message);
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
return NULL;
stmt = NULL;
}
@@ -4661,6 +4666,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);
+ /*
+ if (!ast_strlen_zero(idata.category)) {
+ ast_log(AST_LOG_WARNING, "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id,category) VALUES (%s,%s,<recording>,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", odbc_table, idata.dir, idata.msgnums, idata.context, idata.macrocontext, idata.callerid, idata.origtime, idata.duration, idata.mailboxuser, idata.mailboxcontext, idata.flag, idata.msg_id, idata.category);
+ } else {
+ ast_log(AST_LOG_WARNING, "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (%s,%s,<recording>,%s,%s,%s,%s,%s,%s,%s,%s,%s)", odbc_table, idata.dir, idata.msgnums, idata.context, idata.macrocontext, idata.callerid, idata.origtime, idata.duration, idata.mailboxuser, idata.mailboxcontext, idata.flag, idata.msg_id);
+ }
+ */
res = -1;
}
} while (0);

@ -3,14 +3,14 @@ Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_uuid_mailbox
---
apps/app_voicemail.c | 756 +++++----------------------------------------------
1 file changed, 61 insertions(+), 695 deletions(-)
apps/app_voicemail.c | 783 ++++-----------------------------------------------
1 file changed, 62 insertions(+), 721 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 9105e1a..c6ad060 100644
index 425f599..a03fe25 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -760,7 +760,8 @@ and vm-Old are spelled plural, to make them sound more as folder name than an ad
@@ -894,7 +894,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 */
@ -20,7 +20,7 @@ index 9105e1a..c6ad060 100644
char password[80]; /*!< Secret pin code, numbers only */
char fullname[80]; /*!< Full name, for directory app */
char *email; /*!< E-mail address */
@@ -1562,6 +1563,12 @@ static void apply_options_full(struct ast_vm_user *retval, struct ast_variable *
@@ -1834,6 +1835,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));
@ -33,7 +33,7 @@ index 9105e1a..c6ad060 100644
#ifdef IMAP_STORAGE
} else if (!strcasecmp(var->name, "imapuser")) {
ast_copy_string(retval->imapuser, var->value, sizeof(retval->imapuser));
@@ -1644,6 +1651,7 @@ static struct ast_vm_user *find_user_realtime(struct ast_vm_user *ivm, const cha
@@ -1916,6 +1923,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) {
@ -41,7 +41,7 @@ index 9105e1a..c6ad060 100644
apply_options_full(retval, var);
ast_variables_destroy(var);
} else {
@@ -1699,6 +1707,7 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
@@ -1971,6 +1979,7 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
}
AST_LIST_UNLOCK(&users);
if (!vmu) {
@ -49,7 +49,7 @@ index 9105e1a..c6ad060 100644
vmu = find_user_realtime(ivm, context, mailbox);
}
if (!vmu && !ast_strlen_zero(aliasescontext)) {
@@ -3048,7 +3057,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
@@ -3336,7 +3345,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
return -1;
}
@ -58,7 +58,7 @@ index 9105e1a..c6ad060 100644
/* Check Quota */
if (box == 0) {
@@ -4774,7 +4783,8 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
@@ -5263,7 +5272,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);
@ -68,7 +68,7 @@ index 9105e1a..c6ad060 100644
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"));
@@ -5598,7 +5608,7 @@ static int get_date(char *s, int len)
@@ -6090,7 +6100,7 @@ static int get_date(char *s, int len)
return ast_strftime(s, len, "%a %b %e %r UTC %Y", &tm);
}
@ -77,7 +77,7 @@ index 9105e1a..c6ad060 100644
{
int res;
char fn[PATH_MAX];
@@ -5621,12 +5631,11 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, in
@@ -6113,12 +6123,11 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, in
} else {
/* Dispose just in case */
DISPOSE(fn, -1);
@ -94,15 +94,15 @@ index 9105e1a..c6ad060 100644
}
res = ast_stream_and_wait(chan, busy ? "vm-isonphone" : "vm-isunavail", ecodes);
return res;
@@ -5670,6 +5679,7 @@ static int count_messages_in_folder(struct odbc_obj *odbc, const char *context,
@@ -6161,6 +6170,7 @@ static int count_messages_in_folder(struct odbc_obj *odbc, const char *context,
}
*messages = atoi(rowdata);
+ ast_log(LOG_DEBUG, "inboxcount/%s: %d\n", context, *messages);
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
return 0;
@@ -6096,10 +6106,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
SCOPE_EXIT_RTN_VALUE(0, "messages: %d\n", *messages);
@@ -6609,10 +6619,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
return res;
}
@ -115,7 +115,7 @@ index 9105e1a..c6ad060 100644
int newvoicemails = 0, oldvoicemails = 0, urgentvoicemails = 0;
struct ast_smdi_mwi_message *mwi_msg;
@@ -6108,6 +6119,9 @@ static void run_externnotify(const char *context, const char *extension, const c
@@ -6621,6 +6632,9 @@ static void run_externnotify(const char *context, const char *extension, const c
else
ast_copy_string(ext_context, extension, sizeof(ext_context));
@ -125,7 +125,7 @@ index 9105e1a..c6ad060 100644
if (smdi_iface) {
if (ast_app_has_voicemail(ext_context, NULL))
ast_smdi_mwi_set(smdi_iface, extension);
@@ -6128,12 +6142,15 @@ static void run_externnotify(const char *context, const char *extension, const c
@@ -6641,12 +6655,15 @@ static void run_externnotify(const char *context, const char *extension, const c
}
if (!ast_strlen_zero(externnotify)) {
@ -142,7 +142,7 @@ index 9105e1a..c6ad060 100644
oldvoicemails, urgentvoicemails);
ast_debug(1, "Executing %s\n", arguments);
ast_safe_system(arguments);
@@ -6577,7 +6594,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -7085,7 +7102,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
/* Setup pre-file if appropriate */
if (strcmp(vmu->context, "default"))
@ -151,7 +151,7 @@ index 9105e1a..c6ad060 100644
else
ast_copy_string(ext_context, vmu->mailbox, sizeof(ext_context));
@@ -6587,16 +6604,16 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -7095,18 +7112,18 @@ 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)) {
@ -161,19 +161,21 @@ index 9105e1a..c6ad060 100644
- snprintf(prefile, sizeof(prefile), "%s%s/%s/unavail", VM_SPOOL_DIR, vmu->context, ext);
+ snprintf(prefile, sizeof(prefile), "%s%s/%s/unavail", VM_SPOOL_DIR, vmu->context, vmu->mailbox);
}
ast_trace(-1, "prefile: %s\n", prefile);
/* Set the path to the tmpfile as
VM_SPOOL_DIR/context/ext/temp
and attempt to create the folder structure.
*/
- snprintf(tempfile, sizeof(tempfile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, ext);
- if ((res = create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, ext, "tmp"))) {
+ snprintf(tempfile, sizeof(tempfile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vmu->mailbox);
ast_trace(-1, "tempfile: %s\n", tempfile);
- if ((res = create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, ext, "tmp"))) {
+ if ((res = create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, vmu->mailbox, "tmp"))) {
ast_log(AST_LOG_WARNING, "Failed to make directory (%s)\n", tempfile);
free_user(vmu);
ast_free(tmp);
@@ -6609,7 +6626,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
DISPOSE(tempfile, -1);
SCOPE_EXIT_LOG_RTN_VALUE(-1, LOG_WARNING,
@@ -7122,7 +7139,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
/* It's easier just to try to make it than to check for its existence */
#ifndef IMAP_STORAGE
- create_dirpath(dir, sizeof(dir), vmu->context, ext, "INBOX");
@ -181,25 +183,28 @@ index 9105e1a..c6ad060 100644
#else
snprintf(dir, sizeof(dir), "%simap", VM_SPOOL_DIR);
if (mkdir(dir, VOICEMAIL_DIR_MODE) && errno != EEXIST) {
@@ -6670,7 +6687,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
#ifdef ODBC_STORAGE
int success =
@@ -7171,9 +7188,9 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
/* Play the beginning intro if desired */
if (!ast_strlen_zero(prefile)) {
#if defined(ODBC_STORAGE)
- int success = SCOPE_CALL_WITH_INT_RESULT(-1, RETRIEVE, prefile, -1, ext, context);
+ int success = SCOPE_CALL_WITH_INT_RESULT(-1, RETRIEVE, prefile, -1, vmu->mailbox, context);
#elif defined(IMAP_STORAGE)
- SCOPE_CALL(-1, RETRIEVE, prefile, -1, ext, context);
+ SCOPE_CALL(-1, RETRIEVE, prefile, -1, vmu->mailbox, context);
#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) {
/* We know we have a greeting at this point, so squelch the instructions
@@ -6689,7 +6706,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -7194,7 +7211,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);
ast_trace(-1, "%s doesn't exist, doing what we can\n", prefile);
- res = invent_message(chan, vmu->context, ext, ast_test_flag(options, OPT_BUSY_GREETING), ecodes);
+ res = invent_message(chan, vmu->context, vmu->mailbox, vmu->dialed_num, ast_test_flag(options, OPT_BUSY_GREETING), ecodes);
}
DISPOSE(prefile, -1);
SCOPE_CALL(-1, DISPOSE, prefile, -1);
if (res < 0) {
@@ -6792,7 +6809,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -7292,7 +7309,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
ast_free(tmp);
return -1;
}
@ -208,25 +213,25 @@ index 9105e1a..c6ad060 100644
/* 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.
@@ -6860,7 +6877,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -7361,7 +7378,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",
- "origmailbox", ext,
+ "origmailbox", vmu->mailbox,
"context", ast_channel_context(chan),
"macrocontext", ast_channel_macrocontext(chan),
"exten", ast_channel_exten(chan),
@@ -6900,7 +6917,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
"priority", priority,
@@ -7399,7 +7416,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
"origtime=%ld\n"
"category=%s\n"
"msg_id=%s\n",
- ext,
+ vmu->mailbox,
ast_channel_context(chan),
ast_channel_macrocontext(chan),
ast_channel_exten(chan),
@@ -6928,7 +6945,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
S_COR(ast_channel_redirecting(chan)->from.number.valid,
@@ -7428,7 +7445,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")) {
@ -235,7 +240,7 @@ index 9105e1a..c6ad060 100644
}
if (txt) {
@@ -7160,7 +7177,7 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg
@@ -7665,7 +7682,7 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg
return res;
#else
char *dir = vms->curdir;
@ -244,7 +249,7 @@ index 9105e1a..c6ad060 100644
char *context = vmu->context;
char sfn[PATH_MAX];
char dfn[PATH_MAX];
@@ -7824,186 +7841,6 @@ static int get_folder2(struct ast_channel *chan, char *fn, int start)
@@ -8338,197 +8355,6 @@ static int get_folder2(struct ast_channel *chan, char *fn, int start)
return res;
}
@ -266,8 +271,9 @@ index 9105e1a..c6ad060 100644
- * This is invoked from forward_message() when performing a forward operation (option 8 from main menu).
- * \return zero on success, -1 on error.
- */
-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)
-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)
-{
- int cmd = 0;
- int retries = 0, prepend_duration = 0, already_recorded = 0;
@ -281,9 +287,11 @@ index 9105e1a..c6ad060 100644
- const char *msg_id = NULL;
-#endif
- const char *duration_str;
- SCOPE_ENTER(3, "mbox: %s msgnum: %d curdir: %s", vmu->mailbox, curmsg, curdir);
-
- /* Must always populate duration correctly */
- make_file(msgfile, sizeof(msgfile), curdir, curmsg);
- ast_trace(-1, "msgfile: %s\n", msgfile);
- strcpy(textfile, msgfile);
- strcpy(backup, msgfile);
- strcpy(backup_textfile, msgfile);
@ -320,8 +328,11 @@ index 9105e1a..c6ad060 100644
-#else
-
- /* prepend a message to the current message, update the metadata and return */
- ast_trace(-1, "Prepending to message %d\n", curmsg);
-
- make_file(msgfile, sizeof(msgfile), curdir, curmsg);
- ast_trace(-1, "msgfile: %s\n", msgfile);
-
- strcpy(textfile, msgfile);
- strncat(textfile, ".txt", sizeof(textfile) - 1);
- *duration = 0;
@ -335,10 +346,12 @@ index 9105e1a..c6ad060 100644
- /* Back up the original file, so we can retry the prepend and restore it after forward. */
-#ifndef IMAP_STORAGE
- if (already_recorded) {
- ast_trace(-1, "Restoring '%s' to '%s'\n", backup, msgfile);
- ast_filecopy(backup, msgfile, NULL);
- copy(backup_textfile, textfile);
- }
- else {
- ast_trace(-1, "Backing up '%s' to '%s'\n", backup, msgfile);
- ast_filecopy(msgfile, backup, NULL);
- copy(textfile, backup_textfile);
- }
@ -348,7 +361,7 @@ index 9105e1a..c6ad060 100644
- if (record_gain)
- ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
-
- cmd = ast_play_and_prepend(chan, NULL, msgfile, 0, vm_fmts, &prepend_duration, NULL, 1, silencethreshold, maxsilence);
- cmd = SCOPE_CALL_WITH_INT_RESULT(-1, ast_play_and_prepend, chan, NULL, msgfile, 0, vm_fmts, &prepend_duration, NULL, 1, silencethreshold, maxsilence);
-
- if (cmd == 'S') { /* If we timed out, tell the user it didn't work properly and clean up the files */
- ast_stream_and_wait(chan, vm_pls_try_again, ""); /* this might be removed if a proper vm_prepend_timeout is ever recorded */
@ -369,6 +382,7 @@ index 9105e1a..c6ad060 100644
- char duration_buf[12];
-
- *duration += prepend_duration;
- ast_trace(-1, "Prepending duration: %d total duration: %ld\n", prepend_duration, *duration);
- msg_cat = ast_category_get(msg_cfg, "message", NULL);
- snprintf(duration_buf, sizeof(duration_buf), "%ld", *duration);
- if (!ast_variable_update(msg_cat, "duration", duration_buf, NULL, 0)) {
@ -419,19 +433,21 @@ index 9105e1a..c6ad060 100644
-
- if (already_recorded && cmd == -1) {
- /* restore original message if prepention cancelled */
- ast_trace(-1, "Restoring '%s' to '%s'\n", backup, msgfile);
- ast_filerename(backup, msgfile, NULL);
- rename(backup_textfile, textfile);
- }
-
- if (cmd == 't' || cmd == 'S') /* XXX entering this block with a value of 'S' is probably no longer possible. */
- if (cmd == 't' || cmd == 'S') { /* XXX entering this block with a value of 'S' is probably no longer possible. */
- cmd = 0;
- return cmd;
- }
- SCOPE_EXIT_RTN_VALUE(cmd, "Done. CMD: %d %c\n", cmd, cmd >= 32 && cmd < 127 ? cmd : '?');
-}
-
static void queue_mwi_event(const char *channel_id, const char *box, int urgent, int new, int old)
{
char *mailbox;
@@ -8123,7 +7960,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8648,7 +8474,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);
@ -440,7 +456,7 @@ index 9105e1a..c6ad060 100644
#ifdef IMAP_STORAGE
vm_delete(fn); /* Delete the file, but not the IMAP message */
@@ -8136,373 +7973,6 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8661,378 +8487,6 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
return 0;
}
@ -495,11 +511,16 @@ index 9105e1a..c6ad060 100644
-#ifndef IMAP_STORAGE
- char msgfile[PATH_MAX], textfile[PATH_MAX], backup[PATH_MAX], backup_textfile[PATH_MAX];
-#endif
- SCOPE_ENTER(3, "%s: user: %s dir: %s msg: %d\n", ast_channel_name(chan),
- vms->username, vms->curdir, vms->curmsg);
-
- if (ast_test_flag((&globalflags), VM_FWDURGAUTO)) {
- ast_copy_string(urgent_str, urgent ? "Urgent" : "", sizeof(urgent_str));
- }
-
- if (vms == NULL) return -1;
- if (vms == NULL) {
- SCOPE_EXIT_RTN_VALUE(-1, "vms is NULL\n");
- }
- dir = vms->curdir;
- curmsg = vms->curmsg;
-
@ -661,17 +682,17 @@ index 9105e1a..c6ad060 100644
-
- /* play name if available, else play extension number */
- snprintf(fn, sizeof(fn), "%s%s/%s/greet", VM_SPOOL_DIR, receiver->context, s);
- RETRIEVE(fn, -1, s, receiver->context);
- SCOPE_CALL(-1, RETRIEVE, fn, -1, s, receiver->context);
- if (ast_fileexists(fn, NULL, NULL) > 0) {
- res = ast_stream_and_wait(chan, fn, ecodes);
- if (res) {
- DISPOSE(fn, -1);
- SCOPE_CALL(-1, DISPOSE, fn, -1);
- return res;
- }
- } else {
- res = ast_say_digit_str(chan, s, ecodes, ast_channel_language(chan));
- }
- DISPOSE(fn, -1);
- SCOPE_CALL(-1, DISPOSE, fn, -1);
-
- s = strsep(&stringp, "*");
- }
@ -691,7 +712,7 @@ index 9105e1a..c6ad060 100644
- memset(&leave_options, 0, sizeof(leave_options));
- leave_options.record_gain = record_gain;
- leave_options.beeptone = "beep";
- cmd = leave_voicemail(chan, mailbox, &leave_options);
- cmd = SCOPE_CALL_WITH_INT_RESULT(-1, leave_voicemail, chan, mailbox, &leave_options);
- } else {
- /* Forward VoiceMail */
- long duration = 0;
@ -705,7 +726,7 @@ index 9105e1a..c6ad060 100644
-#endif
- memcpy(&vmstmp, vms, sizeof(vmstmp));
-
- RETRIEVE(dir, curmsg, sender->mailbox, sender->context);
- SCOPE_CALL(-1, RETRIEVE, dir, curmsg, sender->mailbox, sender->context);
-#ifdef IMAP_STORAGE
- make_file(filename, sizeof(filename), dir, curmsg);
- strncat(filename, ".txt", sizeof(filename) - strlen(filename) - 1);
@ -716,7 +737,7 @@ index 9105e1a..c6ad060 100644
- }
-#endif
-
- cmd = vm_forwardoptions(chan, sender, vmstmp.curdir, curmsg, vmfmts, S_OR(context, "default"), record_gain, &duration, &vmstmp, urgent_str);
- cmd = SCOPE_CALL_WITH_INT_RESULT(-1, vm_forwardoptions, chan, sender, vmstmp.curdir, curmsg, vmfmts, S_OR(context, "default"), record_gain, &duration, &vmstmp, urgent_str);
- if (!cmd) {
- AST_LIST_TRAVERSE_SAFE_BEGIN(&extensions, vmtmp, list) {
-#ifdef IMAP_STORAGE
@ -750,7 +771,7 @@ index 9105e1a..c6ad060 100644
- vmstmp.fn, vmstmp.introfn, fmt, duration, attach_user_voicemail, chan,
- NULL, urgent_str, msg_id);
-#else
- copy_msg_result = copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt, dir, urgent_str, NULL);
- copy_msg_result = SCOPE_CALL_WITH_INT_RESULT(-1, copy_message, chan, sender, 0, curmsg, duration, vmtmp, fmt, dir, urgent_str, NULL);
-#endif
- saved_messages++;
- AST_LIST_REMOVE_CURRENT(list);
@ -790,7 +811,7 @@ index 9105e1a..c6ad060 100644
- }
-#endif
- }
- DISPOSE(dir, curmsg);
- SCOPE_CALL(-1, DISPOSE, dir, curmsg);
-#ifndef IMAP_STORAGE
- if (cmd) { /* assuming hangup, cleanup backup file */
- make_file(msgfile, sizeof(msgfile), dir, curmsg);
@ -808,13 +829,13 @@ index 9105e1a..c6ad060 100644
- inprocess_count(vmtmp->mailbox, vmtmp->context, -1);
- free_user(vmtmp);
- }
- return res ? res : cmd;
- SCOPE_EXIT_RTN_VALUE(res ? res : cmd, "Done. res: %d cmd: %d\n", res, cmd);
-}
-
static int wait_file2(struct ast_channel *chan, struct vm_state *vms, char *file)
{
int res;
@@ -9007,7 +8477,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
@@ -9537,7 +8991,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. */
@ -822,8 +843,8 @@ index 9105e1a..c6ad060 100644
+ create_dirpath(vms->curdir, sizeof(vms->curdir), vmu->context, vmu->mailbox, vms->curbox);
/* traverses directory using readdir (or select query for ODBC) */
count_msg = count_messages(vmu, vms->curdir);
@@ -10307,7 +9777,7 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
count_msg = COUNT(vmu, vms->curdir);
@@ -10842,7 +10296,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 */
@ -832,7 +853,7 @@ index 9105e1a..c6ad060 100644
if (ast_test_flag(vmu, VM_TEMPGREETWARN)) {
RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
if (ast_fileexists(prefile, NULL, NULL) > 0) {
@@ -10437,9 +9907,6 @@ static int vm_instructions_en(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -10972,9 +10426,6 @@ static int vm_instructions_en(struct ast_channel *chan, struct ast_vm_user *vmu,
res = ast_play_and_wait(chan, "vm-undelete");
}
}
@ -842,7 +863,7 @@ index 9105e1a..c6ad060 100644
if (!res) {
res = ast_play_and_wait(chan, "vm-savemessage");
}
@@ -10530,9 +9997,6 @@ static int vm_instructions_ja(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -11065,9 +10516,6 @@ static int vm_instructions_ja(struct ast_channel *chan, struct ast_vm_user *vmu,
} else {
res = ast_play_and_wait(chan, "vm-undelete");
}
@ -852,7 +873,7 @@ index 9105e1a..c6ad060 100644
if (!res) {
res = ast_play_and_wait(chan, "vm-savemessage");
}
@@ -10614,7 +10078,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -11149,7 +10597,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)) {
@ -861,7 +882,7 @@ index 9105e1a..c6ad060 100644
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 == '#')
@@ -10624,14 +10088,14 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -11159,14 +10607,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)) {
@ -878,7 +899,7 @@ index 9105e1a..c6ad060 100644
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 == '#')
@@ -10655,7 +10119,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -11190,7 +10638,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) {
@ -887,7 +908,7 @@ index 9105e1a..c6ad060 100644
cmd = ast_play_and_wait(chan, vm_invalid_password);
} else {
newpassword2[1] = '\0';
@@ -10669,7 +10133,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -11204,7 +10652,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
return cmd;
if (!strcmp(newpassword, newpassword2))
break;
@ -896,7 +917,7 @@ index 9105e1a..c6ad060 100644
cmd = ast_play_and_wait(chan, vm_mismatch);
}
if (++tries == 3)
@@ -10683,7 +10147,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -11218,7 +10666,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);
@ -905,26 +926,26 @@ index 9105e1a..c6ad060 100644
cmd = ast_play_and_wait(chan, vm_passchanged);
return cmd;
@@ -10714,15 +10178,15 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -11250,15 +10698,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 */
- snprintf(prefile, sizeof(prefile), "%s%s/%s/unavail", VM_SPOOL_DIR, vmu->context, vms->username);
+ snprintf(prefile, sizeof(prefile), "%s%s/%s/unavail", VM_SPOOL_DIR, vmu->context, vmu->mailbox);
cmd = play_record_review(chan, "vm-rec-unv", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL, NULL, 0);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, play_record_review, chan, "vm-rec-unv", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL, NULL, 0);
break;
case '2': /* Record your busy message */
- snprintf(prefile, sizeof(prefile), "%s%s/%s/busy", VM_SPOOL_DIR, vmu->context, vms->username);
+ snprintf(prefile, sizeof(prefile), "%s%s/%s/busy", VM_SPOOL_DIR, vmu->context, vmu->mailbox);
cmd = play_record_review(chan, "vm-rec-busy", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL, NULL, 0);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, play_record_review, chan, "vm-rec-busy", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL, NULL, 0);
break;
case '3': /* Record greeting */
- snprintf(prefile, sizeof(prefile), "%s%s/%s/greet", VM_SPOOL_DIR, vmu->context, vms->username);
+ snprintf(prefile, sizeof(prefile), "%s%s/%s/greet", VM_SPOOL_DIR, vmu->context, vmu->mailbox);
cmd = play_record_review(chan, "vm-rec-name", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL, NULL, 0);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, 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 */
@@ -10746,7 +10210,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -11282,7 +10730,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) {
@ -933,7 +954,7 @@ index 9105e1a..c6ad060 100644
cmd = ast_play_and_wait(chan, vm_invalid_password);
if (!cmd) {
cmd = ast_play_and_wait(chan, vm_pls_try_again);
@@ -10766,7 +10230,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -11302,7 +10750,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
}
}
if (strcmp(newpassword, newpassword2)) {
@ -942,7 +963,7 @@ index 9105e1a..c6ad060 100644
cmd = ast_play_and_wait(chan, vm_mismatch);
if (!cmd) {
cmd = ast_play_and_wait(chan, vm_pls_try_again);
@@ -10782,7 +10246,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -11318,7 +10766,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",
@ -951,16 +972,16 @@ index 9105e1a..c6ad060 100644
cmd = ast_play_and_wait(chan, vm_passchanged);
break;
case '*':
@@ -10790,7 +10254,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -11326,7 +10774,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
break;
default:
cmd = 0;
- snprintf(prefile, sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vms->username);
+ snprintf(prefile, sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vmu->mailbox);
RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
SCOPE_CALL(-1, RETRIEVE, prefile, -1, vmu->mailbox, vmu->context);
if (ast_fileexists(prefile, NULL, NULL)) {
cmd = ast_play_and_wait(chan, "vm-tmpexists");
@@ -10852,7 +10316,7 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
@@ -11388,7 +10836,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");
@ -969,7 +990,7 @@ index 9105e1a..c6ad060 100644
while ((cmd >= 0) && (cmd != 't')) {
if (cmd)
retries = 0;
@@ -11778,35 +11242,6 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12710,37 +12158,6 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
vms.repeats = 0;
while ((cmd > -1) && (cmd != 't') && (cmd != '#')) {
switch (cmd) {
@ -978,6 +999,7 @@ index 9105e1a..c6ad060 100644
- cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 1, record_gain);
- if (cmd == ERROR_LOCK_PATH || cmd == OPERATOR_EXIT) {
- res = cmd;
- ast_trace(-1, "advanced options: %d\n", cmd);
- goto out;
- }
- } else {
@ -990,6 +1012,7 @@ index 9105e1a..c6ad060 100644
- ast_verb(3, "Callback Requested\n");
- if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1 && !vms.starting) {
- cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 2, record_gain);
- ast_trace(-1, "advanced options: %d\n", cmd);
- if (cmd == 9) {
- silentexit = 1;
- goto out;
@ -1005,7 +1028,7 @@ index 9105e1a..c6ad060 100644
case '3': /* Envelope */
if (vms.lastmsg > -1 && !vms.starting) {
ast_safe_sleep(chan, 500);
@@ -11820,32 +11255,6 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12755,34 +12172,6 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
@ -1014,6 +1037,7 @@ index 9105e1a..c6ad060 100644
- cmd = dialout(chan, vmu, NULL, vmu->dialout);
- if (cmd == 9) {
- silentexit = 1;
- ast_trace(-1, "dialout: %d\n", cmd);
- goto out;
- }
- } else {
@ -1024,9 +1048,10 @@ index 9105e1a..c6ad060 100644
-
- case '5': /* Leave VoiceMail */
- if (ast_test_flag(vmu, VM_SVMAIL)) {
- cmd = forward_message(chan, context, &vms, vmu, vmfmts, 1, record_gain, 0);
- cmd = SCOPE_CALL_WITH_INT_RESULT(-1, forward_message, chan, context, &vms, vmu, vmfmts, 1, record_gain, 0);
- if (cmd == ERROR_LOCK_PATH || cmd == OPERATOR_EXIT) {
- res = cmd;
- ast_trace(-1, "forward message: %d\n", cmd);
- goto out;
- }
- } else {
@ -1038,7 +1063,7 @@ index 9105e1a..c6ad060 100644
case '*': /* Return to main menu */
cmd = 't';
break;
@@ -11853,21 +11262,9 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12790,21 +12179,9 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
default:
ast_safe_sleep(chan, 500);
cmd = 0;
@ -1060,15 +1085,16 @@ index 9105e1a..c6ad060 100644
if (!cmd) {
cmd = ast_play_and_wait(chan, "vm-starmain");
}
@@ -12018,37 +11415,6 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12967,42 +12344,6 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
#endif
break;
- case '8': /* Forward the current message */
- if (vms.lastmsg > -1) {
- cmd = forward_message(chan, context, &vms, vmu, vmfmts, 0, record_gain, in_urgent);
- cmd = SCOPE_CALL_WITH_INT_RESULT(-1, forward_message, chan, context, &vms, vmu, vmfmts, 0, record_gain, in_urgent);
- if (cmd == ERROR_LOCK_PATH) {
- res = cmd;
- ast_trace(-1, "forward message: %d\n", res);
- goto out;
- }
- } else {
@ -1079,12 +1105,16 @@ index 9105e1a..c6ad060 100644
- if (in_urgent == 1 && vms.newmessages > 0) {
- /* Check for new messages */
- in_urgent = 0;
- res = close_mailbox(&vms, vmu);
- if (res == ERROR_LOCK_PATH)
- res = SCOPE_CALL_WITH_INT_RESULT(-1, close_mailbox, &vms, vmu);
- if (res == ERROR_LOCK_PATH) {
- ast_trace(-1, "close mailbox: %d\n", res);
- goto out;
- res = open_mailbox(&vms, vmu, NEW_FOLDER);
- if (res < 0)
- }
- res = SCOPE_CALL_WITH_INT_RESULT(-1, open_mailbox, &vms, vmu, NEW_FOLDER);
- if (res < 0) {
- ast_trace(-1, "open mailbox: %d\n", res);
- goto out;
- }
- ast_debug(1, "No more urgent messages, opened INBOX and got %d new messages\n", vms.lastmsg + 1);
- vms.curmsg = -1;
- if (vms.lastmsg < 0) {
@ -1098,15 +1128,15 @@ index 9105e1a..c6ad060 100644
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) {
@@ -12159,6 +11525,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -13118,6 +12459,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
cmd = 0;
break;
case '0': /* Mailbox options */
+ ast_log(LOG_DEBUG, "setting options for '%s'", vmu->mailbox);
cmd = vm_options(chan, vmu, &vms, vmfmts, record_gain);
cmd = SCOPE_CALL_WITH_INT_RESULT(-1, vm_options,chan, vmu, &vms, vmfmts, record_gain);
if (useadsi)
adsi_status(chan, &vms);
@@ -12205,7 +11572,7 @@ out:
@@ -13166,7 +12508,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 */
@ -1115,7 +1145,7 @@ index 9105e1a..c6ad060 100644
ast_app_inboxcount2(ext_context, &urgent, &new, &old);
queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgent, new, old);
}
@@ -13027,7 +12394,6 @@ static int poll_subscribed_mailbox(struct ast_mwi_state *mwi_state, void *data)
@@ -14006,7 +13348,6 @@ static int poll_subscribed_mailbox(struct ast_mwi_state *mwi_state, void *data)
if (urgent != mwi_state->urgent_msgs || new != mwi_state->new_msgs || old != mwi_state->old_msgs) {
queue_mwi_event(NULL, mwi_state->uniqueid, urgent, new, old);
@ -1123,7 +1153,7 @@ index 9105e1a..c6ad060 100644
}
return 0;
@@ -16104,7 +15470,7 @@ static void notify_new_state(struct ast_vm_user *vmu)
@@ -17345,7 +16686,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_vmnotify_ext_format
1 file changed, 97 insertions(+), 36 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 70478fa..f26bbfa 100644
index 0d63f1e..72aa606 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1091,6 +1091,8 @@ static int vm_msg_move(const char *mailbox, const char *context, size_t num_msgs
@@ -1231,6 +1231,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);
@ -19,7 +19,7 @@ index 70478fa..f26bbfa 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);
@@ -5656,7 +5658,7 @@ static int sendmail(char *srcemail,
@@ -6145,7 +6147,7 @@ static int sendmail(char *srcemail,
return 0;
}
@ -28,7 +28,7 @@ index 70478fa..f26bbfa 100644
{
char arguments[2048];
char date[256];
@@ -5665,6 +5667,7 @@ static void run_externpager(char *pager, char *dialed_num, char *cidnum, int dur
@@ -6154,6 +6156,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 70478fa..f26bbfa 100644
if (!str1) {
return;
@@ -5680,8 +5683,14 @@ static void run_externpager(char *pager, char *dialed_num, char *cidnum, int dur
@@ -6169,8 +6172,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 70478fa..f26bbfa 100644
if (pagerbody) {
struct ast_channel *ast;
@@ -6236,9 +6245,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
@@ -6746,9 +6755,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
return res;
}
@ -67,7 +67,7 @@ index 70478fa..f26bbfa 100644
char ext_context[256] = "";
char number[256] = "";
int newvoicemails = 0, oldvoicemails = 0, urgentvoicemails = 0;
@@ -6278,10 +6289,20 @@ static void run_externnotify(const char *context, const char *extension, const c
@@ -6788,10 +6799,20 @@ static void run_externnotify(const char *context, const char *extension, const 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 70478fa..f26bbfa 100644
ast_debug(1, "Executing %s\n", arguments);
ast_safe_system(arguments);
}
@@ -8002,6 +8023,59 @@ static void queue_mwi_event(const char *channel_id, const char *box, int urgent,
@@ -8513,6 +8534,59 @@ static void queue_mwi_event(const char *channel_id, const char *box, int urgent,
}
}
@ -152,7 +152,7 @@ index 70478fa..f26bbfa 100644
/*!
* \brief Sends email notification that a user has a new voicemail waiting for them.
* \param chan
@@ -8022,6 +8096,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8533,6 +8607,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 70478fa..f26bbfa 100644
ast_channel_lock(chan);
if ((category = pbx_builtin_getvar_helper(chan, "VM_CATEGORY"))) {
@@ -8079,7 +8155,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8590,7 +8666,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
}
if (!ast_strlen_zero(vmu->pager)) {
@ -170,7 +170,7 @@ index 70478fa..f26bbfa 100644
}
if (ast_test_flag(vmu, VM_DELETE))
@@ -8090,7 +8166,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8601,7 +8677,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 70478fa..f26bbfa 100644
#ifdef IMAP_STORAGE
vm_delete(fn); /* Delete the file, but not the IMAP message */
@@ -8135,35 +8211,20 @@ static int play_message_category(struct ast_channel *chan, const char *category)
@@ -8646,35 +8722,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;
@ -221,7 +221,7 @@ index 70478fa..f26bbfa 100644
/* No internal variable parsing for now, so we'll comment it out for the time being */
#if 0
/* Set the DIFF_* variables */
@@ -8180,8 +8241,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8691,8 +8752,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
@ -232,7 +232,7 @@ index 70478fa..f26bbfa 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 */
@@ -11820,7 +11881,7 @@ out:
@@ -12753,7 +12814,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 */
@ -241,7 +241,7 @@ index 70478fa..f26bbfa 100644
ast_app_inboxcount2(ext_context, &urgent, &new, &old);
queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgent, new, old);
}
@@ -15737,7 +15798,7 @@ static void notify_new_state(struct ast_vm_user *vmu)
@@ -16950,7 +17011,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 33dc99c..70478fa 100644
index e3182eb..0d63f1e 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -8135,7 +8135,7 @@ static int play_message_category(struct ast_channel *chan, const char *category)
@@ -8646,7 +8646,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 33dc99c..70478fa 100644
time_t t;
if (ast_get_time_t(origtime, &t, 0, NULL)) {
@@ -8150,13 +8150,20 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8661,13 +8661,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 33dc99c..70478fa 100644
/* No internal variable parsing for now, so we'll comment it out for the time being */
#if 0
/* Set the DIFF_* variables */
@@ -8173,8 +8180,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8684,8 +8691,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 33dc99c..70478fa 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 */
@@ -13210,17 +13217,14 @@ static void load_zonemessages(struct ast_config *cfg)
@@ -14385,17 +14392,14 @@ static void load_zonemessages(struct ast_config *cfg)
strcpy(storage, var->value); /* safe */
msg_format = storage;
tzone = strsep(&msg_format, "|,");

Loading…
Cancel
Save