Get duration of call from asterisk manager port 5038

Is there a parameter in the manager.conf that I can use to have Asterisk output the duration of the call in the Hangup event when viewed over port 5038?

We have a handmade logging tool that uses port 5038 to get the details of calls and it works well but I want to easily add the call duration and I can’t see anything in the 5038 output that gives me that.

Here’s my manager.conf;

[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
displayconnects=no ;only effects 1.6+

[cdrs]
writetimeout =
secret = cdrsonly321
deny=0.0.0.0/0.0.0.0
permit=10.1.39.47/255.255.255.0
read = call,cdr,log
write =system, call, log, verbose, command, agent, user, config, command,dtmf,reporting,cdr,dialplan,originate

Hi

Check http://www.voip-info.org/wiki/view/asterisk+manager+events
Lookout for CDR portion to get billsec or duration.

Looks like I need the CDR event in my manager.conf. That web page says that it needs to be enabled in cdr_manager.conf but I don’t seem to have this file.


‘Cdr’ Event
Description:
[derived from cdr_manager.c]
Must be enabled in cdr_manager.conf
[general]
enabled = yes

Data Sample:
Event: Cdr
AccountCode:
Source:
Destination:
DestinationContext:
CallerID:
Channel:
DestinationChannel:
LastApplication:
LastData:
StartTime:
AnswerTime:
EndTime:
Duration:
BillableSeconds:
Disposition:
AMAFlags:
UniqueID:
UserField: