sanjay
sanjay

Reputation: 1

How to get call duration in asterisk from start of a particular context and end?

I am able to get call duration using CDR(billsec) which gives me complete call duration (i.e the moment it was answered till hangup).

I have a requirement where I need call duration of a particular context. The time internal to asterisk from start of that call context until end.

Upvotes: 0

Views: 1622

Answers (1)

arheops
arheops

Reputation: 15259

You also have CDR(duration) which show you unanswered(overal ) lenght

If you need split your cdr, you have do it yourself in dialplan like

exten => _X.,n,Set(CDR(start_here)=${STRFTIME(,%c)})
; need start_here field in cdr table

or you can use ForkCDR/ResetCDR.

Other complex option is asterisk manager interface(AMI) events or channel level logging(CEL)

Anyway there are no easy context-independed way, becuase one context can include other.

Upvotes: 2

Related Questions