CEL custom field

Hello!
Is it possible to store at CEL my own field? I want to store SIP header X-Shared-ID of call to all events of call.

If I use CHANNEL(userfield) - that value not stored at CHAN_START, ANSWER(Outgoing line), BRIDGE_ENTER (Outgoing line), BRIDGE_EXIT and other events.

I think you could use The CELGenUserEvent application allows you to instruct Asterisk to generate a user defined event with custom type name.

CELGenUserEvent will insert just another one event. I want to put field with the same value for all events of call.

I dont think such feature it is avaiable, anyway you could wait for other members feedbacks

So, maybe there is another way to identify the call which goes through many asterisks(after transfer, parking, etc)?

I think I at first time I create sip header X-Shared-ID and put call-id. In other asterisks I want to save that value in cel.
Are there any other approach?

Your requirement is unusual. Not that many people run such networks of Asterisk boxes.

You would need to generate a custom event to log the identifier, then have your back end attach it to the other records.

You could set up a central database, add triggers to your CDR/CEL tables which write an ID record to another table. Separately, write a program to read the ID tables, joined to the CDR/CEL tables, and push any inserted or updated records to the central database. From there you should have a complete history of the call. Reporting on that may prove to be tricky. Also, the central db cannot use the auto-increment id fields the same as on each individual server. Take the primary key off or you’ll end up with duplicate records.

Thank you for answer. I thought about this approach, I already have central db. There will be million+ rows, so that approach not desirable.

OK. I can tell you that my central CDR table has 4.2 million rows in it, and I’ve had no issues so far.

1 Like

https://issues.asterisk.org/jira/browse/ASTERISK-27266

CEL stores channel events, and you’ve only set the userfield on a single channel while your log shows two channels logging events.

Is there any way to set the userfield on all channels?