]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
2 days agochan_pjsip: Add technology-specific off-nominal hangup cause to events.
George Joseph [Tue, 14 Oct 2025 16:53:06 +0000 (10:53 -0600)] 
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.

5 days agores_audiosocket: add message types for all slin sample rates
Sven Kube [Fri, 10 Oct 2025 09:05:43 +0000 (11:05 +0200)] 
res_audiosocket: add message types for all slin sample rates

Extend audiosocket messages with types 0x11 - 0x18 to create asterisk
frames in slin12, slin16, slin24, slin32, slin44, slin48, slin96, and
slin192 format, enabling the transmission of audio at a higher sample
rates. For audiosocket messages sent by Asterisk, the message kind is
determined by the format of the originating asterisk frame.

UpgradeNote: New audiosocket message types 0x11 - 0x18 has been added
for slin12, slin16, slin24, slin32, slin44, slin48, slin96, and
slin192 audio. External applications using audiosocket may need to be
updated to support these message types if the audiosocket channel is
created with one of these audio formats.

8 days agores_fax.c: lower FAXOPT read warning to debug level
phoneben [Thu, 2 Oct 2025 21:25:01 +0000 (00:25 +0300)] 
res_fax.c: lower FAXOPT read warning to debug level

Reading ${FAXOPT()} before a fax session is common in dialplans to check fax state.
Currently this logs an error even when no fax datastore exists, creating excessive noise.
Change these messages to ast_debug(3, …) so they appear only with debug enabled.

Resolves: #1509

8 days agoendpoints: Remove need for stasis subscription.
Joshua C. Colp [Fri, 10 Oct 2025 16:01:23 +0000 (13:01 -0300)] 
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.

8 days agoapp_queue: Allow stasis message filtering to work.
Joshua C. Colp [Fri, 10 Oct 2025 15:53:42 +0000 (12:53 -0300)] 
app_queue: Allow stasis message filtering to work.

The app_queue module subscribes on a per-dialed agent basis to both
the bridge all and channel all topics to keep apprised of things going
on involving them. This subscription has associated state that must
be cleaned up when the subscription ends. This was done by setting
a default router callback that only had logic to handle the case
where the subscription ends. By using the default router callback
all filtering for the subscription was disabled, causing unrelated
messages to get published and handled by it.

This change makes it so that an explicit route is added for the
message type used for the message indicating the subscription has
ended and removes the default router callback. This allows message
filtering to occur on publishing reducing the messages to app_queue
to only those it is interested in.

9 days agotaskpool: Fix some references to threadpool that should be taskpool.
George Joseph [Fri, 10 Oct 2025 12:26:05 +0000 (06:26 -0600)] 
taskpool:  Fix some references to threadpool that should be taskpool.

Resolves: #1478

9 days agoUpdate contact information for anthm
Anthony Minessale [Fri, 10 Oct 2025 14:58:27 +0000 (10:58 -0400)] 
Update contact information for anthm

2 weeks agochan_websocket.c: Change payload references to command instead.
George Joseph [Wed, 8 Oct 2025 13:42:41 +0000 (07:42 -0600)] 
chan_websocket.c: Change payload references to command instead.

Some of the tests in process_text_message() were still comparing to the
websocket message payload instead of the "command" string.

Resolves: #1525

2 weeks agofunc_callerid: Document limitation of DNID fields.
Naveen Albert [Mon, 6 Oct 2025 20:38:35 +0000 (16:38 -0400)] 
func_callerid: Document limitation of DNID fields.

The Dial() application does not propagate DNID fields, which is counter
to the behavior of the other Caller ID fields. This behavior is likely
intentional since the use of Dial theoretically suggests a new dialed
number, but document this caveat to inform users of it.

Resolves: #1519

2 weeks agofunc_channel: Allow R/W of ADSI CPE capability setting.
Naveen Albert [Mon, 6 Oct 2025 16:07:37 +0000 (12:07 -0400)] 
func_channel: Allow R/W of ADSI CPE capability setting.

Allow retrieving and setting the channel's ADSI capability from the
dialplan.

Resolves: #1514

UserNote: CHANNEL(adsicpe) can now be read or written to change
the channels' ADSI CPE capability setting.

2 weeks agocore_unreal: Preserve ADSI capability when dialing Local channels.
Naveen Albert [Mon, 6 Oct 2025 19:00:24 +0000 (15:00 -0400)] 
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

2 weeks agofunc_hangupcause.c: Add access to Reason headers via HANGUPCAUSE()
Igor Goncharovsky [Thu, 4 Sep 2025 04:54:27 +0000 (10:54 +0600)] 
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.

2 weeks agosig_analog: Allow '#' to end the inter-digit timeout when dialing.
Naveen Albert [Fri, 3 Oct 2025 19:56:06 +0000 (15:56 -0400)] 
sig_analog: Allow '#' to end the inter-digit timeout when dialing.

It is customary to allow # to terminate digit collection immediately
when there would normally be a timeout. However, currently, users are
forced to wait for the timeout to expire when dialing numbers that
are prefixes of other valid matches, and there is no way to end the
timeout early. Customarily, # terminates the timeout, but at the moment,
this is just rejected unless there happens to be a matching extension
ending in #.

Allow # to terminate the timeout in cases where there is no dialplan
match. This ensures that the dialplan is always respected, but if a
valid extension has been dialed that happens to prefix other valid
matches, # can be used to dial it immediately.

Resolves: #1510

2 weeks agofunc_math: Add DIGIT_SUM function.
Naveen Albert [Wed, 1 Oct 2025 15:34:20 +0000 (11:34 -0400)] 
func_math: Add DIGIT_SUM function.

Add a function (DIGIT_SUM) which returns the digit sum of a number.

Resolves: #1499

UserNote: The DIGIT_SUM function can be used to return the digit sum of
a number.

2 weeks agoapp_sf: Add post-digit timer option to ReceiveSF.
Naveen Albert [Wed, 1 Oct 2025 14:40:48 +0000 (10:40 -0400)] 
app_sf: Add post-digit timer option to ReceiveSF.

Add a sorely needed option to set a timeout between digits, rather than
for receiving the entire number. This is needed if the number of digits
being sent is unknown by the receiver in advance. Previously, we had
to wait for the entire timer to expire.

Resolves: #1493

UserNote: The 't' option for ReceiveSF now allows for a timer since
the last digit received, in addition to the number-wide timeout.

2 weeks agocodec_builtin.c: Adjust some of the quality scores to reflect reality.
Naveen Albert [Thu, 2 Oct 2025 16:21:26 +0000 (12:21 -0400)] 
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

2 weeks agores_tonedetect: Fix formatting of XML documentation.
Naveen Albert [Thu, 2 Oct 2025 17:50:50 +0000 (13:50 -0400)] 
res_tonedetect: Fix formatting of XML documentation.

Fix the indentation in the documentation for the variable list.

Resolves: #1507

2 weeks agores_fax: Add XML documentation for channel variables.
Naveen Albert [Thu, 2 Oct 2025 17:46:29 +0000 (13:46 -0400)] 
res_fax: Add XML documentation for channel variables.

Document the channel variables currently set by SendFAX and ReceiveFAX.

Resolves: #1505

2 weeks agochannelstorage_cpp_map_name_id: Add read locking around retrievals.
George Joseph [Wed, 1 Oct 2025 14:30:52 +0000 (08:30 -0600)] 
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

2 weeks agoapp_dial: Allow fractional seconds for dial timeouts.
Naveen Albert [Tue, 30 Sep 2025 14:25:01 +0000 (10:25 -0400)] 
app_dial: Allow fractional seconds for dial timeouts.

Even though Dial() internally uses milliseconds for its dial timeouts,
this capability has been mostly obscured from users as the argument is
only parsed as an integer, thus forcing the use of whole seconds for
timeouts.

Parse it as a decimal instead so that timeouts can now truly have
millisecond precision.

Resolves: #1487

UserNote: The answer and progress dial timeouts now have millisecond
precision, instead of having to be whole numbers.

2 weeks agodsp.c: Make minor fixes to debug log messages.
Naveen Albert [Wed, 1 Oct 2025 14:51:12 +0000 (10:51 -0400)] 
dsp.c: Make minor fixes to debug log messages.

Commit dc8e3eeaaf094a3d16991289934093d5e7127680 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

2 weeks agoconfig_options.c: Improve misleading warning.
Naveen Albert [Tue, 30 Sep 2025 20:57:58 +0000 (16:57 -0400)] 
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

3 weeks agofunc_scramble: Add example to XML documentation.
Naveen Albert [Mon, 29 Sep 2025 16:15:39 +0000 (12:15 -0400)] 
func_scramble: Add example to XML documentation.

The previous lack of an example made it ambiguous if the arguments went
inside the function arguments or were part of the right-hand value.

Resolves: #1485

3 weeks agosig_analog: Eliminate potential timeout with Last Number Redial.
Naveen Albert [Mon, 29 Sep 2025 14:10:23 +0000 (10:10 -0400)] 
sig_analog: Eliminate potential timeout with Last Number Redial.

If Last Number Redial is used to redial, ensure that we do not wait
for further digits. This was possible if the number that was last
dialed is a prefix of another possible dialplan match. Since all we
did is copy the number into the extension buffer, if other matches
are now possible, there would thus be a timeout before the call went
through. We now complete redialed calls immediaetly in all cases.

Resolves: #1483

3 weeks agoARI: The bridges play and record APIs now handle sample rates > 8K correctly.
George Joseph [Thu, 25 Sep 2025 17:48:01 +0000 (11:48 -0600)] 
ARI: The bridges play and record APIs now handle sample rates > 8K correctly.

The bridge play and record APIs were forcing the Announcer/Recorder channel
to slin8 which meant that if you played or recorded audio with a sample
rate > 8K, it was downsampled to 8K limiting the bandwidth.

* The /bridges/play REST APIs have a new "announcer_format" parameter that
  allows the caller to explicitly set the format on the "Announcer" channel
  through which the audio is played into the bridge.  If not specified, the
  default depends on how many channels are currently in the bridge.  If
  a single channel is in the bridge, then the Announcer channel's format
  will be set to the same as that channel's.  If multiple channels are in the
  bridge, the channels will be scanned to find the one with the highest
  sample rate and the Announcer channel's format will be set to the slin
  format that has an equal to or greater than sample rate.

* The /bridges/record REST API has a new "recorder_format" parameter that
  allows the caller to explicitly set the format on the "Recorder" channel
  from which audio is retrieved to write to the file.  If not specified,
  the Recorder channel's format will be set to the format that was requested
  to save the audio in.

Resolves: #1479

DeveloperNote: The ARI /bridges/play and /bridges/record REST APIs have new
parameters that allow the caller to specify the format to be used on the
"Announcer" and "Recorder" channels respecitvely.

3 weeks agores_pjsip_geolocation: Add support for Geolocation loc-src parameter
Max Grobecker [Sun, 21 Sep 2025 13:34:56 +0000 (15:34 +0200)] 
res_pjsip_geolocation: Add support for Geolocation loc-src parameter

This adds support for the Geolocation 'loc-src' parameter to res_pjsip_geolocation.
The already existing config option 'location_source` in res_geolocation is documented to add a 'loc-src' parameter containing a user-defined FQDN to the 'Geolocation:' header,
but that option had no effect as it was not implemented by res_pjsip_geolocation.

If the `location_source` configuration option is not set or invalid, that parameter will not be added (this is already checked by res_geolocation).

This commits adds already documented functionality.

3 weeks agosorcery: Move from threadpool to taskpool.
Joshua C. Colp [Tue, 23 Sep 2025 22:54:35 +0000 (19:54 -0300)] 
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.

4 weeks agostasis_channels.c: Make protocol_id optional to enable blind transfer via ari
Sven Kube [Mon, 22 Sep 2025 06:00:44 +0000 (08:00 +0200)] 
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

4 weeks agoconfig.c: fix saving of deep/wide template configurations
Allan Nathanson [Wed, 10 Sep 2025 20:35:27 +0000 (16:35 -0400)] 
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

4 weeks agores_rtp_asterisk.c: Use rtp->dtls in __rtp_sendto when rtcp mux is used.
George Joseph [Tue, 23 Sep 2025 13:41:04 +0000 (07:41 -0600)] 
res_rtp_asterisk.c: Use rtp->dtls in __rtp_sendto when rtcp mux is used.

In __rtp_sendto(), the check for DTLS negotiation completion for rtcp packets
needs to use the rtp->dtls structure instead of rtp->rtcp->dtls when
AST_RTP_INSTANCE_RTCP_MUX is set.

Resolves: #1474

4 weeks agoFix some doxygen, typos and whitespace
Bastian Triller [Sun, 21 Sep 2025 09:59:48 +0000 (11:59 +0200)] 
Fix some doxygen, typos and whitespace

4 weeks agostasis_channels.c: Add null check for referred_by in ast_ari_transfer_message_create
Sven Kube [Thu, 18 Sep 2025 06:26:33 +0000 (08:26 +0200)] 
stasis_channels.c: Add null check for referred_by in ast_ari_transfer_message_create

When handling SIP transfers via ARI, the `referred_by` field in
`transfer_ari_state` may be null, since SIP REFER requests are not
required to include a `Referred-By` header. Without this check, a null
value caused the transfer to fail and triggered a NOTIFY with a 500
Internal Server Error.

4 weeks agochan_websocket: Fix codec validation and add passthrough option.
George Joseph [Wed, 17 Sep 2025 13:21:48 +0000 (07:21 -0600)] 
chan_websocket: Fix codec validation and add passthrough option.

* Fixed an issue in webchan_write() where we weren't detecting equivalent
  codecs properly.
* Added the "p" dialstring option that puts the channel driver in
  "passthrough" mode where it will not attempt to re-frame or re-time
  media coming in over the websocket from the remote app.  This can be used
  for any codec but MUST be used for codecs that use packet headers or whose
  data stream can't be broken up on arbitrary byte boundaries. In this case,
  the remote app is fully responsible for correctly framing and timing media
  sent to Asterisk and the MEDIA text commands that could be sent over the
  websocket are disabled.  Currently, passthrough mode is automatically set
  for the opus, speex and g729 codecs.
* Now calling ast_set_read_format() after ast_channel_set_rawreadformat() to
  ensure proper translation paths are set up when switching between native
  frames and slin silence frames.  This fixes an issue with codec errors
  when transcode_via_sln=yes.

Resolves: #1462

4 weeks agoapp_queue: Add NULL pointer checks in app_queue
phoneben [Thu, 11 Sep 2025 17:31:30 +0000 (20:31 +0300)] 
app_queue: Add NULL pointer checks in app_queue

Add NULL check for word_list before calling word_in_list()
Add NULL checks for channel snapshots from ast_multi_channel_blob_get_channel()

Resolves: #1425

4 weeks agoapp_externalivr: Prevent out-of-bounds read during argument processing.
Sean Bright [Wed, 17 Sep 2025 18:27:49 +0000 (14:27 -0400)] 
app_externalivr: Prevent out-of-bounds read during argument processing.

Resolves: #1422

4 weeks agochan_dahdi: Add DAHDI_CHANNEL function.
Naveen Albert [Thu, 11 Sep 2025 19:57:03 +0000 (15:57 -0400)] 
chan_dahdi: Add DAHDI_CHANNEL function.

Add a dialplan function that can be used to get/set properties of
DAHDI channels (as opposed to Asterisk channels). This exposes
properties that were not previously available, allowing for certain
operations to now be performed in the dialplan.

Resolves: #1455

UserNote: The DAHDI_CHANNEL function allows for getting/setting
certain properties about DAHDI channels from the dialplan.

5 weeks agotaskpool: Update versions for taskpool stasis options. 1465/head
Joshua C. Colp [Tue, 16 Sep 2025 21:07:54 +0000 (18:07 -0300)] 
taskpool: Update versions for taskpool stasis options.

5 weeks agotaskpool: Add taskpool API, switch Stasis to using it.
Joshua C. Colp [Wed, 6 Aug 2025 16:19:20 +0000 (13:19 -0300)] 
taskpool: Add taskpool API, switch Stasis to using it.

This change introduces a new API called taskpool. This is a pool
of taskprocessors. It provides the following functionality:

1. Task pushing to a pool of taskprocessors
2. Synchronous tasks
3. Serializers for execution ordering of tasks
4. Growing/shrinking of number of taskprocessors in pool

This functionality already exists through the combination of
threadpool+taskprocessors but through investigating I determined
that this carries substantial overhead for short to medium duration
tasks. The threadpool uses a single queue of work, and for management
of threads it involves additional tasks.

I wrote taskpool to eliminate the extra overhead and management
as much as possible. Instead of a single queue of work each
taskprocessor has its own queue and at push time a selector chooses
the taskprocessor to queue the task to. Each taskprocessor also
has its own thread like normal. This spreads out the tasks immediately
and reduces contention on shared resources.

Using the included efficiency tests the number of tasks that can be
executed per second in a taskpool is 6-12 times more than an equivalent
threadpool+taskprocessor setup.

Stasis has been moved over to using this new API as it is a heavy consumer
of threadpool+taskprocessors and produces a lot of tasks.

UpgradeNote: The threadpool_* options in stasis.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 stasis.

DeveloperNote: The taskpool API has been added for common usage of a
pool of taskprocessors. It is suggested to use this API instead of the
threadpool+taskprocessor approach.

5 weeks agores_ari: Ensure outbound websocket config has a websocket_client_id.
George Joseph [Fri, 12 Sep 2025 13:10:50 +0000 (07:10 -0600)] 
res_ari: Ensure outbound websocket config has a websocket_client_id.

Added a check to outbound_websocket_apply() that makes sure an outbound
websocket config object in ari.conf has a websocket_client_id parameter.

Resolves: #1457

5 weeks agoapp_adsiprog: Fix possible NULL dereference.
Naveen Albert [Wed, 10 Sep 2025 16:15:08 +0000 (12:15 -0400)] 
app_adsiprog: Fix possible NULL dereference.

get_token can return NULL, but process_token uses this result without
checking for NULL; as elsewhere, check for a NULL result to avoid
possible NULL dereference.

Resolves: #1419

5 weeks agomanager.c: Fix presencestate object leak
Nathan Monfils [Mon, 8 Sep 2025 15:56:02 +0000 (17:56 +0200)] 
manager.c: Fix presencestate object leak

ast_presence_state allocates subtype and message. We straightforwardly
need to clean those up.

5 weeks agoaudiohook.c: Ensure correct AO2 reference is dereffed.
Sean Bright [Wed, 10 Sep 2025 20:19:55 +0000 (16:19 -0400)] 
audiohook.c: Ensure correct AO2 reference is dereffed.

Part of #1440.

5 weeks agores_cliexec: Remove unnecessary casts to char*.
Naveen Albert [Tue, 9 Sep 2025 20:12:52 +0000 (16:12 -0400)] 
res_cliexec: Remove unnecessary casts to char*.

Resolves: #1436

5 weeks agortp_engine.c: Add exception for comfort noise payload.
Ben Ford [Tue, 9 Sep 2025 18:34:39 +0000 (13:34 -0500)] 
rtp_engine.c: Add exception for comfort noise payload.

In a previous commit, a change was made to
ast_rtp_codecs_payload_code_tx_sample_rate to check for differing sample
rates. This ended up returning an invalid payload int for comfort noise.
A check has been added that returns early if the payload is in fact
supposed to be comfort noise.

Fixes: #1340
5 weeks agopbx_variables.c: Create real channel for "dialplan eval function".
Naveen Albert [Tue, 9 Sep 2025 20:10:14 +0000 (16:10 -0400)] 
pbx_variables.c: Create real channel for "dialplan eval function".

"dialplan eval function" has been using a dummy channel for function
evaluation, much like many of the unit tests. However, sometimes, this
can cause issues for functions that are not expecting dummy channels.
As an example, ast_channel_tech(chan) is NULL on such channels, and
ast_channel_tech(chan)->type consequently results in a NULL dereference.
Normally, functions do not worry about this since channels executing
dialplan aren't dummy channels.

While some functions are better about checking for these sorts of edge
cases, use a real channel with a dummy technology to make this CLI
command inherently safe for any dialplan function that could be evaluated
from the CLI.

Resolves: #1434

6 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

6 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.

6 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
6 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

6 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.

7 weeks agores_tonedetect: Add option for TONE_DETECT detection to auto stop.
Naveen Albert [Fri, 22 Aug 2025 15:51:15 +0000 (11:51 -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.

7 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
7 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

8 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.

8 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

8 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

2 months 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

2 months 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.

2 months 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

2 months 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

2 months 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.

2 months 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

2 months 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
2 months 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.

2 months 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.

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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
2 months agoPrepare master for Asterisk 24
Ben Ford [Wed, 13 Aug 2025 19:52:36 +0000 (14:52 -0500)] 
Prepare master for Asterisk 24

2 months 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

2 months 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

2 months 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

2 months 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.

2 months agofunc_dialplan: Remove deprecated/redundant function.
Naveen Albert [Thu, 7 Aug 2025 19:36:01 +0000 (15:36 -0400)] 
func_dialplan: Remove deprecated/redundant function.

Remove VALID_EXTEN, which was deprecated/superseded by DIALPLAN_EXISTS
in Asterisk 11 (commit 8017b65bb97c4226ca7a3c7c944a9811484e0305),
as DIALPLAN_EXISTS does the same thing and is more flexible.

Resolves: #1347

UpgradeNote: The deprecated VALID_EXTEN function has been removed.
Use DIALPLAN_EXISTS instead.

2 months agologger.c: Remove deprecated/redundant configuration option.
Naveen Albert [Thu, 7 Aug 2025 19:23:54 +0000 (15:23 -0400)] 
logger.c: Remove deprecated/redundant configuration option.

Remove the deprecated 'rotatetimestamp' config option, as this
was deprecated by 'rotatestrategy' in 1.6 by commit
f5a14167f3ef090f8576da3070ed5c452fa01e44.

Resolves: #1345

UpgradeNote: The deprecated rotatetimestamp option has been removed.
Use rotatestrategy instead.

2 months agocli.c: Remove deprecated and redundant CLI command.
Naveen Albert [Thu, 7 Aug 2025 19:13:13 +0000 (15:13 -0400)] 
cli.c: Remove deprecated and redundant CLI command.

The "no debug channel" command has been deprecated since
1.6 (commit 691363656fbdc83edf04b125317aebae6525c9e7),
as it is replaced by "core set debug channel", which also
supports tab-completion on channels. Remove the redundant
command.

Resolves: #1343

UpgradeNote: The deprecated "no debug channel" command has
now been removed; use "core set debug channel" instead.

2 months agoapp_queue: Remove redundant/deprecated function.
Naveen Albert [Thu, 7 Aug 2025 18:55:24 +0000 (14:55 -0400)] 
app_queue: Remove redundant/deprecated function.

QUEUE_MEMBER_COUNT has been deprecated since at least 1.6,
for fully duplicating functionality available in the
QUEUE_MEMBER function; remove it now.

Resolves: #1341

UpgradeNote: The deprecated QUEUE_MEMBER_COUNT function
has been removed; use QUEUE_MEMBER(<queue>,logged) instead.

2 months 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

2 months 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.

2 months 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'

2 months 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.

2 months agores_stir_shaken: Test for missing semicolon in Identity header.
George Joseph [Thu, 31 Jul 2025 14:39:06 +0000 (08:39 -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 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 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.

2 months 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
2 months 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.

2 months 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

3 months 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

3 months 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
3 months agoapp_voicemail: Remove deprecated options.
Naveen Albert [Thu, 10 Jul 2025 12:24:56 +0000 (08:24 -0400)] 
app_voicemail: Remove deprecated options.

Remove the deprecated maxmessage and minmessage options,
which have been superseded by maxsecs and minsecs since 1.6.
Also remove the deprecated 'cz' language option (deprecated
since 1.8.)

Resolves: #1298

UpgradeNote: The deprecated maxmessage and minmessage options
have been removed; use maxsecs and minsecs instead.
The deprecated 'cz' language has also been removed; use 'cs' instead.

3 months 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

3 months 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

3 months 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.

3 months 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.

3 months 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

3 months 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

3 months agores_musiconhold: Remove options that were deprecated in Asterisk 14.
Naveen Albert [Wed, 9 Jul 2025 19:57:13 +0000 (15:57 -0400)] 
res_musiconhold: Remove options that were deprecated in Asterisk 14.

Commit 9c1f34c7e904b26bb550f426020635894cb805ac added dedicated options
for random sorting functionality and deprecated older options that
now duplicated these capabilities. Remove these deprecated options.

Resolves: #1296

UpgradeNote: The deprecated random and application=r options have
been removed; use sort=random instead.