Multiple CDR entries and custom values

I’m using quite a lot of “SET VARIABLE CDR(my_own_variable)” code, and this works fine most of the time, but when the call is forked, I can only access what seems to be the first item in the list.

Let’s say I want to capture the {HANGUPCAUSE}, if you dial multiple devices, then multiple CDRs are written, but the hangup cause is only written to one of them, in the sample i’m looking at its the UNANSWERED one any way - so CDR(…) seems only to apply to one of the multiple entries in the CDR buffer before it gets written to the DB (in this case)

How do I get CDR(…) to write to all the entries?

Using: AGI, cdr_adaptive_odbc, MySQL, Ast 13.24

I was looking at “hangup handlers”

Would this be the right way to update the CDRs when the call is forked? Do you have access to the CDR(…) function from here?

I also saw that in older documents the CDR(name[,options]) allowed for:

  • r - Searches the entire stack of CDRs on the channel.
    Is this option no longer available?

It currently seems to behaving as:

  • l - Uses the most recent CDR on a channel with multiple records

I know typically the CDR(…) function isn’t supposed to be used after the Dial(…) function is called however this is executing in AGI, and the script does continue, and is able to set the CDR(…), its just not working correctly.

Any advise?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.