1
votes

We have kamailio 4.2.0 connected to a SIP provider and we will route calls to one or more Asterisks in the back end.

I assume it is most practical to collect all CDRs in one place, Kamailio. The CDRs I get are pretty useful, except one field is missing. The timestamp in the CDR shows only when the call is answered—i.e., when charging starts. We want to know when the first INVITE comes in, when charging starts (answer), and when the call is disconnected.

Can anyone help with this?

1

1 Answers

0
votes

You can store any attribute in Kamailio accounting using variables and the db_extra parameter for the acc module.

For the incoming INVITE time, do:

$avp(invtime) = $Ts;

And add $avp(invtime) to be stored via the db_extra parameter. You will have to create a column in the acc table where it is to be saved.

If you use the CDR recording with acc+dialog, you can use a similar approach with the dialog variables.