diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2006-04-24 17:20:41 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2006-04-24 17:20:41 +0000 |
commit | e3f569532f7a76f93f544c933a9daa6c299091e0 (patch) | |
tree | fc41629d5eb3d368537e350e3c8c133690e5296a | |
parent | 574e14cbea69b596a9a540b6401f2a087ec1e9ac (diff) |
Deprecate prefixed options in voicemail
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@22268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | apps/app_voicemail.c | 22 | ||||
-rw-r--r-- | configs/extensions.conf.sample | 16 |
2 files changed, 25 insertions, 13 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 46a8b2cd7..659bd27d3 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -5577,6 +5577,7 @@ static int vm_exec(struct ast_channel *chan, void *data) char *tmp; struct leave_vm_options leave_options; struct ast_flags flags = { 0 }; + static int deprecate_warning = 0; char *opts[OPT_ARG_ARRAY_SIZE]; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(argv0); @@ -5617,19 +5618,30 @@ static int vm_exec(struct ast_channel *chan, void *data) } } else { /* old style options parsing */ + int old = 0; + char *orig_argv0 = args.argv0; while (*(args.argv0)) { - if (*(args.argv0) == 's') + if (*(args.argv0) == 's') { + old = 1; ast_set_flag(&leave_options, OPT_SILENT); - else if (*(args.argv0) == 'b') + } else if (*(args.argv0) == 'b') { + old = 1; ast_set_flag(&leave_options, OPT_BUSY_GREETING); - else if (*(args.argv0) == 'u') + } else if (*(args.argv0) == 'u') { + old = 1; ast_set_flag(&leave_options, OPT_UNAVAIL_GREETING); - else if (*(args.argv0) == 'j') + } else if (*(args.argv0) == 'j') { + old = 1; ast_set_flag(&leave_options, OPT_PRIORITY_JUMP); - else + } else break; (args.argv0)++; } + if (!deprecate_warning && old) { + deprecate_warning = 1; + ast_log(LOG_WARNING, "Prefixing the mailbox with an option is deprecated ('%s').\n", orig_argv0); + ast_log(LOG_WARNING, "Please move all leading options to the second argument.\n"); + } } } else { char tmp[256]; diff --git a/configs/extensions.conf.sample b/configs/extensions.conf.sample index a61c15c90..bc858a953 100644 --- a/configs/extensions.conf.sample +++ b/configs/extensions.conf.sample @@ -313,10 +313,10 @@ include => iaxprovider exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) -exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce +exten => s-NOANSWER,1,Voicemail(${ARG1},u) ; If unavailable, send to voicemail w/ unavail announce exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start -exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce +exten => s-BUSY,1,Voicemail(${ARG1},b) ; If busy, send to voicemail w/ busy announce exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer @@ -335,10 +335,10 @@ exten => s,1,Dial(${ARG2},20|p) ; Ring the interface, 20 seconds maximum, call ; option (or use P for databased call screening) exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) -exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce +exten => s-NOANSWER,1,Voicemail(${ARG1},u) ; If unavailable, send to voicemail w/ unavail announce exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start -exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce +exten => s-BUSY,1,Voicemail(${ARG1},b) ; If busy, send to voicemail w/ busy announce exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start exten => s-DONTCALL,1,Goto(${ARG3},s,1) ; Callee chose to send this call to a polite "Don't call again" script. @@ -393,10 +393,10 @@ exten => 1234,1,Playback(transfer,skip) ; "Please hold while..." ; (but skip if channel is not up) exten => 1234,n,Macro(stdexten,1234,${CONSOLE}) -exten => 1235,1,Voicemail(u1234) ; Right to voicemail +exten => 1235,1,Voicemail(1234,u) ; Right to voicemail exten => 1236,1,Dial(Console/dsp) ; Ring forever -exten => 1236,n,Voicemail(u1234) ; Unless busy +exten => 1236,n,Voicemail(1234,b) ; Unless busy ; ; # for when they're done with the demo @@ -500,9 +500,9 @@ include => demo ;exten => 6245,hint,SIP/Grandstream1&SIP/Xlite1,Joe Schmoe ; Channel hints for presence ;exten => 6245,1,Dial(SIP/Grandstream1,20,rt) ; permit transfer ;exten => 6245,n(dial),Dial(${HINT},20,rtT) ; Use hint as listed -;exten => 6245,n,Voicemail(u6245) ; Voicemail (unavailable) +;exten => 6245,n,Voicemail(6245,u) ; Voicemail (unavailable) ;exten => 6245,s+1,Hangup ; s+1, same as n -;exten => 6245,dial+101,Voicemail(b6245) ; Voicemail (busy) +;exten => 6245,dial+101,Voicemail(6245,b) ; Voicemail (busy) ;exten => 6361,1,Dial(IAX2/JaneDoe,,rm) ; ring without time limit ;exten => 6389,1,Dial(MGCP/aaln/1@192.168.0.14) ;exten => 6394,1,Dial(Local/6275/n) ; this will dial ${MARK} |