For calculating the difference between two times, the time values should be converted to an epoch value first. This can be done using the asterisk function STRFTIME. Use the below dialplan to convert current time to an epoch value
Asterisk CLI provides Hangup command to hangup live calls. For using the hangup command, you need to get the name of the channel that you want to hangup.
To manage call recording in Asterisk there is simple command. Mix(Monitor() can be used to manage all the call recordings in Asterisk.