[asterisk-users] AMI and CDR(answer)

Matthew Jordan mjordan at digium.com
Wed Oct 15 17:27:57 CDT 2014


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_Newstate
[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



More information about the asterisk-users mailing list