]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
3 weeks agoUpdate for 20.16.0-rc1 releases/20-pre-reorder
Asterisk Development Team [Wed, 10 Sep 2025 19:53:05 +0000 (19:53 +0000)] 
Update for 20.16.0-rc1

3 weeks agochan_websocket.c: Add DTMF messages
Joe Garlick [Thu, 4 Sep 2025 12:20:35 +0000 (12:20 +0000)] 
chan_websocket.c: Add DTMF messages

Added DTMF messages to the chan_websocket feature.

When a user presses DTMF during a call over chan_websocket it will send a message like:
"DTMF_END digit:1"

Resolves: https://github.com/asterisk/asterisk-feature-requests/issues/70
(cherry picked from commit cf2b2c7f83d7f65b4acd952bac4ec8d997611df8)

3 weeks agoapp_queue.c: Add new global 'log_unpause_on_reason_change'
Igor Goncharovsky [Tue, 2 Sep 2025 06:50:19 +0000 (12:50 +0600)] 
app_queue.c: Add new global 'log_unpause_on_reason_change'

In many asterisk-based systems, the pause reason is used to separate
pauses by type,and logically, changing the reason defines two intervals
that should be accounted for separately. The introduction of a new
option allows me to separate the intervals of operator inactivity in
the log by the event of unpausing.

UserNote: Add new global option 'log_unpause_on_reason_change' that
is default disabled. When enabled cause addition of UNPAUSE event on
every re-PAUSE with reason changed.

(cherry picked from commit f4e88b56e08ff3e701ff274e7150bc608eca80ed)

3 weeks agoapp_waitforsilence.c: Use milliseconds to calculate timeout time
Igor Goncharovsky [Thu, 4 Sep 2025 04:00:50 +0000 (10:00 +0600)] 
app_waitforsilence.c: Use milliseconds to calculate timeout time

The functions WaitForNoise() and WaitForSilence() use the time()
functions to calculate elapsed time, which causes the timer to fire on
a whole second boundary, and the actual function execution time to fire
the timer may be 1 second less than expected. This fix replaces time()
with ast_tvnow().

Fixes: #1401
(cherry picked from commit e6ade6ddbd44f40223c9f24d2bdb8eefc49ed807)

3 weeks agoFix missing ast_test_flag64 in extconf.c
Artem Umerov [Thu, 28 Aug 2025 21:43:11 +0000 (00:43 +0300)] 
Fix missing ast_test_flag64 in extconf.c

Fix missing ast_test_flag64 after https://github.com/asterisk/asterisk/commit/43bf8a4ded7a65203b766b91eaf8331a600e9d8d

(cherry picked from commit 5a32533245b0ecacaa645836734d1831c16d1982)

3 weeks agopbx_builtins: Allow custom tone for WaitExten.
Naveen Albert [Mon, 25 Aug 2025 17:58:31 +0000 (13:58 -0400)] 
pbx_builtins: Allow custom tone for WaitExten.

Currently, the 'd' option will play dial tone while waiting
for digits. Allow it to accept an argument for any tone from
indications.conf.

Resolves: #1396

UserNote: The tone used while waiting for digits in WaitExten
can now be overridden by specifying an argument for the 'd'
option.

(cherry picked from commit d063257ab790eee221d3fe9066b601a2a78dff0f)

3 weeks agores_tonedetect: Add option for TONE_DETECT detection to auto stop.
Naveen Albert [Thu, 28 Aug 2025 12:29:02 +0000 (08:29 -0400)] 
res_tonedetect: Add option for TONE_DETECT detection to auto stop.

One of the problems with TONE_DETECT as it was originally written
is that if a tone is detected multiple times, it can trigger
the redirect logic multiple times as well. For example, if we
do an async goto in the dialplan after detecting a tone, because
the detector is still active until explicitly disabled, if we
detect the tone again, we will branch again and start executing
that dialplan a second time. This is rarely ever desired behavior,
and can happen if the detector is not removed quickly enough.

Add a new option, 'e', which automatically disables the detector
once the desired number of matches have been heard. This eliminates
the potential race condition where previously the detector would
need to be disabled immediately, but doing so quickly enough
was not guaranteed. This also allows match criteria to be retained
longer if needed, so the detector does not need to be destroyed
prematurely.

Resolves: #1390

UserNote: The 'e' option for TONE_DETECT now allows detection to
be disabled automatically once the desired number of matches have
been fulfilled, which can help prevent race conditions in the
dialplan, since TONE_DETECT does not need to be disabled after
a hit.

(cherry picked from commit d555e8117fa0ffd53bf5cd2215f334c1f65a140b)

3 weeks agoapp_queue: fix comparison for announce-position-only-up
Stuart Henderson [Thu, 21 Aug 2025 10:22:40 +0000 (10:22 +0000)] 
app_queue: fix comparison for announce-position-only-up

Numerically comparing that the current queue position is less than
last_pos_said can only be done after at least one announcement has been
made, otherwise last_pos_said is at the default (0).

Fixes: #1386
(cherry picked from commit a32fe8572534f071dbf0a2d2ea9c7c0217426117)

3 weeks agosorcery: Prevent duplicate objects and ensure missing objects are created on update
Alexei Gradinari [Mon, 7 Jul 2025 20:52:13 +0000 (16:52 -0400)] 
sorcery: Prevent duplicate objects and ensure missing objects are created on update

This patch resolves two issues in Sorcery objectset handling with multiple
backends:

1. Prevent duplicate objects:
   When an object exists in more than one backend (e.g., a contact in both
   'astdb' and 'realtime'), the objectset previously returned multiple instances
   of the same logical object. This caused logic failures in components like the
   PJSIP registrar, where duplicate contact entries led to overcounting and
   incorrect deletions, when max_contacts=1 and remove_existing=yes.

   This patch ensures only one instance of an object with a given key is added
   to the objectset, avoiding these duplicate-related side effects.

2. Ensure missing objects are created:
   When using multiple writable backends, a temporary backend failure can lead
   to objects missing permanently from that backend.
   Currently, .update() silently fails if the object is not present,
   and no .create() is attempted.
   This results in inconsistent state across backends (e.g. astdb vs. realtime).

   This patch introduces a new global option in sorcery.conf:
     [general]
     update_or_create_on_update_miss = yes|no

   Default: no (preserves existing behavior).

   When enabled: if .update() fails with no data found, .create() is attempted
   in that backend. This ensures that objects missing due to temporary backend
   outages are re-synchronized once the backend is available again.

   Added a new CLI command:
     sorcery show settings
   Displays global Sorcery settings, including the current value of
   update_or_create_on_update_miss.

   Updated tests to validate both flag enabled/disabled behavior.

Fixes: #1289
UserNote: Users relying on Sorcery multiple writable backends configurations
(e.g., astdb + realtime) may now enable update_or_create_on_update_miss = yes
in sorcery.conf to ensure missing objects are recreated after temporary backend
failures. Default behavior remains unchanged unless explicitly enabled.

(cherry picked from commit a6142af2a098e9444007b9c6ab98329bd06765d8)

3 weeks agosig_analog: Skip Caller ID spill if usecallerid=no.
Naveen Albert [Mon, 25 Aug 2025 17:05:15 +0000 (13:05 -0400)] 
sig_analog: Skip Caller ID spill if usecallerid=no.

If Caller ID is disabled for an FXS port, then we should not send any
Caller ID spill on the line, as we have no Caller ID information that
we can/should be sending.

Resolves: #1394
(cherry picked from commit 08a588e200e179593edd174f7bb7a831970fc978)

3 weeks agochan_dahdi: Fix erroneously persistent dialmode.
Naveen Albert [Mon, 18 Aug 2025 12:56:23 +0000 (08:56 -0400)] 
chan_dahdi: Fix erroneously persistent dialmode.

It is possible to modify the dialmode setting in the chan_dahdi/sig_analog
private using the CHANNEL function, to modify it during calls. However,
it was not being reset between calls, meaning that if, for example, tone
dialing was disabled, it would never work again unless explicitly enabled.

This fixes the setting by pairing it with a "perm" version of the setting,
as a few other features have, so that it can be reset to the permanent
setting between calls. The documentation is also clarified to explain
the interaction of this setting and the digitdetect setting more clearly.

Resolves: #1378
(cherry picked from commit 1cfd9216b7a576f72c5d6d16c85fcea00a2f7eab)

3 weeks ago.github: Update Releaser to use SES email
George Joseph [Wed, 20 Aug 2025 18:02:26 +0000 (12:02 -0600)] 
.github: Update Releaser to use SES email

(cherry picked from commit bda1d32001b9d257ee4881d6209a297d7c7963e5)

3 weeks agochan_websocket: Allow additional URI parameters to be added to the outgoing URI.
George Joseph [Wed, 13 Aug 2025 19:22:38 +0000 (13:22 -0600)] 
chan_websocket: Allow additional URI parameters to be added to the outgoing URI.

* Added a new option to the WebSocket dial string to capture the additional
  URI parameters.
* Added a new API ast_uri_verify_encoded() that verifies that a string
  either doesn't need URI encoding or that it has already been encoded.
* Added a new API ast_websocket_client_add_uri_params() to add the params
  to the client websocket session.
* Added XML documentation that will show up with `core show application Dial`
  that shows how to use it.

Resolves: #1352

UserNote: A new WebSocket channel driver option `v` has been added to the
Dial application that allows you to specify additional URI parameters on
outgoing connections. Run `core show application Dial` from the Asterisk CLI
to see how to use it.

(cherry picked from commit de6aaa9623143438fb43bcf9d6e943a869b61463)

3 weeks agochan_websocket: Fix buffer overrun when processing TEXT websocket frames.
George Joseph [Tue, 19 Aug 2025 15:46:39 +0000 (09:46 -0600)] 
chan_websocket: Fix buffer overrun when processing TEXT websocket frames.

ast_websocket_read() receives data into a fixed 64K buffer then continually
reallocates a final buffer that, after all continuation frames have been
received, is the exact length of the data received and returns that to the
caller.  process_text_message() in chan_websocket was attempting to set a
NULL terminator on the received payload assuming the payload buffer it
received was the large 64K buffer.  The assumption was incorrect so when it
tried to set a NULL terminator on the payload, it could, depending on the
state of the heap at the time, cause heap corruption.

process_text_message() now allocates its own payload_len + 1 sized buffer,
copies the payload received from ast_websocket_read() into it then NULL
terminates it prevent the possibility of the overrun and corruption.

Resolves: #1384
(cherry picked from commit 076423aa18808e2a4fff1259cd927b1f562081c0)

3 weeks agosig_analog: Fix SEGV due to calling strcmp on NULL.
Naveen Albert [Mon, 18 Aug 2025 14:02:38 +0000 (10:02 -0400)] 
sig_analog: Fix SEGV due to calling strcmp on NULL.

Add an additional check to guard against the channel application being
NULL.

Resolves: #1380
(cherry picked from commit 45ee5cda1c39efd4650eb88f4377f799f7890987)

3 weeks agoARI: Add command to indicate progress to a channel
Sven Kube [Wed, 30 Jul 2025 12:24:07 +0000 (14:24 +0200)] 
ARI: Add command to indicate progress to a channel

Adds an ARI command to send a progress indication to a channel.

DeveloperNote: A new ARI endpoint is available at `/channels/{channelId}/progress` to indicate progress to a channel.
(cherry picked from commit a0b36f809998f6ae15f01dc7193858f8c2e56faa)

3 weeks agodsp.c: Improve debug logging in tone_detect().
Naveen Albert [Fri, 15 Aug 2025 12:32:00 +0000 (08:32 -0400)] 
dsp.c: Improve debug logging in tone_detect().

The debug logging during DSP processing has always been kind
of overwhelming and annoying to troubleshoot. Simplify and
improve the logging in a few ways to aid DSP debugging:

* If we had a DSP hit, don't also emit the previous debug message that
  was always logged. It is duplicated by the hit message, so this can
  reduce the number of debug messages during detection by 50%.
* Include the hit count and required number of hits in the message so
  on partial detections can be more easily troubleshot.
* Use debug level 9 for hits instead of 10, so we can focus on hits
  without all the noise from the per-frame debug message.
* 1-index the hit count in the debug messages. On the first hit, it
  currently logs '0', just as when we are not detecting anything,
  which can be confusing.

Resolves: #1375
(cherry picked from commit 286c104231afbbb38cf6f988e86afd0c7602cd91)

3 weeks agores_stasis_device_state: Fix delete ARI Devicestates after asterisk restart.
Jose Lopes [Wed, 30 Jul 2025 12:49:16 +0000 (13:49 +0100)] 
res_stasis_device_state: Fix delete ARI Devicestates after asterisk restart.

After an asterisk restart, the deletion of ARI Devicestates didn't
return error, but the devicestate was not deleted.
Found a typo on populate_cache function that created wrong cache for
device states.
This bug caused wrong assumption that devicestate didn't exist,
since it was not in cache, so deletion didn't returned error.

Fixes: #1327
(cherry picked from commit 4b9a373ec5d7c50055120306bd514a4e38bdb373)

3 weeks agoapp_chanspy: Add option to not automatically answer channel.
Naveen Albert [Wed, 13 Aug 2025 13:01:03 +0000 (09:01 -0400)] 
app_chanspy: Add option to not automatically answer channel.

Add an option for ChanSpy and ExtenSpy to not answer the channel
automatically. Most applications that auto-answer by default
already have an option to disable this behavior if unwanted.

Resolves: #1358

UserNote: ChanSpy and ExtenSpy can now be configured to not
automatically answer the channel by using the 'N' option.

(cherry picked from commit e182531373a7178c2d7c2b533386587323ee5d72)

3 weeks agoxmldoc.c: Fix rendering of CLI output.
George Joseph [Thu, 14 Aug 2025 15:41:45 +0000 (09:41 -0600)] 
xmldoc.c: Fix rendering of CLI output.

If you do a `core show application Dial`, you'll see it's kind of a mess.
Indents are wrong is some places, examples are printed in black which makes
them invisible on most terminals, and the lack of line breaks in some cases
makes it hard to follow.

* Fixed the rendering of examples so they are indented properly and changed
the color so they can be seen.
* There is now a line break before each option.
* Options are now printed on their own line with all option content indented
below them.

Example from Dial before fixes:
```
    Example: Dial 555-1212 on first available channel in group 1, searching
    from highest to lowest

    Example: Ringing FXS channel 4 with ring cadence 2

    Example: Dial 555-1212 on channel 3 and require answer confirmation

...

    O([mode]):
        mode - With <mode> either not specified or set to '1', the originator
        hanging up will cause the phone to ring back immediately.
 - With <mode> set to '2', when the operator flashes the trunk, it will ring
 their phone back.
Enables *operator services* mode.  This option only works when bridging a DAHDI
channel to another DAHDI channel only. If specified on non-DAHDI interfaces, it
will be ignored. When the destination answers (presumably an operator services
station), the originator no longer has control of their line. They may hang up,
but the switch will not release their line until the destination party (the
operator) hangs up.

    p: This option enables screening mode. This is basically Privacy mode
    without memory.
```

After:
```
    Example: Dial 555-1212 on first available channel in group 1, searching
    from highest to lowest

     same => n,Dial(DAHDI/g1/5551212)

    Example: Ringing FXS channel 4 with ring cadence 2

     same => n,Dial(DAHDI/4r2)

    Example: Dial 555-1212 on channel 3 and require answer confirmation

     same => n,Dial(DAHDI/3c/5551212)

...

    O([mode]):
        mode - With <mode> either not specified or set to '1', the originator
        hanging up will cause the phone to ring back immediately.
        With <mode> set to '2', when the operator flashes the trunk, it will
        ring their phone back.
        Enables *operator services* mode.  This option only works when bridging
        a DAHDI channel to another DAHDI channel only. If specified on
        non-DAHDI interfaces, it will be ignored. When the destination answers
        (presumably an operator services station), the originator no longer has
        control of their line. They may hang up, but the switch will not
        release their line until the destination party (the operator) hangs up.

    p:
        This option enables screening mode. This is basically Privacy mode
        without memory.
```

There are still things we can do to make this more readable but this is a
start.

(cherry picked from commit bd1e723ecac610a0afdce9258dac907f0ca91e40)

3 weeks agofunc_frame_drop: Add debug messages for dropped frames.
Naveen Albert [Thu, 14 Aug 2025 23:40:27 +0000 (19:40 -0400)] 
func_frame_drop: Add debug messages for dropped frames.

Add debug messages in scenarios where frames that are usually processed
are dropped or skipped.

Resolves: #1371
(cherry picked from commit 00b6ab22a0175c1c4f39e67a40ccccd24d8d12ce)

3 weeks agotest_res_prometheus: Fix compilation failure on Debian 13.
Naveen Albert [Thu, 14 Aug 2025 20:31:00 +0000 (16:31 -0400)] 
test_res_prometheus: Fix compilation failure on Debian 13.

curl_easy_setopt expects long types, so be explicit.

Resolves: #1369
(cherry picked from commit d04f273955cda45d13925ba72128678dfeb6dda9)

3 weeks agofunc_frame_drop: Handle allocation failure properly.
Naveen Albert [Thu, 14 Aug 2025 14:00:09 +0000 (10:00 -0400)] 
func_frame_drop: Handle allocation failure properly.

Handle allocation failure and simplify the allocation using asprintf.

Resolves: #1366
(cherry picked from commit 40e6f2b12cfaeddf57712586f40b1f90d658eba9)

3 weeks agopbx_lua.c: segfault when pass null data to term_color function
Alexey Khabulyak [Thu, 14 Aug 2025 08:21:41 +0000 (11:21 +0300)] 
pbx_lua.c: segfault when pass null data to term_color function

This can be reproduced under certain curcomstences.
For example: call app.playback from lua with invalid data: app.playback({}).
pbx_lua.c will try to get data for this playback using lua_tostring function.
This function returs NULL for everything but strings and numbers.
Then, it calls term_color with NULL data.
term_color function can call(if we don't use vt100 compat term)
ast_copy_string with NULL inbuf which cause segfault. bt example:
ast_copy_string (size=8192, src=0x0, dst=0x7fe44b4be8b0)
at /usr/src/asterisk/asterisk-20.11.0/include/asterisk/strings.h:412

Resolves: https://github.com/asterisk/asterisk/issues/1363
(cherry picked from commit a321038cad901a982e1f9584f9f40f07903450be)

3 weeks agobridge.c: Obey BRIDGE_NOANSWER variable to skip answering channel.
Naveen Albert [Thu, 14 Aug 2025 12:50:31 +0000 (08:50 -0400)] 
bridge.c: Obey BRIDGE_NOANSWER variable to skip answering channel.

If the BRIDGE_NOANSWER variable is set on a channel, it is not supposed
to answer when another channel bridges to it using Bridge(), and this is
checked when ast_bridge_call* is called. However, another path exists
(bridge_exec -> ast_bridge_add_channel) where this variable was not
checked and channels would be answered. We now check the variable there.

Resolves: #401
Resolves: #1364
(cherry picked from commit 3ea3ec6f0aaebe7bc057bab584f11ef0e7171514)

3 weeks agores_rtp_asterisk: Don't send RTP before DTLS has negotiated.
Ben Ford [Mon, 4 Aug 2025 17:22:12 +0000 (12:22 -0500)] 
res_rtp_asterisk: Don't send RTP before DTLS has negotiated.

There was no check in __rtp_sendto that prevented Asterisk from sending
RTP before DTLS had finished negotiating. This patch adds logic to do
so.

Fixes: #1260
(cherry picked from commit 5843d025412db8f7ca4694fc05b79be951887fd1)

3 weeks agoapp_dial.c: Moved channel lock to prevent deadlock
Alexey Khabulyak [Mon, 4 Aug 2025 14:48:57 +0000 (17:48 +0300)] 
app_dial.c: Moved channel lock to prevent deadlock

It's reproducible with pbx_lua, not regular dialplan.

deadlock description:
1. asterisk locks a channel
2. calls function onedigit_goto
3. calls ast_goto_if_exists funciton
4. checks ast_exists_extension -> pbx_extension_helper
5. pbx_extension_helper calls pbx_find_extension
6. Then asterisk starts autoservice in a new thread
7. autoservice run tries to lock the channel again

Because our channel is locked already, autoservice can't lock.
Autoservice can't lock -> autoservice stop is waiting forever.
onedigit_goto waits for autoservice stop.

Resolves: https://github.com/asterisk/asterisk/issues/1335
(cherry picked from commit 4b766d24d078dff701805f18cb41fb59bd6033ce)

3 weeks agores_pjsip_diversion: resolve race condition between Diversion header processing and...
Mike Bradeen [Thu, 7 Aug 2025 22:33:36 +0000 (16:33 -0600)] 
res_pjsip_diversion: resolve race condition between Diversion header processing and redirect

Based on the firing order of the PJSIP call-backs on a redirect, it was possible for
the Diversion header to not be included in the outgoing 181 response to the UAC and
the INVITE to the UAS.

This change moves the Diversion header processing to an earlier PJSIP callback while also
preventing the corresponding update that can cause a duplicate 181 response when processing
the header at that time.

Resolves: #1349
(cherry picked from commit 8dce57f9ada76580cb6d5ea12779f2a0301069a2)

3 weeks agofile.c: with "sounds_search_custom_dir = yes", search "custom" directory
Allan Nathanson [Sun, 10 Aug 2025 17:21:53 +0000 (13:21 -0400)] 
file.c: with "sounds_search_custom_dir = yes", search "custom" directory

With `sounds_search_custom_dir = yes`, we are supposed to search for sounds
in the `AST_DATA_DIR/sounds/custom` directory before searching the normal
directories.  Unfortunately, a recent change
(https://github.com/asterisk/asterisk/pull/1172) had a typo resulting in
the "custom" directory not being searched.  This change restores this
expected behavior.

Resolves: #1353
(cherry picked from commit 59d6d2addf04c7f71b63967edc560d65cbe2f76b)

3 weeks agocel: Add STREAM_BEGIN, STREAM_END and DTMF event types.
Sperl Viktor [Mon, 30 Jun 2025 11:38:50 +0000 (13:38 +0200)] 
cel: Add STREAM_BEGIN, STREAM_END and DTMF event types.

Fixes: #1280
UserNote: Enabling the tracking of the
STREAM_BEGIN and the STREAM_END event
types in cel.conf will log media files and
music on hold played to each channel.
The STREAM_BEGIN event's extra field will
contain a JSON with the file details (path,
format and language), or the class name, in
case of music on hold is played. The DTMF
event's extra field will contain a JSON with
the digit and the duration in milliseconds.

(cherry picked from commit 0906282f2593f9635c203a70fc6378a62dced90b)

3 weeks agochannelstorage_cpp_map_name_id.cc: Refactor iterators for thread-safety.
George Joseph [Wed, 30 Jul 2025 12:39:49 +0000 (06:39 -0600)] 
channelstorage_cpp_map_name_id.cc: Refactor iterators for thread-safety.

The fact that deleting an object from a map invalidates any iterator
that happens to currently point to that object was overlooked in the initial
implementation.  Unfortunately, there's no way to detect that an iterator
has been invalidated so the result was an occasional SEGV triggered by modules
like app_chanspy that opens an iterator and can keep it open for a long period
of time.  The new implementation doesn't keep the underlying C++ iterator
open across calls to ast_channel_iterator_next() and uses a read lock
on the map to ensure that, even for the few microseconds we use the
iterator, another thread can't delete a channel from under it.  Even with
this change, the iterators are still WAY faster than the ao2_legacy
storage driver.

Full details about the new implementation are located in the comments for
iterator_next() in channelstorage_cpp_map_name_id.cc.

Resolves: #1309
(cherry picked from commit 830dd4656ccd642524ecb8b7eba50d7dea3fb3d1)

3 weeks agores_srtp: Add menuselect options to enable AES_192, AES_256 and AES_GCM
George Joseph [Tue, 5 Aug 2025 14:10:29 +0000 (08:10 -0600)] 
res_srtp: Add menuselect options to enable AES_192, AES_256 and AES_GCM

UserNote: Options are now available in the menuselect "Resource Modules"
category that allow you to enable the AES_192, AES_256 and AES_GCM
cipher suites in res_srtp. Of course, libsrtp and OpenSSL must support
them but modern versions do.  Previously, the only way to enable them was
to set the CFLAGS environment variable when running ./configure.
The default setting is to disable them preserving existing behavior.

(cherry picked from commit 581e4a23a815fb27fba7238f4465c055b3c58621)

3 weeks agocdr: add CANCEL dispostion in CDR
zhou_jiajian [Thu, 24 Jul 2025 11:39:27 +0000 (19:39 +0800)] 
cdr: add CANCEL dispostion in CDR

In the original implementation, both CANCEL and NO ANSWER states were
consolidated under the NO ANSWER disposition. This patch introduces a
separate CANCEL disposition, with an optional configuration switch to
enable this new disposition.

Resolves: #1323

UserNote: A new CDR option "canceldispositionenabled" has been added
that when set to true, the NO ANSWER disposition will be split into
two dispositions: CANCEL and NO ANSWER. The default value is 'no'

(cherry picked from commit 9d4674d93d69acd9e2f4a09c2748838affbc1c74)

3 weeks agofunc_curl: Allow auth methods to be set.
Naveen Albert [Fri, 1 Aug 2025 15:58:16 +0000 (11:58 -0400)] 
func_curl: Allow auth methods to be set.

Currently the CURL function only supports Basic Authentication,
the default auth method in libcurl. Add an option that also
allows enabling digest authentication.

Resolves: #1332

UserNote: The httpauth field in CURLOPT now allows the authentication
methods to be set.

(cherry picked from commit 99b310a33f7797089030ed5ccdc21281d2a97ae4)

3 weeks agooptions: Change ast_options from ast_flags to ast_flags64.
George Joseph [Mon, 21 Jul 2025 19:12:40 +0000 (13:12 -0600)] 
options:  Change ast_options from ast_flags to ast_flags64.

DeveloperNote: The 32-bit ast_options has no room left to accomodate new
options and so has been converted to an ast_flags64 structure. All internal
references to ast_options have been updated to use the 64-bit flag
manipulation macros.  External module references to the 32-bit ast_options
should continue to work on little-endian systems because the
least-significant bytes of a 64 bit integer will be in the same location as a
32-bit integer.  Because that's not the case on big-endian systems, we've
swapped the bytes in the flags manupulation macros on big-endian systems
so external modules should still work however you are encouraged to test.

(cherry picked from commit d1a194596756250a68d5de8ab7dd805640be3558)

3 weeks agores_config_odbc: Prevent Realtime fallback on record-not-found (SQL_NO_DATA)
Alexei Gradinari [Tue, 15 Jul 2025 21:56:39 +0000 (17:56 -0400)] 
res_config_odbc: Prevent Realtime fallback on record-not-found (SQL_NO_DATA)

This patch fixes an issue in the ODBC Realtime engine where Asterisk incorrectly
falls back to the next configured backend when the current one returns
SQL_NO_DATA (i.e., no record found).
This is a logical error and performance risk in multi-backend configurations.

Solution:
Introduced CONFIG_RT_NOT_FOUND ((void *)-1) as a special return marker.
ODBC Realtime backend now return CONFIG_RT_NOT_FOUND when no data is found.
Core engine stops iterating on this marker, avoiding unnecessary fallback.

Notes:
Other Realtime backends (PostgreSQL, LDAP, etc.) can be updated similarly.
This patch only covers ODBC.

Fixes: #1305
(cherry picked from commit 9e3ea1c8ac8f87d44f13868ffd3ff81db4eac298)

3 weeks agoresource_channels.c: Don't call ast_channel_get_by_name on empty optional arguments
Sven Kube [Wed, 30 Jul 2025 10:26:13 +0000 (12:26 +0200)] 
resource_channels.c: Don't call ast_channel_get_by_name on empty optional arguments

`ast_ari_channels_create` and `ast_ari_channels_dial` called the
`ast_channel_get_by_name` function with optional arguments. Since
8f1982c4d6, this function logs an error for empty channel names.
This commit adds checks for empty optional arguments that are used
to call `ast_channel_get_by_name` to prevent these error logs.

(cherry picked from commit 0ba07ac7c374cc42885e7fd35f15ab5284c2826d)

3 weeks agoapp_agent_pool: Remove documentation for removed option.
Naveen Albert [Mon, 28 Jul 2025 13:27:07 +0000 (09:27 -0400)] 
app_agent_pool: Remove documentation for removed option.

The already-deprecated "password" option for the AGENT function was
removed in commit d43b17a872e8227aa8a9905a21f90bd48f9d5348 for
Asterisk 12, but the documentation for it wasn't removed then.

Resolves: #1321
(cherry picked from commit 74e002277c6579cd9ca87be4ca0cf741f4620b7e)

3 weeks agopbx.c: When the AST_SOFTHANGUP_ASYNCGOTO flag is set, pbx_extension_helper should...
Tinet-mucw [Tue, 22 Jul 2025 09:36:11 +0000 (02:36 -0700)] 
pbx.c: When the AST_SOFTHANGUP_ASYNCGOTO flag is set, pbx_extension_helper should return directly.

Under certain circumstances the context/extens/prio are set in the ast_async_goto, for example action Redirect.
In the situation that action Redirect is broken by pbx_extension_helper this info is changed.
This will cause the current dialplan location to be executed twice.
In other words, the Redirect action does not take effect.

Resolves: #1315
(cherry picked from commit 4442e2dce1d0a663888b9a12a3a6f083fd0d4492)

3 weeks agores_agi: Increase AGI command buffer size from 2K to 8K
Sperl Viktor [Tue, 22 Jul 2025 13:04:01 +0000 (15:04 +0200)] 
res_agi: Increase AGI command buffer size from 2K to 8K

Fixes: #1317
(cherry picked from commit 3403da9c019ca7d71c2549d3c533b6ce5975ac43)

3 weeks agoast_tls_cert: Make certificate validity configurable.
Naveen Albert [Wed, 16 Jul 2025 13:06:35 +0000 (09:06 -0400)] 
ast_tls_cert: Make certificate validity configurable.

Currently, the ast_tls_cert script is hardcoded to produce certificates
with a validity of 365 days, which is not generally desirable for self-
signed certificates. Make this parameter configurable.

Resolves: #1307
(cherry picked from commit 9c55e72b671bacf835cade9f2f6feba943d4caf0)

3 weeks agocdr.c: Set tenantid from party_a->base instead of chan->base.
George Joseph [Thu, 17 Jul 2025 21:18:50 +0000 (15:18 -0600)] 
cdr.c: Set tenantid from party_a->base instead of chan->base.

The CDR tenantid was being set in cdr_object_alloc from the channel->base
snapshot.  Since this happens at channel creation before the dialplan is even
reached, calls to `CHANNEL(tenantid)=<something>` in the dialplan were being
ignored.  Instead we now take tenantid from party_a when
cdr_object_create_public_records() is called which is after the call has
ended and all channel snapshots rebuilt.  This is exactly how accountcode
and amaflags, which can also be set in tha dialplpan, are handled.

Resolves: #1259
(cherry picked from commit a4aab9d39f87c25381934f176de32718427af9cb)

3 weeks ago.github: Reduce number of inputs to Releaser to 10.
George Joseph [Fri, 18 Jul 2025 17:26:37 +0000 (11:26 -0600)] 
.github: Reduce number of inputs to Releaser to 10.

The max number of inputs supported by GitHub is 10 so
is_security and is_hotfix were factored into a single choice
entry.

(cherry picked from commit f459a57394fcf45c1404df21a9b351bc7ad2f818)

3 weeks ago.github: Add skip-cherry-pick and skip-test-builds to Releaser.
George Joseph [Fri, 18 Jul 2025 17:04:04 +0000 (11:04 -0600)] 
.github: Add skip-cherry-pick and skip-test-builds to Releaser.

(cherry picked from commit cc74f2f28cfc6705d6d8bbe91f0ea223e035ed7b)

3 weeks agoapp_mixmonitor: Update the documentation concerning the "D" option.
George Joseph [Wed, 16 Jul 2025 15:49:22 +0000 (09:49 -0600)] 
app_mixmonitor:  Update the documentation concerning the "D" option.

When using the "D" option to output interleaved audio, the file extension
must be ".raw".  That info wasn't being properly rendered in the markdown
and HTML on the documentation site.  The XML was updated to move the
note in the option section to a warning in the description.

Resolves: #1269
(cherry picked from commit 8a602dbfeeed8a2b54ca1e8f03dc425b02a0005b)

3 weeks agosig_analog: Properly handle STP, ST2P, and ST3P for fgccamamf.
Naveen Albert [Mon, 14 Jul 2025 11:44:14 +0000 (07:44 -0400)] 
sig_analog: Properly handle STP, ST2P, and ST3P for fgccamamf.

Previously, we were only using # (ST) as a terminator, and not handling
A (STP), B (ST2P), or C (ST3P), which erroneously led to it being
treated as part of the dialed number. Parse any of these as the start
digit.

Resolves: #1301
(cherry picked from commit a45e6d6fd8ff88db070011ea3822f7b415591984)

3 weeks agochan_websocket: Reset frame_queue_length to 0 after FLUSH_MEDIA
kodokaii [Thu, 3 Jul 2025 17:40:10 +0000 (19:40 +0200)] 
chan_websocket: Reset frame_queue_length to 0 after FLUSH_MEDIA

In the WebSocket channel driver, the FLUSH_MEDIA command clears all frames from
the queue but does not reset the frame_queue_length counter.

As a result, the driver incorrectly thinks the queue is full after flushing,
which prevents new multimedia frames from being sent, especially after multiple
flush commands.

This fix sets frame_queue_length to 0 after flushing, ensuring the queue state
is consistent with its actual content.

Fixes: #1304
(cherry picked from commit 38d0909669bcfd084538a641225ca8fcded0b3b9)

3 weeks agochan_pjsip.c: Change SSRC after media source change
Martin Tomec [Wed, 25 Jun 2025 13:20:17 +0000 (15:20 +0200)] 
chan_pjsip.c: Change SSRC after media source change

When the RTP media source changes, such as after a blind transfer, the new source introduces a discontinuous timestamp. According to RFC 3550, Section 5.1, an RTP stream's timestamp for a given SSRC must increment monotonically and linearly.
To comply with the standard and avoid a large timestamp jump on the existing SSRC, a new SSRC is generated for the new media stream.
This change resolves known interoperability issues with certain SBCs (like Sonus/Ribbon) that stop forwarding media when they detect such a timestamp violation. This code uses the existing implementation from chan_sip.

Resolves: #927
(cherry picked from commit 5946bc63633638cc92952bcb05ae0b22305017c1)

3 weeks agoMedia over Websocket Channel Driver
George Joseph [Mon, 28 Apr 2025 16:39:50 +0000 (10:39 -0600)] 
Media over Websocket Channel Driver

* Created chan_websocket which can exchange media over both inbound and
outbound websockets which the driver will frame and time.
See http://s.asterisk.net/mow for more information.

* res_http_websocket: Made defines for max message size public and converted
a few nuisance verbose messages to debugs.

* main/channel.c: Changed an obsolete nuisance error to a debug.

* ARI channels: Updated externalMedia to include chan_websocket as a supported
transport.

UserNote: A new channel driver "chan_websocket" is now available. It can
exchange media over both inbound and outbound websockets and will both frame
and re-time the media it receives.
See http://s.asterisk.net/mow for more information.

UserNote: The ARI channels/externalMedia API now includes support for the
WebSocket transport provided by chan_websocket.

(cherry picked from commit 07fd3af897489b53a47d16dc04281e4963873592)

3 weeks agobundled_pjproject: Avoid deadlock between transport and transaction
Stanislav Abramenkov [Tue, 1 Jul 2025 09:05:48 +0000 (12:05 +0300)] 
bundled_pjproject: Avoid deadlock between transport and transaction

Backport patch from upstream
* Avoid deadlock between transport and transaction
https://github.com/pjsip/pjproject/commit/edde06f261ac

Issue described in
https://github.com/pjsip/pjproject/issues/4442

(cherry picked from commit 877e5ef7704884295aa8990450aa3a8bc79024bd)

3 weeks agoutils.h: Add rounding to float conversion to int.
mkmer [Mon, 24 Mar 2025 01:04:50 +0000 (21:04 -0400)] 
utils.h: Add rounding to float conversion to int.

Quote from an audio engineer NR9V:
There is a minor issue of a small amount of crossover distortion though as a result of `ast_slinear_saturated_multiply_float()` not rounding the float. This could result in some quiet but potentially audible distortion artifacts in lower volume parts of the signal. If you have for example a sign wave function with a max amplitude of just a few samples, all samples between -1 and 1 will be truncated to zero, resulting in the waveform no longer being a sine wave and in harmonic distortion.

Resolves: #1176
(cherry picked from commit 55f4294e821fef183db71bf2f897d906c808670e)

3 weeks agopbx.c: when set flag AST_SOFTHANGUP_ASYNCGOTO, ast_explicit_goto should return -1.
Tinet-mucw [Thu, 19 Jun 2025 02:34:56 +0000 (19:34 -0700)] 
pbx.c: when set flag AST_SOFTHANGUP_ASYNCGOTO, ast_explicit_goto should return -1.

Under certain circumstances the context/extens/prio are set in the ast_async_goto, for example action Redirect.
In the situation that action Redirect is broken by GotoIf this info is changed.
that will causes confusion in dialplan execution.

Resolves: #1273
(cherry picked from commit 88f653c12df8cc7b82cdfb53fb38524a6840e518)

3 weeks agores_musiconhold.c: Ensure we're always locked around music state access.
Sean Bright [Tue, 8 Apr 2025 19:54:37 +0000 (15:54 -0400)] 
res_musiconhold.c: Ensure we're always locked around music state access.

(cherry picked from commit 7feb676409b623d35cc644c7bc2c4850df54d359)

3 weeks agores_musiconhold.c: Annotate when the channel is locked.
Sean Bright [Tue, 8 Apr 2025 19:44:59 +0000 (15:44 -0400)] 
res_musiconhold.c: Annotate when the channel is locked.

(cherry picked from commit def223ffd8965c1f45540d0e5350ea5f2ffdd774)

3 weeks agores_musiconhold: Appropriately lock channel during start.
Jaco Kroon [Thu, 19 Dec 2024 14:45:15 +0000 (16:45 +0200)] 
res_musiconhold: Appropriately lock channel during start.

This relates to #829

This doesn't sully solve the Ops issue, but it solves the specific crash
there.  Further PRs to follow.

In the specific crash the generator was still under construction when
moh was being stopped, which then proceeded to close the stream whilst
it was still in use.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
(cherry picked from commit 97258111259e1b449b43c32d6d114e26b1c1388b)

5 weeks agoUpdate for 20.15.2 releases/20.15
Asterisk Development Team [Thu, 28 Aug 2025 15:04:41 +0000 (15:04 +0000)] 
Update for 20.15.2

5 weeks agores_pjsip_authenticator_digest: Fix SEGV if get_authorization_hdr returns NULL.
George Joseph [Thu, 28 Aug 2025 12:47:04 +0000 (06:47 -0600)] 
res_pjsip_authenticator_digest: Fix SEGV if get_authorization_hdr returns NULL.

In the highly-unlikely event that get_authorization_hdr() couldn't find an
Authorization header in a request, trying to get the digest algorithm
would cauase a SEGV.  We now check that we have an auth header that matches
the realm before trying to get the algorithm from it.

Resolves: #GHSA-64qc-9x89-rx5j

2 months agoUpdate for 20.15.1
Asterisk Development Team [Thu, 31 Jul 2025 16:32:53 +0000 (16:32 +0000)] 
Update for 20.15.1

2 months agosafe_asterisk: Add ownership checks for /etc/asterisk/startup.d and its files.
ThatTotallyRealMyth [Tue, 10 Jun 2025 07:18:00 +0000 (17:18 +1000)] 
safe_asterisk: Add ownership checks for /etc/asterisk/startup.d and its files.

UpgradeNote: The safe_asterisk script now checks that, if it was run by the
root user, the /etc/asterisk/startup.d directory and all the files it contains
are owned by root.  If the checks fail, safe_asterisk will exit with an error
and Asterisk will not be started.  Additionally, the default logging
destination is now stderr instead of tty "9" which probably won't exist
in modern systems.

Resolves: #GHSA-v9q8-9j8m-5xwp

2 months agores_stir_shaken: Test for missing semicolon in Identity header.
George Joseph [Thu, 31 Jul 2025 14:38:21 +0000 (08:38 -0600)] 
res_stir_shaken: Test for missing semicolon in Identity header.

ast_stir_shaken_vs_verify() now makes sure there's a semicolon in
the Identity header to prevent a possible segfault.

Resolves: #GHSA-mrq5-74j5-f5cr

2 months ago.lastclean: Remove from git
George Joseph [Fri, 18 Jul 2025 14:21:38 +0000 (08:21 -0600)] 
.lastclean: Remove from git

It never should been versioned in the first place.

2 months agoUpdate for 20.15.0
Asterisk Development Team [Thu, 17 Jul 2025 14:27:58 +0000 (14:27 +0000)] 
Update for 20.15.0

2 months agoUpdate for 20.15.0-rc3
Asterisk Development Team [Thu, 10 Jul 2025 15:59:04 +0000 (15:59 +0000)] 
Update for 20.15.0-rc3

2 months agochannelstorage: Rename callbacks that conflict with DEBUG_FD_LEAKS.
George Joseph [Tue, 8 Jul 2025 11:42:51 +0000 (05:42 -0600)] 
channelstorage: Rename callbacks that conflict with DEBUG_FD_LEAKS.

DEBUG_FD_LEAKS replaces calls to "open" and "close" with functions that keep
track of file descriptors, even when those calls are actually callbacks
defined in structures like ast_channelstorage_instance->open and don't touch
file descriptors.  This causes compilation failures.  Those callbacks
have been renamed to "open_instance" and "close_instance" respectively.

Resolves: #1287

2 months agochannelstorage_cpp_map_name_id: Fix callback returning non-matching channels.
George Joseph [Wed, 9 Jul 2025 17:14:55 +0000 (11:14 -0600)] 
channelstorage_cpp_map_name_id: Fix callback returning non-matching channels.

When the callback() API was invoked but no channel passed the test, callback
would return the last channel tested instead of NULL.  It now correctly
returns NULL when no channel matches.

Resolves: #1288

3 months agoUpdate for 20.15.0-rc2
Asterisk Development Team [Thu, 3 Jul 2025 16:36:13 +0000 (16:36 +0000)] 
Update for 20.15.0-rc2

3 months agoaudiohook.c: Improve frame pairing logic to avoid MixMonitor breakage with mixed...
Michal Hajek [Wed, 21 May 2025 08:28:20 +0000 (10:28 +0200)] 
audiohook.c: Improve frame pairing logic to avoid MixMonitor breakage with mixed codecs

This patch adjusts the read/write synchronization logic in audiohook_read_frame_both()
to better handle calls where participants use different codecs or sample sizes
(e.g., alaw vs G.722). The previous hard threshold of 2 * samples caused MixMonitor
recordings to break or stutter when frames were not aligned between both directions.

The new logic uses a more tolerant limit (1.5 * samples), which prevents audio tearing
without causing excessive buffer overruns. This fix specifically addresses issues
with MixMonitor when recording directly on a channel in a bridge using mixed codecs.

Reported-by: Michal Hajek <michal.hajek@daktela.com>
Resolves: #1276
Resolves: #1279

3 months agochannelstorage_makeopts.xml: Remove errant XML character.
Sean Bright [Mon, 30 Jun 2025 22:00:02 +0000 (18:00 -0400)] 
channelstorage_makeopts.xml: Remove errant XML character.

Resolves: #1282

3 months agoUpdate for 20.15.0-rc1
Asterisk Development Team [Thu, 26 Jun 2025 18:58:13 +0000 (18:58 +0000)] 
Update for 20.15.0-rc1

3 months agores_stir_shaken.so: Handle X5U certificate chains.
George Joseph [Wed, 18 Jun 2025 20:38:08 +0000 (14:38 -0600)] 
res_stir_shaken.so: Handle X5U certificate chains.

The verification process will now load a full certificate chain retrieved
via the X5U URL instead of loading only the end user cert.

* Renamed crypto_load_cert_from_file() and crypto_load_cert_from_memory()
to crypto_load_cert_chain_from_file() and crypto_load_cert_chain_from_memory()
respectively.

* The two load functions now continue to load certs from the file or memory
PEMs and store them in a separate stack of untrusted certs specific to the
current verification context.

* crypto_is_cert_trusted() now uses the stack of untrusted certs that were
extracted from the PEM in addition to any untrusted certs that were passed
in from the configuration (and any CA certs passed in from the config of
course).

Resolves: #1272

UserNote: The STIR/SHAKEN verification process will now load a full
certificate chain retrieved via the X5U URL instead of loading only
the end user cert.

(cherry picked from commit b3de33b76b2165cbae489a3b9fc25cc6894cafb0)

3 months agores_stir_shaken: Add "ignore_sip_date_header" config option.
George Joseph [Sun, 15 Jun 2025 20:43:13 +0000 (14:43 -0600)] 
res_stir_shaken: Add "ignore_sip_date_header" config option.

UserNote: A new STIR/SHAKEN verification option "ignore_sip_date_header" has
been added that when set to true, will cause the verification process to
not consider a missing or invalid SIP "Date" header to be a failure.  This
will make the IAT the sole "truth" for Date in the verification process.
The option can be set in the "verification" and "profile" sections of
stir_shaken.conf.

Also fixed a bug in the port match logic.

Resolves: #1251
Resolves: #1271
(cherry picked from commit 6b107e90f33fe168055f5a7a38f5237ddacfa599)

3 months agoapp_record: Add RECORDING_INFO function.
Naveen Albert [Mon, 22 Jan 2024 12:23:47 +0000 (07:23 -0500)] 
app_record: Add RECORDING_INFO function.

Add a function that can be used to retrieve info
about a previous recording, such as its duration.

This is being added as a function to avoid possibly
trampling on dialplan variables, and could be extended
to provide other information in the future.

Resolves: #548

UserNote: The RECORDING_INFO function can now be used
to retrieve the duration of a recording.

(cherry picked from commit b5a04ed7ac0b2c374ad0880e66262abac75dfbb5)

3 months agoapp_sms.c: Fix sending and receiving SMS messages in protocol 2
Itzanh [Sun, 6 Apr 2025 12:13:21 +0000 (14:13 +0200)] 
app_sms.c: Fix sending and receiving SMS messages in protocol 2

This fixes bugs in SMS messaging to SMS-capable analog phones that prevented app_sms.c from talking to phones using SMS protocol 2.

- Fix MORX message reception (from phone to Asterisk) in SMS protocol 2
- Fix MTTX message transmission (from Asterisk to phone) in SMS protocol 2

One of the bugs caused messages to have random characters and junk appended at the end up to the character limit. Another bug prevented Asterisk from sending messages from Asterisk to the phone at all. A final bug caused the transmission from Asterisk to the phone to take a long time because app_sms.c did not hang up after correctly sending the message, causing the phone to have to time out and hang up in order to complete the message transmission.

This was tested with a Linksys PAP2T and with a GrandStream HT814, sending and receiving messages with Telefónica DOMO Mensajes phones from Telefónica Spain. I had to play with both the network jitter buffer and the dB gain to get it to work. One of my phones required the gain to be set to +3dB for it to work, while another required it to be set to +6dB.

Only MORX and MTTX were tested, I did not test sending and receiving messages to a TelCo SMSC.

(cherry picked from commit 7ee6a3502d390fa0ed508a79109f00a1e0969e6f)

3 months agoapp_queue: queue rules – Add support for QUEUE_RAISE_PENALTY=rN to raise penalties...
phoneben [Mon, 26 May 2025 20:52:34 +0000 (23:52 +0300)] 
app_queue: queue rules – Add support for QUEUE_RAISE_PENALTY=rN to raise penalties only for members within min/max range

This update adds support for a new QUEUE_RAISE_PENALTY format: rN

When QUEUE_RAISE_PENALTY is set to rN (e.g., r4), only members whose current penalty
is greater than or equal to the defined min_penalty and less than or equal to max_penalty
will have their penalty raised to N.

Members with penalties outside the min/max range remain unchanged.

Example behaviors:

QUEUE_RAISE_PENALTY=4     → Raise all members with penalty < 4 (existing behavior)
QUEUE_RAISE_PENALTY=r4    → Raise only members with penalty in [min_penalty, max_penalty] to 4

Implementation details:

Adds parsing logic to detect the r prefix and sets the raise_respect_min flag

Modifies the raise logic to skip members outside the defined penalty range when the flag is active

UserNote: This change introduces QUEUE_RAISE_PENALTY=rN, allowing selective penalty raises
only for members whose current penalty is within the [min_penalty, max_penalty] range.
Members with lower or higher penalties are unaffected.
This behavior is backward-compatible with existing queue rule configurations.

(cherry picked from commit 435c36b557b96b3261c8c9c031761b0c295db694)

3 months agores_websocket_client: Add more info to the XML documentation.
George Joseph [Thu, 5 Jun 2025 14:06:47 +0000 (08:06 -0600)] 
res_websocket_client:  Add more info to the XML documentation.

Added "see-also" links to chan_websocket and ARI Outbound WebSocket and
added an example configuration for each.

(cherry picked from commit 9e446d872eebe83caceaee852b7249e5b89db727)

3 months agores_odbc: cache_size option to limit the cached connections.
Jaco Kroon [Thu, 12 Dec 2024 22:35:55 +0000 (00:35 +0200)] 
res_odbc: cache_size option to limit the cached connections.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
UserNote: New cache_size option for res_odbc to on a per class basis limit the
number of cached connections. Please reference the sample configuration
for details.

(cherry picked from commit ef09126eb124a06d04cfbfd773c127a27fb6cef9)

3 months agores_odbc: cache_type option for res_odbc.
Jaco Kroon [Tue, 10 Dec 2024 20:36:02 +0000 (22:36 +0200)] 
res_odbc: cache_type option for res_odbc.

This enables setting cache_type classes to a round-robin queueing system
rather than the historic stack mechanism.

This should result in lower risk of connection drops due to shorter idle
times (the first connection to go onto the stack could in theory never
be used again, ever, but sit there consuming resources, there could be
multiple of these).

And with a queue rather than a stack, dead connections are guaranteed to
be detected and purged eventually.

This should end up better balancing connection_cnt with actual load
over time, assuming the database doesn't keep connections open
excessively long from it's side.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
UserNote: When using res_odbc it should be noted that back-end
connections to the underlying database can now be configured to re-use
the cached connections in a round-robin manner rather than repeatedly
re-using the same connection.  This helps to keep connections alive, and
to purge dead connections from the system, thus more dynamically
adjusting to actual load.  The downside is that one could keep too many
connections active for a longer time resulting in resource also begin
consumed on the database side.

(cherry picked from commit 6422509ce6706e79126a5ba6cceac6f30ee2a9de)

3 months agores_pjsip: Fix empty `ActiveChannels` property in AMI responses.
Sean Bright [Tue, 27 May 2025 16:56:30 +0000 (12:56 -0400)] 
res_pjsip: Fix empty `ActiveChannels` property in AMI responses.

The logic appears to have been reversed since it was introduced in
05cbf8df.

Resolves: #1254
(cherry picked from commit 0f5ea4797e483dadd636c9686c69cd473924e786)

3 months agoARI Outbound Websockets
George Joseph [Fri, 28 Mar 2025 12:54:21 +0000 (06:54 -0600)] 
ARI Outbound Websockets

Asterisk can now establish websocket sessions _to_ your ARI applications
as well as accepting websocket sessions _from_ them.
Full details: http://s.asterisk.net/ari-outbound-ws

Code change summary:
* Added an ast_vector_string_join() function,
* Added ApplicationRegistered and ApplicationUnregistered ARI events.
* Converted res/ari/config.c to use sorcery to process ari.conf.
* Added the "outbound-websocket" ARI config object.
* Refactored res/ari/ari_websockets.c to handle outbound websockets.
* Refactored res/ari/cli.c for the sorcery changeover.
* Updated res/res_stasis.c for the sorcery changeover.
* Updated apps/app_stasis.c to allow initiating per-call outbound websockets.
* Added CLI commands to manage ARI websockets.
* Added the new "outbound-websocket" object to ari.conf.sample.
* Moved the ARI XML documentation out of res_ari.c into res/ari/ari_doc.xml

UserNote: Asterisk can now establish websocket sessions _to_ your ARI applications
as well as accepting websocket sessions _from_ them.
Full details: http://s.asterisk.net/ari-outbound-ws

(cherry picked from commit 87097b3dd1f01ecf08d27acf92b0215142c48a37)

3 months agores_websocket_client: Create common utilities for websocket clients.
George Joseph [Fri, 2 May 2025 14:52:54 +0000 (08:52 -0600)] 
res_websocket_client: Create common utilities for websocket clients.

Since multiple Asterisk capabilities now need to create websocket clients
it makes sense to create a common set of utilities rather than making
each of those capabilities implement their own.

* A new configuration file "websocket_client.conf" is used to store common
client parameters in named configuration sections.
* APIs are provided to list and retrieve ast_websocket_client objects created
from the named configurations.
* An API is provided that accepts an ast_websocket_client object, connects
to the remote server with retries and returns an ast_websocket object. TLS is
supported as is basic authentication.
* An observer can be registered to receive notification of loaded or reloaded
client objects.
* An API is provided to compare an existing client object to one just
reloaded and return the fields that were changed. The caller can then decide
what action to take based on which fields changed.

Also as part of thie commit, several sorcery convenience macros were created
to make registering common object fields easier.

UserNote: A new module "res_websocket_client" and config file
"websocket_client.conf" have been added to support several upcoming new
capabilities that need common websocket client configuration.

(cherry picked from commit 974489e5a78403170acd2738babcad218d9674c5)

3 months agoasterisk.c: Add option to restrict shell access from remote consoles.
George Joseph [Mon, 19 May 2025 14:16:53 +0000 (08:16 -0600)] 
asterisk.c: Add option to restrict shell access from remote consoles.

UserNote: A new asterisk.conf option 'disable_remote_console_shell' has
been added that, when set, will prevent remote consoles from executing
shell commands using the '!' prefix.

Resolves: #GHSA-c7p6-7mvq-8jq2
(cherry picked from commit 443fc4d2d56b53102d8a860286041ceec7d82fcb)

3 months agoframe.c: validate frame data length is less than samples when adjusting volume
mkmer [Mon, 12 May 2025 14:18:19 +0000 (10:18 -0400)] 
frame.c: validate frame data length is less than samples when adjusting volume

Resolves: #1230
(cherry picked from commit f916d5f4a2f0098d0560b77456a58d37ebeb1e89)

3 months agores_audiosocket.c: Add retry mechanism for reading data from AudioSocket
Sven Kube [Tue, 13 May 2025 14:01:32 +0000 (16:01 +0200)] 
res_audiosocket.c: Add retry mechanism for reading data from AudioSocket

The added retry mechanism addresses an issue that arises when fragmented TCP
packets are received, each containing only a portion of an AudioSocket packet.
This situation can occur if the external service sending the AudioSocket data
has Nagle's algorithm enabled.

(cherry picked from commit 787c8f647cd12dceb48f3ca02fe5c7f905e2fd98)

3 months agores_audiosocket.c: Set the TCP_NODELAY socket option
Sven Kube [Tue, 13 May 2025 13:37:38 +0000 (15:37 +0200)] 
res_audiosocket.c: Set the TCP_NODELAY socket option

Disable Nagle's algorithm by setting the TCP_NODELAY socket option.
This reduces latency by preventing delays caused by packet buffering.

(cherry picked from commit f8b70a97aa3589d9807e7bb7e545a22457a93e10)

3 months agomenuselect: Fix GTK menu callbacks for Fedora 42 compatibility
Thomas B. Clark [Mon, 12 May 2025 21:46:00 +0000 (17:46 -0400)] 
menuselect: Fix GTK menu callbacks for Fedora 42 compatibility

This patch resolves a build failure in `menuselect_gtk.c` when running
`make menuconfig` on Fedora 42. The new version of GTK introduced stricter
type checking for callback signatures.

Changes include:
- Add wrapper functions to match the expected `void (*)(void)` signature.
- Update `menu_items` array to use these wrappers.

Fixes: #1243
(cherry picked from commit 41d54dfaa2f0ac492dccf410ec34ad168e3a5f81)

3 months agojansson: Upgrade version to jansson 2.14.1
Stanislav Abramenkov [Mon, 24 Mar 2025 13:10:26 +0000 (15:10 +0200)] 
jansson: Upgrade version to jansson 2.14.1

UpgradeNote: jansson has been upgraded to 2.14.1. For more
information visit jansson Github page: https://github.com/akheron/jansson/releases/tag/v2.14.1

Resolves: #1178
(cherry picked from commit e2741ff01817398d031d1191e9a0efb160b79885)

3 months agopjproject: Increase maximum SDP formats and attribute limits
Joe Searle [Thu, 15 May 2025 13:06:29 +0000 (14:06 +0100)] 
pjproject: Increase maximum SDP formats and attribute limits

Since Chrome 136, using Windows, when initiating a video call the INVITE SDP exceeds the maximum number of allowed attributes, resulting in the INVITE being rejected. This increases the attribute limit and the number of formats allowed when using bundled pjproject.

Fixes: #1240
(cherry picked from commit 569ceeb46b71d95c84c28d1dbe7b8e15650eaad9)

3 months agomanager.c: Invalid ref-counting when purging events
Nathan Monfils [Mon, 5 May 2025 08:47:43 +0000 (10:47 +0200)] 
manager.c: Invalid ref-counting when purging events

We have a use-case where we generate a *lot* of events on the AMI, and
then when doing `manager show eventq` we would see some events which
would linger for hours or days in there. Obviously something was leaking.
Testing allowed us to track down this logic bug in the ref-counting on
the event purge.

Reproducing the bug was not super trivial, we managed to do it in a
production-like load testing environment with multiple AMI consumers.

The race condition itself:

1. something allocates and links `session`
2. `purge_sessions` iterates over that `session` (takes ref)
3. `purge_session` correctly de-referencess that session
4. `purge_session` re-evaluates the while() loop, taking a reference
5. `purge_session` exits (`n_max > 0` is false)
6. whatever allocated the `session` deallocates it, but a reference is
   now lost since we exited the `while` loop before de-referencing.
7. since the destructor is never called, the session->last_ev->usecount
   is never decremented, leading to events lingering in the queue

The impact of this bug does not seem major. The events are small and do
not seem, from our testing, to be causing meaningful additional CPU
usage. Mainly we wanted to fix this issue because we are internally
adding prometheus metrics to the eventq and those leaked events were
causing the metrics to show garbage data.

(cherry picked from commit 81785db9663d64a9c997a484bc097852a123d86b)

3 months agores_pjsip_nat.c: Do not overwrite transfer host
Mike Bradeen [Thu, 8 May 2025 18:12:33 +0000 (12:12 -0600)] 
res_pjsip_nat.c: Do not overwrite transfer host

When a call is transfered via dialplan behind a NAT, the
host portion of the Contact header in the 302 will no longer
be over-written with the external NAT IP and will retain the
hostname.

Fixes: #1141
(cherry picked from commit 36a2fa2de7d7cd339a2d6d0e24b686dd9047a80b)

3 months agochan_pjsip: Serialize INVITE creation on DTMF attended transfer
Mike Bradeen [Mon, 5 May 2025 18:05:15 +0000 (12:05 -0600)] 
chan_pjsip: Serialize INVITE creation on DTMF attended transfer

When a call is transfered via DTMF feature code, the Transfer Target and
Transferer are bridged immediately.  This opens the possibilty of a race
condition between the creation of an INVITE and the bridge induced colp
update that can result in the set caller ID being over-written with the
transferer's default info.

Fixes: #1234
(cherry picked from commit ba4680f7ec0c6aebd0952d6052d10c7e3cb99005)

3 months agosig_analog: Add Call Waiting Deluxe support.
Naveen Albert [Thu, 24 Aug 2023 14:07:06 +0000 (14:07 +0000)] 
sig_analog: Add Call Waiting Deluxe support.

Adds support for Call Waiting Deluxe options to enhance
the current call waiting feature.

As part of this change, a mechanism is also added that
allows a channel driver to queue an audio file for Dial()
to play, which is necessary for the announcement function.

ASTERISK-30373 #close

Resolves: #271

UserNote: Call Waiting Deluxe can now be enabled for FXS channels
by enabling its corresponding option.

(cherry picked from commit 76ab68b7e915f6ca2803c8e215ffce72250084a8)

3 months agoapp_sms: Ignore false positive vectorization warning.
Naveen Albert [Fri, 24 Jan 2025 14:35:50 +0000 (09:35 -0500)] 
app_sms: Ignore false positive vectorization warning.

Ignore gcc warning about writing 32 bytes into a region of size 6,
since we check that we don't go out of bounds for each byte.
This is due to a vectorization bug in gcc 15, stemming from
gcc commit 68326d5d1a593dc0bf098c03aac25916168bc5a9.

Resolves: #1088
(cherry picked from commit 3951a5a2dcd375adf4980b157e2c1643d61c4674)

3 months agolock.h: Add include for string.h when DEBUG_THREADS is defined.
George Joseph [Fri, 2 May 2025 18:19:25 +0000 (12:19 -0600)] 
lock.h: Add include for string.h when DEBUG_THREADS is defined.

When DEBUG_THREADS is defined, lock.h uses strerror(), which is defined
in the libc string.h file, to print warning messages. If the including
source file doesn't include string.h then strerror() won't be found and
and compile errors will be thrown. Since lock.h depends on this, string.h
is now included from there if DEBUG_THREADS is defined.  This way, including
source files don't have to worry about it.

(cherry picked from commit 8eaad114f4d77376c64a1ad88c05490ac67352c0)

3 months agoAlternate Channel Storage Backends
George Joseph [Tue, 31 Dec 2024 18:27:02 +0000 (11:27 -0700)] 
Alternate Channel Storage Backends

Full details: http://s.asterisk.net/dc679ec3

The previous proof-of-concept showed that the cpp_map_name_id alternate
storage backed performed better than all the others so this final PR
adds only that option.  You still need to enable it in menuselect under
the "Alternate Channel Storage Backends" category.

To select which one is used at runtime, set the "channel_storage_backend"
option in asterisk.conf to one of the values described in
asterisk.conf.sample.  The default remains "ao2_legacy".

UpgradeNote: With this release, you can now select an alternate channel
storage backend based on C++ Maps.  Using the new backend may increase
performance and reduce the chances of deadlocks on heavily loaded systems.
For more information, see http://s.asterisk.net/dc679ec3

4 months agoUpdate for 20.14.1 releases/20.14 20.14.1
Asterisk Development Team [Thu, 22 May 2025 15:54:07 +0000 (15:54 +0000)] 
Update for 20.14.1

4 months agoasterisk.c: Add option to restrict shell access from remote consoles.
George Joseph [Mon, 19 May 2025 14:16:53 +0000 (08:16 -0600)] 
asterisk.c: Add option to restrict shell access from remote consoles.

UserNote: A new asterisk.conf option 'disable_remote_console_shell' has
been added that, when set, will prevent remote consoles from executing
shell commands using the '!' prefix.

Resolves: #GHSA-c7p6-7mvq-8jq2

4 months agores_pjsip_messaging.c: Mask control characters in received From display name
George Joseph [Mon, 24 Mar 2025 20:59:42 +0000 (14:59 -0600)] 
res_pjsip_messaging.c: Mask control characters in received From display name

Incoming SIP MESSAGEs will now have their From header's display name
sanitized by replacing any characters < 32 (space) with a space.

Resolves: #GHSA-2grh-7mhv-fcfw

4 months agoUpdate for 20.14.0 20.14.0
Asterisk Development Team [Thu, 8 May 2025 12:33:18 +0000 (12:33 +0000)] 
Update for 20.14.0

5 months agoUpdate for 20.14.0-rc1 20.14.0-rc1
Asterisk Development Team [Thu, 1 May 2025 12:39:53 +0000 (12:39 +0000)] 
Update for 20.14.0-rc1

5 months agores_pjsip_caller_id: Also parse URI parameters for ANI2.
Naveen Albert [Sat, 26 Apr 2025 12:33:20 +0000 (08:33 -0400)] 
res_pjsip_caller_id: Also parse URI parameters for ANI2.

If the isup-oli was sent as a URI parameter, rather than a header
parameter, it was not being parsed. Make sure we parse both if
needed so the ANI2 is set regardless of which type of parameter
the isup-oli is sent as.

Resolves: #1220
(cherry picked from commit 5d82f69b9b98428e46dc442275e9b4f177841729)