endpoints: Remove need for stasis subscription.

When an endpoint is created in the core of Asterisk a subscription
was previously created alongside it to monitor any channels being
destroyed that were related to it. This was done by receiving all
channel snapshot updates for every channel and only reacting when
it was indicated that the channel was dead.

This change removes this logic and instead provides an API call
for directly removing a channel from an endpoint. This is called
when channels are destroyed. This operation is fast, so blocking
the calling thread for a short period of time doesn't have any
noticeable impact.
This commit is contained in:
Joshua C. Colp
2025-10-10 13:01:23 -03:00
parent 6944a7d2d7
commit 7477d120fd
7 changed files with 69 additions and 51 deletions

View File

@@ -256,6 +256,8 @@ AST_TEST_DEFINE(channel_messages)
actual_snapshot = stasis_message_data(msg);
ast_test_validate(test, 1 == actual_snapshot->num_channels);
ast_endpoint_remove_channel(uut, chan);
ast_hangup(chan);
chan = NULL;