Macros, Variables and "s"

Hi, I am trying to shrink my config files as much as possible by converting to macros.

When using “priorities” instead of pattern matching filenames are not created correctly

exten => _1XXX,1,MixMonitor(${STRFTIME(,%d-%m-%Y-%H%M-${CALLERID(num)}-${EXTEN})}.wav,b)

this works and Creates a file: dd-mm-yyyy-HHMM-<calling_phonenumber>-<dialed_phonenumber>.wav

when changing this to :

exten => s,1,MixMonitor(${STRFTIME(,%d-%m-%Y-%H%M-${CALLERID(num)}-${EXTEN})}.wav,b)

Creates a file: dd-mm-yyyy-HHMM-<calling_phonenumber>-s.wav

Where “s” is actually “s” not the value assigned to “s”. ${EXTEN} as a vairable now = “s” and not the dialled number ( internal or extenal ). Is there a way to fix this? I cant seem to work it out.


You can use the variable

${MACRO_EXTEN} it holds the dialed number

exten => s,1,MixMonitor(${STRFTIME(,%d-%m-%Y-%H%M-${CALLERID(num)}-${MACRO_EXTEN})}.wav,b)

@sander4000, Thanks for this it works a treat, at least I get to keep the remaining hair on my head;)

is there any definitive Reading that lists what variables etc ate available?
I have the future of telephony book, Asterisk PDF and asterisk for dummies. Can you recommend anything further?

Thanks again.

Please be warned that macros are deprecated, in favour of subroutines, in 1.6. In fact, internally, they are implemented as subroutines. There are warnings in the documentation that Return may not always be correctly inferred for macros.