Если так?
[test]
exten => _XXXX,n,Verbose(0,-----Call-Start-----)
same => n,Set(CHANNEL(hangup_handler_push)=hdlr-call-end,s,1)
same => n,Dial(SIP/${EXTEN},10,U(sub-answ-call-start))
same => n,HangUp()
[sub-answ-call-start]
exten => s,1,Set(__ANSWER_CALL_START=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)})
same => n,return
[hdlr-call-end]
exten => s,1,Verbose(0,-----hdlr-call-stats-----)
same => n,Set(ANSWER_CALL_END=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} )
same => n,Set(CALL_TIME=${MATH(${ANSWER_CALL_END}-${ANSWER_CALL_START},int)})
same => n,return