Skip to content

Commit

Permalink
Fixed entity index in the b2b callbacks.
Browse files Browse the repository at this point in the history
After some rework of the B2B API, the entities are counted starting from 0, while before they were form 1 - this was affecting the call center logic by mixing the caller versus callee parties of the call.

Reported by Jonathan Hunter - many thanks also for testing !!

(cherry picked from commit 1e21f91)
  • Loading branch information
bogdan-iancu committed Feb 5, 2017
1 parent 0e42067 commit d6baaa0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/call_center/call_center.c
Expand Up @@ -469,7 +469,7 @@ int b2bl_callback_customer(b2bl_cb_params_t *params, unsigned int event)
int cnt;
b2bl_dlg_stat_t* stat = params->stat;

LM_DBG(" call (%p) has BYE for %d, \n", call, event);
LM_DBG(" call (%p) has event %d, \n", call, event);

lock_set_get( data->call_locks, call->lock_idx );
cs = call->state;
Expand Down Expand Up @@ -517,7 +517,7 @@ int b2bl_callback_customer(b2bl_cb_params_t *params, unsigned int event)
}
}

if (event==B2B_BYE_CB && params->entity==1) {
if (event==B2B_BYE_CB && params->entity==0) {
LM_DBG("BYE from the customer\n");
/* external caller terminated the call */
call->state = CC_CALL_ENDED;
Expand All @@ -543,12 +543,12 @@ int b2bl_callback_customer(b2bl_cb_params_t *params, unsigned int event)
return 2;
}
/* if reInvite to the customer failed - end the call */
if(event == B2B_REJECT_CB && params->entity==1) {
if(event == B2B_REJECT_CB && params->entity==0) {
lock_set_release( data->call_locks, call->lock_idx );
return 1;
}

if(event == B2B_REJECT_CB && params->entity>1) {
if(event == B2B_REJECT_CB && params->entity>0) {
if(call->state == CC_CALL_TOAGENT) {
handle_agent_reject(call, 1, stat->setup_time);
lock_set_release( data->call_locks, call->lock_idx );
Expand Down

0 comments on commit d6baaa0

Please sign in to comment.