How can I get "Answered" Call Duration

Hello everyone!
All day I trying to get callduration (like billablesec in cdr) but I need this while call is being active, not after "hang up"
tried everything Status(), CoreShowChannels(), all cli commands, nothing helps.
seconds after answer available nowhere!
also I find a module, its calls kerio_activecalls.so, but unfortunately it wont load at my * 11.

you my last hope guys.

You need to use AMI, like in FOP.

core show channel will give you the contents of the CDR answer time field. However, one would normally want to do this with AMI, rather than CLI, and therefore just call the ${CDR()) function on the channel.

If this is in connection with imposing time limits, you may be going about it the wrong way.

I am using AMI, but seems like there is no method to get answered time or billsecs of all active calls

[quote=“david55”]core show channel will give you the contents of the CDR answer time field. However, one would normally want to do this with AMI, rather than CLI, and therefore just call the ${CDR()) function on the channel.

If this is in connection with imposing time limits, you may be going about it the wrong way.[/quote]
“core show channel” gives me an information, but this it not very usefull in my case, sometimes alot of channels is up,this is crazy ask “core show channel” 50 times every second just to get correct list of active calls

Are you using queues? which kind of time resolution are you looking for?

I write a gui and faced with the problem that I can not display current calls properly,

see? call not even connected, but seconds is ticking, right now I getting an information about call via AMI by calling CoreShowChannel() every second, would be perfect if this feature would show billseconds also.
or maybe there is better solution for getting this that I do not know.

The start time won’t change once it has set, so you don’t need to keep reading it.

You should be able to call ${CDR(…)} on the channel, from AMI, without shelling out.

By enabling events, you should be able to mirror the state of the channel in your application.

Why is the current chargeable time something useful to have in real time?

Incidentally, bill seconds is not calculated until the call completes.