Need to know call up time

Hey guys,

How can I get the call up time? (Total time call is up, in seconds (integer), from answer to hangup)

I’m having problem with BILLSEC, it’s always equal to Duration.


Variable ANSWEREDTIME keeps exact time from answer to hangup.
But - not in all cases. If you have PSTN then you have to play with reverse polarity…

Outgoing call duration depends upon detection of answer supervision. On calls that go out to the PSTN using analog trunks, in most of the USA, you do not get any indication that the far end has answered. In a few places, you do. In New Jersey Verizon territory, you can order it for an extra monthly charge, but it is not always available. (It is generally not available to subscribers who are served out of multiplexers (called pair-gain systems by the field forces)).

Where it is available, it is delivered as a reversal of the loop polarity. To make use of it, your analog trunk interface hardware must be able to detect the polarity switch and report it to the software.

Thanks a lot for your answers!

unfortunately there is no ANSWEREDTIME in my case, also there is no ENDTIME or something… I don’t realy get how to determine exect call duration time

ANSWEREDTIME is asterisk variable, which you can get next way:
If you use AGI scripts written in Perl - you can get call time with
This variable of course is accessible from dialplan, any AGI script, AMI.

thanks to help
casas de madera