Need help with call recording

Hi all,

I am trying to change the dialplan to enable call recording (incoming and outgoing calls) on the “click of a button”. Is it possible? All the documentation I found so far, enable recording for ‘all calls’ to an extension. So I tried changing the dialplan as follows.

Does this code look ok?
Currently Recording “on” only for 1030
when user presses *44, start recording.
*55 to stop recording


#include extensions_custom.conf

include => custom-startmonitor
include => custom-stopmonitor

include => custom-startmonitor
include => custom-stopmonitor


exten => *44,1,GotoIf($[${EXTEN} = 1030]?2:20)

exten => *44,2,BackGround(for-quality-purposes) ;play background files “for-quality-purposes this-call-may-be recorded”

exten => *44,3,BackGround(this-call-may-be)

exten => *44,4,BackGround(recorded)

exten => *44,5,Setvar(FILENAME=${EXTEN}-${TIMESTAMP}-${UNIQUEID}) ; create variable to hold filename by exten-timestamp

exten => *44,3,Monitor(wav, FILENAME, m) ; when user presses *44, start recording

exten => *44,20,Noop(Recording on only for 1030)


exten => *55,1,GotoIf($[${EXTEN} = 1030]?2:20) ; when user presses *55, stop recording

exten => *55,2,StopMonitor()

exten => *55,3,Wait(2)

exten => *55,20,Noop(Recording on only for 1030)

I would really appreciate any help. Thank you in advance.