]> git.ipfire.org Git - thirdparty/asterisk.git/commit
app_queue: Fix extension state subscriptions removed on dialplan reload
authorIvan Poddubny <ivan.poddubny@gmail.com>
Tue, 12 Dec 2017 21:38:01 +0000 (22:38 +0100)
committerIvan Poddubny <ivan.poddubny@gmail.com>
Tue, 12 Dec 2017 22:05:56 +0000 (16:05 -0600)
commit7ffc41d19feff85414daa9fb547b6081b6360a46
tree37371b37fa983d631f62b02b2e263b50f6826a2d
parent28eddc7ea64094f18661c5a092e27c3f7bb19032
app_queue: Fix extension state subscriptions removed on dialplan reload

The approach with having a single global subscription to all extension
state changes has one issue: dynamically created hints don't have any
watchers and are therefore garbage collected on the first dialplan
reload.

This change creates a state subscription for every queue member with a
hint as state_interface, thus increasing the count of watches for
hints, so they are not destroyed prematurely anymore.

There are 2 side effects:
1. The state change callback in app_queue is not executed when
   there are no members referring to the extension.
2. The callback is called multiple times for the same hint if it's
   associated with more than one queue member.

Reported by: Steven T. Wheeler

ASTERISK-18411 #close

Change-Id: I4956af2136ea2a7f110ac9272eae5f6e676d8f89
apps/app_queue.c