Monitor() funtion, impossible to choose a dynamic filename

Hello again !

I’m monitoring calls in my dialplan using:
exten = s,1,Monitor(gsm,m)

this works fine but I would like to change the file name. I tried the following:
exten = s,1,SetVar(CALLFILENAME=${CALLERID(num)}-${CHANNEL}-${TIMESTAMP})
exten = s,n,Monitor(gsm,${CALLFILENAME},m)

Then I get an error in the CLI specifying that asterisk is unable to create the file so the call will not be monitored.

Could anyone advise me ?

Thanks
Lilian
Asterisk V1.2

Hi
try this

exten => 1,1,Set(MONITOR_FILENAME=${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)}-${CALLERID(num)})
exten => 1,2,Set(MONITOR_OPTIONS=ba)
exten => 1,3,Set(MONITOR_EXEC=mv /var/spool/asterisk/monitor/^{MONITOR_FILENAME}.wav /var/spool/asterisk/monitor/1113)

this monitor all incoming & out calls as per you need & no need use TIMESTAMP option. Store in var/spool/asterisk/monitor in 1113 folder . you have to make dir. in monitor.try if want with ${CHANNEL} BUT DONT THINK IT WILL WORK
as you mention ur using 1.2 so check some variables.

try this

Amit

Hi

thanks for your help !
Lilian