How to record calls from the trunk?

Good day, I can not understand how to set the macro to record a conversation into the extension. The macro:
[macro-crm]
exten => s,1,NoOp(${ARG1} ${ARG2})
exten => s,n,GotoIf(${DB_EXISTS(NORECNUM/${ARG1})}?gtme)
exten => s,n,GotoIf(${DB_EXISTS(NORECNUM/${ARG2})}?gtme)
exten => s,n,Set(F=/var/spool/asterisk/calls/${STRFTIME(${EPOCH},,%Y%m)}/${STRFTIME(${EPOCH},,%Y%m%d)}/${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)}-${ARG1}-${ARG2})
exten => s,n,MixMonitor(${F}.wav,W(1),lame-b 16 ${F}.wav ${F}.mp3 && rm ${F}.wav)
exten => s,n(gtme),MacroExit


and here incoming calls setup:
[call-in]
exten => 8XXXXXXXXX,1,Dial(SIP/102)
need in this scheme to record the call.

on the inside the rooms everything is written:
exten => _XXX,1,Dial(SIP/${EXTEN},,tTM(crm^${CALLERID(num)}^${EXTEN}))
June 3rd 19 at 21:03
1 answer
June 3rd 19 at 21:05
Solution
"on the inside the rooms everything is written:
exten => _XXX,1,Dial(SIP/${EXTEN},,tTM(crm^${CALLERID(num)}^${EXTEN}))"
here are the crm and there.
try to bring to mind
exten => 8XXXXXXXXX,1,Dial(SIP/102,,tTM(crm^${CALLERID(num)}^${EXTEN})))
Tried result has not given:( - Susanna commented on June 3rd 19 at 21:08
Thank you, wrote in the same direction but made a mistake for which the parameter M is not transferred. - Susanna commented on June 3rd 19 at 21:11

Find more questions by tags Asterisk