aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-11 20:57:44 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-11 20:57:44 +0000
commitb7a892e38434a7418c53593a1f8bc4c2be8276c4 (patch)
tree6f42d1a4565cc9f4e0131a70eb8f4c9d1616ca4f
parente8c74a4a13470289aaeece7df64240f4bf118697 (diff)
Add an option to voicemail.conf to allow urgent messages to be
forwarded as not urgent. (closes issue #14063) Reported by: jaroth Patches: urgfwd_v2.patch uploaded by jaroth (license 50) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163213 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_voicemail.c11
-rw-r--r--configs/voicemail.conf.sample4
2 files changed, 14 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 0206e221a..f23624fa2 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -407,6 +407,7 @@ static AST_LIST_HEAD_STATIC(vmstates, vmstate);
#define VM_TEMPGREETWARN (1 << 15) /*!< Remind user tempgreeting is set */
#define VM_MOVEHEARD (1 << 16) /*!< Move a "heard" message to Old after listening to it */
#define VM_MESSAGEWRAP (1 << 17) /*!< Wrap around from the last message to the first, and vice-versa */
+#define VM_FWDURGAUTO (1 << 18) /*!< Autoset of Urgent flag on forwarded Urgent messages set globally */
#define ERROR_LOCK_PATH -100
@@ -6267,7 +6268,9 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
char urgent_str[7] = "";
char tmptxtfile[PATH_MAX];
- ast_copy_string(urgent_str, urgent ? "Urgent" : "", sizeof(urgent_str));
+ 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;
@@ -10663,6 +10666,12 @@ static int load_config(int reload)
}
ast_set2_flag((&globalflags), ast_true(val), VM_MOVEHEARD);
+ if (!(val = ast_variable_retrieve(cfg, "general", "forward_urgent_auto"))) {
+ ast_debug(1,"Autoset of Urgent flag on forwarded Urgent messages disabled globally\n");
+ val = "no";
+ }
+ ast_set2_flag((&globalflags), ast_true(val), VM_FWDURGAUTO);
+
if (!(val = ast_variable_retrieve(cfg, "general", "sayduration"))) {
ast_debug(1,"Duration info before msg enabled globally\n");
val = "yes";
diff --git a/configs/voicemail.conf.sample b/configs/voicemail.conf.sample
index b7f4ccbc6..17c6a018d 100644
--- a/configs/voicemail.conf.sample
+++ b/configs/voicemail.conf.sample
@@ -55,6 +55,10 @@ maxlogins=3
; Move heard messages to the 'Old' folder automagically. Defaults to on.
;moveheard=yes
;
+; Forward an urgent message as an urgent message. Defaults to no so
+; sender can set the urgency on the envelope of the forwarded message.
+;forward_urgent_auto=no
+;
; User context is where entries from users.conf are registered. The
; default value is 'default'
;