I've enabled Cdr event in asterisk in cdr_manager.conf:
[general]
enabled=yes
I do recieve Cdr events in adhearsion in events.rb:
events.asterisk.manager_interface.each do |event|
ahn_log.events event.inspect if event.name == 'Cdr'
end
But parsing is incorrect (from logs): INFO events:
#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0x1a8c6a8
@headers={"AMAFlags"=>"DOCUMENTATION",
"Disposition"=>"ANSWERED", "BillableSeconds"=>"5", "EndTime:
2009-04-16 09:29"=>"52", "StartTime: 2009-04-16 09:29"=>"45",
"DestinationChannel"=>"SIP/1_2000-0082ae00",
"Channel"=>"SIP/1_2001-00822000", "Destination"=>"2000",
"LastData"=>"SIP/1_2000|15|tT", "LastApplication"=>"Dial",
"UniqueID"=>"1239866985.2", "DestinationContext"=>"yago",
"Source"=>"1_2001", "AnswerTime: 2009-04-16 09:29"=>"47",
"CallerID"=>""Test 1" <1_2001>",
"Privilege"=>"call,all", "UserField"=>"",
"AccountCode"=>"", "Duration"=>"7"}, @name="Cdr">
"AnswerTime: 2009-04-16 09:29"=>"47" should be
"AnswerTime"=>"2009-04-16 09:29:47". The first ':' should be
used to seperate key from value instead of the last one.