1

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?

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
SEvensen
  • 49
  • 3

1 Answers1

0

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.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
miconda
  • 1,754
  • 11
  • 14
  • Thanks for the tips. I have already solved it by parsing sip_trace and generating cdr from that. But good to know that acc and cdr can be expanded like that – SEvensen Mar 07 '16 at 09:18