[asterisk-commits] tilghman: branch 1.6.0 r110690 - in /branches/1.6.0: ./ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 25 12:41:20 CDT 2008


Author: tilghman
Date: Tue Mar 25 12:41:20 2008
New Revision: 110690

URL: http://svn.digium.com/view/asterisk?view=rev&rev=110690
Log:
Merged revisions 110689 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r110689 | tilghman | 2008-03-25 12:40:28 -0500 (Tue, 25 Mar 2008) | 6 lines

Update the sample configuration, to use Macro less (since it's now deprecated).
(closes issue #12293)
 Reported by: pprindeville
 Patches: 
       bugid-0012293.1.6.patch uploaded by pprindeville (license 347)

........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/configs/extensions.conf.sample

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/configs/extensions.conf.sample
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/configs/extensions.conf.sample?view=diff&rev=110690&r1=110689&r2=110690
==============================================================================
--- branches/1.6.0/configs/extensions.conf.sample (original)
+++ branches/1.6.0/configs/extensions.conf.sample Tue Mar 25 12:41:20 2008
@@ -210,7 +210,8 @@
 ;
 ; List canonical entries here
 ;
-;exten => 12564286000,1,Macro(stdexten,6000,IAX2/foo)
+;exten => 12564286000,1,Gosub(stdexten,s,1(6000,IAX2/foo))
+;exten => 12564286000,n,Goto(default,s,1)	; exited Voicemail
 ;exten => _125642860XX,1,Dial(IAX2/otherbox/${EXTEN:7})
 
 [dundi-e164-customers]
@@ -376,50 +377,86 @@
 exten => s-BUSY,1,Hangup
 exten => _s-.,1,NoOp
 
-[macro-stdexten];
-;
-; Standard extension macro:
-;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
+[stdexten]
+;
+; Standard extension subroutine:
+;   ${ARG1} - Extension
 ;   ${ARG2} - Device(s) to ring
-;
-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(${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(${ARG1},b)		; If busy, send to voicemail w/ busy announce
-exten => s-BUSY,2,Goto(default,s,1)		; If they press #, return to start
+;   ${ARG3} - Optional context in Voicemail (if empty, then "default")
+;
+; Note that the current version will drop through to the next priority in the
+; case of their pressing '#'.  This gives more flexibility in what do to next:
+; you can prompt for a new extension, or drop the call, or send them to a
+; general delivery mailbox, or...
+;
+; The use of the LOCAL() function is purely for convenience.  Any variable
+; initially declared as LOCAL() will disappear when the innermost Gosub context
+; in which it was declared returns.  Note also that you can declare a LOCAL()
+; variable on top of an existing variable, and its value will revert to its
+; previous value (before being declared as LOCAL()) upon Return.
+;
+exten => s,1,NoOp(Start stdexten)
+exten => s,n,Set(LOCAL(ext)=${ARG1})
+exten => s,n,Set(LOCAL(dev)=${ARG2})
+exten => s,n,Set(LOCAL(cntx)=${ARG3})
+
+exten => s,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""])
+exten => s,n,Dial(${dev},20)			; Ring the interface, 20 seconds maximum
+exten => s,n,Goto(s-${DIALSTATUS},1)		; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
+
+exten => s-NOANSWER,1,Voicemail(${mbx},u)	; If unavailable, send to voicemail w/ unavail announce
+exten => s-NOANSWER,n,NoOp(Finish stdexten NOANSWER)
+exten => s-NOANSWER,n,Return()			; If they press #, return to start
+
+exten => s-BUSY,1,Voicemail(${mbx},b)
+						; If busy, send to voicemail w/ busy announce
+exten => s-BUSY,n,NoOp(Finish stdexten BUSY)
+exten => s-BUSY,n,Return()			; If they press #, return to start
 
 exten => _s-.,1,Goto(s-NOANSWER,1)		; Treat anything else as no answer
 
-exten => a,1,VoicemailMain(${ARG1})		; If they press *, send the user into VoicemailMain
-
-[macro-stdPrivacyexten];
-;
-; Standard extension macro:
-;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
+exten => a,1,VoicemailMain(${mbx})		; If they press *, send the user into VoicemailMain
+						; does this ever return?
+
+[stdPrivacyexten]
+;
+; Standard extension subroutine:
+;   ${ARG1} - Extension
 ;   ${ARG2} - Device(s) to ring
 ;   ${ARG3} - Optional DONTCALL context name to jump to (assumes the s,1 extension-priority)
 ;   ${ARG4} - Optional TORTURE context name to jump to (assumes the s,1 extension-priority)`
-;
-exten => s,1,Dial(${ARG2},20|p)			; Ring the interface, 20 seconds maximum, call screening 
+;   ${ARG5} - Context in voicemail (if empty, then "default")
+;
+; See above note in stdexten about priority handling on exit.
+;
+exten => s,1,NoOp(Start stdPrivacyexten)
+exten => s,n,Set(LOCAL(ext)=${ARG1})
+exten => s,n,Set(LOCAL(dev)=${ARG2})
+exten => s,n,Set(LOCAL(dontcntx)=${ARG3})
+exten => s,n,Set(LOCAL(tortcntx)=${ARG4})
+exten => s,n,Set(LOCAL(cntx)=${ARG5})
+
+exten => s,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""])
+exten => s,n,Dial(${dev},20|p)			; Ring the interface, 20 seconds maximum, call screening 
 						; 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(${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(${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.
-
-exten => s-TORTURE,1,Goto(${ARG4},s,1)		; Callee chose to send this call to a telemarketer torture script.
+exten => s,n,Goto(s-${DIALSTATUS},1)		; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
+
+exten => s-NOANSWER,1,Voicemail(${mbx},u)	; If unavailable, send to voicemail w/ unavail announce
+exten => s-NOANSWER,n,NoOp(Finish stdPrivacyexten NOANSWER)
+exten => s-NOANSWER,n,Return()			; If they press #, return to start
+
+exten => s-BUSY,1,Voicemail(${mbx},b)		; If busy, send to voicemail w/ busy announce
+exten => s-BUSY,n,NoOp(Finish stdPrivacyexten BUSY)
+exten => s-BUSY,n,Return()			; If they press #, return to start
+
+exten => s-DONTCALL,1,Goto(${dontcntx},s,1)	; Callee chose to send this call to a polite "Don't call again" script.
+
+exten => s-TORTURE,1,Goto(${tortcntx},s,1)	; Callee chose to send this call to a telemarketer torture script.
 
 exten => _s-.,1,Goto(s-NOANSWER,1)		; Treat anything else as no answer
 
-exten => a,1,VoicemailMain(${ARG1})		; If they press *, send the user into VoicemailMain
+exten => a,1,VoicemailMain(${mbx})		; If they press *, send the user into VoicemailMain
+						; does this ever return?
 
 [macro-page];
 ;
@@ -463,7 +500,8 @@
 ;
 exten => 1234,1,Playback(transfer,skip)		; "Please hold while..." 
 					; (but skip if channel is not up)
-exten => 1234,n,Macro(stdexten,1234,${GLOBAL(CONSOLE)})
+exten => 1234,n,Gosub(stdexten,s,1(1234,${GLOBAL(CONSOLE)}))
+exten => 1234,n,Goto(default,s,1)		; exited Voicemail
 
 exten => 1235,1,Voicemail(1234,u)		; Right to voicemail
 
@@ -579,9 +617,13 @@
 ;exten => 6391,1,Dial(JINGLE/asterisk at digium.com/mogorman at astjab.org) ;Dial via jingle using asterisk as the transport and calling mogorman.
 ;exten => 6394,1,Dial(Local/6275/n)		; this will dial ${MARK}
 
-;exten => 6275,1,Macro(stdexten,6275,${MARK})	; assuming ${MARK} is something like Zap/2
+;exten => 6275,1,Gosub(stdexten,s,1(6275,${MARK}))
+						; assuming ${MARK} is something like Zap/2
+;exten => 6275,n,Goto(default,s,1)		; exited Voicemail
 ;exten => mark,1,Goto(6275|1)			; alias mark to 6275
-;exten => 6536,1,Macro(stdexten,6236,${WIL})	; Ditto for wil
+;exten => 6536,1,Gosub(stdexten,s,1(6236,${WIL}))
+						; Ditto for wil
+;exten => 6536,n,Goto(default,s,1)		; exited Voicemail
 ;exten => wil,1,Goto(6236|1)
 
 ;If you want to subscribe to the status of a parking space, this is




More information about the asterisk-commits mailing list