From 81daa103bd4ef7d96f24a80bd96cd4e44c90f2a5 Mon Sep 17 00:00:00 2001 From: Bogdan-Andrei Iancu Date: Wed, 11 May 2022 10:32:13 +0300 Subject: [PATCH] [call_center] fix condition on searching call... ... when doing MI call dispatching --- modules/call_center/call_center.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/call_center/call_center.c b/modules/call_center/call_center.c index 83c4df70f09..967d32f1207 100644 --- a/modules/call_center/call_center.c +++ b/modules/call_center/call_center.c @@ -2131,9 +2131,9 @@ static mi_response_t *mi_dispatch_call_to_agent(const mi_params_t *params, /* search for the call in the queue */ for (call=data->queue.first ; call ; call=call->lower_in_queue) { /* match the call id */ - if ( call->b2bua_id.len==0 || call->b2bua_id.len!=call_id.len || - strncmp(call->b2bua_id.s, call_id.s, call_id.len) ) - continue; + if ( call->b2bua_id.len && call->b2bua_id.len==call_id.len && + strncmp(call->b2bua_id.s, call_id.s, call_id.len)==0 ) + break; } if (call==NULL) { lock_release( data->lock );