]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res/res_stasis: Fix accidental subscription to 'all' bridge topic 32/1332/1
authorMatt Jordan <mjordan@digium.com>
Mon, 28 Sep 2015 01:45:50 +0000 (20:45 -0500)
committerMatt Jordan <mjordan@digium.com>
Mon, 28 Sep 2015 01:51:33 +0000 (20:51 -0500)
commit90165e306d958293bae47dd901e2c672dca95006
tree1cc8d83df5f5322eb62af1d7b02882a6ed53527b
parent41f856e5a2f71274423dba591b3219c172aec8ca
res/res_stasis: Fix accidental subscription to 'all' bridge topic

When b99a7052621700a1aa641a1c24308f5873275fc8 was merged, subscribing to a
NULL bridge will now cause app_subscribe_bridge to implicitly subscribe to
all bridges. Unfortunately, the res_stasis control loop did not check that
a bridge changing on a channel's control object was actually also non-NULL.
As a result, app_subscribe_bridge will be called with a NULL bridge when a
channel leaves a bridge. This causes a new subscription to be made to the
bridge. If an application has also subscribed to the bridge, the application
will now have two subscriptions:
(1) The explicit one created by the app
(2) The implicit one accidentally created by the control structure

As a result, the 'BridgeDestroyed' event can be sent multiple times. This
patch corrects the control loop such that it only subscribes an application
to a new bridge if the bridge pointer is non-NULL.

ASTERISK-24870

Change-Id: I3510e55f6bc36517c10597ead857b964463c9f4f
res/res_stasis.c