[svn-commits] trunk r22268 - in /trunk: apps/app_voicemail.c configs/extensions.conf.sample

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Apr 24 10:20:42 MST 2006


Author: tilghman
Date: Mon Apr 24 12:20:41 2006
New Revision: 22268

URL: http://svn.digium.com/view/asterisk?rev=22268&view=rev
Log:
Deprecate prefixed options in voicemail

Modified:
    trunk/apps/app_voicemail.c
    trunk/configs/extensions.conf.sample

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=22268&r1=22267&r2=22268&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Mon Apr 24 12:20:41 2006
@@ -5577,6 +5577,7 @@
 	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,18 +5618,29 @@
 			}
 		} 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 {

Modified: trunk/configs/extensions.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/extensions.conf.sample?rev=22268&r1=22267&r2=22268&view=diff
==============================================================================
--- trunk/configs/extensions.conf.sample (original)
+++ trunk/configs/extensions.conf.sample Mon Apr 24 12:20:41 2006
@@ -313,10 +313,10 @@
 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 @@
 						; 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 @@
 					; (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 @@
 ;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 at 192.168.0.14)
 ;exten => 6394,1,Dial(Local/6275/n)		; this will dial ${MARK}



More information about the svn-commits mailing list