[OpenSIPS-Users] CDR change before sending to database
Bogdan-Andrei Iancu
bogdan at opensips.org
Tue Nov 11 10:50:24 UTC 2025
An alternative here will be not to use the native DB backend (for cdrs),
but the E_ACC_CDR event only - and from event route, do you changes and
manual DB insert.
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
https://www.opensips-solutions.com
https://www.siphub.com
On 19.10.2025 19:39, M S wrote:
> Hi Răzvan,
> Thank you for your explanation.
> Checking after BYE might not work cause receiving a BYE is not
> guaranteed, I guess...
> My problem:
> I have an acc_extra parameter and a corresponding INTEGER type
> database field. In the beginning of the script, I check if INVITE &
> !to_tag and then create_dialog, and assign it a 0 value. I assume this
> is the first place I can do that, right after creating the dialog?
> (just in case i am wrong, I have a line in the beginning of script
> also, assigning to acc_extra - which probably does nothing)
> However, I still have errors like this showing up frequently:
>
> CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute: driver error
> (1366): Incorrect integer value: '' for column 'suppservice' at row 1
> ERROR:acc:acc_db_request: failed to insert into acc table
>
> Which is very strange - it says acc table which means it should be
> after the dialog was created. I also have no way to debug this
> (machine is in production). might be worth noting that it started
> happening after upgrading from 3.1 to 3.4.17.
>
> One solution is to change the database field type to string (which I
> can't do because it has millions of records), so I thought there might
> be a chance to inspect CDR records before they are shipped out....
>
> Thank you.
>
> On Thu, Oct 9, 2025 at 2:20 PM Răzvan Crainea <razvan at opensips.org> wrote:
>
> Hello!
>
> The E_ACC_CDR event is executed asynchronously, thus the dialog/acc
> context may no longer be available. Thus you should not try to
> modify it.
> Your best change is to make sure that the acc variables are final
> after
> the BYE/200 OK is processed.
> But if you could give us more information about what you are
> trying to
> do, we might be able to help you.
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Core Developer / SIPhub CTO
> http://www.opensips-solutions.com / https://www.siphub.com
>
> On 9/27/25 2:03 PM, M S wrote:
> > Hi list,
> > I was wondering if anybody has any ideas about making changes to CDR
> > variables before sending them to the database.
> > Documents say the acc module calls E_ACC_CDR, is this before
> sending it to
> > the database, or in a parallel branch? if I change a variable in
> here, does
> > it change what's written to the database?
> >
> > Thanks!
> >
> >
> > Hi list,
> > I was wondering if anybody has any ideas about making changes to
> CDR
> > variables before sending them to the database.
> > Documents say the acc module calls E_ACC_CDR, is this before
> sending it
> > to the database, or in a parallel branch? if I change a variable in
> > here, does it change what's written to the database?
> >
> > Thanks!
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20251111/111c27d1/attachment.html>
More information about the Users
mailing list