Mike Diehl
2013-Jul-27 06:30 UTC
[asterisk-users] Can' correlate AMI MonitorStart with CDR
Hi all. I'm trying to write an AMI handler to take care of cases where a user uses the feature code to start recording a call. When a user starts a recording, my AMI listener receives this event: $VAR1 = { 'Server' => 'example.com', 'Event' => 'MonitorStart', 'Uniqueid' => 'server-1374906101.132305', 'Privilege' => 'call,all', 'Channel' => 'SIP/trunk-000200d0' }; However, when I then go and look up that call in the cdr table using Uniqueid = 'server-1374906101.132305', my query doesn't find anything. If I then ask the cdr database for the Uniqueid of the call in question, I get something slightly different, such as: server-1374906100.132304 In general, it seems that the two strings only differ in the last character. So, how am I supposed to correlate this? TIA, Mike Diehl.
You probably picked the wrong channel. There are two bridged channels with slightly different unique ids, which are actually timestamps. You should watch for the "Bridge" event that ties the two channels up. The "Bridge" event contains both channels, both UniqueIDs, and both CallerIDs. jg