Error Saving Cdr At H Exten In Asterisk13

Home » Asterisk Users » Error Saving Cdr At H Exten In Asterisk13
Asterisk Users 2 Comments


I need to save some information on userfield when calls end in Asterisk13, but I have two error cases:

1. With endbeforehexten=no in cdr.conf, I have a registry in cdr, but userfield is not set.
2. With endbeforehexten=yes, I have two lines in cdr, one with duration, src e dst correct, and a second line with userfield setting and dst h.

I am using cdr_odbc.conf, with Asterisk11.14.0 it works fine. May be this is a bug in asterisk13’s cdr?

pabx=# select calldate,src,dst,duration,billsec,uniqueid,userfield from cdr order by calldate desc limit 2;
calldate | src | dst | duration | billsec | uniqueid | userfield

2 thoughts on - Error Saving Cdr At H Exten In Asterisk13

  • If you are setting the userfield in the ‘h’ extension, then this is what I would expect. CDRs are finalized when the path of communication between channels is finished; altering the data after that point updates the next CDR for that channel. It isn’t retroactive.

    The ‘h’ extension is special in that ‘endbeforehexten’ explicitly ignores updates in ‘h’ extension. If you disable ‘endbeforehexten’, then you will get a CDR for the channel while it updates the hangup logic – but again, modifications occur on that CDR, not on previous ones.

    If you want the CDR for the channel prior to the ‘h’ extension to have a userfield entry, you have to apply it before the channel hangs up.