[Asterisk-Users] PHP Gui for Asterisk (AGI questions)
Karl Putland
karl at putland.linux-site.net
Tue Mar 18 07:26:03 MST 2003
On Tue, 2003-03-18 at 00:10, Chris Albertson wrote:
> The best thing might be to seporate the two types of data.
> The simple thing to do is use a preprocessor like M4.
> Defin a macro for a "type-D" phone and then have lines like
>
> extn-type_D(6578)
> extn-type_D(6579)
>
> Then to change the flw of control for all 100 extension you
> only have to change the macro definition. Still you are keeping
> two diferent kinds of data in the same file but at least you've
> "factored out" the redundent information
extensions.conf now has powerful variables and macros for the last couple of weeks.
>
[macro-stdexten];
;
; Standard extension macro:
; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
; ${ARG2} - Device(s) to ring
;
exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
exten => s,2,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
exten => s,3,Goto(default,s,1) ; If they press#, return to start
exten => s,102,Voicemail(b${ARG1}) ; If busy, sendto voicemail w/ busy announce
exten => s,103,Goto(default,s,1) ; If they press#, return to start
exten => 1234,2,Macro(stdexten,1234,${CONSOLE})
;exten => 6275,Macro(stdexten,6275,${MARK})
--
Karl Putland <karl at putland.linux-site.net>
More information about the asterisk-users
mailing list