Commit Graph

6999 Commits

Author SHA1 Message Date
Mike Bradeen
46292c9a45 acl: Add ACL support to http and ari
Add uri prefix based acl support to the built in http server.
This allows an acl to be added per uri prefix (ie '/metrics'
or '/ws') to restrict access.

Add user based acl support for ARI. This adds new acl options
to the user section of ari.conf to restrict access on a per
user basis.

resolves: #1799

UserNote: A new section, type=restriction has been added to http.conf
to allow an uri prefix based acl to be configured. See
http.conf.sample for examples and more information.
The user section of ari.conf can now contain an acl configuration
to restrict users access. See ari.conf.sample for examples and more
information
2026-03-05 12:52:43 +00:00
Naveen Albert
7d3fb10c02 dsp.c: Add support for detecting R2 signaling tones.
Extend the existing DTMF/MF tone detection support by adding support
for R2 tones, another variant of MF (R1) signaling. Both forward
and backward signaling are supported.

Resolves: #1804
2026-03-03 22:07:26 +00:00
Tinet-mucw
86b694f6f3 main/file: fix translated-frame write loop to use current frame
write each translated frame from translator output.

Resolves: #1797
2026-03-03 21:51:53 +00:00
George Joseph
797e258be1 docs: Add "Provided-by" to doc XML and CLI output.
For application, function, manager, managerEvent, managerEventInstance
and info XML documentation nodes, the make_xml_documentation script will
add a "module" attribute if not already present.  For XML in separate
"*_doc.xml" files, the script figures out the correct module name.  For
documentation in the "main" directory, the module name is set to "builtin".

The CLI handlers for "core show application", "core show function",
"manager show command" and "manager show event", have been updated to
show the following after the Synopsis...

```
[Provided By]
<modulename>
```

For modules that provide additional "info" elements (like the technologies
do for Dial), the providing module has also been added.

```
Technology: WebSocket  Provided by: chan_websocket
WebSocket Dial Strings:
...
```

UserNote: The CLI help for applications, functions, manager commands and
manager events now shows the module that provides its functionality.
2026-03-03 18:55:56 +00:00
George Joseph
fd781d966a CDR/CEL Custom Performance Improvements
There is a LOT of work in this commit but the TL;DR is that it takes
CEL processing from using 38% of the CPU instructions used by a call,
which is more than that used by the call processing itself, down to less
than 10% of the instructions.

So here's the deal...  cdr_custom, cdr_sqlite3_custom, cel_custom
and cel_sqlite3_custom all shared one ugly trait...they all used
ast_str_substitute_variables() or pbx_substitute_variables_helper()
to resolve the dialplan functions used in their config files.  Not only
are they both extraordinarily expensive, they both require a dummy
channel to be allocated and destroyed for each record written.  For CDRs,
that's not too bad because we only write one CDR per call.  For CELs however,
it's a disaster.

As far as source code goes, the modules basically all did the same thing.
Unfortunately, they did it badly.  The config files simply contained long
opaque strings which were intepreted by ast_str_substitute_variables() or
pbx_substitute_variables_helper(), the very functions that ate all the
instructions.  This meant introducing a new "advanced" config format much
like the advanced manager event filtering added to manager.conf in 2024.
Fortunately however, if the legacy config was recognizable, we were able to
parse it as an advanced config and gain the benefit.  If not, then it
goes the legacy, and very expensive, route.

Given the commonality among the modules, instead of making the same
improvements to 4 modules then trying to maintain them over time, a single
module "res_cdrel_custom" was created that contains all of the common code.
A few bonuses became possible in the process...
* The cdr_custom and cel_custom modules now support JSON formatted output.
* The cdr_sqlite_custom and cel_sqlite3_custom modules no longer have
  to share an Sqlite3 database.

Summary of changes:

A new module "res/res_cdrel_custom.c" has been created and the existing
cdr_custom, cdr_sqlite3_custom, cel_custom and cel_sqlite3_custom modules
are now just stubs that call the code in res_cdrel_custom.

res_cdrel_custom contains:
* A common configuration facility.
* Getters for both CDR and CEL fields that share the same abstraction.
* Formatters for all data types found in the ast_cdr and ast_event
  structures that share the same abstraction.
* Common writers for the text file and database backends that, you guessed it,
  share the same abstraction.

The result is that while there is certainly a net increase in the number of
lines in the code base, most of it is in the configuration handling at
load-time.  The run-time instruction path length is now significanty shorter.

```
Scenario                   Instructions     Latency
=====================================================
CEL pre changes                  38.49%     37.51%
CEL Advanced                      9.68%      6.06%
CEL Legacy (auto-conv to adv)     9.95%      6.13%

CEL Sqlite3 pre changes          39.41%     39.90%
CEL Sqlite3 Advanced             25.68%     24.24%
CEL Sqlite3 Legacy (auto conv)   25.88%     24.53%

CDR pre changes                   4.79%      2.95%
CDR Advanced                      0.79%      0.47%
CDR Legacy (auto conv to adv)     0.86%      0.51%

CDR Sqlite3 pre changes           4.47%      2.89%
CEL Sqlite3 Advanced              2.16%      1.29%
CEL Sqlite3 Legacy (auto conv)    2.19%      1.30%
```

Notes:
* We only write one CDR per call but every little bit helps.
* Sqlite3 still takes a fair amount of resources but the new config
  makes a decent improvement.
* Legacy configs that we can't auto convert will still take the
  "pre changes" path.

If you're interested in more implementation details, see the comments
at the top of the res_cdrel_custom.c file.

One minor fix to CEL is also included...Although TenantID was added to the
ast_event structure, it was always rendered as an empty string.  It's now
properly rendered.

UserNote: Significant performance improvements have been made to the
cdr_custom, cdr_sqlite3_custom, cel_custom and cel_sqlite3_custom modules.
See the new sample config files for those modules to see how to benefit
from them.
2026-03-02 16:43:30 +00:00
Prashant Srivastav
3e3096533e fix: Add macOS (Darwin) compatibility for building Asterisk
- Makefile: Skip /usr/lib/bundle1.o on modern macOS (doesn't exist)
- Makefile.rules: Skip -fno-partial-inlining for clang (gcc-only flag)
- include/asterisk/utils.h: Use asterisk/endian.h instead of <endian.h>
- main/Makefile: Add Darwin-specific pjproject linking with -force_load
- main/strcompat.c: Include poll-compat.h, use ast_poll()
- main/xml.c: Add ASTMM_LIBC ASTMM_IGNORE for libxml2 compatibility
- res/res_pjsip/config_transport.c: Define TCP keepalive constants for macOS

Tested on macOS Darwin 25.2.0 (Apple Silicon ARM64)
2026-02-26 15:51:08 +00:00
Naveen Albert
b533d7f035 build: Fix unused-but-set-variable warnings with gcc 16.
Fix or remove a few variables that were being set but not actually
used anywhere, causing warnings with gcc 16.

Resolves: #1783
2026-02-25 13:25:21 +00:00
Naveen Albert
7c52e14042 build: Fix another GCC discarded-qualifiers const error.
Follow on commit to 27a39cba7e
to fix compilation with BETTER_BACKTRACES with gcc 15.2.1.

Resolves: #1781
2026-02-18 19:30:18 +00:00
Joshua C. Colp
1decab6def build: Fix GCC discarded-qualifiers const errors.
GCC 15.2.1 pays attention to the discarding of the const
qualifier when strchr, strrchr, memchr, or memrchr are now
used. This change fixes numerous errors with this throughout
the tree. The fixes can be broken down into the following:

1. The return value should be considered const.
2. The value passed to strchr or strrchr can be cast as it is
   expected and allowed to be modified.
3. The pointer passed to strchr or strrchr is not meant to be
   modified and so the contents must be duplicated.
4. It was declared const and never should have been.
2026-02-18 13:43:42 +00:00
Joshua C. Colp
ff34444a4b endpoints: Allow access to latest snapshot directly.
This change adds an API call to allow direct access to the latest
snapshot of an ast_endpoint. This is then used by chan_pjsip when
calculating device state, eliminating the need to access the cache
which would incur a container find and access.
2026-02-17 13:31:31 +00:00
George Joseph
06486a2f60 http.c: Change httpstatus to default disabled and sanitize output.
To address potential security issues, the httpstatus page is now disabled
by default and the echoed query string and cookie output is html-escaped.

Resolves: #GHSA-v6hp-wh3r-cwxh

UpgradeNote: To prevent possible security issues, the `/httpstatus` page
served by the internal web server is now disabled by default.  To explicitly
enable it, set `enable_status=yes` in http.conf.
2026-02-05 15:25:18 +00:00
George Joseph
4f8aa579ce xml.c: Replace XML_PARSE_NOENT with XML_PARSE_NONET for xmlReadFile.
The xmlReadFile XML_PARSE_NOENT flag, which allows parsing of external
entities, could allow a potential XXE injection attack.  Replacing it with
XML_PARSE_NONET, which prevents network access, is safer.

Resolves: #GHSA-85x7-54wr-vh42
2026-02-05 15:25:18 +00:00
phoneben
74eeec1522 stasis.c: Fix deadlock in stasis_topic_pool_get_topic during module load
stasis.c: Fix deadlock in stasis_topic_pool_get_topic during module load.

Deadlock occurs when res_manager_devicestate loads concurrently with
device state operations due to lock ordering violation:

Thread 1: Holds pool lock → needs topic lock (in stasis_forward_all)
Thread 2: Holds topic lock → needs pool lock (in stasis_topic_pool_get_topic)

Fix: Release pool lock before calling stasis_topic_create() and
stasis_forward_all(). Re-acquire only for insertion with race check.

Preserves borrowed reference semantics while breaking the deadlock cycle.

Fixes: #1611
2026-01-26 20:33:27 +00:00
Sean Bright
a27114d45c asterisk.c: Use C.UTF-8 locale instead of relying on user's environment.
Resolves: #1739
2026-01-26 19:42:23 +00:00
Jasper Hafkenscheid
1d22f5a345 channelstorage_cpp_map_name_id: Fix get_by_name_prefix prefix match
Lower bound filter did not ensure prefix match.

Resolves: #1730
2026-01-23 15:25:43 +00:00
Talha Asghar
1d5ebbf4a9 say.c: added language support for pashto and dari
With this new feature, users who speak these languages can now benefit from the
text-to-speech functionality provided by asterisk. This will make the platform
more accessible and useful to a wider range of users, particularly those in
regions where Pashto and Dari are spoken. This contribution will help to improve
the overall usability and inclusivity of the asterisk platform.

Fixes: #1724
2026-01-22 18:33:37 +00:00
Sean Bright
2b2abbfa1f cli.c: Allow 'channel request hangup' to accept patterns.
This extends 'channel request hangup' to accept multiple channel
names, a POSIX Extended Regular Expression, a glob-like pattern, or a
combination of all of them.

UserNote: The 'channel request hangup' CLI command now accepts
multiple channel names, POSIX Extended Regular Expressions, glob-like
patterns, or a combination of all of them. See the CLI command 'core
show help channel request hangup' for full details.
2026-01-13 16:03:31 +00:00
Sean Bright
27cab02ab2 asterisk.c: Allow multi-byte characters on the Asterisk CLI.
Versions of libedit that support Unicode expect that the
EL_GETCFN (the function that does character I/O) will fill in a
`wchar_t` with a character, which may be multi-byte. The built-in
function that libedit provides, but does not expose with a public API,
does properly handle multi-byte sequences.

Due to the design of Asterisk's console processing loop, Asterisk
provides its own implementation which does not handle multi-byte
characters. Changing Asterisk to use libedit's built-in function would
be ideal, but would also require changing some fundamental things
about console processing which could be fairly disruptive.

Instead, we bring in libedit's `read_char` implementation and modify
it to suit our specific needs.

Resolves: #60
2026-01-05 14:46:27 +00:00
sarangr7
3b4f4d2258 main/dial.c: Set channel hangup cause on timeout in handle_timeout_trip
When dial attempts timeout in the core dialing API, the channel's hangup
cause was not being set before hanging up. Only the ast_dial_channel
structure's internal cause field was updated, but the actual ast_channel
hangup cause remained unset.

This resulted in incorrect or missing hangup cause information being
reported through CDRs, AMI events, and other mechanisms that read the
channel's hangup cause when dial timeouts occurred via applications
using the dialing API (FollowMe, Page, etc.).

The fix adds proper channel locking and sets AST_CAUSE_NO_ANSWER on
the channel before calling ast_hangup(), ensuring consistent hangup
cause reporting across all interfaces.

Resolves: #1660
2025-12-29 19:37:38 +00:00
Sean Bright
08d4960df7 http.c: Include remote address in URI handler message.
Resolves: #1662
2025-12-29 18:01:50 +00:00
Joshua C. Colp
c67d3d2796 pjsip: Move from threadpool to taskpool
This change moves the PJSIP module from the threadpool API
to the taskpool API. PJSIP-specific implementations for
task usage have been removed and replaced with calls to
the optimized taskpool implementations instead. The need
for a pool of serializers has also been removed as
taskpool inherently provides this. The default settings
have also been changed to be more realistic for common
usage.

UpgradeNote: The threadpool_* options in pjsip.conf have now
been deprecated though they continue to be read and used.
They have been replaced with taskpool options that give greater
control over the underlying taskpool used for PJSIP. An alembic
upgrade script has been added to add these options to realtime
as well.
2025-12-16 17:03:49 +00:00
George Joseph
bf0ce4577c endpoint.c: Plug a memory leak in ast_endpoint_shutdown().
Commit 26795be introduced a memory leak of ast_endpoint when
ast_endpoint_shutdown() was called. The leak occurs only if a configuration
change removes an endpoint and isn't related to call volume or the length of
time asterisk has been running.  An ao2_ref(-1) has been added to
ast_endpoint_shutdown() to plug the leak.

Resolves: #1635
2025-12-09 19:39:16 +00:00
Sean Bright
3e84ffaaa1 Revert "func_hangupcause.c: Add access to Reason headers via HANGUPCAUSE()"
This reverts commit 5177662990.

For rationale, see #1621 and #1606
2025-12-09 17:04:14 +00:00
Mike Bradeen
f29ce05e3e taskprocessors: Improve logging and add new cli options
This change makes some small changes to improve log readability in
addition to the following changes:

Modified 'core show taskprocessors' to now show Low time and High time
for task execution.

New command 'core show taskprocessor name <taskprocessor-name>' to dump
taskprocessor info and current queue.

Addionally, a new test was added to demonstrate the 'show taskprocessor
name' functionality:
test execute category /main/taskprocessor/ name taskprocessor_cli_show

Setting 'core set debug 3 taskprocessor.c' will now log pushed tasks.
(Warning this is will cause extremely high levels of logging at even
low traffic levels.)

Resolves: #1566

UserNote: New CLI command has been added -
core show taskprocessor name <taskprocessor-name>
2025-12-04 16:13:08 +00:00
Michal Hajek
0cf61f8d47 manager: fix double free of criteria variable when adding filter
Signed-off-by: Michal Hajek <michal.hajek@daktela.com>

Fixes: #1531
2025-12-04 13:05:50 +00:00
Sean Bright
2ecdc84d07 abstract_jb.c: Remove redundant timer check per static analysis.
While this check is technically unnecessary, it also was not harmful.

The 2 other items mentioned in the linked issue are false positives
and require no action.

Resolves: #1417
2025-12-03 13:58:30 +00:00
phoneben
065c507ffc channelstorage_cpp: Fix fallback return value in channelstorage callback
callback returned the last iterated channel when no match existed, causing invalid channel references and potential double frees. Updated to correctly return NULL when there is no match.

Resolves: #1609
2025-12-01 15:34:00 +00:00
George Joseph
ed8d5c6430 ccss: Add option to ccss.conf to globally disable it.
The Call Completion Supplementary Service feature is rarely used but many of
it's functions are called by app_dial and channel.c "just in case".  These
functions lock and unlock the channel just to see if CCSS is enabled on it,
which it isn't 99.99% of the time.

UserNote: A new "enabled" parameter has been added to ccss.conf.  It defaults
to "yes" to preserve backwards compatibility but CCSS is rarely used so
setting "enabled = no" in the "general" section can save some unneeded channel
locking operations and log message spam.  Disabling ccss will also prevent
the func_callcompletion and chan_dahdi modules from loading.

DeveloperNote: A new API ast_is_cc_enabled() has been added.  It should be
used to ensure that CCSS is enabled before making any other ast_cc_* calls.
2025-12-01 14:06:00 +00:00
Naveen Albert
b19dbffa9a pbx.c: Print new context count when reloading dialplan.
When running "dialplan reload", the number of contexts reported
is initially wrong, as it is the old context count. Running
"dialplan reload" a second time returns the correct number of
contexts that are loaded. This can confuse users into thinking
that the reload didn't work successfully the first time.

This counter is currently only incremented when iterating the
old contexts prior to the context merge; at the very end, get
the current number of elements in the context hash table and
report that instead. This way, the count is correct immediately
whenever a reload occurs.

Resolves: #1599
2025-11-19 17:19:51 +00:00
Tinet-mucw
fe194b4016 core_unreal.c: Use ast instead of p->chan to get the DIALSTATUS variable
After p->chan = NULL, ast still points to the valid channel object,
using ast safely accesses the channel's DIALSTATUS variable before it's fully destroyed

Resolves: #1590
2025-11-17 14:09:11 +00:00
phoneben
f9e00d3ead stasis: switch stasis show topics temporary container from list - RBtree
switch stasis show topics temporary container from list to RB-tree
minimizing lock time

Resolves: #1585
2025-11-12 22:22:12 +00:00
Sean Bright
86c3baea61 main: Explicitly mark case statement fallthrough as such.
Resolves: #1442
2025-11-12 22:10:51 +00:00
George Joseph
c1e5258497 channelstorage: Allow storage driver read locking to be skipped.
After PR #1498 added read locking to channelstorage_cpp_map_name_id, if ARI
channels/externalMedia was called with a custom channel id AND the
cpp_map_name_id channel storage backend is in use, a deadlock can occur when
hanging up the channel. It's actually triggered in
channel.c:__ast_channel_alloc_ap() when it gets a write lock on the
channelstorage driver then subsequently does a lookup for channel uniqueid
which now does a read lock. This is an invalid operation and causes the lock
state to get "bad". When the channels try to hang up, a write lock is
attempted again which hangs and causes the deadlock.

Now instead of the cpp_map_name_id channelstorage driver "get" APIs
automatically performing a read lock, they take a "lock" parameter which
allows a caller who already has a write lock to indicate that the "get" API
must not attempt its own lock.  This prevents the state from getting mesed up.

The ao2_legacy driver uses the ao2 container's recursive mutex so doesn't
have this issue but since it also implements the common channelstorage API,
it needed its "get" implementations updated to take the lock parameter. They
just don't use it.

Resolves: #1578
2025-11-12 21:27:24 +00:00
Joshua C. Colp
74b1cafece Revert "pjsip: Move from threadpool to taskpool"
This reverts commit bb6b76c2d8.
2025-10-28 12:45:00 +00:00
Tinet-mucw
b026fb80bd iostream.c: Handle TLS handshake attacks in order to resolve the issue of exceeding the maximum number of HTTPS sessions.
The TCP three-way handshake completes, but if the server is under a TLS handshake attack, asterisk will get stuck at SSL_do_handshake().
In this case, a timeout mechanism should be set for the SSL/TLS handshake process to prevent indefinite waiting during the SSL handshake.

Resolves: #1559
2025-10-28 12:44:32 +00:00
Joshua C. Colp
bb6b76c2d8 pjsip: Move from threadpool to taskpool
This change moves the PJSIP module from the threadpool API
to the taskpool API. PJSIP-specific implementations for
task usage have been removed and replaced with calls to
the optimized taskpool implementations instead. The need
for a pool of serializers has also been removed as
taskpool inherently provides this. The default settings
have also been changed to be more realistic for common
usage.

UpgradeNote: The threadpool_* options in pjsip.conf have now
been deprecated though they continue to be read and used.
They have been replaced with taskpool options that give greater
control over the underlying taskpool used for PJSIP. An alembic
upgrade script has been added to add these options to realtime
as well.
2025-10-22 16:32:55 +00:00
Joshua C. Colp
bd5c409371 devicestate: Don't publish redundant device state messages.
When publishing device state check the local cache for the
existing device state. If the new device state is unchanged
from the prior one, don't bother publishing the update. This
can reduce the work done by consumers of device state, such
as hints and app_queue, by not publishing a message to them.

These messages would most often occur with devices that are
seeing numerous simultaneous channels. The underlying device
state would remain as in use throughout, but an update would
be published as channels are created and hung up.
2025-10-22 15:47:21 +00:00
George Joseph
5766460cc7 chan_pjsip: Add technology-specific off-nominal hangup cause to events.
Although the ISDN/Q.850/Q.931 hangup cause code is already part of the ARI
and AMI hangup and channel destroyed events, it can be helpful to know what
the actual channel technology code was if the call was unsuccessful.
For PJSIP, it's the SIP response code.

* A new "tech_hangupcause" field was added to the ast_channel structure along
with ast_channel_tech_hangupcause() and ast_channel_tech_hangupcause_set()
functions.  It should only be set for off-nominal terminations.

* chan_pjsip was modified to set the tech hangup cause in the
chan_pjsip_hangup() and chan_pjsip_session_end() functions.  This is a bit
tricky because these two functions aren't always called in the same order.
The channel that hangs up first will get chan_pjsip_session_end() called
first which will trigger the core to call chan_pjsip_hangup() on itself,
then call chan_pjsip_hangup() on the other channel.  The other channel's
chan_pjsip_session_end() function will get called last.  Unfortunately,
the other channel's HangupRequest events are sent before chan_pjsip has had a
chance to set the tech hangupcause code so the HangupRequest events for that
channel won't have the cause code set.  The ChannelDestroyed and Hangup
events however will have the code set for both channels.

* A new "tech_cause" field was added to the ast_channel_snapshot_hangup
structure. This is a public structure so a bit of refactoring was needed to
preserve ABI compatibility.

* The ARI ChannelHangupRequest and ChannelDestroyed events were modified to
include the "tech_cause" parameter in the JSON for off-nominal terminations.
The parameter is suppressed for nominal termination.

* The AMI SoftHangupRequest, HangupRequest and Hangup events were modified to
include the "TechCause" parameter for off-nominal terminations. Like their ARI
counterparts, the parameter is suppressed for nominal termination.

DeveloperNote: A "tech_cause" parameter has been added to the
ChannelHangupRequest and ChannelDestroyed ARI event messages and a "TechCause"
parameter has been added to the HangupRequest, SoftHangupRequest and Hangup
AMI event messages.  For chan_pjsip, these will be set to the last SIP
response status code for off-nominally terminated calls.  The parameter is
suppressed for nominal termination.
2025-10-20 13:19:22 +00:00
Joshua C. Colp
27fbc166e1 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.
2025-10-14 20:02:04 +00:00
George Joseph
21df9edc38 taskpool: Fix some references to threadpool that should be taskpool.
Resolves: #1478
2025-10-13 15:34:18 +00:00
Naveen Albert
88680c3e7e core_unreal: Preserve ADSI capability when dialing Local channels.
Dial() already preserves the ADSI capability by copying it to the new
channel, but since Local channel pairs consist of two channels, we
also need to copy the capability to the second channel.

Resolves: #1517
2025-10-07 18:19:08 +00:00
Igor Goncharovsky
5177662990 func_hangupcause.c: Add access to Reason headers via HANGUPCAUSE()
As soon as SIP call may end with several Reason headers, we
want to make all of them available through the HAGUPCAUSE() function.
This implementation uses the same ao2 hash for cause codes storage
and adds a flag to make difference between last processed sip
message and content of reason headers.

UserNote: Added a new option to HANGUPCAUSE to access additional
information about hangup reason. Reason headers from pjsip
could be read using 'tech_extended' cause type.
2025-10-07 15:27:04 +00:00
Naveen Albert
b8c9440e19 codec_builtin.c: Adjust some of the quality scores to reflect reality.
Among the lower-quality voice codecs, some of the quality scores did
not make sense relative to each other.

For instance, quality-wise, G.729 > G.723 > PLC10.
However, current scores do not uphold these relationships.

Tweak the scores slightly to reflect more accurate relationships.

Resolves: #1501
2025-10-06 15:46:30 +00:00
George Joseph
c597c8b5c0 channelstorage_cpp_map_name_id: Add read locking around retrievals.
When we retrieve a channel from a C++ map, we actually get back a wrapper
object that points to the channel then right after we retrieve it, we bump its
reference count.  There's a tiny chance however that between those two
statements a delete and/or unref might happen which would cause the wrapper
object or the channel itself to become invalid resulting in a SEGV.  To avoid
this we now perform a read lock on the driver around those statements.

Resolves: #1491
2025-10-06 13:50:31 +00:00
Naveen Albert
e57f10bbe5 dsp.c: Make minor fixes to debug log messages.
Commit dc8e3eeaaf improved the debug log
messages in dsp.c. This makes two minor corrections to it:

* Properly guard an added log statement in a conditional.
* Don't add one to the hit count if there was no hit (however, we do
  still want to do this for the case where this is one).

Resolves: #1496
2025-10-02 14:44:45 +00:00
Naveen Albert
037bf58c78 config_options.c: Improve misleading warning.
When running "config show help <module>", if no XML documentation exists
for the specified module, "Module <module> not found." is returned,
which is misleading if the module is loaded but simply has no XML
documentation for its config. Improve the message to clarify that the
module may simply have no config documentation.

Resolves: #1489
2025-10-02 14:43:06 +00:00
Joshua C. Colp
ece6ed9459 sorcery: Move from threadpool to taskpool.
This change moves observer invocation from the use of
a threadpool to a taskpool. The taskpool options have also
been adjusted to ensure that at least one taskprocessor
remains available at all times.
2025-09-30 13:50:37 +00:00
Sven Kube
ff80666aac stasis_channels.c: Make protocol_id optional to enable blind transfer via ari
When handling SIP transfers via ARI, there is no protocol_id in case of
a blind transfer.

Resolves: #1467
2025-09-23 19:50:04 +00:00
Allan Nathanson
7bd30279de config.c: fix saving of deep/wide template configurations
Follow-on to #244 and #960 regarding how the ast_config_XXX APIs
handle template inheritance.

ast_config_text_file_save2() incorrectly suppressed variables if they
matched any ancestor template.  This broke deep chains (dropping values
based on distant parents) and wide inheritance (ignoring last-wins order
across multiple parents).

The function now inspects the full template hierarchy to find the nearest
effective parent (last occurrence wins).  Earlier inherited duplicates are
collapsed, explicit overrides are kept unless they exactly match the parent,
and PreserveEffectiveContext avoids writing redundant lines.

Resolves: #1451
2025-09-23 19:48:25 +00:00
Bastian Triller
a0f1e460fe Fix some doxygen, typos and whitespace 2025-09-22 17:39:24 +00:00