]> git.ipfire.org Git - thirdparty/asterisk.git/commit
stasis.c: Use correct topic name in stasis_topic_pool_delete_topic
authorGeorge Joseph <gjoseph@digium.com>
Thu, 2 Jan 2020 20:25:33 +0000 (13:25 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Mon, 6 Jan 2020 15:52:34 +0000 (09:52 -0600)
commitdd82ebecd34bd18fe6569b950402e23786a05664
tree89a7f3b4e8571784c80402c8acbcec4e5bb0a0e6
parent3818759e9c81a0a25d36d803430f69664cce1036
stasis.c:  Use correct topic name in stasis_topic_pool_delete_topic

When a topic is created for an object, its name is only
<object>:<uniqueid>
For example:
bridge:cb68b3a8-fce7-4738-8a17-d7847562f020

When a topic is added to a pool, its name has the pool's topic
name prepended.  For example:
bridge:all/bridge:cb68b3a8-fce7-4738-8a17-d7847562f020

The topic_pool_entry's name however, is only what was passed
in to stasis_topic_pool_get_topic which is
bridge:cb68b3a8-fce7-4738-8a17-d7847562f020
That's actually correct because the entry is qualified by the
pool that's in.

When you're ready to delete the entry from the pool, you retrieve
the tropic name from the object but since it now has the pool's
topic name prepended, it won't be found in the pool container.

Fix:

* Modified stasis_topic_pool_delete_topic() to skip past the
pool topic's name, if it was prepended to the topic name,
before searching the container for a pool entry.

ASTERISK-28633
Reported by: Joeran Vinzens

Change-Id: I4396aa69dd83e4ab84c5b91b39293cfdbcf483e6
include/asterisk/stasis.h
main/stasis.c