exten => l-dial,1,Set(record=${IF($[ "${EXTEN}" =~ "^(1001|1002|1003)$"]?:A(record/out))})
same => n,Dial(${ARG1},,${record})
directmedia=no
same => n, SetVar(QUEUE_PRIO=10)
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.