Skip to content

Commit

Permalink
[call_center] avoid a negative setup_time in CDR
Browse files Browse the repository at this point in the history
In the DB schema, the setup_time is an unsigned, and a -1 value was computed while a call was rejected by an agent

(cherry picked from commit 9dc28a9)
  • Loading branch information
bogdan-iancu committed Aug 17, 2022
1 parent 2aa0caf commit 5dc2ec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/call_center/call_center.c
Expand Up @@ -600,8 +600,8 @@ static void terminate_call(struct cc_call *call, b2bl_dlg_stat_t* stat,

lock_release( data->lock );

if (call->setup_time==-1 && stat)
call->setup_time = stat->setup_time;
if (call->setup_time==-1)
call->setup_time = stat ? stat->setup_time : 0;

/* generate CDR */
type = (stat==NULL) ? -1 : ((prev_state==CC_CALL_TOAGENT && stat->call_time)? 0 : 1);
Expand Down

0 comments on commit 5dc2ec7

Please sign in to comment.