Skip to content

Commit

Permalink
Fixed usage of Prep Statement on failed CDRs.
Browse files Browse the repository at this point in the history
The number of inserted columns is variable (n+m or n+m+2), so we need different statements for each.
Reported by @apsaras (on GITHUB)
Closes #821

(cherry picked from commit e49e2e8)
  • Loading branch information
bogdan-iancu committed Mar 19, 2016
1 parent 13cbc68 commit a98d0eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/acc/acc.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,9 @@ int acc_db_request( struct sip_msg *rq, struct sip_msg *rpl,
query_list_t **ins_list)
{
static db_ps_t my_ps_ins = NULL;
static db_ps_t my_ps_ins2 = NULL;
static db_ps_t my_ps = NULL;
static db_ps_t my_ps2 = NULL;
int m;
int n;
int i;
Expand All @@ -570,7 +572,8 @@ int acc_db_request( struct sip_msg *rq, struct sip_msg *rpl,
VAL_STR(db_vals+i) = val_arr[i];

acc_dbf.use_table(db_handle, &acc_env.text/*table*/);
CON_PS_REFERENCE(db_handle) = ins_list? &my_ps_ins : &my_ps;
CON_PS_REFERENCE(db_handle) = cdr_flag ?
(ins_list? &my_ps_ins2:&my_ps2) : (ins_list? &my_ps_ins:&my_ps);

/* multi-leg columns */
if ( !leg_info ) {
Expand Down

0 comments on commit a98d0eb

Please sign in to comment.