Can we get duration of a call from AMI hangup event

As we get everything in AMI events but are not able to get the duration of a call from AMI hangup event when using call file and especially both the call legs duration via AMI and do not want from the CDR table

Like we are getting only 1 leg’s answeredtime on the VarSet Event

{ event: ‘VarSet’,
privilege: ‘dialplan,all’,
channel: ‘Local/9958@internal-local-calltest-000001b0;2’,
channelstate: ‘6’,
channelstatedesc: ‘Up’,
calleridnum: ‘13232’,
calleridname: ‘’,
connectedlinenum: ‘’,
connectedlinename: ‘’,
language: ‘en’,
accountcode: TEST-CC’,
context: ‘internal-local-calltest’,
exten: ‘9958’,
priority: ‘9’,
uniqueid: ‘1560232281.950204’,
linkedid: ‘1560232281.950203’,
variable: { answeredtime: ‘’ },
value: ‘4’ }

As the system wouldn’t set lower case variables, your dialplan must have set answertime. Extend the dialplan to add any other variables that you need.

Ok but I have not set any variable in the current context: ‘internal-local-calltest’ in the name of answeredtime and i dont understand from where it is coming