MT#55917 support bookworm

* asterisk-modules uses /usr/lib/<triplet>/asterisk
* apps/*.c: from upstream asterisk_20.1.0~dfsg+~cs6.12.40431414-1~bpo12+1
* use dh_asterisk provided by asterisk-dev to
  set the proper version asterisk dependency
* refresh patches
* update debian/changelog

Change-Id: Ib8becab169fdf4408b07fce26c814339cd10eb46
mr11.4.1
Victor Seva 3 years ago committed by Víctor Seva
parent 0b25036d5b
commit 14a059e6e7

@ -7,7 +7,7 @@
# at the top of the source tree.
INSTALL=install
ASTLIBDIR=/usr/lib/asterisk/modules
ASTLIBDIR?=/usr/lib/asterisk/modules
MODULES_DIR=$(INSTALL_PREFIX)$(ASTLIBDIR)
ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk

@ -35,7 +35,7 @@
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/app.h"
/* This file provides config-file based 'say' functions, and implenents
/* This file provides config-file based 'say' functions, and implements
* some CLI commands.
*/
#include "asterisk/say.h" /*!< provides config-file based 'say' functions */
@ -62,13 +62,19 @@
be answered before the sound is played.</para>
<note><para>Not all channel types support playing messages while still on hook.</para></note>
</option>
<option name="say">
<para>Play using the say.conf file.</para>
</option>
<option name="mix">
<para>Play using a mix of filename and the say.conf file.</para>
</option>
</optionlist>
</parameter>
</syntax>
<description>
<para>Plays back given filenames (do not put extension of wav/alaw etc).
The playback command answer the channel if no options are specified.
If the file is non-existant it will fail</para>
The Playback application answers the channel if no options are specified.
If the file is non-existent it will fail.</para>
<para>This application sets the following channel variable upon completion:</para>
<variablelist>
<variable name="PLAYBACKSTATUS">
@ -446,6 +452,7 @@ static int playback_exec(struct ast_channel *chan, const char *data)
char *tmp;
int option_skip=0;
int option_say=0;
int option_mix=0;
int option_noanswer = 0;
AST_DECLARE_APP_ARGS(args,
@ -466,6 +473,8 @@ static int playback_exec(struct ast_channel *chan, const char *data)
option_skip = 1;
if (strcasestr(args.options, "say"))
option_say = 1;
if (strcasestr(args.options, "mix"))
option_mix = 1;
if (strcasestr(args.options, "noanswer"))
option_noanswer = 1;
}
@ -486,6 +495,13 @@ static int playback_exec(struct ast_channel *chan, const char *data)
while (!res && (front = strsep(&back, "&"))) {
if (option_say)
res = say_full(chan, front, "", ast_channel_language(chan), NULL, -1, -1);
else if (option_mix){
/* Check if it is in say format but not remote audio file */
if (strcasestr(front, ":") && !strcasestr(front, "://"))
res = say_full(chan, front, "", ast_channel_language(chan), NULL, -1, -1);
else
res = ast_streamfile(chan, front, ast_channel_language(chan));
}
else
res = ast_streamfile(chan, front, ast_channel_language(chan));
if (!res) {

File diff suppressed because it is too large Load Diff

3
debian/changelog vendored

@ -1,6 +1,7 @@
ngcp-asterisk-voicemail (16.16.1+0~mr11.4.0.0) unstable; urgency=medium
ngcp-asterisk-voicemail (20.1.0+0~mr11.4.0.0) unstable; urgency=medium
* New release.
* [507ee34] MT#55917 support bookworm
-- Sipwise Jenkins Builder <jenkins@sipwise.com> Fri, 24 Mar 2023 13:02:25 +0100

2
debian/control vendored

@ -14,7 +14,7 @@ Build-Depends:
Package: ngcp-asterisk-voicemail-odbcstorage
Architecture: any
Depends:
asterisk,
${asterisk:Depends},
${misc:Depends},
${shlibs:Depends},
Provides:

@ -21,7 +21,6 @@ sipwise_vm_fix_odbc_retreive_file.patch
sipwise_fix_chan_usage.patch
sipwise_vm_store_message_add_diag_info.patch
sipwise_vm_fix_envelope_play.patch
sipwise_vm_asterisk_16_support.patch
sipwise_vm_pointers_malloc.patch
sipwise_fix_app_voicemail_bugs.patch
sipwise_vm_externnotify_by_uuid.patch

@ -7,10 +7,10 @@ Subject: sipwise_app_playback_timezone
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/apps/app_playback.c b/apps/app_playback.c
index f8d0abd..6eb6fb3 100644
index b9caab5..e7ad660 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -230,6 +230,15 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
@@ -237,6 +237,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 f8d0abd..6eb6fb3 100644
/* scan the body, one piece at a time */
while ( !ret && (x = strsep(&rule, ",")) ) { /* exit on key */
char fn[128];
@@ -243,6 +252,15 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
@@ -250,6 +259,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 f8d0abd..6eb6fb3 100644
/* locate prefix and data, if any */
fmt = strchr(fn, ':');
if (!fmt || fmt == fn) { /* regular filename */
@@ -326,10 +344,34 @@ static int say_date_generic(struct ast_channel *chan, time_t t,
@@ -333,10 +351,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 f8d0abd..6eb6fb3 100644
snprintf(buf, sizeof(buf), "%s:%s:%04d%02d%02d%02d%02d.%02d-%d-%3d",
prefix,
format,
@@ -341,7 +383,7 @@ static int say_date_generic(struct ast_channel *chan, time_t t,
@@ -348,7 +390,7 @@ static int say_date_generic(struct ast_channel *chan, time_t t,
tm.tm_sec,
tm.tm_wday,
tm.tm_yday);

@ -3,33 +3,35 @@ Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_define_module
---
apps/app_playback.c | 2 ++
apps/app_voicemail.c | 2 ++
2 files changed, 4 insertions(+)
apps/app_playback.c | 3 +++
apps/app_voicemail.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 0c9281a..f8d0abd 100644
index 56c2a86..b9caab5 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -31,6 +31,8 @@
#include "asterisk.h"
@@ -29,6 +29,9 @@
<support_level>core</support_level>
***/
+#define AST_MODULE "app_playback"
+#define AST_MODULE_SELF_SYM __app_playback_sym
+
#include "asterisk.h"
#include "asterisk/file.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index e554ee7..b1f5182 100644
index 1aca59b..69371b0 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -100,6 +100,8 @@
#endif
#endif
@@ -46,6 +46,9 @@
* \verbinclude voicemail.conf.sample
*/
+#define AST_MODULE "voicemail"
+#define AST_MODULE "app_voicemail"
+#define AST_MODULE_SELF_SYM __app_voicemail_sym
+
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
#include <sys/time.h>
#include <sys/stat.h>
#include "asterisk.h"
#ifdef IMAP_STORAGE

@ -7,10 +7,10 @@ Subject: sipwise_fix_app_voicemail_bugs
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 36fac28..d9c0755 100644
index 049453f..b7db74c 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1316,7 +1316,7 @@ static int findreplen(const char *rep, int nmat, const int *replen)
@@ -1221,7 +1221,7 @@ static int findreplen(const char *rep, int nmat, const int *replen)
while(*cp) {
if (*cp == '$' && isdigit(cp[1])) {
val = strtoul(&cp[1], &cp, 10);
@ -19,7 +19,7 @@ index 36fac28..d9c0755 100644
len += replen[val -1];
else
fprintf(stderr, "repl %d out of range\n", val);
@@ -1336,7 +1336,7 @@ static void doreplace(char *out, const char *rep,
@@ -1241,7 +1241,7 @@ static void doreplace(char *out, const char *rep,
while(*cp) {
if (*cp == '$' && isdigit(cp[1])) {
val = strtoul(&cp[1], &cp, 10);
@ -28,7 +28,7 @@ index 36fac28..d9c0755 100644
strncpy(out, repstr[val - 1], replen[val - 1]);
out += replen[val -1];
}
@@ -1383,7 +1383,7 @@ static char *pcre_subst(const pcre *ppat, const pcre_extra *extra,
@@ -1288,7 +1288,7 @@ static char *pcre_subst(const pcre *ppat, const pcre_extra *extra,
int nmat;
int ovec[MAXCAPTURE * 3];
nmat = pcre_exec(ppat, extra, str, len, offset, options,

@ -7,10 +7,10 @@ Subject: sipwise_fix_chan_usage
1 file changed, 2 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index c72c9e5..8e6e343 100644
index 9c1e5d3..b11c94d 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -15516,7 +15516,9 @@ AST_TEST_DEFINE(test_voicemail_msgcount)
@@ -14385,7 +14385,9 @@ AST_TEST_DEFINE(test_voicemail_msgcount)
break;
}
open_mailbox(&vms, vmu, folder2mbox[i]);

@ -7,7 +7,7 @@ Subject: sipwise_rename_apps
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 5b96cba..67ec08d 100644
index e183752..393aefc 100644
--- a/Makefile
+++ b/Makefile
@@ -45,13 +45,19 @@ apps/app_playback.so: apps/app_playback.o

@ -7,10 +7,10 @@ Subject: sipwise_vm_add_arabic_support
1 file changed, 94 insertions(+), 2 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 06d8eea..31f26b7 100644
index c42d667..39df573 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9397,8 +9397,10 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -8487,8 +8487,10 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg);
adsi_message(chan, vms);
@ -23,7 +23,7 @@ index 06d8eea..31f26b7 100644
if (!vms->curmsg) {
res = wait_file2(chan, vms, "vm-first"); /* "First" */
} else if (vms->curmsg == vms->lastmsg) {
@@ -9446,6 +9448,18 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -8536,6 +8538,18 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
}
if (!res)
res = wait_file2(chan, vms, "vm-message");
@ -42,7 +42,7 @@ index 06d8eea..31f26b7 100644
/* HEBREW syntax */
} else if (!strncasecmp(ast_channel_language(chan), "he", 2)) {
if (!vms->curmsg) {
@@ -9888,6 +9902,8 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
@@ -8978,6 +8992,8 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
return cmd ? cmd : ast_play_and_wait(chan, box);
} else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) {
return vm_play_folder_name_gr(chan, box);
@ -51,7 +51,7 @@ index 06d8eea..31f26b7 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 */
@@ -10049,6 +10065,59 @@ static int vm_intro_multilang(struct ast_channel *chan, struct vm_state *vms, co
@@ -9139,6 +9155,59 @@ static int vm_intro_multilang(struct ast_channel *chan, struct vm_state *vms, co
return res;
}
@ -111,7 +111,7 @@ index 06d8eea..31f26b7 100644
/* Default Hebrew syntax */
static int vm_intro_he(struct ast_channel *chan, struct vm_state *vms)
{
@@ -10989,6 +11058,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
@@ -10124,6 +10193,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
return vm_intro_fr(chan, vms);
} else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) { /* GREEK syntax */
return vm_intro_gr(chan, vms);
@ -120,7 +120,7 @@ index 06d8eea..31f26b7 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 */
@@ -11591,6 +11662,23 @@ static int vm_browse_messages_gr(struct ast_channel *chan, struct vm_state *vms,
@@ -10720,6 +10791,23 @@ static int vm_browse_messages_gr(struct ast_channel *chan, struct vm_state *vms,
return cmd;
}
@ -144,7 +144,7 @@ index 06d8eea..31f26b7 100644
/* Hebrew Syntax */
static int vm_browse_messages_he(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
@@ -11829,6 +11917,8 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st
@@ -10958,6 +11046,8 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st
return vm_browse_messages_es(chan, vms, vmu);
} else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) { /* GREEK */
return vm_browse_messages_gr(chan, vms, vmu);
@ -153,7 +153,7 @@ index 06d8eea..31f26b7 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 */
@@ -12881,6 +12971,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -11919,6 +12009,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
if (folder_change && vms.lastmsg == -1) {
if(!strcasecmp(ast_channel_language(chan), "ro")) {
ast_play_and_wait(chan, "vm-dir-empty");

@ -7,10 +7,10 @@ Subject: sipwise_vm_add_callid
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index b5fb35e..c00767a 100644
index 33571cd..e483129 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -930,7 +930,7 @@ static char odbc_database[80] = "asterisk";
@@ -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)
@ -19,7 +19,7 @@ index b5fb35e..c00767a 100644
#define EXISTS(a,b,c,d) (message_exists(a,b))
#define RENAME(a,b,c,d,e,f,g,h) (rename_file(a,b,c,d,e,f))
#define COPY(a,b,c,d,e,f,g,h) (copy_file(a,b,c,d,e,f))
@@ -4567,6 +4567,7 @@ struct insert_data {
@@ -4454,6 +4454,7 @@ struct insert_data {
const char *category;
const char *flag;
const char *msg_id;
@ -27,7 +27,7 @@ index b5fb35e..c00767a 100644
};
static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4595,6 +4596,9 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4482,6 +4483,9 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
SQLBindParameter(stmt, 12, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->msg_id), 0, (void *) data->msg_id, 0, NULL);
if (!ast_strlen_zero(data->category)) {
SQLBindParameter(stmt, 13, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->category), 0, (void *) data->category, 0, NULL);
@ -37,7 +37,7 @@ index b5fb35e..c00767a 100644
}
res = ast_odbc_execute_sql(obj, stmt, data->sql);
if (!SQL_SUCCEEDED(res)) {
@@ -4619,7 +4623,7 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4506,7 +4510,7 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
*
* \return the zero on success -1 on error.
*/
@ -46,7 +46,7 @@ index b5fb35e..c00767a 100644
{
int res = 0;
int fd = -1;
@@ -4634,8 +4638,9 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
@@ -4521,8 +4525,9 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
char *c;
struct ast_config *cfg = NULL;
struct odbc_obj *obj;
@ -57,7 +57,7 @@ index b5fb35e..c00767a 100644
struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
delete_file(dir, msgnum);
@@ -4708,10 +4713,15 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
@@ -4595,10 +4600,15 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
idata.data = fdm;
idata.datalen = idata.indlen = fdlen;
@ -75,7 +75,7 @@ index b5fb35e..c00767a 100644
if (ast_strlen_zero(idata.origtime)) {
idata.origtime = "0";
@@ -7189,7 +7199,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6831,7 +6841,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");

@ -4,11 +4,11 @@ Subject: sipwise_vm_add_pcre_support
---
Makefile | 2 +-
apps/app_voicemail.c | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 169 insertions(+), 1 deletion(-)
apps/app_voicemail.c | 708 ++++++++++++---------------------------------------
2 files changed, 162 insertions(+), 548 deletions(-)
diff --git a/Makefile b/Makefile
index 67ec08d..ad0c960 100644
index 393aefc..ce13bbf 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ CC?=gcc
@ -21,18 +21,10 @@ index 67ec08d..ad0c960 100644
CFLAGS+=-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
CFLAGS+=-D_REENTRANT -D_GNU_SOURCE -DODBC_STORAGE
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index cb3db9b..954c66f 100644
index c05fd92..0b5cf5a 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -50,6 +50,7 @@
<defaultenabled>yes</defaultenabled>
<use type="module">res_adsi</use>
<use type="module">res_smdi</use>
+ <depend>pcre</depend>
<support_level>core</support_level>
***/
@@ -144,6 +145,9 @@
@@ -112,6 +112,9 @@
#include "asterisk/threadstorage.h"
#endif
@ -42,7 +34,7 @@ index cb3db9b..954c66f 100644
/*** DOCUMENTATION
<application name="VoiceMail" language="en_US">
<synopsis>
@@ -1014,6 +1018,8 @@ static int maxlogins = 3;
@@ -942,6 +945,8 @@ static int maxlogins = 3;
static int minpassword = MINPASSWORD;
static int passwordlocation;
static char aliasescontext[MAX_VM_CONTEXT_LEN];
@ -51,7 +43,7 @@ index cb3db9b..954c66f 100644
/*! Poll mailboxes for changes since there is something external to
* app_voicemail that may change them. */
@@ -1270,6 +1276,114 @@ static int inprocess_count(const char *context, const char *mailbox, int delta)
@@ -1177,6 +1182,114 @@ static int inprocess_count(const char *context, const char *mailbox, int delta)
static int __has_voicemail(const char *context, const char *mailbox, const char *folder, int shortcircuit);
#endif
@ -166,41 +158,568 @@ index cb3db9b..954c66f 100644
/*!
* \brief Strips control and non 7-bit clean characters from input string.
*
@@ -8136,6 +8250,8 @@ static int get_folder2(struct ast_channel *chan, char *fn, int start)
* This is invoked from forward_message() when performing a forward operation (option 8 from main menu).
* \return zero on success, -1 on error.
*/
+
+#if 0
static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, char *curdir, int curmsg, char *vm_fmts,
char *context, signed char record_gain, long *duration, struct vm_state *vms, char *flag)
{
@@ -8297,6 +8413,7 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
cmd = 0;
return cmd;
@@ -7918,186 +8031,6 @@ static int get_folder2(struct ast_channel *chan, char *fn, int start)
return res;
}
+#endif
-/*!
- * \brief presents the option to prepend to an existing message when forwarding it.
- * \param chan
- * \param vmu
- * \param curdir
- * \param curmsg
- * \param vm_fmts
- * \param context
- * \param record_gain
- * \param duration
- * \param vms
- * \param flag
- *
- * Presents a prompt for 1 to prepend the current message, 2 to forward the message without prepending, or * to return to the main menu.
- *
- * 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)
-{
- int cmd = 0;
- int retries = 0, prepend_duration = 0, already_recorded = 0;
- char msgfile[PATH_MAX], backup[PATH_MAX], backup_textfile[PATH_MAX];
- char textfile[PATH_MAX];
- struct ast_config *msg_cfg;
- struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
-#ifndef IMAP_STORAGE
- signed char zero_gain = 0;
-#else
- const char *msg_id = NULL;
-#endif
- const char *duration_str;
-
- /* Must always populate duration correctly */
- make_file(msgfile, sizeof(msgfile), curdir, curmsg);
- strcpy(textfile, msgfile);
- strcpy(backup, msgfile);
- strcpy(backup_textfile, msgfile);
- strncat(textfile, ".txt", sizeof(textfile) - strlen(textfile) - 1);
- strncat(backup, "-bak", sizeof(backup) - strlen(backup) - 1);
- strncat(backup_textfile, "-bak.txt", sizeof(backup_textfile) - strlen(backup_textfile) - 1);
-
- if ((msg_cfg = ast_config_load(textfile, config_flags)) && valid_config(msg_cfg) && (duration_str = ast_variable_retrieve(msg_cfg, "message", "duration"))) {
- *duration = atoi(duration_str);
- } else {
- *duration = 0;
- }
-
- while ((cmd >= 0) && (cmd != 't') && (cmd != '*')) {
- if (cmd)
- retries = 0;
- switch (cmd) {
- case '1':
-
-#ifdef IMAP_STORAGE
- /* Record new intro file */
- if (msg_cfg && msg_cfg != CONFIG_STATUS_FILEINVALID) {
- msg_id = ast_variable_retrieve(msg_cfg, "message", "msg_id");
- }
- make_file(vms->introfn, sizeof(vms->introfn), curdir, curmsg);
- strncat(vms->introfn, "intro", sizeof(vms->introfn));
- ast_play_and_wait(chan, "vm-record-prepend");
- ast_play_and_wait(chan, "beep");
- cmd = play_record_review(chan, NULL, vms->introfn, vmu->maxsecs, vm_fmts, 1, vmu, (int *) duration, NULL, NULL, record_gain, vms, flag, msg_id, 1);
- if (cmd == -1) {
- break;
- }
- cmd = 't';
-#else
-
- /* prepend a message to the current message, update the metadata and return */
-
- make_file(msgfile, sizeof(msgfile), curdir, curmsg);
- strcpy(textfile, msgfile);
- strncat(textfile, ".txt", sizeof(textfile) - 1);
- *duration = 0;
-
- /* if we can't read the message metadata, stop now */
- if (!valid_config(msg_cfg)) {
- cmd = 0;
- break;
- }
-
- /* Back up the original file, so we can retry the prepend and restore it after forward. */
-#ifndef IMAP_STORAGE
- if (already_recorded) {
- ast_filecopy(backup, msgfile, NULL);
- copy(backup_textfile, textfile);
- }
- else {
- ast_filecopy(msgfile, backup, NULL);
- copy(textfile, backup_textfile);
- }
-#endif
- already_recorded = 1;
-
- 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);
-
- 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 */
- ast_stream_and_wait(chan, vm_prepend_timeout, "");
- ast_filerename(backup, msgfile, NULL);
- }
-
- if (record_gain)
- ast_channel_setoption(chan, AST_OPTION_RXGAIN, &zero_gain, sizeof(zero_gain), 0);
-
-
- if ((duration_str = ast_variable_retrieve(msg_cfg, "message", "duration")))
- *duration = atoi(duration_str);
-
- if (prepend_duration) {
- struct ast_category *msg_cat;
- /* need enough space for a maximum-length message duration */
- char duration_buf[12];
-
- *duration += prepend_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)) {
- ast_config_text_file_save(textfile, msg_cfg, "app_voicemail");
- }
- }
-
-#endif
- break;
- case '2':
- /* NULL out introfile so we know there is no intro! */
-#ifdef IMAP_STORAGE
- *vms->introfn = '\0';
-#endif
- cmd = 't';
- break;
- case '*':
- cmd = '*';
- break;
- default:
- /* If time_out and return to menu, reset already_recorded */
- already_recorded = 0;
-
- cmd = ast_play_and_wait(chan, "vm-forwardoptions");
- /* "Press 1 to prepend a message or 2 to forward the message without prepending" */
- if (!cmd) {
- cmd = ast_play_and_wait(chan, "vm-starmain");
- /* "press star to return to the main menu" */
- }
- if (!cmd) {
- cmd = ast_waitfordigit(chan, 6000);
- }
- if (!cmd) {
- retries++;
- }
- if (retries > 3) {
- cmd = '*'; /* Let's cancel this beast */
- }
- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",
- isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');
- }
- }
-
- if (valid_config(msg_cfg))
- ast_config_destroy(msg_cfg);
- if (prepend_duration)
- *duration = prepend_duration;
-
- if (already_recorded && cmd == -1) {
- /* restore original message if prepention cancelled */
- 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. */
- cmd = 0;
- return cmd;
-}
-
static void queue_mwi_event(const char *channel_id, const char *box, int urgent, int new, int old)
{
@@ -8457,6 +8574,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
*
* \return zero on success, -1 on error.
*/
+
+#if 0
static int forward_message(struct ast_channel *chan, char *context, struct vm_state *vms, struct ast_vm_user *sender, char *fmt, int is_new_message, signed char record_gain, int urgent)
{
#ifdef IMAP_STORAGE
@@ -8795,6 +8914,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
}
return res ? res : cmd;
char *mailbox;
@@ -8230,373 +8163,6 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
return 0;
}
+#endif
-/*!
- * \brief Sends a voicemail message to a mailbox recipient.
- * \param chan
- * \param context
- * \param vms
- * \param sender
- * \param fmt
- * \param is_new_message Used to indicate the mode for which this method was invoked.
- * Will be 0 when called to forward an existing message (option 8)
- * Will be 1 when called to leave a message (option 3->5)
- * \param record_gain
- * \param urgent
- *
- * Reads the destination mailbox(es) from keypad input for CID, or if use_directory feature is enabled, the Directory.
- *
- * When in the leave message mode (is_new_message == 1):
- * - allow the leaving of a message for ourselves. (Will not allow us to forward a message to ourselves, when is_new_message == 0).
- * - attempt to determine the context and mailbox, and then invoke leave_message() function to record and store the message.
- *
- * When in the forward message mode (is_new_message == 0):
- * - retrieves the current message to be forwarded
- * - copies the original message to a temporary file, so updates to the envelope can be done.
- * - determines the target mailbox and folders
- * - copies the message into the target mailbox, using copy_message() or by generating the message into an email attachment if using imap folders.
- *
- * \return zero on success, -1 on error.
- */
-static int forward_message(struct ast_channel *chan, char *context, struct vm_state *vms, struct ast_vm_user *sender, char *fmt, int is_new_message, signed char record_gain, int urgent)
-{
-#ifdef IMAP_STORAGE
- int todircount = 0;
- struct vm_state *dstvms;
-#endif
- char username[70]="";
- char fn[PATH_MAX]; /* for playback of name greeting */
- char ecodes[16] = "#";
- int res = 0, cmd = 0;
- struct ast_vm_user *receiver = NULL, *vmtmp;
- AST_LIST_HEAD_NOLOCK_STATIC(extensions, ast_vm_user);
- char *stringp;
- const char *s;
- const char mailbox_context[256];
- int saved_messages = 0;
- int valid_extensions = 0;
- char *dir;
- int curmsg;
- char urgent_str[7] = "";
- int prompt_played = 0;
-#ifndef IMAP_STORAGE
- char msgfile[PATH_MAX], textfile[PATH_MAX], backup[PATH_MAX], backup_textfile[PATH_MAX];
-#endif
- if (ast_test_flag((&globalflags), VM_FWDURGAUTO)) {
- ast_copy_string(urgent_str, urgent ? "Urgent" : "", sizeof(urgent_str));
- }
-
- if (vms == NULL) return -1;
- dir = vms->curdir;
- curmsg = vms->curmsg;
-
- ast_test_suite_event_notify("FORWARD", "Message: entering forward message menu");
- while (!res && !valid_extensions) {
- int use_directory = 0;
- if (ast_test_flag((&globalflags), VM_DIRECTFORWARD)) {
- int done = 0;
- int retries = 0;
- cmd = 0;
- while ((cmd >= 0) && !done ){
- if (cmd)
- retries = 0;
- switch (cmd) {
- case '1':
- use_directory = 0;
- done = 1;
- break;
- case '2':
- use_directory = 1;
- done = 1;
- break;
- case '*':
- cmd = 't';
- done = 1;
- break;
- default:
- /* Press 1 to enter an extension press 2 to use the directory */
- cmd = ast_play_and_wait(chan, "vm-forward");
- if (!cmd) {
- cmd = ast_waitfordigit(chan, 3000);
- }
- if (!cmd) {
- retries++;
- }
- if (retries > 3) {
- cmd = 't';
- done = 1;
- }
- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",
- isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');
- }
- }
- if (cmd < 0 || cmd == 't')
- break;
- }
-
- if (use_directory) {
- /* use app_directory */
-
- struct ast_app* directory_app;
-
- directory_app = pbx_findapp("Directory");
- if (directory_app) {
- char vmcontext[256];
- char old_context[strlen(ast_channel_context(chan)) + 1];
- char old_exten[strlen(ast_channel_exten(chan)) + 1];
- int old_priority;
- /* make backup copies */
- strcpy(old_context, ast_channel_context(chan)); /* safe */
- strcpy(old_exten, ast_channel_exten(chan)); /* safe */
- old_priority = ast_channel_priority(chan);
-
- /* call the Directory, changes the channel */
- snprintf(vmcontext, sizeof(vmcontext), "%s,,v", context ? context : "default");
- res = pbx_exec(chan, directory_app, vmcontext);
-
- ast_copy_string(username, ast_channel_exten(chan), sizeof(username));
-
- /* restore the old context, exten, and priority */
- ast_channel_context_set(chan, old_context);
- ast_channel_exten_set(chan, old_exten);
- ast_channel_priority_set(chan, old_priority);
- } else {
- ast_log(AST_LOG_WARNING, "Could not find the Directory application, disabling directory_forward\n");
- ast_clear_flag((&globalflags), VM_DIRECTFORWARD);
- }
- } else {
- /* Ask for an extension */
- res = ast_streamfile(chan, "vm-extension", ast_channel_language(chan)); /* "extension" */
- prompt_played++;
- if (res || prompt_played > 4)
- break;
- if ((res = ast_readstring(chan, username, sizeof(username) - 1, 2000, 10000, "#")) < 0)
- break;
- }
-
- /* start all over if no username */
- if (ast_strlen_zero(username))
- continue;
- stringp = username;
- s = strsep(&stringp, "*");
- /* start optimistic */
- valid_extensions = 1;
- while (s) {
- snprintf((char*)mailbox_context, sizeof(mailbox_context), "%s@%s", s, context ? context : "default");
- if ((is_new_message == 1 || strcmp(s, sender->mailbox)) && (receiver = find_user(NULL, context, s))) {
- int oldmsgs;
- int newmsgs;
- int capacity;
-
- if (inboxcount(mailbox_context, &newmsgs, &oldmsgs)) {
- ast_log(LOG_ERROR, "Problem in calculating number of voicemail messages available for extension %s\n", mailbox_context);
- /* Shouldn't happen, but allow trying another extension if it does */
- res = ast_play_and_wait(chan, "pbx-invalid");
- valid_extensions = 0;
- break;
- }
-#ifdef IMAP_STORAGE
- if (!(dstvms = get_vm_state_by_mailbox(s, context, 0))) {
- if (!(dstvms = create_vm_state_from_user(receiver))) {
- ast_log(AST_LOG_ERROR, "Couldn't allocate necessary space\n");
- /* Shouldn't happen, but allow trying another extension if it does */
- res = ast_play_and_wait(chan, "pbx-invalid");
- valid_extensions = 0;
- break;
- }
- }
- check_quota(dstvms, imapfolder);
- if (dstvms->quota_limit && dstvms->quota_usage >= dstvms->quota_limit) {
- ast_log(LOG_NOTICE, "Mailbox '%s' is exceeded quota %u >= %u\n", mailbox_context, dstvms->quota_usage, dstvms->quota_limit);
- res = ast_play_and_wait(chan, "vm-mailboxfull");
- valid_extensions = 0;
- while ((vmtmp = AST_LIST_REMOVE_HEAD(&extensions, list))) {
- inprocess_count(vmtmp->mailbox, vmtmp->context, -1);
- free_user(vmtmp);
- }
- break;
- }
-#endif
- capacity = receiver->maxmsg - inprocess_count(receiver->mailbox, receiver->context, +1);
- if ((newmsgs + oldmsgs) >= capacity) {
- ast_log(LOG_NOTICE, "Mailbox '%s' is full with capacity of %d, prompting for another extension.\n", mailbox_context, capacity);
- res = ast_play_and_wait(chan, "vm-mailboxfull");
- valid_extensions = 0;
- while ((vmtmp = AST_LIST_REMOVE_HEAD(&extensions, list))) {
- inprocess_count(vmtmp->mailbox, vmtmp->context, -1);
- free_user(vmtmp);
- }
- inprocess_count(receiver->mailbox, receiver->context, -1);
- break;
- }
- AST_LIST_INSERT_HEAD(&extensions, receiver, list);
- } else {
- /* XXX Optimization for the future. When we encounter a single bad extension,
- * bailing out on all of the extensions may not be the way to go. We should
- * probably just bail on that single extension, then allow the user to enter
- * several more. XXX
- */
- while ((receiver = AST_LIST_REMOVE_HEAD(&extensions, list))) {
- free_user(receiver);
- }
- ast_log(LOG_NOTICE, "'%s' is not a valid mailbox\n", mailbox_context);
- /* "I am sorry, that's not a valid extension. Please try again." */
- res = ast_play_and_wait(chan, "pbx-invalid");
- valid_extensions = 0;
- break;
- }
-
- /* 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);
- if (ast_fileexists(fn, NULL, NULL) > 0) {
- res = ast_stream_and_wait(chan, fn, ecodes);
- if (res) {
- DISPOSE(fn, -1);
- return res;
- }
- } else {
- res = ast_say_digit_str(chan, s, ecodes, ast_channel_language(chan));
- }
- DISPOSE(fn, -1);
-
- s = strsep(&stringp, "*");
- }
- /* break from the loop of reading the extensions */
- if (valid_extensions)
- break;
- }
- /* check if we're clear to proceed */
- if (AST_LIST_EMPTY(&extensions) || !valid_extensions)
- return res;
- if (is_new_message == 1) {
- struct leave_vm_options leave_options;
- char mailbox[AST_MAX_EXTENSION * 2 + 2];
- snprintf(mailbox, sizeof(mailbox), "%s@%s", username, context);
-
- /* Send VoiceMail */
- memset(&leave_options, 0, sizeof(leave_options));
- leave_options.record_gain = record_gain;
- leave_options.beeptone = "beep";
- cmd = leave_voicemail(chan, mailbox, &leave_options);
- } else {
- /* Forward VoiceMail */
- long duration = 0;
- struct vm_state vmstmp;
- int copy_msg_result = 0;
-#ifdef IMAP_STORAGE
- char filename[PATH_MAX];
- struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
- const char *msg_id = NULL;
- struct ast_config *msg_cfg;
-#endif
- memcpy(&vmstmp, vms, sizeof(vmstmp));
-
- 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);
- msg_cfg = ast_config_load(filename, config_flags);
- if (msg_cfg && msg_cfg == CONFIG_STATUS_FILEINVALID) {
- msg_id = ast_strdupa(ast_variable_retrieve(msg_cfg, "message", "msg_id"));
- ast_config_destroy(msg_cfg);
- }
-#endif
-
- cmd = 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
- int attach_user_voicemail;
- char *myserveremail = serveremail;
-
- /* get destination mailbox */
- dstvms = get_vm_state_by_mailbox(vmtmp->mailbox, vmtmp->context, 0);
- if (!dstvms) {
- dstvms = create_vm_state_from_user(vmtmp);
- }
- if (dstvms) {
- init_mailstream(dstvms, 0);
- if (!dstvms->mailstream) {
- ast_log(AST_LOG_ERROR, "IMAP mailstream for %s is NULL\n", vmtmp->mailbox);
- } else {
- copy_msg_result = STORE(vmstmp.curdir, vmtmp->mailbox, vmtmp->context, curmsg, chan, vmtmp, fmt, duration, dstvms, urgent_str, msg_id);
- run_externnotify(vmtmp->context, vmtmp->mailbox, urgent_str, vmtmp->dialed_num);
- }
- } else {
- ast_log(AST_LOG_ERROR, "Could not find state information for mailbox %s\n", vmtmp->mailbox);
- }
- if (!ast_strlen_zero(vmtmp->serveremail))
- myserveremail = vmtmp->serveremail;
- attach_user_voicemail = ast_test_flag(vmtmp, VM_ATTACH);
- /* NULL category for IMAP storage */
- sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox,
- dstvms->curbox,
- S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL),
- S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL),
- 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);
-#endif
- saved_messages++;
- AST_LIST_REMOVE_CURRENT(list);
- inprocess_count(vmtmp->mailbox, vmtmp->context, -1);
- free_user(vmtmp);
- if (res)
- break;
- }
- AST_LIST_TRAVERSE_SAFE_END;
- if (saved_messages > 0 && !copy_msg_result) {
- /* give confirmation that the message was saved */
- /* commented out since we can't forward batches yet
- if (saved_messages == 1)
- res = ast_play_and_wait(chan, "vm-message");
- else
- res = ast_play_and_wait(chan, "vm-messages");
- if (!res)
- res = ast_play_and_wait(chan, "vm-saved"); */
- res = ast_play_and_wait(chan, "vm-msgforwarded");
- }
-#ifndef IMAP_STORAGE
- else {
- /* with IMAP, mailbox full warning played by imap_check_limits */
- res = ast_play_and_wait(chan, "vm-mailboxfull");
- }
- /* Restore original message without prepended message if backup exists */
- make_file(msgfile, sizeof(msgfile), dir, curmsg);
- strcpy(textfile, msgfile);
- strcpy(backup, msgfile);
- strcpy(backup_textfile, msgfile);
- strncat(textfile, ".txt", sizeof(textfile) - strlen(textfile) - 1);
- strncat(backup, "-bak", sizeof(backup) - strlen(backup) - 1);
- strncat(backup_textfile, "-bak.txt", sizeof(backup_textfile) - strlen(backup_textfile) - 1);
- if (ast_fileexists(backup, NULL, NULL) > 0) {
- ast_filerename(backup, msgfile, NULL);
- rename(backup_textfile, textfile);
- }
-#endif
- }
- DISPOSE(dir, curmsg);
-#ifndef IMAP_STORAGE
- if (cmd) { /* assuming hangup, cleanup backup file */
- make_file(msgfile, sizeof(msgfile), dir, curmsg);
- strcpy(textfile, msgfile);
- strcpy(backup_textfile, msgfile);
- strncat(textfile, ".txt", sizeof(textfile) - strlen(textfile) - 1);
- strncat(backup_textfile, "-bak.txt", sizeof(backup_textfile) - strlen(backup_textfile) - 1);
- rename(backup_textfile, textfile);
- }
-#endif
- }
-
- /* If anything failed above, we still have this list to free */
- while ((vmtmp = AST_LIST_REMOVE_HEAD(&extensions, list))) {
- inprocess_count(vmtmp->mailbox, vmtmp->context, -1);
- free_user(vmtmp);
- }
- return res ? res : cmd;
-}
-
static int wait_file2(struct ast_channel *chan, struct vm_state *vms, char *file)
{
@@ -11496,6 +11616,11 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
int res;
@@ -11336,6 +10902,11 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
int useadsi = 0, valid = 0, logretries = 0;
char password[AST_MAX_EXTENSION], *passptr = NULL;
struct ast_vm_user vmus, *vmu = NULL;
@ -212,7 +731,7 @@ index cb3db9b..954c66f 100644
/* If ADSI is supported, setup login screen */
adsi_begin(chan, &useadsi);
@@ -11506,6 +11631,22 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
@@ -11346,6 +10917,22 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
return -1;
}
@ -235,7 +754,7 @@ index cb3db9b..954c66f 100644
/* Authenticate them and get their mailbox/password */
while (!valid && (logretries < max_logins)) {
@@ -11535,6 +11676,18 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
@@ -11375,6 +10962,18 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
if (useadsi)
adsi_password(chan);
@ -247,14 +766,14 @@ index cb3db9b..954c66f 100644
+ ast_log(LOG_NOTICE, "Rewrote mailbox user input '%s' to %s\n",
+ mailbox, normalized_mailbox);
+ ast_copy_string(mailbox, normalized_mailbox, mailbox_size);
+ free(normalized_mailbox);
+ ast_free(normalized_mailbox);
+ }
+ }
+
if (!ast_strlen_zero(prefix)) {
char fullusername[80];
@@ -14117,6 +14270,8 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -13696,6 +13295,8 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
char secretfn[PATH_MAX] = "";
long tps_queue_low;
long tps_queue_high;
@ -263,7 +782,7 @@ index cb3db9b..954c66f 100644
#ifdef IMAP_STORAGE
ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder));
@@ -14181,6 +14336,19 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -13760,6 +13361,19 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
ast_copy_string(odbc_table, val, sizeof(odbc_table));
}
#endif

@ -7,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 d776cd0..b7ee586 100644
index 1ec826c..7bed701 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1848,7 +1848,7 @@ static int is_valid_dtmf(const char *key)
@@ -1752,7 +1752,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 d776cd0..b7ee586 100644
{
struct ast_variable *var;
struct ast_vm_user *retval;
@@ -1865,9 +1865,15 @@ static struct ast_vm_user *find_user_realtime(struct ast_vm_user *ivm, const cha
@@ -1769,9 +1769,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 d776cd0..b7ee586 100644
}
if (var) {
// ast_log (LOG_DEBUG,"call apply_options_full\n");
@@ -1931,7 +1937,7 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
@@ -1835,7 +1841,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 d776cd0..b7ee586 100644
#endif
}
if (!vmu && !ast_strlen_zero(aliasescontext)) {
@@ -4242,6 +4248,7 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
@@ -4131,6 +4137,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 d776cd0..b7ee586 100644
SQLHSTMT stmt = NULL;
obj = ast_odbc_request_obj(odbc_database, 0);
@@ -4256,6 +4263,8 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
@@ -4145,6 +4152,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 d776cd0..b7ee586 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);
@@ -4282,7 +4291,11 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
@@ -4171,7 +4180,11 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
ast_odbc_release_obj(obj);
ast_log(LOG_NOTICE, "Found mailbox '%s' for alias '%s'\n", mailbox, alias);

@ -1,100 +0,0 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_asterisk_16_support
---
Makefile | 2 +-
apps/app_playback.c | 5 +++--
apps/app_voicemail.c | 15 +++++++++------
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index fc52c48..1a62428 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ DEBUG=-g
LIBS+=-lpcre
CFLAGS+=-pipe -fPIC
CFLAGS+=-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
- -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable
+ -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-format-truncation
CFLAGS+=-D_REENTRANT -D_GNU_SOURCE -DODBC_STORAGE
all: _all
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 6eb6fb3..90a04e4 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -29,9 +29,10 @@
<support_level>core</support_level>
***/
-#include "asterisk.h"
-
#define AST_MODULE "app_playback"
+#define AST_MODULE_SELF_SYM __app_playback_sym
+
+#include "asterisk.h"
#include "asterisk/file.h"
#include "asterisk/pbx.h"
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index d1249df..92c9669 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -80,6 +80,9 @@
</category>
***/
+#define AST_MODULE "app_voicemail"
+#define AST_MODULE_SELF_SYM __app_voicemail_sym
+
#include "asterisk.h"
#ifdef IMAP_STORAGE
@@ -101,8 +104,6 @@
#endif
#endif
-#define AST_MODULE "voicemail"
-
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
#include <sys/time.h>
#include <sys/stat.h>
@@ -11918,7 +11919,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
ast_log(LOG_NOTICE, "Rewrote mailbox user input '%s' to %s\n",
mailbox, normalized_mailbox);
ast_copy_string(mailbox, normalized_mailbox, mailbox_size);
- free(normalized_mailbox);
+ ast_free(normalized_mailbox);
}
}
@@ -12166,8 +12167,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
int box;
int useadsi = 0;
int skipuser = 0;
- struct vm_state vms = {{0}};
- struct ast_vm_user *vmu = NULL, vmus = {{0}};
+ struct vm_state vms;
+ struct ast_vm_user *vmu = NULL, vmus;
char *context = NULL;
int silentexit = 0;
struct ast_flags flags = { 0 };
@@ -13510,7 +13511,7 @@ static struct ast_custom_function vm_info_acf = {
static int vmauthenticate(struct ast_channel *chan, const char *data)
{
char *s, *user = NULL, *context = NULL, mailbox[AST_MAX_EXTENSION] = "";
- struct ast_vm_user vmus = {{0}};
+ struct ast_vm_user vmus;
char *options = NULL;
int silent = 0, skipuser = 0;
int res = -1;
@@ -17473,5 +17474,7 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,
.load = load_module,
.unload = unload_module,
.reload = reload,
+#if 0
.optional_modules = "res_adsi,res_smdi",
+#endif
);

@ -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 143511a..d7c9e32 100644
index c9a2a594..f821c54 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1711,7 +1711,7 @@ static int change_password_realtime(struct ast_vm_user *vmu, const char *passwor
@@ -1619,7 +1619,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);
}

@ -2,28 +2,26 @@ From: Sipwise Development Team <support@sipwise.com>
Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_envelope_behaviour
envelope variable is taken globally from voicemail.conf
and currently ignored per user
---
apps/app_voicemail.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
apps/app_voicemail.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index bdd0850..90c5f41 100644
index 472e697..0584ab1 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1527,8 +1527,10 @@ static void apply_option(struct ast_vm_user *vmu, const char *var, const char *v
@@ -1435,8 +1435,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);
- } else if (!strcasecmp(var, "envelope")){
- ast_set2_flag(vmu, ast_true(value), VM_ENVELOPE);
+ // envelope variable is taken globally from voicemail.conf
+ // and currently ignored per user
+ //} else if (!strcasecmp(var, "envelope")){
+ // ast_set2_flag(vmu, ast_true(value), VM_ENVELOPE);
} else if (!strcasecmp(var, "moveheard")){
ast_set2_flag(vmu, ast_true(value), VM_MOVEHEARD);
} else if (!strcasecmp(var, "sayduration")){
@@ -15952,7 +15954,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -14973,7 +14971,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
context = ast_variable_retrieve(msg_cfg, "message", "macrocontext");
switch (option) {
case 3: /* Play message envelope */

@ -7,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 1a697ce..3849b6d 100644
index 6adbe29..3079b3e 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1021,6 +1021,8 @@ static int passwordlocation;
@@ -948,6 +948,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 1a697ce..3849b6d 100644
/*! Poll mailboxes for changes since there is something external to
* app_voicemail that may change them. */
@@ -1186,6 +1188,7 @@ static int vm_msg_remove(const char *mailbox, const char *context, size_t num_ms
@@ -1092,6 +1094,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 1a697ce..3849b6d 100644
#ifdef TEST_FRAMEWORK
static int vm_test_destroy_user(const char *context, const char *mailbox);
@@ -1783,6 +1786,8 @@ static void apply_options_full(struct ast_vm_user *retval, struct ast_variable *
@@ -1687,6 +1690,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 1a697ce..3849b6d 100644
#ifdef IMAP_STORAGE
} else if (!strcasecmp(var->name, "imapuser")) {
ast_copy_string(retval->imapuser, var->value, sizeof(retval->imapuser));
@@ -8593,6 +8598,58 @@ static struct vm_zone * get_vmu_timezone(struct ast_vm_user *vmu)
@@ -8055,6 +8060,58 @@ static struct vm_zone * get_vmu_timezone(struct ast_vm_user *vmu)
return tz;
}
@ -95,7 +95,7 @@ index 1a697ce..3849b6d 100644
/*!
* \brief Sends email notification that a user has a new voicemail waiting for them.
* \param chan
@@ -14423,6 +14480,9 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -13293,6 +13350,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 1a697ce..3849b6d 100644
#ifdef IMAP_STORAGE
ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder));
@@ -14500,6 +14560,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -13370,6 +13430,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
sw_normalize_user_replace[0] = '\0';
}

@ -7,10 +7,10 @@ Subject: sipwise_vm_externnotify_by_uuid
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index d9c0755..dfb806b 100644
index b7db74c..c4e3399 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -6701,15 +6701,15 @@ static void run_externnotify(char *context, char *extension, const char *flag, c
@@ -6308,15 +6308,15 @@ static void run_externnotify(const char *context, const char *extension, const c
if (msg_time) {
ast_localtime(msg_time, &tm, timezonename);
ast_strftime(date, sizeof(date), "%Y-%m-%dT%H:%M:%S%z", &tm);

@ -7,10 +7,10 @@ Subject: sipwise_vm_find_user_by_alias
1 file changed, 67 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ba41f21..cb3db9b 100644
index c901d8a..c05fd92 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1129,6 +1129,9 @@ static char emaildateformat[32] = "%A, %B %d, %Y at %r";
@@ -1036,6 +1036,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 ba41f21..cb3db9b 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);
@@ -1800,7 +1803,12 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
@@ -1709,7 +1712,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,7 +33,7 @@ index ba41f21..cb3db9b 100644
}
if (!vmu && !ast_strlen_zero(aliasescontext)) {
struct alias_mailbox_mapping *mapping;
@@ -4095,6 +4103,65 @@ bail:
@@ -3989,6 +3997,65 @@ bail:
return x - 1;
}

@ -7,10 +7,10 @@ Subject: sipwise_vm_find_user_by_alias_prio_uuid
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index c00767a..d776cd0 100644
index e483129..1ec826c 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4245,26 +4245,26 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
@@ -4134,26 +4134,26 @@ static struct ast_vm_user *find_user_realtime_by_alias(struct ast_vm_user *ivm,
SQLHSTMT stmt = NULL;
obj = ast_odbc_request_obj(odbc_database, 0);

@ -8,7 +8,7 @@ Subject: sipwise_vm_fix_compile_warnings
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index ad0c960..fc52c48 100644
index ce13bbf..a2ef134 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,8 @@ DEBUG=-g
@ -17,15 +17,15 @@ index ad0c960..fc52c48 100644
CFLAGS+=-pipe -fPIC
-CFLAGS+=-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
+CFLAGS+=-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
+ -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable
+ -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-format-truncation
CFLAGS+=-D_REENTRANT -D_GNU_SOURCE -DODBC_STORAGE
all: _all
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 3849b6d..b5fb35e 100644
index 3079b3e..33571cd 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5194,16 +5194,11 @@ static int base_encode(char *filename, FILE *so)
@@ -4953,16 +4953,11 @@ static int vm_delete(char *file)
static void prep_pager_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, char *cidnum, char *dur, char *date)
{
@ -42,7 +42,7 @@ index 3849b6d..b5fb35e 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)
@@ -5252,7 +5247,7 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
@@ -5011,7 +5006,7 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
}
if ((origtime = ast_variable_retrieve(msg_cfg, "message", "origtime")) && sscanf(origtime, "%30d", &inttime) == 1) {
@ -51,7 +51,7 @@ index 3849b6d..b5fb35e 100644
struct ast_tm tm;
ast_localtime(&tv, &tm, NULL);
ast_strftime_locale(origdate, sizeof(origdate), emaildateformat, &tm, S_OR(vmu->locale, NULL));
@@ -5653,7 +5648,7 @@ static void make_email_file(FILE *p,
@@ -5412,7 +5407,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,37 +3,36 @@ Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_fix_envelope_play
---
apps/app_voicemail.c | 4 ++++
1 file changed, 4 insertions(+)
apps/app_voicemail.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 33e52bb..d1249df 100644
index 3bcd05d..58d92fa 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -12503,8 +12503,10 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
+ */
case '3': // Envelope
if (vms.lastmsg > -1 && !vms.starting) {
@@ -11615,11 +11615,25 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
vms.repeats = 0;
while ((cmd > -1) && (cmd != 't') && (cmd != '#')) {
switch (cmd) {
+ case '3': // Envelope
+ if (vms.lastmsg > -1 && !vms.starting) {
+ ast_safe_sleep(chan,500);
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 3, record_gain);
if (cmd == ERROR_LOCK_PATH) {
res = cmd;
@@ -12515,6 +12517,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
+ cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 3, record_gain);
+ if (cmd == ERROR_LOCK_PATH) {
+ res = cmd;
+ goto out;
+ }
+ } else {
+ cmd = ast_play_and_wait(chan, "vm-sorry");
+ }
+ cmd = 't';
+ break;
case '*': /* Return to main menu */
cmd = 't';
break;
+ /*
case '4': // Dialout
if (!ast_strlen_zero(vmu->dialout)) {
cmd = dialout(chan, vmu, NULL, vmu->dialout);
@@ -12547,6 +12550,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
break;
default:
+ ast_safe_sleep(chan,500);
cmd = 0;
/*
if (!vms.starting) {
if (!cmd && !vms.starting) {
cmd = ast_play_and_wait(chan, "vm-tohearenv");

@ -7,10 +7,10 @@ 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 b7ee586..58d4595 100644
index 7bed701..9c1e5d3 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4203,7 +4203,9 @@ static int retrieve_file(char *dir, int msgnum)
@@ -4092,7 +4092,9 @@ static int retrieve_file(char *dir, int msgnum)
ast_debug(3, "Ignoring null category column in ODBC voicemail retrieve_file.\n");
continue;
} else if (!SQL_SUCCEEDED(res)) {
@ -21,7 +21,7 @@ index b7ee586..58d4595 100644
goto bail_with_handle;
}
if (strcasecmp(coltitle, "msgnum") && strcasecmp(coltitle, "dir")) {
@@ -9527,7 +9529,9 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -8619,7 +8621,9 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
}
#endif
if ((res = wait_file(chan, vms, vms->fn)) < 0) {

@ -7,10 +7,10 @@ Subject: sipwise_vm_fix_prev_message
1 file changed, 1 insertion(+)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 31f26b7..447ca93 100644
index 39df573..c09853c 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -12276,6 +12276,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -11408,6 +11408,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
#endif
/* Add the vm_state to the active list and keep it active */

@ -7,10 +7,10 @@ Subject: sipwise_vm_hebrew_language_fixups
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index dfb806b..06d8eea 100644
index c4e3399..c42d667 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9396,10 +9396,14 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
@@ -8486,10 +8486,14 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
vms->starting = 0;
make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg);
adsi_message(chan, vms);

@ -7,10 +7,10 @@ Subject: sipwise_vm_play_anonymous
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index d7c9e32..bdd0850 100644
index f821c54..472e697 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9045,7 +9045,7 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
@@ -8292,7 +8292,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,18 +7,18 @@ 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 954c66f..143511a 100644
index 0b5cf5a..c9a2a594 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11940,6 +11940,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -11228,6 +11228,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
signed char record_gain = 0;
int play_auto = 0;
int play_folder = 0;
+ int folder_change = 0;
int in_urgent = 0;
int nodelete = 0;
#ifdef IMAP_STORAGE
int deleted = 0;
@@ -12199,6 +12200,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -11497,6 +11498,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 954c66f..143511a 100644
ast_test_suite_event_notify("CHANGEFOLDER", "Message: browsing to a different folder");
if (useadsi)
adsi_folders(chan, 0, "Change to folder...");
@@ -12631,6 +12633,16 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -11816,6 +11818,16 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
vms.starting = 1;
break;
default: /* Nothing */
@ -41,5 +41,5 @@ index 954c66f..143511a 100644
+ }
+ folder_change = 0;
ast_test_suite_event_notify("PLAYBACK", "Message: instructions");
cmd = vm_instructions(chan, vmu, &vms, 0, in_urgent);
cmd = vm_instructions(chan, vmu, &vms, 0, in_urgent, nodelete);
break;

@ -7,10 +7,10 @@ Subject: sipwise_vm_pointers_malloc
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 92c9669..36fac28 100644
index 58d92fa..049453f 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1363,7 +1363,7 @@ static char *edit(const char *str, int len, const char *rep,
@@ -1268,7 +1268,7 @@ static char *edit(const char *str, int len, const char *rep,
slen = len;
len -= mvec[1] - mvec[0];
len += rlen = findreplen(rep, nmat, replen);
@ -19,7 +19,7 @@ index 92c9669..36fac28 100644
if (mvec[0] > 0) {
strncpy(cp, str, mvec[0]);
cp += mvec[0];
@@ -12183,6 +12183,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -11315,6 +11315,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;

@ -3,14 +3,14 @@ Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_romanian_syntax
---
apps/app_voicemail.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 84 insertions(+), 7 deletions(-)
apps/app_voicemail.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 85 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index c85220a..ba41f21 100644
index 0664279..c901d8a 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -730,6 +730,7 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -667,6 +667,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,15 +18,10 @@ index c85220a..ba41f21 100644
\arg \b nl - Dutch
\arg \b pt - Portuguese
\arg \b pt_BR - Portuguese (Brazil)
@@ -5865,13 +5866,17 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, ch
@@ -5629,6 +5630,17 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, ch
} else {
/* Dispose just in case */
DISPOSE(fn, -1);
- /*
- res = ast_stream_and_wait(chan, "vm-theperson", ecodes);
- if (res) {
- ast_log(LOG_WARNING, "failed to stream/wait vm-theperson\n");
- return res;
+
+ if(!strcasecmp(ast_channel_language(chan), "ro")) { /* ROMANIAN */
+ res = ast_stream_and_wait(chan, "vm-theperson", ecodes);
@ -35,14 +30,13 @@ index c85220a..ba41f21 100644
+ ast_log(LOG_WARNING, "failed to stream/wait vm-theperson\n");
+ return res;
+ }
}
- */
+ }
+
+ ast_log(LOG_DEBUG, "stream/wait dialed_num\n");
res = ast_say_digit_str(chan, dialed_num, ecodes, ast_channel_language(chan));
if (res) {
ast_log(LOG_WARNING, "failed to stream/wait '%s'\n", dialed_num);
@@ -8804,6 +8809,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8598,6 +8610,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);
@ -51,7 +45,7 @@ index c85220a..ba41f21 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 */
@@ -9448,8 +9455,9 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
@@ -9242,8 +9256,9 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
int cmd;
if ( !strncasecmp(ast_channel_language(chan), "it", 2) ||
@ -62,7 +56,7 @@ index c85220a..ba41f21 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)) {
@@ -9721,6 +9729,52 @@ static int vm_intro_ja(struct ast_channel *chan,struct vm_state *vms)
@@ -9515,6 +9530,52 @@ static int vm_intro_ja(struct ast_channel *chan,struct vm_state *vms)
return res;
} /* Japanese */
@ -115,7 +109,7 @@ index c85220a..ba41f21 100644
/* Default English syntax */
static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
{
@@ -10515,6 +10569,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
@@ -10354,6 +10415,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);
@ -124,7 +118,7 @@ index c85220a..ba41f21 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 */
@@ -11207,6 +11263,25 @@ static int vm_browse_messages_ja(struct ast_channel *chan, struct vm_state *vms,
@@ -11040,6 +11103,25 @@ static int vm_browse_messages_ja(struct ast_channel *chan, struct vm_state *vms,
return cmd;
}
@ -150,7 +144,7 @@ index c85220a..ba41f21 100644
/*!
* \brief Spanish syntax for 'You have N messages' greeting.
* \param chan
@@ -11332,6 +11407,8 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st
@@ -11165,6 +11247,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 | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 80 insertions(+), 1 deletion(-)
apps/app_voicemail.c | 178 +++++++++++++++------------------------------------
1 file changed, 53 insertions(+), 125 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 90c5f41..c370f16 100644
index 0584ab1..ba8f298 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1007,6 +1007,7 @@ static int silencethreshold = 128;
@@ -934,6 +934,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 90c5f41..c370f16 100644
static struct ast_smdi_interface *smdi_iface = NULL;
static char vmfmts[80] = "wav";
static double volgain;
@@ -5184,6 +5185,20 @@ static int base_encode(char *filename, FILE *so)
return 1;
@@ -4943,6 +4944,20 @@ static int vm_delete(char *file)
return ast_filedelete(file, NULL);
}
+static void prep_pager_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, char *cidnum, char *dur, char *date)
@ -39,34 +39,129 @@ index 90c5f41..c370f16 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];
@@ -5861,6 +5876,59 @@ static int sendmail(char *srcemail,
@@ -5620,150 +5635,56 @@ static int sendmail(char *srcemail,
return 0;
}
-static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, int duration, struct ast_vm_user *vmu, const char *category, const char *flag)
+static void run_externpager(char *pager, char *dialed_num, char *cidnum, int duration, struct ast_vm_user *vmu)
+{
{
- char enc_cidnum[256], enc_cidname[256];
+ char arguments[2048];
+ char date[256];
char date[256];
- char host[MAXHOSTNAMELEN] = "";
- char who[256];
+ char from[256];
+ char body[1024];
+ char dur[PATH_MAX];
+ struct ast_tm tm;
char dur[PATH_MAX];
- char tmp[80] = "/tmp/astmail-XXXXXX";
- char tmp2[PATH_MAX];
struct ast_tm tm;
- FILE *p;
- struct ast_str *str1 = ast_str_create(16), *str2 = 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));
- }
- if (cidname) {
- strip_control_and_high(cidname, enc_cidname, sizeof(enc_cidname));
- }
-
- if ((p = ast_file_mkftemp(tmp, VOICEMAIL_FILE_MODE & ~my_umask)) == NULL) {
- ast_log(AST_LOG_WARNING, "Unable to launch '%s' (can't create temporary file)\n", mailcmd);
- ast_free(str1);
- ast_free(str2);
- return -1;
- }
- gethostname(host, sizeof(host)-1);
- if (strchr(srcemail, '@')) {
- ast_copy_string(who, srcemail, sizeof(who));
- } else {
- snprintf(who, sizeof(who), "%s@%s", srcemail, host);
+ if (!str1) {
+ return;
+ }
+
}
- snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
- ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
- fprintf(p, "Date: %s\n", date);
- /* Reformat for custom pager format */
- ast_strftime_locale(date, sizeof(date), pagerdateformat, vmu_tm(vmu, &tm), S_OR(vmu->locale, NULL));
+ if (!ast_strlen_zero(externpager)) {
+
- if (!ast_strlen_zero(pagerfromstring)) {
- struct ast_channel *ast;
- if ((ast = ast_dummy_channel_alloc())) {
- char *ptr;
- prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, enc_cidnum, enc_cidname, dur, date, category, flag);
- ast_str_substitute_variables(&str1, 0, ast, pagerfromstring);
-
- if (check_mime(ast_str_buffer(str1))) {
- int first_line = 1;
- ast_str_encode_mime(&str2, 0, ast_str_buffer(str1), strlen("From: "), strlen(who) + 3);
- while ((ptr = strchr(ast_str_buffer(str2), ' '))) {
- *ptr = '\0';
- fprintf(p, "%s %s" ENDL, first_line ? "From:" : "", ast_str_buffer(str2));
- first_line = 0;
- /* Substring is smaller, so this will never grow */
- ast_str_set(&str2, 0, "%s", ptr + 1);
- }
- fprintf(p, "%s %s <%s>" ENDL, first_line ? "From:" : "", ast_str_buffer(str2), who);
- } else {
- fprintf(p, "From: %s <%s>" ENDL, ast_str_quote(&str2, 0, ast_str_buffer(str1)), who);
- }
- ast = ast_channel_unref(ast);
+ if (!ast_strlen_zero(pagerfromstring)) {
+ ast_copy_string(from, pagerfromstring, sizeof(from));
+ } else {
} else {
- ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
+ ast_copy_string(from, "Sipwise Voicemail", sizeof(from));
+ }
+
}
- } else {
- fprintf(p, "From: Asterisk PBX <%s>" ENDL, who);
- }
- if (check_mime(vmu->fullname)) {
- int first_line = 1;
- char *ptr;
- ast_str_encode_mime(&str2, 0, vmu->fullname, strlen("To: "), strlen(pager) + 3);
- while ((ptr = strchr(ast_str_buffer(str2), ' '))) {
- *ptr = '\0';
- fprintf(p, "%s %s" ENDL, first_line ? "To:" : "", ast_str_buffer(str2));
- first_line = 0;
- /* Substring is smaller, so this will never grow */
- ast_str_set(&str2, 0, "%s", ptr + 1);
- }
- fprintf(p, "%s %s <%s>" ENDL, first_line ? "To:" : "", ast_str_buffer(str2), pager);
- } else {
- fprintf(p, "To: %s <%s>" ENDL, ast_str_quote(&str2, 0, vmu->fullname), pager);
- }
+ snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
+
- if (!ast_strlen_zero(pagersubject)) {
- struct ast_channel *ast;
- if ((ast = ast_dummy_channel_alloc())) {
- prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, category, flag);
- ast_str_substitute_variables(&str1, 0, ast, pagersubject);
- if (check_mime(ast_str_buffer(str1))) {
- int first_line = 1;
- char *ptr;
- ast_str_encode_mime(&str2, 0, ast_str_buffer(str1), strlen("Subject: "), 0);
- while ((ptr = strchr(ast_str_buffer(str2), ' '))) {
- *ptr = '\0';
- fprintf(p, "%s %s" ENDL, first_line ? "Subject:" : "", ast_str_buffer(str2));
- first_line = 0;
- /* Substring is smaller, so this will never grow */
- ast_str_set(&str2, 0, "%s", ptr + 1);
- }
- fprintf(p, "%s %s" ENDL, first_line ? "Subject:" : "", ast_str_buffer(str2));
+ ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
+ ast_strftime_locale(date, sizeof(date), pagerdateformat, vmu_tm(vmu, &tm), S_OR(vmu->locale, NULL));
+
@ -77,56 +172,64 @@ index 90c5f41..c370f16 100644
+ ast_str_substitute_variables(&str1, 0, ast, pagerbody);
+ ast = ast_channel_unref(ast);
+ snprintf(body, sizeof(body), "%s", ast_str_buffer(str1));
+ } else {
} else {
- fprintf(p, "Subject: %s" ENDL, ast_str_buffer(str1));
+ ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
+ }
+ } else {
}
- ast = ast_channel_unref(ast);
} else {
- ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
+ snprintf(body, sizeof(body), "New %s long voicemail from %s in box %s, on %s",
+ dur, cidnum, dialed_num, date);
+ }
+
}
- } else {
- if (ast_strlen_zero(flag)) {
- fprintf(p, "Subject: New VM\n\n");
- } else {
- fprintf(p, "Subject: New %s VM\n\n", flag);
- }
- }
- if (pagerbody) {
- struct ast_channel *ast;
- if ((ast = ast_dummy_channel_alloc())) {
- prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, category, flag);
- ast_str_substitute_variables(&str1, 0, ast, pagerbody);
- fprintf(p, "%s" ENDL, ast_str_buffer(str1));
- ast = ast_channel_unref(ast);
- } else {
- ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
- }
+ snprintf(arguments, sizeof(arguments), "%s '%s' '%s' '%s' '%s' '%s' '%s' '%s' &",
+ externpager, from, pager, dialed_num, cidnum, dur, date, body);
+ ast_log(LOG_DEBUG, "Executing %s\n", arguments);
+ ast_safe_system(arguments);
+ } else {
} else {
- fprintf(p, "New %s long %s msg in box %s\n"
- "from %s, on %s", dur, flag, mailbox, (cidname ? cidname : (cidnum ? cidnum : "unknown")), date);
+ ast_log(LOG_DEBUG, "No externpager defined, skipping\n");
+ }
+ ast_free(str1);
+}
+
+#if 0
static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, int duration, struct ast_vm_user *vmu, const char *category, const char *flag)
{
char enc_cidnum[256], enc_cidname[256];
@@ -5874,6 +5942,8 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
FILE *p;
struct ast_str *str1 = ast_str_create(16), *str2 = ast_str_create(16);
+ ast_log(AST_LOG_WARNING, ">>>>>>>>>>>>>> sendpage called, srcemail=%s, pager=%s, msgnum=%d, context=%s, mailbox=%s, fromfolder=%s, cidnum=%s, cidname=%s, duration=%d, category=%s, flag=%s\n", srcemail, pager, msgnum, context, mailbox, fromfolder, cidnum, cidname, duration, category, flag);
+
if (!str1 || !str2) {
ast_free(str1);
ast_free(str2);
@@ -6006,6 +6076,7 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
ast_free(str2);
return 0;
}
-
- fclose(p);
- snprintf(tmp2, sizeof(tmp2), "( %s < %s ; rm -f %s ) &", mailcmd, tmp, tmp);
- ast_safe_system(tmp2);
- ast_debug(1, "Sent page to %s with command '%s'\n", pager, mailcmd);
ast_free(str1);
- ast_free(str2);
- return 0;
}
+#endif
/*!
* \brief Gets the current date and time, as formatted string.
@@ -8525,7 +8596,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8137,7 +8058,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
}
if (!ast_strlen_zero(vmu->pager)) {
- sendpage(myserveremail, vmu->pager, msgnum, vmu->context, vmu->mailbox, mbox(vmu, 0), cidnum, cidname, duration, vmu, category, flag);
+ //sendpage(myserveremail, vmu->pager, msgnum, vmu->context, vmu->mailbox, mbox(vmu, 0), cidnum, cidname, duration, vmu, category, flag);
+ run_externpager(vmu->pager, vmu->dialed_num, cidnum, duration, vmu)
}
if (ast_test_flag(vmu, VM_DELETE))
@@ -14533,6 +14605,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
@@ -13554,6 +13475,13 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con
externnotify[0] = '\0';
}

@ -7,10 +7,10 @@ Subject: sipwise_vm_store_message_add_diag_info
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 8e6e343..33e52bb 100644
index b11c94d..3bcd05d 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4592,6 +4592,10 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4478,6 +4478,10 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
int res;
SQLHSTMT stmt;
@ -21,7 +21,7 @@ index 8e6e343..33e52bb 100644
res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
if (!SQL_SUCCEEDED(res)) {
ast_log(AST_LOG_WARNING, "SQL Alloc Handle failed!\n");
@@ -4618,7 +4622,8 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
@@ -4504,7 +4508,8 @@ static SQLHSTMT insert_data_cb(struct odbc_obj *obj, void *vdata)
}
res = ast_odbc_execute_sql(obj, stmt, data->sql);
if (!SQL_SUCCEEDED(res)) {
@ -31,7 +31,7 @@ index 8e6e343..33e52bb 100644
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
return NULL;
}
@@ -4751,6 +4756,13 @@ static int store_file(const char *dir, const char *mailboxuser, const char *mail
@@ -4637,6 +4642,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);

@ -3,31 +3,14 @@ Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_uuid_mailbox
---
apps/app_voicemail.c | 145 +++++++++++++++++++++++++++++++--------------------
1 file changed, 89 insertions(+), 56 deletions(-)
apps/app_voicemail.c | 223 ++++++++++++++-------------------------------------
1 file changed, 62 insertions(+), 161 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index b1f5182..c85220a 100644
index 69371b0..0664279 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -58,14 +58,14 @@
<member name="FILE_STORAGE" displayname="Storage of Voicemail using filesystem">
<conflict>ODBC_STORAGE</conflict>
<conflict>IMAP_STORAGE</conflict>
- <defaultenabled>yes</defaultenabled>
+ <defaultenabled>no</defaultenabled>
<support_level>core</support_level>
</member>
<member name="ODBC_STORAGE" displayname="Storage of Voicemail using ODBC">
<depend>generic_odbc</depend>
<conflict>IMAP_STORAGE</conflict>
<conflict>FILE_STORAGE</conflict>
- <defaultenabled>no</defaultenabled>
+ <defaultenabled>yes</defaultenabled>
<support_level>core</support_level>
</member>
<member name="IMAP_STORAGE" displayname="Storage of Voicemail using IMAP4">
@@ -831,7 +831,8 @@ struct baseio {
@@ -760,7 +760,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 */
@ -37,7 +20,7 @@ index b1f5182..c85220a 100644
char password[80]; /*!< Secret pin code, numbers only */
char fullname[80]; /*!< Full name, for directory app */
char *email; /*!< E-mail address */
@@ -1653,6 +1654,12 @@ static void apply_options_full(struct ast_vm_user *retval, struct ast_variable *
@@ -1562,6 +1563,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));
@ -50,7 +33,7 @@ index b1f5182..c85220a 100644
#ifdef IMAP_STORAGE
} else if (!strcasecmp(var->name, "imapuser")) {
ast_copy_string(retval->imapuser, var->value, sizeof(retval->imapuser));
@@ -1735,6 +1742,7 @@ static struct ast_vm_user *find_user_realtime(struct ast_vm_user *ivm, const cha
@@ -1644,6 +1651,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) {
@ -58,7 +41,7 @@ index b1f5182..c85220a 100644
apply_options_full(retval, var);
ast_variables_destroy(var);
} else {
@@ -1790,6 +1798,7 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
@@ -1699,6 +1707,7 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
}
AST_LIST_UNLOCK(&users);
if (!vmu) {
@ -66,7 +49,7 @@ index b1f5182..c85220a 100644
vmu = find_user_realtime(ivm, context, mailbox);
}
if (!vmu && !ast_strlen_zero(aliasescontext)) {
@@ -3154,7 +3163,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
@@ -3048,7 +3057,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
return -1;
}
@ -75,7 +58,7 @@ index b1f5182..c85220a 100644
/* Check Quota */
if (box == 0) {
@@ -5008,7 +5017,8 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
@@ -4772,7 +4781,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);
@ -85,7 +68,7 @@ index b1f5182..c85220a 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"));
@@ -5832,7 +5842,7 @@ static int get_date(char *s, int len)
@@ -5596,7 +5606,7 @@ static int get_date(char *s, int len)
return ast_strftime(s, len, "%a %b %e %r UTC %Y", &tm);
}
@ -94,20 +77,15 @@ index b1f5182..c85220a 100644
{
int res;
char fn[PATH_MAX];
@@ -5855,12 +5865,18 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, in
@@ -5619,12 +5629,11 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, in
} else {
/* Dispose just in case */
DISPOSE(fn, -1);
+ /*
res = ast_stream_and_wait(chan, "vm-theperson", ecodes);
- res = ast_stream_and_wait(chan, "vm-theperson", ecodes);
- if (res)
+ if (res) {
+ ast_log(LOG_WARNING, "failed to stream/wait vm-theperson\n");
return res;
- return res;
- res = ast_say_digit_str(chan, ext, ecodes, ast_channel_language(chan));
- if (res)
+ }
+ */
+ 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);
@ -116,7 +94,7 @@ index b1f5182..c85220a 100644
}
res = ast_stream_and_wait(chan, busy ? "vm-isonphone" : "vm-isunavail", ecodes);
return res;
@@ -5904,6 +5920,7 @@ static int count_messages_in_folder(struct odbc_obj *odbc, const char *context,
@@ -5668,6 +5677,7 @@ static int count_messages_in_folder(struct odbc_obj *odbc, const char *context,
}
*messages = atoi(rowdata);
@ -124,12 +102,12 @@ index b1f5182..c85220a 100644
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
return 0;
@@ -6330,10 +6347,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
@@ -6094,10 +6104,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
return res;
}
-static void run_externnotify(char *context, char *extension, const char *flag)
+static void run_externnotify(char *context, char *extension, const char *flag, char *dialed_num)
-static void run_externnotify(const char *context, const char *extension, const char *flag)
+static void run_externnotify(const char *context, const char *extension, const char *flag, const char *dialed_num)
{
char arguments[255];
char ext_context[256] = "";
@ -137,7 +115,7 @@ index b1f5182..c85220a 100644
int newvoicemails = 0, oldvoicemails = 0, urgentvoicemails = 0;
struct ast_smdi_mwi_message *mwi_msg;
@@ -6342,6 +6360,9 @@ static void run_externnotify(char *context, char *extension, const char *flag)
@@ -6106,6 +6117,9 @@ static void run_externnotify(const char *context, const char *extension, const c
else
ast_copy_string(ext_context, extension, sizeof(ext_context));
@ -147,7 +125,7 @@ index b1f5182..c85220a 100644
if (smdi_iface) {
if (ast_app_has_voicemail(ext_context, NULL))
ast_smdi_mwi_set(smdi_iface, extension);
@@ -6362,12 +6383,15 @@ static void run_externnotify(char *context, char *extension, const char *flag)
@@ -6126,12 +6140,15 @@ static void run_externnotify(const char *context, const char *extension, const c
}
if (!ast_strlen_zero(externnotify)) {
@ -164,7 +142,7 @@ index b1f5182..c85220a 100644
oldvoicemails, urgentvoicemails);
ast_debug(1, "Executing %s\n", arguments);
ast_safe_system(arguments);
@@ -6784,7 +6808,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6575,7 +6592,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
/* Setup pre-file if appropriate */
if (strcmp(vmu->context, "default"))
@ -173,7 +151,7 @@ index b1f5182..c85220a 100644
else
ast_copy_string(ext_context, vmu->mailbox, sizeof(ext_context));
@@ -6794,16 +6818,16 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6585,16 +6602,16 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
Depending on the flag set in options.
*/
if (ast_test_flag(options, OPT_BUSY_GREETING)) {
@ -194,7 +172,7 @@ index b1f5182..c85220a 100644
ast_log(AST_LOG_WARNING, "Failed to make directory (%s)\n", tempfile);
free_user(vmu);
ast_free(tmp);
@@ -6816,7 +6840,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6607,7 +6624,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
DISPOSE(tempfile, -1);
/* It's easier just to try to make it than to check for its existence */
#ifndef IMAP_STORAGE
@ -203,16 +181,16 @@ index b1f5182..c85220a 100644
#else
snprintf(dir, sizeof(dir), "%simap", VM_SPOOL_DIR);
if (mkdir(dir, VOICEMAIL_DIR_MODE) && errno != EEXIST) {
@@ -6877,7 +6901,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6668,7 +6685,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
#ifdef ODBC_STORAGE
int success =
#endif
- RETRIEVE(prefile, -1, ext, context);
+ RETRIEVE(prefile, -1, vmu->mailbox, context);
if (ast_fileexists(prefile, NULL, NULL) > 0) {
if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1)
res = ast_waitstream(chan, ecodes);
@@ -6890,7 +6914,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1) {
/* We know we have a greeting at this point, so squelch the instructions
@@ -6687,7 +6704,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);
@ -221,7 +199,7 @@ index b1f5182..c85220a 100644
}
DISPOSE(prefile, -1);
if (res < 0) {
@@ -6993,7 +7017,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6790,7 +6807,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
ast_free(tmp);
return -1;
}
@ -230,7 +208,7 @@ index b1f5182..c85220a 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.
@@ -7058,7 +7082,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6858,7 +6875,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",
@ -239,7 +217,7 @@ index b1f5182..c85220a 100644
"context", ast_channel_context(chan),
"macrocontext", ast_channel_macrocontext(chan),
"exten", ast_channel_exten(chan),
@@ -7098,7 +7122,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6898,7 +6915,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
"origtime=%ld\n"
"category=%s\n"
"msg_id=%s\n",
@ -248,7 +226,7 @@ index b1f5182..c85220a 100644
ast_channel_context(chan),
ast_channel_macrocontext(chan),
ast_channel_exten(chan),
@@ -7126,7 +7150,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6926,7 +6943,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")) {
@ -257,7 +235,7 @@ index b1f5182..c85220a 100644
}
if (txt) {
@@ -7358,7 +7382,7 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg
@@ -7158,7 +7175,7 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg
return res;
#else
char *dir = vms->curdir;
@ -266,7 +244,7 @@ index b1f5182..c85220a 100644
char *context = vmu->context;
char sfn[PATH_MAX];
char dfn[PATH_MAX];
@@ -8321,7 +8345,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8121,7 +8138,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);
@ -275,7 +253,7 @@ index b1f5182..c85220a 100644
#ifdef IMAP_STORAGE
vm_delete(fn); /* Delete the file, but not the IMAP message */
@@ -8623,7 +8647,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
@@ -8424,7 +8441,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
ast_log(AST_LOG_ERROR, "IMAP mailstream for %s is NULL\n", vmtmp->mailbox);
} else {
copy_msg_result = STORE(vmstmp.curdir, vmtmp->mailbox, vmtmp->context, curmsg, chan, vmtmp, fmt, duration, dstvms, urgent_str, msg_id);
@ -284,7 +262,7 @@ index b1f5182..c85220a 100644
}
} else {
ast_log(AST_LOG_ERROR, "Could not find state information for mailbox %s\n", vmtmp->mailbox);
@@ -9202,7 +9226,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
@@ -9003,7 +9020,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. */
@ -293,7 +271,7 @@ index b1f5182..c85220a 100644
/* traverses directory using readdir (or select query for ODBC) */
count_msg = count_messages(vmu, vms->curdir);
@@ -10457,7 +10481,7 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
@@ -10303,7 +10320,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 */
@ -302,31 +280,27 @@ index b1f5182..c85220a 100644
if (ast_test_flag(vmu, VM_TEMPGREETWARN)) {
RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
if (ast_fileexists(prefile, NULL, NULL) > 0) {
@@ -10583,9 +10607,11 @@ static int vm_instructions_en(struct ast_channel *chan, struct ast_vm_user *vmu,
} else {
res = ast_play_and_wait(chan, "vm-undelete");
}
+ /*
if (!res) {
res = ast_play_and_wait(chan, "vm-toforward");
@@ -10433,9 +10450,6 @@ static int vm_instructions_en(struct ast_channel *chan, struct ast_vm_user *vmu,
res = ast_play_and_wait(chan, "vm-undelete");
}
}
+ */
- if (!res) {
- res = ast_play_and_wait(chan, "vm-toforward");
- }
if (!res) {
res = ast_play_and_wait(chan, "vm-savemessage");
}
@@ -10676,9 +10702,11 @@ static int vm_instructions_ja(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -10526,9 +10540,6 @@ static int vm_instructions_ja(struct ast_channel *chan, struct ast_vm_user *vmu,
} else {
res = ast_play_and_wait(chan, "vm-undelete");
}
+ /*
if (!res) {
res = ast_play_and_wait(chan, "vm-toforward");
}
+ */
- if (!res) {
- res = ast_play_and_wait(chan, "vm-toforward");
- }
if (!res) {
res = ast_play_and_wait(chan, "vm-savemessage");
}
@@ -10760,7 +10788,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -10610,7 +10621,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)) {
@ -335,7 +309,7 @@ index b1f5182..c85220a 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 == '#')
@@ -10770,14 +10798,14 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -10620,14 +10631,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)) {
@ -352,7 +326,7 @@ index b1f5182..c85220a 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 == '#')
@@ -10801,7 +10829,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -10651,7 +10662,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) {
@ -361,7 +335,7 @@ index b1f5182..c85220a 100644
cmd = ast_play_and_wait(chan, vm_invalid_password);
} else {
newpassword2[1] = '\0';
@@ -10815,7 +10843,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -10665,7 +10676,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
return cmd;
if (!strcmp(newpassword, newpassword2))
break;
@ -370,7 +344,7 @@ index b1f5182..c85220a 100644
cmd = ast_play_and_wait(chan, vm_mismatch);
}
if (++tries == 3)
@@ -10829,7 +10857,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -10679,7 +10690,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);
@ -379,7 +353,7 @@ index b1f5182..c85220a 100644
cmd = ast_play_and_wait(chan, vm_passchanged);
return cmd;
@@ -10860,15 +10888,15 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -10710,15 +10721,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 */
@ -398,7 +372,7 @@ index b1f5182..c85220a 100644
cmd = play_record_review(chan, "vm-rec-name", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL, NULL, 0);
break;
case '4': /* manage the temporary greeting */
@@ -10892,7 +10920,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -10742,7 +10753,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) {
@ -407,7 +381,7 @@ index b1f5182..c85220a 100644
cmd = ast_play_and_wait(chan, vm_invalid_password);
if (!cmd) {
cmd = ast_play_and_wait(chan, vm_pls_try_again);
@@ -10912,7 +10940,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -10762,7 +10773,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
}
}
if (strcmp(newpassword, newpassword2)) {
@ -416,7 +390,7 @@ index b1f5182..c85220a 100644
cmd = ast_play_and_wait(chan, vm_mismatch);
if (!cmd) {
cmd = ast_play_and_wait(chan, vm_pls_try_again);
@@ -10928,7 +10956,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -10778,7 +10789,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",
@ -425,7 +399,7 @@ index b1f5182..c85220a 100644
cmd = ast_play_and_wait(chan, vm_passchanged);
break;
case '*':
@@ -10936,7 +10964,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -10786,7 +10797,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
break;
default:
cmd = 0;
@ -434,7 +408,7 @@ index b1f5182..c85220a 100644
RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
if (ast_fileexists(prefile, NULL, NULL)) {
cmd = ast_play_and_wait(chan, "vm-tmpexists");
@@ -10998,7 +11026,7 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
@@ -10848,7 +10859,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");
@ -443,118 +417,140 @@ index b1f5182..c85220a 100644
while ((cmd >= 0) && (cmd != 't')) {
if (cmd)
retries = 0;
@@ -11912,7 +11940,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -11774,94 +11785,15 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
vms.repeats = 0;
while ((cmd > -1) && (cmd != 't') && (cmd != '#')) {
switch (cmd) {
- case '1': /* Reply */
+ /*
+ case '1': //
if (vms.lastmsg > -1 && !vms.starting) {
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 1, record_gain);
if (cmd == ERROR_LOCK_PATH || cmd == OPERATOR_EXIT) {
@@ -11924,7 +11953,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
- if (vms.lastmsg > -1 && !vms.starting) {
- cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 1, record_gain);
- if (cmd == ERROR_LOCK_PATH || cmd == OPERATOR_EXIT) {
- res = cmd;
- goto out;
- }
- } else {
- cmd = ast_play_and_wait(chan, "vm-sorry");
- }
- cmd = 't';
- break;
- case '2': /* Callback */
+ case '2': // Callback
if (!vms.starting)
ast_verb(3, "Callback Requested\n");
if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1 && !vms.starting) {
@@ -11941,7 +11970,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
- if (!vms.starting)
- 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);
- if (cmd == 9) {
- silentexit = 1;
- goto out;
- } else if (cmd == ERROR_LOCK_PATH) {
- res = cmd;
- goto out;
- }
- } else {
- cmd = ast_play_and_wait(chan, "vm-sorry");
- }
- cmd = 't';
- break;
- case '3': /* Envelope */
+ case '3': // Envelope
if (vms.lastmsg > -1 && !vms.starting) {
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 3, record_gain);
if (cmd == ERROR_LOCK_PATH) {
@@ -11953,7 +11982,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
- if (vms.lastmsg > -1 && !vms.starting) {
- cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 3, record_gain);
- if (cmd == ERROR_LOCK_PATH) {
- res = cmd;
- goto out;
- }
- } else {
- cmd = ast_play_and_wait(chan, "vm-sorry");
- }
- cmd = 't';
- break;
- case '4': /* Dialout */
+ case '4': // Dialout
if (!ast_strlen_zero(vmu->dialout)) {
cmd = dialout(chan, vmu, NULL, vmu->dialout);
if (cmd == 9) {
@@ -11966,7 +11995,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
cmd = 't';
break;
- if (!ast_strlen_zero(vmu->dialout)) {
- cmd = dialout(chan, vmu, NULL, vmu->dialout);
- if (cmd == 9) {
- silentexit = 1;
- goto out;
- }
- } else {
- cmd = ast_play_and_wait(chan, "vm-sorry");
- }
- cmd = 't';
- break;
-
- case '5': /* Leave VoiceMail */
+ case '5': // Leave VoiceMail
if (ast_test_flag(vmu, VM_SVMAIL)) {
cmd = forward_message(chan, context, &vms, vmu, vmfmts, 1, record_gain, 0);
if (cmd == ERROR_LOCK_PATH || cmd == OPERATOR_EXIT) {
@@ -11978,6 +12007,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
cmd = 't';
break;
+ */
- if (ast_test_flag(vmu, VM_SVMAIL)) {
- cmd = forward_message(chan, context, &vms, vmu, vmfmts, 1, record_gain, 0);
- if (cmd == ERROR_LOCK_PATH || cmd == OPERATOR_EXIT) {
- res = cmd;
- goto out;
- }
- } else {
- cmd = ast_play_and_wait(chan, "vm-sorry");
- }
- cmd = 't';
- break;
-
case '*': /* Return to main menu */
cmd = 't';
@@ -11985,21 +12015,25 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
break;
default:
cmd = 0;
+ /*
if (!vms.starting) {
cmd = ast_play_and_wait(chan, "vm-toreply");
}
if (!ast_strlen_zero(vmu->callback) && !vms.starting && !cmd) {
cmd = ast_play_and_wait(chan, "vm-tocallback");
}
+ */
- if (!vms.starting) {
- cmd = ast_play_and_wait(chan, "vm-toreply");
- }
- if (!ast_strlen_zero(vmu->callback) && !vms.starting && !cmd) {
- cmd = ast_play_and_wait(chan, "vm-tocallback");
- }
if (!cmd && !vms.starting) {
cmd = ast_play_and_wait(chan, "vm-tohearenv");
}
+ /*
if (!ast_strlen_zero(vmu->dialout) && !cmd) {
cmd = ast_play_and_wait(chan, "vm-tomakecall");
}
if (ast_test_flag(vmu, VM_SVMAIL) && !cmd) {
cmd = ast_play_and_wait(chan, "vm-leavemsg");
}
+ */
- if (!ast_strlen_zero(vmu->dialout) && !cmd) {
- cmd = ast_play_and_wait(chan, "vm-tomakecall");
- }
- if (ast_test_flag(vmu, VM_SVMAIL) && !cmd) {
- cmd = ast_play_and_wait(chan, "vm-leavemsg");
- }
if (!cmd) {
cmd = ast_play_and_wait(chan, "vm-starmain");
}
@@ -12150,7 +12184,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12012,37 +11944,6 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
#endif
break;
- case '8': /* Forward the current message */
+ /*
+ case '8': // Forward the current message
if (vms.lastmsg > -1) {
cmd = forward_message(chan, context, &vms, vmu, vmfmts, 0, record_gain, in_urgent);
if (cmd == ERROR_LOCK_PATH) {
@@ -12158,12 +12193,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
goto out;
}
} else {
- if (vms.lastmsg > -1) {
- cmd = forward_message(chan, context, &vms, vmu, vmfmts, 0, record_gain, in_urgent);
- if (cmd == ERROR_LOCK_PATH) {
- res = cmd;
- goto out;
- }
- } else {
- /* Check if we were listening to urgent
- messages. If so, go to regular new messages
- instead of saying "no more messages"
- */
if (in_urgent == 1 && vms.newmessages > 0) {
- if (in_urgent == 1 && vms.newmessages > 0) {
- /* Check for new messages */
in_urgent = 0;
res = close_mailbox(&vms, vmu);
if (res == ERROR_LOCK_PATH)
@@ -12181,6 +12211,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
}
}
break;
+ */
- in_urgent = 0;
- res = close_mailbox(&vms, vmu);
- if (res == ERROR_LOCK_PATH)
- goto out;
- res = open_mailbox(&vms, vmu, NEW_FOLDER);
- if (res < 0)
- 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) {
- cmd = ast_play_and_wait(chan, "vm-nomore");
- }
- } else {
- cmd = ast_play_and_wait(chan, "vm-nomore");
- }
- }
- break;
case '9': /* Save message to folder */
ast_test_suite_event_notify("SAVEMSG", "Message: saving message %d\r\nVoicemail: %d", vms.curmsg, vms.curmsg);
if (vms.curmsg < 0 || vms.curmsg > vms.lastmsg) {
@@ -12291,6 +12322,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12153,6 +12054,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
cmd = 0;
break;
case '0': /* Mailbox options */
@ -562,7 +558,7 @@ index b1f5182..c85220a 100644
cmd = vm_options(chan, vmu, &vms, vmfmts, record_gain);
if (useadsi)
adsi_status(chan, &vms);
@@ -12337,7 +12369,7 @@ out:
@@ -12199,7 +12101,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 */
@ -571,17 +567,15 @@ index b1f5182..c85220a 100644
ast_app_inboxcount2(ext_context, &urgent, &new, &old);
queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgent, new, old);
}
@@ -13229,7 +13261,8 @@ static void poll_subscribed_mailbox(struct mwi_sub *mwi_sub)
mwi_sub->old_new = new;
mwi_sub->old_old = old;
queue_mwi_event(NULL, mwi_sub->mailbox, urgent, new, old);
- run_externnotify(NULL, mwi_sub->mailbox, NULL);
+ // ksolomko: disabled as we do not have the number here
+ //run_externnotify(NULL, mwi_sub->mailbox, NULL, mwi_sub->dialed_num);
@@ -13021,7 +12923,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);
- run_externnotify(NULL, mwi_state->uniqueid, NULL);
}
}
@@ -16389,7 +16422,7 @@ static void notify_new_state(struct ast_vm_user *vmu)
return 0;
@@ -16096,7 +15997,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);

@ -3,14 +3,14 @@ Date: Mon, 21 Feb 2022 14:17:23 +0100
Subject: sipwise_vm_vmnotify_ext_format
---
apps/app_voicemail.c | 137 +++++++++++++++++++++++++++++++++++++--------------
1 file changed, 99 insertions(+), 38 deletions(-)
apps/app_voicemail.c | 133 +++++++++++++++++++++++++++++++++++++--------------
1 file changed, 97 insertions(+), 36 deletions(-)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index aa79446..1a697ce 100644
index 9f4fd49..6adbe29 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1185,6 +1185,8 @@ static int vm_msg_move(const char *mailbox, const char *context, size_t num_msgs
@@ -1091,6 +1091,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 aa79446..1a697ce 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);
@@ -5876,7 +5878,7 @@ static int sendmail(char *srcemail,
@@ -5635,7 +5637,7 @@ static int sendmail(char *srcemail,
return 0;
}
@ -28,7 +28,7 @@ index aa79446..1a697ce 100644
{
char arguments[2048];
char date[256];
@@ -5885,6 +5887,7 @@ static void run_externpager(char *pager, char *dialed_num, char *cidnum, int dur
@@ -5644,6 +5646,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 aa79446..1a697ce 100644
if (!str1) {
return;
@@ -5900,8 +5903,14 @@ static void run_externpager(char *pager, char *dialed_num, char *cidnum, int dur
@@ -5659,8 +5662,14 @@ static void run_externpager(char *pager, char *dialed_num, char *cidnum, int dur
snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
@ -48,17 +48,17 @@ index aa79446..1a697ce 100644
+ ast_localtime(&t, &tm, timezonename);
+ }
+
+ ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", &tm);
+ ast_strftime_locale(date, sizeof(date), pagerdateformat, &tm, S_OR(vmu->locale, NULL));
+ ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", &tm);
+ ast_strftime_locale(date, sizeof(date), pagerdateformat, &tm, S_OR(vmu->locale, NULL));
if (pagerbody) {
struct ast_channel *ast;
@@ -6606,9 +6615,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
@@ -6215,9 +6224,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
return res;
}
-static void run_externnotify(char *context, char *extension, const char *flag, char *dialed_num)
+static void run_externnotify(char *context, char *extension, const char *flag, char *dialed_num, int msgnum, char *cidnum, struct timeval *msg_time, int duration, char *timezonename)
-static void run_externnotify(const char *context, const char *extension, const char *flag, const char *dialed_num)
+static void run_externnotify(const char *context, const char *extension, const char *flag, const char *dialed_num, int msgnum, char *cidnum, struct timeval *msg_time, int duration, char *timezonename)
{
- char arguments[255];
+ char arguments[2048];
@ -67,7 +67,7 @@ index aa79446..1a697ce 100644
char ext_context[256] = "";
char number[256] = "";
int newvoicemails = 0, oldvoicemails = 0, urgentvoicemails = 0;
@@ -6648,10 +6659,20 @@ static void run_externnotify(char *context, char *extension, const char *flag, c
@@ -6257,10 +6268,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 aa79446..1a697ce 100644
ast_debug(1, "Executing %s\n", arguments);
ast_safe_system(arguments);
}
@@ -8519,6 +8540,59 @@ static void queue_mwi_event(const char *channel_id, const char *box, int urgent,
@@ -7981,6 +8002,59 @@ static void queue_mwi_event(const char *channel_id, const char *box, int urgent,
}
}
@ -152,7 +152,7 @@ index aa79446..1a697ce 100644
/*!
* \brief Sends email notification that a user has a new voicemail waiting for them.
* \param chan
@@ -8539,6 +8613,8 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8001,6 +8075,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,16 +161,16 @@ index aa79446..1a697ce 100644
ast_channel_lock(chan);
if ((category = pbx_builtin_getvar_helper(chan, "VM_CATEGORY"))) {
@@ -8597,7 +8673,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8058,7 +8134,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
}
if (!ast_strlen_zero(vmu->pager)) {
//sendpage(myserveremail, vmu->pager, msgnum, vmu->context, vmu->mailbox, mbox(vmu, 0), cidnum, cidname, duration, vmu, category, flag);
- run_externpager(vmu->pager, vmu->dialed_num, cidnum, duration, vmu)
+ run_externpager(vmu->pager, vmu->dialed_num, cidnum, &msg_time, duration, S_COR(tz, tz->timezone, ""), vmu);
}
if (ast_test_flag(vmu, VM_DELETE))
@@ -8608,7 +8684,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8069,7 +8145,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,16 +179,7 @@ index aa79446..1a697ce 100644
#ifdef IMAP_STORAGE
vm_delete(fn); /* Delete the file, but not the IMAP message */
@@ -8912,7 +8988,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
ast_log(AST_LOG_ERROR, "IMAP mailstream for %s is NULL\n", vmtmp->mailbox);
} else {
copy_msg_result = STORE(vmstmp.curdir, vmtmp->mailbox, vmtmp->context, curmsg, chan, vmtmp, fmt, duration, dstvms, urgent_str, msg_id);
- run_externnotify(vmtmp->context, vmtmp->mailbox, urgent_str, vmtmp->dialed_num);
+ run_externnotify(vmtmp->context, vmtmp->mailbox, urgent_str, vmtmp->dialed_num, 0, NULL, NULL, 0, NULL);
}
} else {
ast_log(AST_LOG_ERROR, "Could not find state information for mailbox %s\n", vmtmp->mailbox);
@@ -9022,35 +9098,20 @@ static int play_message_category(struct ast_channel *chan, const char *category)
@@ -8114,35 +8190,20 @@ static int play_message_category(struct ast_channel *chan, const char *category)
static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, const char *origtime, const char *filename)
{
int res = 0;
@ -230,7 +221,7 @@ index aa79446..1a697ce 100644
/* No internal variable parsing for now, so we'll comment it out for the time being */
#if 0
/* Set the DIFF_* variables */
@@ -9067,8 +9128,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8159,8 +8220,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
/* Can't think of how other diffs might be helpful, but I'm sure somebody will think of something. */
#endif
@ -241,7 +232,7 @@ index aa79446..1a697ce 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 */
@@ -12759,7 +12820,7 @@ out:
@@ -11789,7 +11850,7 @@ out:
int new = 0, old = 0, urgent = 0;
snprintf(ext_context, sizeof(ext_context), "%s@%s", vms.username, vmu->context);
/* Urgent flag not passwd to externnotify here */
@ -250,16 +241,7 @@ index aa79446..1a697ce 100644
ast_app_inboxcount2(ext_context, &urgent, &new, &old);
queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgent, new, old);
}
@@ -13652,7 +13713,7 @@ static void poll_subscribed_mailbox(struct mwi_sub *mwi_sub)
mwi_sub->old_old = old;
queue_mwi_event(NULL, mwi_sub->mailbox, urgent, new, old);
// ksolomko: disabled as we do not have the number here
- //run_externnotify(NULL, mwi_sub->mailbox, NULL, mwi_sub->dialed_num);
+ //run_externnotify(NULL, mwi_sub->mailbox, NULL, mwi_sub->dialed_num, 0, NULL, NULL, 0, NULL);
}
}
@@ -16831,7 +16892,7 @@ static void notify_new_state(struct ast_vm_user *vmu)
@@ -15704,7 +15765,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 c370f16..aa79446 100644
index ba8f298..9f4fd49 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9022,7 +9022,7 @@ static int play_message_category(struct ast_channel *chan, const char *category)
@@ -8114,7 +8114,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 c370f16..aa79446 100644
time_t t;
if (ast_get_time_t(origtime, &t, 0, NULL)) {
@@ -9037,13 +9037,20 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8129,13 +8129,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 c370f16..aa79446 100644
/* No internal variable parsing for now, so we'll comment it out for the time being */
#if 0
/* Set the DIFF_* variables */
@@ -9060,8 +9067,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
@@ -8152,8 +8159,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 c370f16..aa79446 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 */
@@ -14309,17 +14316,14 @@ static void load_zonemessages(struct ast_config *cfg)
@@ -13179,17 +13186,14 @@ static void load_zonemessages(struct ast_config *cfg)
strcpy(storage, var->value); /* safe */
msg_format = storage;
tzone = strsep(&msg_format, "|,");

6
debian/rules vendored

@ -1,8 +1,8 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export ASTLIBDIR=/usr/lib/${DEB_HOST_MULTIARCH}/asterisk/modules
%:
dh $@ --with quilt
dh $@ --with quilt --with asterisk

Loading…
Cancel
Save