Hi, I have one Q: why doesn't work h-extension in macro? I want to setup fax macro, to send tif-file after fax channel hang-up, but h-extension doesn't work in macro, so I must put them to global context. But in this setup, exten => h,1,system(/var/lib/asterisk/bin/mailfax ${FAXFILE} ${EMAILADDR} "${CALLERIDNUM} ${CALLERIDNAME}") mailfax binary will be executed after any hang-up, also after calls, not only faxes. I know I can use some variable and if statement to run mailfax only if that variable will be true, but is there any way to handle h-extension in macro? Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20041206/23edfb11/attachment.pgp
Maros RAJNOCH wrote:> exten => h,1,system(/var/lib/asterisk/bin/mailfax ${FAXFILE} ${EMAILADDR} "${CALLERIDNUM} ${CALLERIDNAME}") > > mailfax binary will be executed after any hang-up, also after calls, not > only faxes. I know I can use some variable and if statement to run > mailfax only if that variable will be true, > > but is there any way to handle h-extension in macro?I would put the fax extension into a seperate context and utilize that context for fax only. rgds pos
>From the wiki page for cmd Macro:Note that you cannot use any other extension than 's' to construct the macro as control is returned to the calling context when the end of the 's,' priorities is reached. So, rather than using a macro - which is simply intended to be a replacement for a frequently repeated block of _linear_ code, try declaring a seperate context and using goto() or gotoif() to branch to it only when handling faxes. Hope that helps.> -----Original Message----- > From: Maros RAJNOCH [SMTP:ml_asterisk-users@rajnoch.sk] > Sent: Monday, December 06, 2004 4:11 AM > To: ASTERISK > Subject: [Asterisk-Users] h extension in macro >Hi, I have one Q: why doesn't work h-extension in macro? I want to setup fax macro, to send tif-file after fax channel hang-up, but h-extension doesn't work in macro, so I must put them to global context. But in this setup, exten => h,1,system(/var/lib/asterisk/bin/mailfax ${FAXFILE} ${EMAILADDR} "${CALLERIDNUM} ${CALLERIDNAME}") mailfax binary will be executed after any hang-up, also after calls, not only faxes. I know I can use some variable and if statement to run mailfax only if that variable will be true, but is there any way to handle h-extension in macro? {clip}