Get ringing time from the outgoing call

Hello,

I develop IVR with AGI on Asterisk 13.
On a choice of the IVR, I need to generate an outgoing call with the dial command.
But I need also to obtain the ringing time of the outgoing call.

With :

EXEC Dial SIP/mynumber@yyy,50 GET VARIABLE "DIALEDTIME" GET VARIABLE "DIALSTATUS"

The DIALSTATUS is ok. I get ANSWER or BUSY.
But DIALEDTIME is incorrect. It’s the time of the actual call and not the outgoing call.

How can I get the ringing time of the outgoing call ?

Sorry for my poor english.

Thanks

You need to be clearer about the requirement, but you may be able to reset the CDR and then read it after the call. Generally though, this is not a common requirement, so it probably needs more research than is justified for a peer support response.

Note that the actual ringing time is not necessarily the time between ALERTING and ANSWER (or 180 and 200), and, in some early media scenarios, Asterisk will have no idea of the correct value.