Skip to content

Commit

Permalink
acc: fix multi_leg_bye info behavior
Browse files Browse the repository at this point in the history
This bug was making the ACC module to print less information in case there
were no AVPs populated for the BYE multi_leg_info

(cherry picked from commit 307388d)
  • Loading branch information
razvancrainea committed Jun 25, 2015
1 parent 7728f70 commit 3c29723
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/acc/acc.c
Expand Up @@ -600,6 +600,7 @@ int acc_db_request( struct sip_msg *rq, struct sip_msg *rpl,
int acc_db_cdrs(struct dlg_cell *dlg, struct sip_msg *msg)
{
int total, nr_vals, i, ret, res = -1, nr_bye_vals = 0, j;
int remaining_bye_vals;
time_t created, start_time;
str core_s, leg_s, extra_s, table;
short nr_legs;
Expand Down Expand Up @@ -676,10 +677,10 @@ int acc_db_cdrs(struct dlg_cell *dlg, struct sip_msg *msg)
LM_ERR("failed inserting into database\n");
goto end;
}
nr_bye_vals = legs2strar(leg_bye_info,msg,val_arr+ret+nr_vals, 0);
remaining_bye_vals = legs2strar(leg_bye_info,msg,val_arr+ret+nr_vals, 0);
}
/* there were no Invite legs */
while (!nr_legs && nr_bye_vals) {
/* check if there is any other extra info */
while (remaining_bye_vals) {
/* drain all the values */
for (j = ret+nr_vals; j<ret+nr_bye_vals+nr_vals; j++)
VAL_STR(db_vals+j+1) = val_arr[j];
Expand All @@ -689,7 +690,7 @@ int acc_db_cdrs(struct dlg_cell *dlg, struct sip_msg *msg)
LM_ERR("failed inserting into database\n");
goto end;
}
nr_bye_vals = legs2strar(leg_bye_info,msg,val_arr+ret+nr_vals, 0);
remaining_bye_vals = legs2strar(leg_bye_info,msg,val_arr+ret+nr_vals, 0);
}
}

Expand Down

0 comments on commit 3c29723

Please sign in to comment.