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 <[email protected]> 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
    > [email protected]
    > http://lists.opensips.org/cgi-bin/mailman/listinfo/users


    _______________________________________________
    Users mailing list
    [email protected]
    http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to