[mytrunk-in]
exten => 202,1,Dial(PJSIP/101,5)
exten => 202,2,Playback(/sounds/<наш_звуковой_файл>)
exten => 202,3,Set(fname=${STRFTIME(${EPOCH},,%Y%m%d%H%M)}-${CALLERID(number)}-${EXTEN})
exten => 202,4,Record(/monitor/${fname}.wav,0,15,x)
exten => 202,n,Hangup
The Record() application plays a beep, and then begins recording audio until you press the hash key (#) on your keypad. If you hang up the call before pressing the hash key, the audio will not be recorded.
k: Keep recorded file upon hangup.