Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qualify: fix qualify with multiple incoming calls #35

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions modules/qualify/qualify.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static int call_start_qualify(struct call *call,
qualle->call = call;
tmr_init(&qualle->to_tmr);
tmr_init(&qualle->int_tmr);
hash_append(q.qual_map, hash_fast_str(account_aor(acc)),
hash_append(q.qual_map, hash_fast_str(call_id(call)),
&qualle->he, qualle);
}

Expand Down Expand Up @@ -220,11 +220,15 @@ static bool qualle_get_applyh(struct le *le, void *arg)
}


static void call_stop_qualify(struct account *acc)
static void call_stop_qualify(struct call *call)
{
struct qualle *qualle;

if (!call)
return;

struct le *le = hash_lookup(q.qual_map,
hash_fast_str(account_aor(acc)),
hash_fast_str(call_id(call)),
qualle_get_applyh, NULL);

if (!le || !le->data)
Expand Down Expand Up @@ -252,10 +256,10 @@ static void ua_event_handler(struct ua *ua, enum ua_event ev,
if (call_is_outgoing(call))
break;

call_stop_qualify(acc);
call_stop_qualify(call);
break;
case UA_EVENT_CALL_CLOSED:
call_stop_qualify(acc);
call_stop_qualify(call);
break;
default:
break;
Expand Down
Loading