]> git.ipfire.org Git - thirdparty/asterisk.git/commit
extension_state: Add new extension state API. master
authorJoshua C. Colp <jcolp@sangoma.com>
Tue, 10 Feb 2026 21:42:50 +0000 (17:42 -0400)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Thu, 11 Jun 2026 18:31:03 +0000 (18:31 +0000)
commitf4f6ec0313a51d5dfc3efa0644d63b06d578f412
tree1fe7a6cfc4c48d3b3e7e8f4cfd21d043d62b72a6
parent16bbc5e0d0b06dff8e0e59196c48967285ab6796
extension_state: Add new extension state API.

Extension state to this point has been an API implemented
inside the PBX core resulting in its state being intermingled
with that of the dialplan. This increased the complexity of
the PBX core and made it difficult to enact improvements.

This change adds a new separate extension state API
which receives updates from the PBX core as configuration
changes but maintains its own separate state. The API is
also written to fully take advantage of modern APIs in a
more selective manner by subscribing each extension state to
only the devices it is interested in, ultimately reducing
resource consumption during updates. Presence state updates
being infrequently done use a single shared subscription that
goes through the extension states to find and update ones
that the update is applicable to.

Legacy API support is provided by reimplementing the API
as wrappers over the new extension state API. This improves
the legacy API by making it multithreaded, with each callback
being individually subscribed.

Autohints support is maintained but has been separated out
into a self contained new implementation.

Synchronous subscription support has also been added to
Stasis to remove the overhead of asynchronous publishing when
the handling of published messages is small and fast.
include/asterisk/_private.h
include/asterisk/extension_state.h [new file with mode: 0644]
include/asterisk/stasis.h
main/asterisk.c
main/extension_state.c [new file with mode: 0644]
main/extension_state_autohints.c [new file with mode: 0644]
main/extension_state_legacy.c [new file with mode: 0644]
main/pbx.c
main/pbx_private.h
main/stasis.c
pbx/pbx_config.c