[asterisk-users] Macro inside macro

Michael Neuhauser mike at firmix.at
Mon Aug 14 11:38:13 MST 2006


On Sun, 2006-08-13 at 11:28 +0200, Attilla De Groot wrote:
> On Aug 13, 2006, at 11:22 AM, Dovid Bender wrote:
> 
> > Please include what you send to the macro from your extensions.conf  
> > so we can see what you are sending down to the macro.
>[...]
> Sorry, didn't thought it was relevant, since the entire macro gets  
> executed, but here it is.
> 
> ;recording
> exten => _*22*XXX,1,Macro(record,conference,${EXTEN:4))
> exten => _*23*.,1,Macro(record|dialout|31455200025|SIP/${EXTEN:4} 
> @voipbuster)

'h' is searched in the current context only. Since macros are
implemented using contexts you need to have a 'h' rule in EVERY macro:

> [macro-record]
> exten => s,1,Setvar(CALLFILENAME=CALL-${ARG1}-${MACRO_EXTEN:4}-$ 
> {TIMESTAMP})
> exten => s,2,Monitor(wav,${CALLFILENAME},m})
> exten => s,3,GotoIf($["${ARG1}" = "conference"]?macro-record|s| 
> 4:macro-record|s|5)
> exten => s,4,Macro(conference|${ARG2})
> exten => s,5,Macro(dialout|${ARG2}|${ARG3})
> exten => h,6,System(/etc/asterisk/mail.sh mail at youmeandvoip.nl $ 
> {CALLFILENAME} &)

exten => h,1,System(/etc/asterisk/mail.sh mail at youmeandvoip.nl ${CALLFILENAME} &)

> [macro-dialout]
> exten => s,1,setcallerid(${ARG1})
> exten => s,2,dial(${ARG2})
> exten => s,3,Hangup()

exten => h,1,System(/etc/asterisk/mail.sh mail at youmeandvoip.nl ${CALLFILENAME} &)

> [macro-conference]
> exten => s,1,Answer
> exten => s,2,Wait(1)
> exten => s,3,MeetMe(${ARG1}|p)
> exten => s,4,Hangup

exten => h,1,System(/etc/asterisk/mail.sh mail at youmeandvoip.nl ${CALLFILENAME} &)

Regards,
	Mike
-- 
Dr. Michael Neuhauser                              mailto:mike at firmix.at
Firmix Software GmbH                                  sip:mike at firmix.at
Vienna/Austria/Europe                               tel:+43-1-7890849-30
Linux Development and Services                     http://www.firmix.at/




More information about the asterisk-users mailing list