Update,

I have traced the line that creates the issue with cdr being written to db to this query:

avp_db_query("update customer set balance = balance - '$avp(callee_bill)' where id = '$dlg_val(callee_cus_id)'");

But after some testing, when I replace this query with static values like:

avp_db_query("update customer set balance = balance - '-0.00001' where id = '1'");

the cdr is also not written and no db query is sent "insert into acc (method,..."

Once this line is commented out cdr are written to db by acc module with all acc_extra() vars.



On 2/18/2022 5:29 PM, Marcin Groszek wrote:
Yes, I am creating dialog.

When I skip a specific route  in my config file the CDR is getting written. This skipped route is executed at the time of initiation of the call.

I have been tracing all my variables and noticed that 3.1.5 is very picky about the variable being string or integer. Not sure why would this effect acc module not even attempting to run a db query to insert cdr at the end of call.

On 2/18/2022 9:31 AM, Răzvan Crainea wrote:
Hi, Marcin!

CDRs are based on dialog support. Can you confirm you are creating the dialog for the call?

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 2/16/22 16:53, Marcin Groszek wrote:
I have narrow down to this route that prevents acc from writing Invite to db,

When I bypass it Invite gets written to db on BYE:

  DBG:avpops:ops_dbquery_avps: query [SELECT balance,credit FROM customer  WHERE id = '1';]   DBG:db_mysql:mysql_raise_event: MySQL status has not changed: connected   DBG:core:db_new_result: allocate 48 bytes for result set at 0x7f7b8a67bbf0
  DBG:db_mysql:db_mysql_get_columns: 2 columns returned from the query
  DBG:core:db_allocate_columns: allocate 56 bytes for result columns at 0x7f7b8a67bc50   DBG:db_mysql:db_mysql_get_columns: RES_NAMES(0x7f7b8a67bc60)[0]=[balance]
  DBG:db_mysql:db_mysql_get_columns: use DB_STRING result type
  DBG:db_mysql:db_mysql_get_columns: RES_NAMES(0x7f7b8a67bc70)[1]=[credit]
  DBG:db_mysql:db_mysql_get_columns: use DB_STRING result type
  DBG:core:db_allocate_rows: allocate 80 bytes for result rows and values at 0x7f7b8a67bcb8
  DBG:db_mysql:db_mysql_str2val: converting STRING [10.096950003999979]
  DBG:db_mysql:db_mysql_str2val: converting STRING [10]
  DBG:avpops:db_query_avp_print_results: rows [1]
  DBG:avpops:db_query_avp_print_results: row [0]
  DBG:avpops:db_close_query: close avp query
  DBG:core:db_free_columns: freeing result columns at 0x7f7b8a67bc50
  DBG:core:db_free_rows: freeing 1 rows
  DBG:core:db_free_row: freeing row values at 0x7f7b8a67bcc8
  DBG:core:db_free_rows: freeing rows at 0x7f7b8a67bcb8
  DBG:core:db_free_result: freeing result set at 0x7f7b8a67bbf0
  DBG:mathops:w_evaluate_exp: Evaluating expression: 10.096950003999979 + 10
  DBG:mathops:w_evaluate_exp: Evaluating expression: 0.002 * 1000000
  DBG:mathops:w_evaluate_exp: Evaluating expression: 20.0969500040 * 1000000
  DBG:mathops:w_evaluate_exp: Evaluating expression: 0.002 / 60
  DBG:mathops:w_evaluate_exp: Evaluating expression: 0.0000333333 * -1
  DBG:mathops:w_evaluate_exp: Evaluating expression: 0.0005 / 60
  DBG:core:comp_scriptvar: int 25 : 2000 / 0
  DBG:mathops:w_evaluate_exp: Evaluating expression: -0.0000333333 + 0.0000083333
  DBG:core:comp_scriptvar: int 25 : 2000 / 0

Any help would be appreciated.


On 2/15/2022 6:19 PM, Marcin Groszek wrote:
I have been using  v3.1.5 and acc module is not behaving as expected:

do_accounting("db","cdr|failed");

it writes to db on cancel when it hits failure_route[missed_call]

But not on BYE. Is there a document how to troubleshoot acc module behavior?  Can a progress of the module be traced or followed as it progresses via config script?

I see not attempts to write to db upon end of the call, so this is not an value or extra_fields issue.

It has been working for months until I upgraded opensips to 3.1.7, then I reverse the upgrade and the acc module stopped working. mariadb has been also upgraded at the same time , but i see all other modules using same database with no issue.





_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

--
Best Regards:
Marcin Groszek
Business Voip Resource.
http://www.voipplus.net


_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to