@ -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 */
@@ -1 653,6 +1654 ,12 @@ static void apply_options_full(struct ast_vm_user *retval, struct ast_variable *
@@ -1 562,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));
@@ -1 735,6 +1742 ,7 @@ static struct ast_vm_user *find_user_realtime(struct ast_vm_user *ivm, const cha
@@ -1 644,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 {
@@ -1 790,6 +1798 ,7 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *contex
@@ -1 699,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)) {
@@ -3 154,7 +3163 ,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
@@ -3 048,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"));
@@ -5 832,7 +5842 ,7 @@ static int get_date(char *s, int len)
@@ -5 596,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];
@@ -5 855,12 +5865,18 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, in
@@ -5 619,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;
@@ -5 904,6 +5920 ,7 @@ static int count_messages_in_folder(struct odbc_obj *odbc, const char *context,
@@ -5 668,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;
@@ -6 330,10 +6347 ,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
@@ -6 094,10 +6104 ,11 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
return res;
}
-static void run_externnotify(c har *context, char *extension, const char *flag)
+static void run_externnotify(c har *context, char *extension, const char *flag, char *dialed_num)
-static void run_externnotify(c onst c har *context, const char *extension, const char *flag)
+static void run_externnotify(c onst c har *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;
@@ -6 342,6 +6360,9 @@ static void run_externnotify(char *context, char *extension, const char *flag)
@@ -6 106,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);
@@ -6 362,12 +6383,15 @@ static void run_externnotify(char *context, char *extension, const char *flag)
@@ -6 126,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);
@@ -6 784,7 +6808 ,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6 575,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));
@@ -6 794,16 +6818 ,16 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6 585,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);
@@ -6 816,7 +6840 ,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6 607,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) {
@@ -6 877,7 +6901 ,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6 668,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);
@@ -6 890,7 +691 4,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
@@ -6 687,7 +670 4,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) {
@@ -6 993,7 +701 7,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
@@ -6 790,7 +680 7,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) {
@@ -7 358,7 +7382 ,7 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg
@@ -7 158,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];
@@ -8 321,7 +8345 ,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -8 121,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 */
@@ -8 623,7 +8647 ,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
@@ -8 424,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);
@@ -9 202,7 +9226 ,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
@@ -9 003,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);
@@ -10 457,7 +10481 ,7 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
@@ -10 303,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");
}
@@ -10 676,9 +10702,11 @@ static int vm_instructions_ja(struct ast_channel *chan, struct ast_vm_user *vmu,
@@ -10 526,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");
}
@@ -10 760,7 +10788 ,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -10 610,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 == '#')
@@ -10 770,14 +10798 ,14 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -10 620,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 == '#')
@@ -10 801,7 +10829 ,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -10 651,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';
@@ -10 815,7 +10843 ,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -10 665,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)
@@ -10 829,7 +10857 ,7 @@ static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, s
@@ -10 679,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;
@@ -10 860,15 +10888 ,15 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -10 710,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 */
@@ -10 892,7 +10920 ,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -10 742,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);
@@ -10 912,7 +10940 ,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -10 762,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);
@@ -10 928,7 +10956 ,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -10 778,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 '*':
@@ -10 936,7 +10964 ,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
@@ -10 786,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");
@@ -10 998,7 +11026 ,7 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
@@ -10 848,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;
@@ -11 912,7 +11940,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -11 774,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");
}
@@ -12 150,7 +12184,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
@@ -12 012,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)
@@ -12 153,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);
@@ -12 337,7 +12369 ,7 @@ out:
@@ -12 199,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);