I'm trying to configure asterisk to execute shell command for incoming calls - but only when the call is accepted. I've managed to setup extensions.conf so that command is executed when new call comes in.
exten => 999999999,1,NoOp("----------mygroup---------------")
exten => 999999999,2,System(echo "1:${EXTEN} - ${DATETIME} - ${CALLERID} - ${CHANNEL}" >> /var/log/asterisk/calls)
exten => 999999999,3,Dial(SIP/7001,20)
Is it possible to change it so that command is executed when operator connected to a SIP extension picks up the call. I need to know ID of the active operator and caller's number to execute the command.