[asterisk-users] Get variable "ANSWEREDTIME" using ARI

Joshua C. Colp jcolp at digium.com
Fri May 3 04:23:29 CDT 2019

On Fri, May 3, 2019, at 4:06 AM, J├Âran Vinzens wrote:
> Hi all,
> i am using ARI in order to control my calls and i try to use the 
> answeredtime generated by Asterisk.
> I had two different ways to get to these variable:
> 1. add ANSWEREDTIME to the channelsvars in ari.conf.
>  - unsuccessful since the variable is empty all the time. I hoped the 
> StasisEnd contains the correct value.
> 2. query the variable using REST.
>  - unsuccessful as well. After the Call is hung Up Stasis looses the 
> context of the call and i get back an 404. While the call is running i 
> get 204 but since the call is still running this makes no sense.
> Has anybody an idea how to get this variable using REST API?

The variable is provided by the Dial() dialplan application not by the Asterisk core. If you are doing things in ARI, then that variable would not exist. You'd need to calculate it yourself.

Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

More information about the asterisk-users mailing list