[asterisk-users] AMI and CDR(answer)

Murthy Gandikota mgandikota at nts.net
Wed Oct 15 21:31:44 CDT 2014


Thanks, Matthew. I think CDR(answer) is, in the end, not very useful to
me if it changes from context to context. Suppose from AMI we generate a
status
event, what will be the CDR(answer)? I see that sometimes it is returned
as the literal "Production" instead of a Date/Time or a blank value. I
am only puzzled that no one created a patch for the first timestamp when
a call is answered. If I get some free time, I will try to create one.

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Matthew
Jordan
Sent: Wednesday, October 15, 2014 3:28 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] AMI and CDR(answer)

On Wed, Oct 15, 2014 at 5:10 PM, Murthy Gandikota <mgandikota at nts.net>
wrote:
> The CDR(disposition) is changing from context to context. Looks like
AGI
> and AMI are in agreement. Still, it is a mystery why the helpful
> Asterisk folks
> haven't given us a built-in variable for when the call was first
> answered.
>

AMI informs you when a channel is answered via a Newstate event [1].
If you receive such an event and the ChannelState/ChannelStateDesc is
6/Up, then the channel has been answered.

Alternatively, you can query a channel for its Answer time using
either the CDR function, which will return back the CDR's view of the
time the channel was answered. If the channel was not answered, then
not surprisingly, the value is empty. An example output is show below:

Response: Success
Variable: CDR(answer)
Value: 2014-10-15 17:21:29

As for why there isn't a "built-in variable":
(1) For queries, the information is already provided by other
mechanisms, such as the CDR function
(2) If you are monitoring the system, you can get exactly when the
channel was answered via the Newstate event
(3) No one (that I'm aware of) has provided such a patch. Asterisk is
open source. If you'd like to have something, write a patch, and
submit it back to the project. [2]

[1]
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerEvent_News
tate
[2]
https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list