I am using monitor and wait() to recording the first 2 seconds of the call after answer to use it on AGI, but not working the file have 1.4 seconds duration:
[answered]
exten => _ZZXXXXXX.,1,NoOp(Answered)
same => n,Set(recording_amd=/var/spool/asterisk/monitor/${company}/${STRFTIME(${EPOCH},,%Y/%m/%d)}/${EXTEN}-${UNIQUEID}_amd)
same => n,Monitor(gsm,${recording_amd},o)
same => n,Wait(2)
same => n,StopMonitor()
same => n,Stasis(call-waiting)