How to execute asterisk application once the call is answered

1k views Asked by At

I want to execute this once the extension answers the call

exten => 2001,1,TrySystem(echo 'Call from ${CALLERID(name)} at
${CALLERID(number)} ${&DIALSTATUS}received
${STRFTIME(${EPOCH},,%l:%M:%S %p %Z on %A %B %e)}' >
/var/www/html/test/testfile.txt)

How can I do that?

1

There are 1 answers

0
Carl Quimada On

I figured it out I use M to call marco on Dial applciation

exten => 2001,1,Answer()
exten => 2001,n,Dial(SIP/${EXTEN},,M(carl),)
exten => 2001,n,Hangup()


[macro-carl]
exten => s,1,TrySystem(echo 'Call from ${CALLERID(name)} at ${CALLERID(number)} received ${STRFTIME(${EPOCH},,%l:%M:%S %p %Z on %A %B %e)}' > /var/www/html/cisco/testfile.txt)