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
  • Loading branch information
bogdan-iancu committed Mar 19, 2016
1 parent e74f665 commit e49e2e8
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 @@ -595,7 +595,9 @@ int acc_db_request( struct sip_msg *rq, struct sip_msg *rpl,
query_list_t **ins_list, int cdr_flag)
{
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 Down Expand Up @@ -629,7 +631,8 @@ int acc_db_request( struct sip_msg *rq, struct sip_msg *rpl,
}

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 e49e2e8

Please sign in to comment.