]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
14 months agomenuselect: Minor cosmetic fixes.
Naveen Albert [Thu, 21 Mar 2024 15:21:00 +0000 (11:21 -0400)] 
menuselect: Minor cosmetic fixes.

Improve some of the formatting from
dd3f17c699e320d6d30c94298d8db49573ba28da
(#521).

(cherry picked from commit 31cdf64d85a7d7ab8f4d0945b50fef3e836a8e3e)

14 months agopbx_variables.c: Prevent SEGV due to stack overflow.
Naveen Albert [Thu, 21 Mar 2024 15:25:17 +0000 (11:25 -0400)] 
pbx_variables.c: Prevent SEGV due to stack overflow.

It is possible for dialplan to result in an infinite
recursion of variable substitution, which eventually
leads to stack overflow. If we detect this, abort
substitution and log an error for the user to fix
the broken dialplan.

Resolves: #480

UpgradeNote: The maximum amount of dialplan recursion
using variable substitution (such as by using EVAL_EXTEN)
is capped at 15.

(cherry picked from commit 264ffaebb1ff864c3efe94e591fcbc7f62a7e959)

14 months agores_prometheus: Fix duplicate output of metric and help text
Holger Hans Peter Freyther [Sat, 24 Feb 2024 09:32:19 +0000 (17:32 +0800)] 
res_prometheus: Fix duplicate output of metric and help text

The prometheus exposition format requires each line to be unique[1].
This is handled by struct prometheus_metric having a list of children
that is managed when registering a metric. In case the scrape callback
is used, it is the responsibility of the implementation to handle this
correctly.

Originally the bridge callback didn't handle NULL snapshots, the crash
fix lead to NULL metrics, and fixing that lead to duplicates.

The original code assumed that snapshots are not NULL and then relied on
"if (i > 0)" to establish the parent/children relationship between
metrics of the same class. This is not workerable as the first bridge
might be invisible/lacks a snapshot.

Fix this by keeping a separate array of the first metric by class.
Instead of relying on the index of the bridge, check whether the array
has an entry. Use that array for the output.

Add a test case that verifies that the help text is not duplicated.

Resolves: #642

[1] https://prometheus.io/docs/instrumenting/exposition_formats/#grouping-and-sorting

(cherry picked from commit 7b1807413df00169639169853b1b0543520a8767)

14 months agomanager.c: Add CLI command to kick AMI sessions.
Naveen Albert [Wed, 6 Dec 2023 17:01:49 +0000 (12:01 -0500)] 
manager.c: Add CLI command to kick AMI sessions.

This adds a CLI command that can be used to manually
kick specific AMI sessions.

Resolves: #485

UserNote: The "manager kick session" CLI command now
allows kicking a specified AMI session.

(cherry picked from commit 6f5ca2cb5118d5a09b9c79d743fe22caff7b699b)

14 months agochan_dahdi: Allow specifying waitfordialtone per call.
Naveen Albert [Sat, 2 Dec 2023 18:24:20 +0000 (13:24 -0500)] 
chan_dahdi: Allow specifying waitfordialtone per call.

The existing "waitfordialtone" setting in chan_dahdi.conf
applies permanently to a specific channel, regardless of
how it is being used. This rather restrictively prevents
a system from simultaneously being able to pick free lines
for outgoing calls while also allowing barge-in to a trunk
by some other arrangement.

This allows specifying "waitfordialtone" using the CHANNEL
function for only the next call that will be placed, allowing
significantly more flexibility in the use of trunk interfaces.

Resolves: #472

UserNote: "waitfordialtone" may now be specified for DAHDI
trunk channels on a per-call basis using the CHANNEL function.

(cherry picked from commit e10bca9f588415cf5a816d425e6b865ead45a9e3)

14 months agores_parking: Fail gracefully if parking lot is full.
Naveen Albert [Sun, 3 Mar 2024 18:37:10 +0000 (13:37 -0500)] 
res_parking: Fail gracefully if parking lot is full.

Currently, if a parking lot is full, bridge setup returns -1,
causing dialplan execution to terminate without TryExec.
However, such failures should be handled more gracefully,
the same way they are on other paths, as indicated by the
module's author, here:

http://lists.digium.com/pipermail/asterisk-dev/2018-December/077144.html

Now, callers will hear the parking failure announcement, and dialplan
will continue, which is consistent with existing failure modes.

Resolves: #624
(cherry picked from commit d0b51f1ff784c5edaa27f58a192781c1e4f6f349)

14 months agores_config_mysql.c: Support hostnames up to 255 bytes.
Sean Bright [Mon, 18 Mar 2024 14:47:50 +0000 (10:47 -0400)] 
res_config_mysql.c: Support hostnames up to 255 bytes.

Fixes #654

(cherry picked from commit 78471aa1a5d4caa6feee56d2d51328d331e7bb68)

14 months agores_pjsip: Fix alembic downgrade for boolean columns.
Sean Bright [Mon, 18 Mar 2024 21:12:34 +0000 (17:12 -0400)] 
res_pjsip: Fix alembic downgrade for boolean columns.

When downgrading, ensure that we don't touch columns that didn't
actually change during upgrade.

(cherry picked from commit 2aa7f7a4dca241106ef4cbe63e6a674b5a4ceeb7)

14 months agoUpgrade bundled pjproject to 2.14.1
Stanislav Abramenkov [Tue, 12 Mar 2024 07:26:44 +0000 (09:26 +0200)] 
Upgrade bundled pjproject to 2.14.1

Fixes: asterisk#648
UserNote: Bundled pjproject has been upgraded to 2.14.1. For more
information visit pjproject Github page: https://github.com/pjsip/pjproject/releases/tag/2.14.1

(cherry picked from commit 929bc2693c513a1367fe46d00371bdda154ea48c)

14 months agoalembic: Quote new MySQL keyword 'qualify.'
Sean Bright [Fri, 15 Mar 2024 17:17:57 +0000 (13:17 -0400)] 
alembic: Quote new MySQL keyword 'qualify.'

Fixes #651

(cherry picked from commit 957cde97fd305fc2b62ef47f567800d7eac22e32)

14 months agores_pjsip_session: Reset pending_media_state->read_callbacks
Maximilian Fridrich [Thu, 15 Feb 2024 16:07:27 +0000 (17:07 +0100)] 
res_pjsip_session: Reset pending_media_state->read_callbacks

In handle_negotiated_sdp the pending_media_state->read_callbacks must be
reset before they are added in the SDP handlers in
handle_negotiated_sdp_session_media. Otherwise, old callbacks for
removed streams and file descriptors could be added to the channel and
Asterisk would poll on non-existing file descriptors.

Resolves: #611
(cherry picked from commit f626af8e13f00deeed0a0220b9af9423508acc0c)

14 months agores_monitor.c: Don't emit a warning about 'X' being unrecognized.
Sean Bright [Thu, 7 Mar 2024 17:27:12 +0000 (12:27 -0500)] 
res_monitor.c: Don't emit a warning about 'X' being unrecognized.

Code was added in 030f7d41 to warn if an unrecognized option was
passed to an application, but code in Monitor was taking advantage of
the fact that the application would silently accept an invalid option.

We now recognize the invalid option but we don't do anything if it's
set.

Fixes #639

(cherry picked from commit 3c1a2daecd8221e5ed50c70011a931f795ed209c)

14 months ago.github: Add PAT to PRSubmitActions/Add Reviewers
George Joseph [Wed, 6 Mar 2024 16:21:33 +0000 (09:21 -0700)] 
.github: Add PAT to PRSubmitActions/Add Reviewers

(cherry picked from commit f63c87c3f8218cac3b61577d75f487a4a17610b4)

16 months agoUpdate for 18.22.0 18.22.0
Asterisk Development Team [Mon, 18 Mar 2024 13:18:36 +0000 (13:18 +0000)] 
Update for 18.22.0

16 months agoUpdate for 18.22.0-rc2 18.22.0-rc2
Asterisk Development Team [Mon, 11 Mar 2024 17:17:02 +0000 (17:17 +0000)] 
Update for 18.22.0-rc2

16 months agores_pjsip_stir_shaken.c: Add checks for missing parameters
George Joseph [Mon, 11 Mar 2024 15:41:14 +0000 (09:41 -0600)] 
res_pjsip_stir_shaken.c:  Add checks for missing parameters

* Added checks for missing session, session->channel and rdata
  in stir_shaken_incoming_request.

* Added checks for missing session, session->channel and tdata
  in stir_shaken_outgoing_request.

Resolves: #645

17 months agoUpdate for 18.22.0-rc1 18.22.0-rc1
Asterisk Development Team [Thu, 7 Mar 2024 14:16:50 +0000 (14:16 +0000)] 
Update for 18.22.0-rc1

17 months agoapp_dial: Add dial time for progress/ringing.
Naveen Albert [Thu, 8 Feb 2024 18:09:49 +0000 (13:09 -0500)] 
app_dial: Add dial time for progress/ringing.

Add a timeout option to control the amount of time
to wait if no early media is received before giving
up. This allows aborting early if the destination
is not being responsive.

Resolves: #588

UserNote: The timeout argument to Dial now allows
specifying the maximum amount of time to dial if
early media is not received.

(cherry picked from commit 17d6a08beb3637004c9b4148f9d2c40bea8ad063)

17 months agoapp_voicemail: Properly reinitialize config after unit tests.
Naveen Albert [Thu, 29 Feb 2024 14:27:09 +0000 (09:27 -0500)] 
app_voicemail: Properly reinitialize config after unit tests.

Most app_voicemail unit tests were not properly cleaning up
after themselves after running. This led to test mailboxes
lingering around in the system. It also meant that if any
unit tests in app_voicemail that create mailboxes were executed
and the module was not unloaded/loaded again prior to running
the test_voicemail_vm_info unit test, Asterisk would segfault
due to an attempt to copy a NULL string.

The load_config test did actually have logic to reinitialize
the config after the test. However, this did not work in practice
since load_config() would not reload the config since voicemail.conf
had not changed during the test; thus, additional logic has been
added to ensure that voicemail.conf is truly reloaded, after any
unit tests which modify the users list.

This prevents the SEGV due to invalid mailboxes lingering around,
and also ensures that the system state is restored to what it was
prior to the tests running.

Resolves: #629
(cherry picked from commit 564d22acc6d1491e3adf7a742b232f2f38e2f574)

17 months agoapp_queue.c : fix "queue add member" usage string
Shaaah [Tue, 23 Jan 2024 11:15:56 +0000 (12:15 +0100)] 
app_queue.c : fix "queue add member" usage string

Fixing bracket placement in the "queue add member" cli usage string.

(cherry picked from commit 157dff87b33bc468273430f0aa51cda6bdb66e72)

17 months agoapp_voicemail: Allow preventing mark messages as urgent.
Naveen Albert [Sat, 24 Feb 2024 20:54:57 +0000 (15:54 -0500)] 
app_voicemail: Allow preventing mark messages as urgent.

This adds an option to allow preventing callers from leaving
messages marked as 'urgent'.

Resolves: #619

UserNote: The leaveurgent mailbox option can now be used to
control whether callers may leave messages marked as 'Urgent'.

(cherry picked from commit 166fc3c3d026073c1b81736e72a07c0a14df0529)

17 months agores_pjsip: Use consistent type for boolean columns.
Sean Bright [Tue, 27 Feb 2024 21:40:40 +0000 (16:40 -0500)] 
res_pjsip: Use consistent type for boolean columns.

This migrates the relevant schema objects from the `('yes', 'no')`
definition to the `('0', '1', 'off', 'on', 'false', 'true', 'yes', 'no')`
one.

Fixes #617

(cherry picked from commit 39199aac56d307a34ac9c4b2de15b06de20d2544)

17 months ago.github: Remove timeout-minutes from gatetests
George Joseph [Tue, 5 Mar 2024 22:17:33 +0000 (15:17 -0700)] 
.github: Remove timeout-minutes from gatetests

(cherry picked from commit a6070e39ec8e45f66f744cefeec23c208a0b0358)

17 months agoattestation_config.c: Use ast_free instead of ast_std_free
George Joseph [Tue, 5 Mar 2024 19:12:08 +0000 (12:12 -0700)] 
attestation_config.c: Use ast_free instead of ast_std_free

In as_check_common_config, we were calling ast_std_free on
raw_key but raw_key was allocated with ast_malloc so it
should be freed with ast_free.

Resolves: #636
(cherry picked from commit 54464321a86e83d9581e5584fa3adc82994e8331)

17 months agoMakefile: Add stir_shaken/cache to directories created on install
George Joseph [Mon, 4 Mar 2024 16:46:48 +0000 (09:46 -0700)] 
Makefile: Add stir_shaken/cache to directories created on install

The default location for the stir_shaken cache is
/var/lib/asterisk/keys/stir_shaken/cache but we were only creating
/var/lib/asterisk/keys/stir_shaken on istall.  We now create
the cache sub-directory.

Resolves: #634
(cherry picked from commit 5a734afdde0c72cea29b84caf6d3d51065217a6b)

17 months ago.github: Pass only single GATETEST_COMMAND to AsteriskGateComposite
George Joseph [Tue, 5 Mar 2024 15:52:01 +0000 (08:52 -0700)] 
.github: Pass only single GATETEST_COMMAND to AsteriskGateComposite

(cherry picked from commit 224182b8984eacd5b0354b517b4c82d14511c466)

17 months agoStir/Shaken Refactor
George Joseph [Thu, 26 Oct 2023 16:27:35 +0000 (10:27 -0600)] 
Stir/Shaken Refactor

Why do we need a refactor?

The original stir/shaken implementation was started over 3 years ago
when little was understood about practical implementation.  The
result was an implementation that wouldn't actually interoperate
with any other stir-shaken implementations.

There were also a number of stir-shaken features and RFC
requirements that were never implemented such as TNAuthList
certificate validation, sending Reason headers in SIP responses
when verification failed but we wished to continue the call, and
the ability to send Media Key(mky) grants in the Identity header
when the call involved DTLS.

Finally, there were some performance concerns around outgoing
calls and selection of the correct certificate and private key.
The configuration was keyed by an arbitrary name which meant that
for every outgoing call, we had to scan the entire list of
configured TNs to find the correct cert to use.  With only a few
TNs configured, this wasn't an issue but if you have a thousand,
it could be.

What's changed?

* Configuration objects have been refactored to be clearer about
  their uses and to fix issues.
    * The "general" object was renamed to "verification" since it
      contains parameters specific to the incoming verification
      process.  It also never handled ca_path and crl_path
      correctly.
    * A new "attestation" object was added that controls the
      outgoing attestation process.  It sets default certificates,
      keys, etc.
    * The "certificate" object was renamed to "tn" and had it's key
      change to telephone number since outgoing call attestation
      needs to look up certificates by telephone number.
    * The "profile" object had more parameters added to it that can
      override default parameters specified in the "attestation"
      and "verification" objects.
    * The "store" object was removed altogther as it was never
      implemented.

* We now use libjwt to create outgoing Identity headers and to
  parse and validate signatures on incoming Identiy headers.  Our
  previous custom implementation was much of the source of the
  interoperability issues.

* General code cleanup and refactor.
    * Moved things to better places.
    * Separated some of the complex functions to smaller ones.
    * Using context objects rather than passing tons of parameters
      in function calls.
    * Removed some complexity and unneeded encapsuation from the
      config objects.

Resolves: #351
Resolves: #46

UserNote: Asterisk's stir-shaken feature has been refactored to
correct interoperability, RFC compliance, and performance issues.
See https://docs.asterisk.org/Deployment/STIR-SHAKEN for more
information.

UpgradeNote: The stir-shaken refactor is a breaking change but since
it's not working now we don't think it matters. The
stir_shaken.conf file has changed significantly which means that
existing ones WILL need to be changed.  The stir_shaken.conf.sample
file in configs/samples/ has quite a bit more information.  This is
also an ABI breaking change since some of the existing objects
needed to be changed or removed, and new ones added.  Additionally,
if res_stir_shaken is enabled in menuselect, you'll need to either
have the development package for libjwt v1.15.3 installed or use
the --with-libjwt-bundled option with ./configure.

(cherry picked from commit 181edcc3a3b1e31478a43fb52c8f5fa34c2159ae)

17 months agoalembic: Synchronize alembic heads between supported branches.
Sean Bright [Wed, 28 Feb 2024 13:46:32 +0000 (08:46 -0500)] 
alembic: Synchronize alembic heads between supported branches.

This adds a dummy migration to 18 and 20 so that our alembic heads are
synchronized across all supported branches.

In this case the migration we are stubbing (24c12d8e9014) is:

https://github.com/asterisk/asterisk/commit/775352ee6c2a5bcd4f0e3df51aee5d1b0abf4cbe
(cherry picked from commit 6c3eaba7c6d6621c463f30d35af5749c64ddfbbc)

17 months agotranslate.c: implement new direct comp table mode
Sebastian Jennen [Sun, 25 Feb 2024 20:53:57 +0000 (21:53 +0100)] 
translate.c: implement new direct comp table mode

The new mode lists for each codec translation the actual real cost in cpu microseconds per second translated audio.
This allows to compare the real cpu usage of translations and helps in evaluation of codec implementation changes regarding performance (regression testing).

- add new table mode
- hide the 999999 comp values, as these only indicate an issue with transcoding
- hide the 0 values, as these also do not contain any information (only indicate a multistep transcoding)

Resolves: #601
(cherry picked from commit fe623aa081ba5e4280c926b287b84472670e2502)

17 months agoREADME.md: Removed outdated link
Shyju Kanaprath [Fri, 23 Feb 2024 17:07:48 +0000 (21:07 +0400)] 
README.md: Removed outdated link

Removed outdated link http://www.quicknet.net from README.md

cherry-pick-to: 18
cherry-pick-to: 20
cherry-pick-to: 21
(cherry picked from commit 5e1309f89aa8be624fdf9d30cc6bbc259a89e366)

17 months agostrings.h: Ensure ast_str_buffer(…) returns a 0 terminated string.
Sean Bright [Sat, 17 Feb 2024 19:41:38 +0000 (14:41 -0500)] 
strings.h: Ensure ast_str_buffer(…) returns a 0 terminated string.

If a dynamic string is created with an initial length of 0,
`ast_str_buffer(…)` will return an invalid pointer.

This was a secondary discovery when fixing #65.

(cherry picked from commit 164001b05cce0a3f9ef3b7fd199ec679f7f9c213)

17 months ago.github: Add force_cherry_pick option to Releaser
George Joseph [Tue, 20 Feb 2024 13:49:20 +0000 (06:49 -0700)] 
.github: Add force_cherry_pick option to Releaser

(cherry picked from commit e62939b18371daaae312bb1dbef945a1f118d526)

17 months ago.github: Remove start_version from Releaser
George Joseph [Tue, 17 Oct 2023 18:39:04 +0000 (12:39 -0600)] 
.github: Remove start_version from Releaser

(cherry picked from commit d7de14600e81d259979f6a44ec937843600c0590)

17 months agores_rtp_asterisk.c: Correct coefficient in MOS calculation.
romryz [Tue, 6 Feb 2024 13:57:32 +0000 (15:57 +0200)] 
res_rtp_asterisk.c: Correct coefficient in MOS calculation.

Media Experience Score relies on incorrect pseudo_mos variable
calculation. According to forming an opinion section of the
documentation, calculation relies on ITU-T G.107 standard:

    https://docs.asterisk.org/Deployment/Media-Experience-Score/#forming-an-opinion

ITU-T G.107 Annex B suggests to calculate MOS with a coefficient
"seven times ten to the power of negative six", 7 * 10^(-6). which
would mean 6 digits after the decimal point. Current implementation
has 7 digits after the decimal point, which downrates the calls.

Fixes: #597
(cherry picked from commit be9665261248d6d7bd4beeec7c9b953a5dffb143)

17 months agodsp.c: Fix and improve potentially inaccurate log message.
Naveen Albert [Fri, 9 Feb 2024 22:07:13 +0000 (17:07 -0500)] 
dsp.c: Fix and improve potentially inaccurate log message.

If ast_dsp_process is called with a codec besides slin, ulaw,
or alaw, a warning is logged that in-band DTMF is not supported,
but this message is not always appropriate or correct, because
ast_dsp_process is much more generic than just DTMF detection.

This logs a more generic message in those cases, and also improves
codec-mismatch logging throughout dsp.c by ensuring incompatible
codecs are printed out.

Resolves: #595
(cherry picked from commit c6f6d1a3ac1e08ea6144f5a52be305f42f78989b)

17 months agopjsip show channelstats: Prevent possible segfault when faxing
George Joseph [Fri, 9 Feb 2024 16:15:13 +0000 (09:15 -0700)] 
pjsip show channelstats: Prevent possible segfault when faxing

Under rare circumstances, it's possible for the original audio
session in the active_media_state default_session to be corrupted
instead of removed when switching to the t38/image media session
during fax negotiation.  This can cause a segfault when a "pjsip
show channelstats" attempts to print that audio media session's
rtp statistics.  In these cases, the active_media_state
topology is correctly showing only a single t38/image stream
so we now check that there's an audio stream in the topology
before attempting to use the audio media session to get the rtp
statistics.

Resolves: #592
(cherry picked from commit 1aaf9e6a1d5ce2b89fe50312aecf01a881206b4f)

17 months agoReduce startup/shutdown verbose logging
George Joseph [Wed, 31 Jan 2024 17:46:28 +0000 (10:46 -0700)] 
Reduce startup/shutdown verbose logging

When started with a verbose level of 3, asterisk can emit over 1500
verbose message that serve no real purpose other than to fill up
logs. When asterisk shuts down, it emits another 1100 that are of
even less use. Since the testsuite runs asterisk with a verbose
level of 3, and asterisk starts and stops for every one of the 700+
tests, the number of log messages is staggering.  Besides taking up
resources, it also makes it hard to debug failing tests.

This commit changes the log level for those verbose messages to 5
instead of 3 which reduces the number of log messages to only a
handful. Of course, NOTICE, WARNING and ERROR message are
unaffected.

There's also one other minor change...
ast_context_remove_extension_callerid2() logs a DEBUG message
instead of an ERROR if the extension you're deleting doesn't exist.
The pjsip_config_wizard calls that function to clean up the config
and has been triggering that annoying error message for years.

Resolves: #582
(cherry picked from commit 57d30c17b3749640c123ee80b128c19ffd41bd84)

17 months agoconfigure: Rerun bootstrap on modern platform.
Naveen Albert [Mon, 12 Feb 2024 17:45:34 +0000 (12:45 -0500)] 
configure: Rerun bootstrap on modern platform.

The last time configure was run, it was run on a system that
did not enable -std=gnu11 by default, which meant that the
restrict qualifier would not be recognized on certain platforms.
This regenerates the configure files from running bootstrap.sh,
so that these should be recognized on all supported platforms.

Resolves: #586
(cherry picked from commit 72f4cf679837ef536b0ddf9099706f63ba4857da)

17 months agoUpgrade bundled pjproject to 2.14.
Ben Ford [Mon, 5 Feb 2024 20:15:12 +0000 (14:15 -0600)] 
Upgrade bundled pjproject to 2.14.

Fixes: #406
UserNote: Bundled pjproject has been upgraded to 2.14. For more
information on what all is included in this change, check out the
pjproject Github page: https://github.com/pjsip/pjproject/releases

(cherry picked from commit e6140eac0cb75117572ff2e32bce1e6a05150971)

17 months agoapp_speech_utils.c: Allow partial speech results.
cmaj [Fri, 2 Feb 2024 17:27:31 +0000 (10:27 -0700)] 
app_speech_utils.c: Allow partial speech results.

Adds 'p' option to SpeechBackground() application.
With this option, when the app timeout is reached,
whatever the backend speech engine collected will
be returned as if it were the final, full result.
(This works for engines that make partial results.)

Resolves: #572

UserNote: The SpeechBackground dialplan application now supports a 'p'
option that will return partial results from speech engines that
provide them when a timeout occurs.

(cherry picked from commit d2de6a215803fa7d08ae11db376508629c8efa20)

17 months agoutils: Make behavior of ast_strsep* match strsep.
Joshua C. Colp [Wed, 31 Jan 2024 14:03:28 +0000 (10:03 -0400)] 
utils: Make behavior of ast_strsep* match strsep.

Given the scenario of passing an empty string to the
ast_strsep functions the functions would return NULL
instead of an empty string. This is counter to how
strsep itself works.

This change alters the behavior of the functions to
match that of strsep.

Fixes: #565
(cherry picked from commit 5e09e2afeb55c647ebf476afc3538fc5178c5942)

17 months agoapp_chanspy: Add 'D' option for dual-channel audio
Mike Bradeen [Wed, 31 Jan 2024 15:55:04 +0000 (08:55 -0700)] 
app_chanspy: Add 'D' option for dual-channel audio

Adds the 'D' option to app chanspy that causes the input and output
frames of the spied channel to be interleaved in the spy output frame.
This allows the input and output of the spied channel to be decoded
separately by the receiver.

If the 'o' option is also set, the 'D' option is ignored as the
audio being spied is inherently one direction.

Fixes: #569
UserNote: The ChanSpy application now accepts the 'D' option which
will interleave the spied audio within the outgoing frames. The
purpose of this is to allow the audio to be read as a Dual channel
stream with separate incoming and outgoing audio. Setting both the
'o' option and the 'D' option and results in the 'D' option being
ignored.

(cherry picked from commit f31b981d92abc15629fa8953fd1064a5d0e5b676)

17 months ago.github: Update github-script to v7 and fix a rest bug
George Joseph [Mon, 5 Feb 2024 15:31:47 +0000 (08:31 -0700)] 
.github: Update github-script to v7 and fix a rest bug

Need to update the github-script to v7 to squash deprecation
warnings.

Also fixed the API name for github.rest.pulls.requestReviewers.

(cherry picked from commit 305111e9541c649c9af2840b7a590bebec0f94ee)

17 months agoapp_if: Fix next priority calculation.
Naveen Albert [Sun, 28 Jan 2024 13:57:47 +0000 (08:57 -0500)] 
app_if: Fix next priority calculation.

Commit fa3922a4d28860d415614347d9f06c233d2beb07 fixed
a branching issue but "overshoots" when calculating
the next priority. This fixes that; accompanying
test suite tests have also been extended.

Resolves: #560
(cherry picked from commit aa5b9d1d9fc7988ad7f7a340a4e64daa6d6db3e9)

17 months agores_pjsip_t38.c: Permit IPv6 SDP connection addresses.
Sean Bright [Mon, 29 Jan 2024 13:51:34 +0000 (08:51 -0500)] 
res_pjsip_t38.c: Permit IPv6 SDP connection addresses.

The existing code prevented IPv6 addresses from being properly parsed.

Fixes #558

(cherry picked from commit d32852ded9800ea45895cfdc9d18f4e82a10af59)

17 months agoBuildSystem: Bump autotools versions on OpenBSD.
Brad Smith [Sat, 27 Jan 2024 08:01:56 +0000 (03:01 -0500)] 
BuildSystem: Bump autotools versions on OpenBSD.

Bump up to the more commonly used and modern versions of
autoconf and automake.

(cherry picked from commit d43d15b052b5b749fb99e024b8d57b7c02eff5b0)

17 months agomain/utils: Simplify the FreeBSD ast_get_tid() handling
Brad Smith [Sat, 27 Jan 2024 07:43:50 +0000 (02:43 -0500)] 
main/utils: Simplify the FreeBSD ast_get_tid() handling

FreeBSD has had kernel threads for 20+ years.

(cherry picked from commit 75dc596843977f3c1b33140a2a8fb180e141631a)

17 months agores_pjsip_session.c: Correctly format SDP connection addresses.
Sean Bright [Sat, 27 Jan 2024 14:46:27 +0000 (09:46 -0500)] 
res_pjsip_session.c: Correctly format SDP connection addresses.

Resolves a regression identified by @justinludwig involving the
rendering of IPv6 addresses in outgoing SDP.

Also updates `media_address` on PJSIP endpoints so that if we are able
to parse the configured value as an IP we store it in a format that we
can directly use later. Based on my reading of the code it appeared
that one could configure `media_address` as:

```
[foo]
type = endpoint
...
media_address = [2001:db8::]
```

And that value would be blindly copied into the outgoing SDP without
regard to its format.

Fixes #541

(cherry picked from commit 72523f19a9ec820b861f8f49084b502fd12520e3)

17 months agortp_engine.c: Correct sample rate typo for L16/44100.
Sean Bright [Sun, 28 Jan 2024 16:34:25 +0000 (11:34 -0500)] 
rtp_engine.c: Correct sample rate typo for L16/44100.

Fixes #555

(cherry picked from commit 0defd65e63fa5a2509ac67d96789dc08cc2217f4)

17 months agomanager.c: Fix erroneous reloads in UpdateConfig.
Naveen Albert [Thu, 25 Jan 2024 17:44:29 +0000 (12:44 -0500)] 
manager.c: Fix erroneous reloads in UpdateConfig.

Currently, a reload will always occur if the
Reload header is provided for the UpdateConfig
action. However, we should not be doing a reload
if the header value has a falsy value, per the
documentation, so this makes the reload behavior
consistent with the existing documentation.

Resolves: #551
(cherry picked from commit 57bb985b26cb2eade3d9a2a8578a7d354e6affce)

17 months agores_calendar_icalendar: Print iCalendar error on parsing failure.
Naveen Albert [Thu, 14 Dec 2023 14:43:14 +0000 (09:43 -0500)] 
res_calendar_icalendar: Print iCalendar error on parsing failure.

If libical fails to parse a calendar, print the error message it provdes.

Resolves: #492
(cherry picked from commit d1da98514347aacebe61a7d0c75295e4a294a6e7)

17 months agoapp_confbridge: Don't emit warnings on valid configurations.
Sean Bright [Sun, 21 Jan 2024 16:40:19 +0000 (11:40 -0500)] 
app_confbridge: Don't emit warnings on valid configurations.

The numeric bridge profile options `internal_sample_rate` and
`maximum_sample_rate` are documented to accept the special values
`auto` and `none`, respectively. While these values currently work,
they also emit warnings when used which could be confusing for users.

In passing, also ensure that we only accept the documented range of
sample rate values between 8000 and 192000.

Fixes #546

(cherry picked from commit 9dd9615edf86d200bb35e2ebf9ca0f52b557ab1d)

17 months agoapp_voicemail: add NoOp alembic script to maintain sync
Mike Bradeen [Wed, 17 Jan 2024 16:21:13 +0000 (09:21 -0700)] 
app_voicemail: add NoOp alembic script to maintain sync

Adding a NoOp alembic script for the voicemail database to maintain
version sync with other branches.

Fixes: #527
(cherry picked from commit d6c10075f8bbfdf84f83ee0f3bfdd3c00bc480c8)

17 months agochan_dahdi: Allow MWI to be manually toggled on channels.
Naveen Albert [Fri, 10 Nov 2023 14:44:25 +0000 (09:44 -0500)] 
chan_dahdi: Allow MWI to be manually toggled on channels.

This adds a CLI command to manually toggle the MWI status
of a channel, useful for troubleshooting or resetting
MWI devices, similar to the capabilities offered with
SIP messaging to manually control MWI status.

UserNote: The 'dahdi set mwi' now allows MWI on channels
to be manually toggled if needed for troubleshooting.

Resolves: #440
(cherry picked from commit 49ec57fc7c11dd5adf13061b4999fe24eed1dcac)

17 months agochan_rtp.c: MulticastRTP missing refcount without codec option
PeterHolik [Mon, 15 Jan 2024 11:28:15 +0000 (12:28 +0100)] 
chan_rtp.c: MulticastRTP missing refcount without codec option

Fixes: #529
(cherry picked from commit 683da188c91485abd436f23e561cfb303d8dee0a)

17 months agochan_rtp.c: Change MulticastRTP nameing to avoid memory leak
PeterHolik [Tue, 16 Jan 2024 07:42:05 +0000 (08:42 +0100)] 
chan_rtp.c: Change MulticastRTP nameing to avoid memory leak

Fixes: asterisk#536
(cherry picked from commit 9044dcc80ace27e5482d7f3249d5cb440f795098)

17 months agofunc_frame_trace: Add CLI command to dump frame queue.
Naveen Albert [Fri, 12 Jan 2024 16:33:00 +0000 (11:33 -0500)] 
func_frame_trace: Add CLI command to dump frame queue.

This adds a simple CLI command that can be used for
analyzing all frames currently queued to a channel.

A couple log messages are also adjusted to be more
useful in tracing bridging problems.

Resolves: #533
(cherry picked from commit 6b82ed819c2f36d368235f18adb17f8e2f8be76a)

18 months agoUpdate for 18.21.0 18.21.0
Asterisk Development Team [Thu, 25 Jan 2024 16:17:00 +0000 (16:17 +0000)] 
Update for 18.21.0

18 months agoUpdate for 18.21.0-rc2 18.21.0-rc2
Asterisk Development Team [Thu, 18 Jan 2024 16:41:20 +0000 (16:41 +0000)] 
Update for 18.21.0-rc2

18 months agologger: Fix linking regression.
Naveen Albert [Tue, 16 Jan 2024 21:58:22 +0000 (16:58 -0500)] 
logger: Fix linking regression.

Commit 008731b0a4b96c4e6c340fff738cc12364985b64
caused a regression by resulting in logger.xml
being compiled and linked into the asterisk
binary in lieu of logger.c on certain platforms
if Asterisk was compiled in dev mode.

To fix this, we ensure the file has a unique
name without the extension. Most existing .xml
files have been named differently from any
.c files in the same directory or did not
pose this issue.

channels/pjsip/dialplan_functions.xml does not
pose this issue but is also being renamed
to adhere to this policy.

Resolves: #539

18 months agoUpdate for 18.21.0-rc1 18.21.0-rc1
Asterisk Development Team [Fri, 12 Jan 2024 18:21:52 +0000 (18:21 +0000)] 
Update for 18.21.0-rc1

18 months agoRevert "core & res_pjsip: Improve topology change handling."
George Joseph [Fri, 12 Jan 2024 12:47:58 +0000 (05:47 -0700)] 
Revert "core & res_pjsip: Improve topology change handling."

This reverts commit 315eb551dbd18ecd424a2f32179d4c1f6f6edd26.

Over the past year, we've had several reports of "topology storms"
occurring where 2 external facing channels connected by one or more
local channels and bridges will get themselves in a state where
they continually send each other topology change requests.  This
usually manifests itself in no-audio calls and a flood of
"Exceptionally long queue length" messages.  It appears that this
commit is the cause so we're reverting it for now until we can
determine a more appropriate solution.

Resolves: #530
(cherry picked from commit b71e338eea8b1460c89993630bfbdb66279477ea)

18 months agomenuselect: Use more specific error message.
Naveen Albert [Thu, 4 Jan 2024 18:05:32 +0000 (18:05 +0000)] 
menuselect: Use more specific error message.

Instead of using the same error message for
missing dependencies and conflicts, be specific
about what actually went wrong.

Resolves: #520
(cherry picked from commit 494fb0b675782c2df8aee4de2162f28984969866)

18 months agores_pjsip_nat: Fix potential use of uninitialized transport details
Maximilian Fridrich [Mon, 8 Jan 2024 06:03:10 +0000 (07:03 +0100)] 
res_pjsip_nat: Fix potential use of uninitialized transport details

The ast_sip_request_transport_details must be zero initialized,
otherwise this could lead to a SEGV.

Resolves: #509
(cherry picked from commit 85dd7cea8a8d807c9a245fa5c71a67b6275b9bf2)

18 months agoapp_if: Fix faulty EndIf branching.
Naveen Albert [Sat, 23 Dec 2023 16:26:13 +0000 (16:26 +0000)] 
app_if: Fix faulty EndIf branching.

This fixes faulty branching logic for the
EndIf application. Instead of computing
the next priority, which should be done
for false conditionals or ExitIf, we should
simply advance to the next priority.

Resolves: #341
(cherry picked from commit f4edb3b87e2b972f9b3009a04c0760e7b69391f0)

18 months agomanager.c: Fix regression due to using wrong free function.
Naveen Albert [Tue, 26 Dec 2023 17:14:11 +0000 (17:14 +0000)] 
manager.c: Fix regression due to using wrong free function.

Commit 424be345639d75c6cb7d0bd2da5f0f407dbd0bd5 introduced
a regression by calling ast_free on memory allocated by
realpath. This causes Asterisk to abort when executing this
function. Since the memory is allocated by glibc, it should
be freed using ast_std_free.

Resolves: #513
(cherry picked from commit d6245bcfa38769e8ac5d6a61bdaf80d7f94945fc)

18 months agoconfig_options.c: Fix truncation of option descriptions.
Naveen Albert [Thu, 9 Nov 2023 15:58:41 +0000 (10:58 -0500)] 
config_options.c: Fix truncation of option descriptions.

This increases the format width of option descriptions
to avoid needless truncation for longer descriptions.

Resolves: #428
(cherry picked from commit 98186cba6310185be06f1bfc60b10cdff81d6a56)

18 months agomanager.c: Improve clarity of "manager show connected".
Naveen Albert [Tue, 5 Dec 2023 16:36:47 +0000 (11:36 -0500)] 
manager.c: Improve clarity of "manager show connected".

Improve the "manager show connected" CLI command
to clarify that the last two columns are permissions
related, not counts, and use sufficient widths
to consistently display these values.

ASTERISK-30143 #close
Resolves: #482

(cherry picked from commit ba742bd9deba38cb74db356cf278d195d0f0f19f)

18 months agomake_xml_documentation: Really collect LOCAL_MOD_SUBDIRS documentation.
Sean Bright [Fri, 1 Dec 2023 20:30:17 +0000 (15:30 -0500)] 
make_xml_documentation: Really collect LOCAL_MOD_SUBDIRS documentation.

Although `make_xml_documentation`'s `print_dependencies` command was
corrected by the previous fix (#461) for #142, the `create_xml` was
not properly handling `LOCAL_MOD_SUBDIRS` XML documentation.

(cherry picked from commit 7909aba37f13bcd6a489c2fad2b1cc357a988db3)

18 months agogeneral: Fix broken links.
Naveen Albert [Thu, 9 Nov 2023 21:26:46 +0000 (16:26 -0500)] 
general: Fix broken links.

This fixes a number of broken links throughout the
tree, mostly caused by wiki.asterisk.org being replaced
with docs.asterisk.org, which should eliminate the
need for sporadic fixes as in f28047db36a70e81fe373a3d19132c43adf3f74b.

Resolves: #430
(cherry picked from commit 8cc5fc2e399e1e8fd680fbd8d033ed03fa00c3ba)

18 months agoMergeApproved.yml: Remove unneeded concurrency
George Joseph [Wed, 6 Dec 2023 21:27:01 +0000 (14:27 -0700)] 
MergeApproved.yml:  Remove unneeded concurrency

The concurrency parameter on the MergeAndCherryPick job has
been rmeoved.  It was a hold-over from earlier days.

(cherry picked from commit 74904a0b3a8b00790f2475ceb20b7ea6a0200aa1)

18 months agoapp_dial: Add option "j" to preserve initial stream topology of caller
Maximilian Fridrich [Thu, 30 Nov 2023 08:57:56 +0000 (09:57 +0100)] 
app_dial: Add option "j" to preserve initial stream topology of caller

Resolves: #462

UserNote: The option "j" is now available for the Dial application which
uses the initial stream topology of the caller to create the outgoing
channels.

(cherry picked from commit 8d7665db7bee2fdcdebaf5bd5e24ee32e27de359)

18 months agoast_coredumper: Increase reliability
George Joseph [Sun, 12 Nov 2023 00:40:10 +0000 (17:40 -0700)] 
ast_coredumper: Increase reliability

Instead of searching for the asterisk binary and the modules in the
filesystem, we now get their locations, along with libdir, from
the coredump itself...

For the binary, we can use `gdb -c <coredump> ... "info proc exe"`.
gdb can print this even without having the executable and symbols.

Once we have the binary, we can get the location of the modules with
`gdb ... "print ast_config_AST_MODULE_DIR`

If there was no result then either it's not an asterisk coredump
or there were no symbols loaded.  Either way, it's not usable.

For libdir, we now run "strings" on the note0 section of the
coredump (which has the shared library -> memory address xref) and
search for "libasteriskssl|libasteriskpj", then take the dirname.

Since we're now getting everything from the coredump, it has to be
correct as long as we're not crossing namespace boundaries like
running asterisk in a docker container but trying to run
ast_coredumper from the host using a shared file system (which you
shouldn't be doing).

There is still a case for using --asterisk-bin and/or --libdir: If
you've updated asterisk since the coredump was taken, the binary,
libraries and modules won't match the coredump which will render it
useless.  If you can restore or rebuild the original files that
match the coredump and place them in a temporary directory, you can
use --asterisk-bin, --libdir, and a new --moddir option to point to
them and they'll be correctly captured in a tarball created
with --tarball-coredumps.  If you also use --tarball-config, you can
use a new --etcdir option to point to what normally would be the
/etc/asterisk directory.

Also addressed many "shellcheck" findings.

Resolves: #445
(cherry picked from commit 26c98bc68b9b12cc577e68ce66435b8dfc617efe)

18 months agologger.c: Move LOG_GROUP documentation to dedicated XML file.
Sean Bright [Fri, 1 Dec 2023 17:03:29 +0000 (12:03 -0500)] 
logger.c: Move LOG_GROUP documentation to dedicated XML file.

The `get_documentation` awk script will only extract the first
DOCUMENTATION block that it finds in a given file. This is by design
(9bc2127) to prevent AMI event documentation from being pulled in to
the core.xml documentation file.

Because of this, the `LOG_GROUP` documentation added in 89709e2 was
not being properly extracted and was missing fom the resulting XML
documentation file. This commit moves the `LOG_GROUP` documentation to
a separate `logger.xml` file.

(cherry picked from commit 2f405d232a5a7bcb1f58bebac383ee8c4943190c)

18 months agores_odbc.c: Allow concurrent access to request odbc connections
Matthew Fredrickson [Thu, 30 Nov 2023 17:57:53 +0000 (11:57 -0600)] 
res_odbc.c: Allow concurrent access to request odbc connections

There are valid scenarios where res_odbc's connection pool might have some dead
or stuck connections while others are healthy (imagine network
elements/firewalls/routers silently timing out connections to a single DB and a
single IP address, or a heterogeneous connection pool connected to potentially
multiple IPs/instances of a replicated DB using a DNS front end for load
balancing and one replica fails).

In order to time out those unhealthy connections without blocking access to
other parts of Asterisk that may attempt access to the connection pool, it would
be beneficial to not lock/block access around the entire pool in
_ast_odbc_request_obj2 while doing potentially blocking operations on connection
pool objects such as the connection_dead() test, odbc_obj_connect(), or by
dereferencing a struct odbc_obj for the last time and triggering a
odbc_obj_disconnect().

This would facilitate much quicker and concurrent timeout of dead connections
via the connection_dead() test, which could block potentially for a long period
of time depending on odbc.ini or other odbc connector specific timeout settings.

This also would make rapid failover (in the clustered DB scenario) much quicker.

This patch changes the locking in _ast_odbc_request_obj2() to not lock around
odbc_obj_connect(), _disconnect(), and connection_dead(), while continuing to
lock around truly shared, non-immutable state like the connection_cnt member and
the connections list on struct odbc_class.

Fixes: #465
(cherry picked from commit 058ead0ea5e64496cc56ce809aca0a31aa7ea77b)

18 months agores_pjsip_header_funcs.c: Check URI parameter length before copying.
Sean Bright [Mon, 4 Dec 2023 14:33:26 +0000 (09:33 -0500)] 
res_pjsip_header_funcs.c: Check URI parameter length before copying.

Fixes #477

(cherry picked from commit 0ed2e8200a315573143160ff7584274e694d8b6e)

18 months agoconfig.c: Log #exec include failures.
Sean Bright [Wed, 22 Nov 2023 19:25:19 +0000 (14:25 -0500)] 
config.c: Log #exec include failures.

If the script referenced by `#exec` does not exist, writes anything to
stderr, or exits abnormally or with a non-zero exit status, we log
that to Asterisk's error logging channel.

Additionally, write out a warning if the script produces no output.

Fixes #259

(cherry picked from commit 461c3c60e24f87f79b4b76bb89957912528dfc9d)

18 months agomake_xml_documentation: Properly handle absolute LOCAL_MOD_SUBDIRS.
Sean Bright [Mon, 27 Nov 2023 16:43:15 +0000 (11:43 -0500)] 
make_xml_documentation: Properly handle absolute LOCAL_MOD_SUBDIRS.

If LOCAL_MOD_SUBDIRS contains absolute paths, do not prefix them with
the path to Asterisk's source tree.

Fixes #142

(cherry picked from commit e196ccb7c22339c3c4455198687c56ad566eaaf9)

18 months agoapp_voicemail.c: Completely resequence mailbox folders.
Sean Bright [Mon, 27 Nov 2023 15:20:02 +0000 (10:20 -0500)] 
app_voicemail.c: Completely resequence mailbox folders.

Resequencing is a process that occurs when we open a voicemail folder
and discover that there are gaps between messages (e.g. `msg0000.txt`
is missing but `msg0001.txt` exists). Resequencing involves shifting
the existing messages down so we end up with a sequential list of
messages.

Currently, this process stops after reaching a threshold based on the
message limit (`maxmsg`) configured on the current folder. However, if
`maxmsg` is lowered when a voicemail folder contains more than
`maxmsg + 10` messages, resequencing will not run completely leaving
the mailbox in an inconsistent state.

We now resequence up to the maximum number of messages permitted by
`app_voicemail` (currently hard-coded at 9999 messages).

Fixes #86

(cherry picked from commit 242a0685b12dd3783676994e3ac9d7f5d90e3401)

18 months agosig_analog: Fix channel leak when mwimonitor is enabled.
Naveen Albert [Fri, 24 Nov 2023 13:06:58 +0000 (08:06 -0500)] 
sig_analog: Fix channel leak when mwimonitor is enabled.

When mwimonitor=yes is enabled for an FXO port,
the do_monitor thread will launch mwi_thread if it thinks
there could be MWI on an FXO channel, due to the noise
threshold being satisfied. This, in turns, calls
analog_ss_thread_start in sig_analog. However, unlike
all other instances where __analog_ss_thread is called
in sig_analog, this call path does not properly set
pvt->ss_astchan to the Asterisk channel, which means
that the Asterisk channel is NULL when __analog_ss_thread
starts executing. As a result, the thread exits and the
channel is never properly cleaned up by calling ast_hangup.

This caused issues with do_monitor on incoming calls,
as it would think the channel was still owned even while
receiving events, leading to an infinite barrage of
warning messages; additionally, the channel would persist
improperly.

To fix this, the assignment is added to the call path
where it is missing (which is only used for mwi_thread).
A warning message is also added since previously there
was no indication that __analog_ss_thread was exiting
abnormally. This resolves both the channel leak and the
condition that led to the warning messages.

Resolves: #458
(cherry picked from commit 069d4801382a922b2c731bec6bba84c7fcb958b9)

18 months agores_rtp_asterisk.c: Update for OpenSSL 3+.
Sean Bright [Mon, 20 Nov 2023 19:56:49 +0000 (14:56 -0500)] 
res_rtp_asterisk.c: Update for OpenSSL 3+.

In 5ac5c2b0 we defined `OPENSSL_SUPPRESS_DEPRECATED` to silence
deprecation warnings. This commit switches over to using
non-deprecated API.

(cherry picked from commit 410b73453357190c717e9e8700697f1b34e4480f)

18 months agoalembic: Update list of TLS methods available on ps_transports.
Sean Bright [Tue, 14 Nov 2023 22:49:04 +0000 (17:49 -0500)] 
alembic: Update list of TLS methods available on ps_transports.

Related to #221 and #222.

Also adds `*.ini` to the `.gitignore` file in ast-db-manage for
convenience.

(cherry picked from commit b16d4a342095e1022c7fe26a02d3aa52eed36dbc)

18 months agofunc_channel: Expose previously unsettable options.
Naveen Albert [Sat, 11 Nov 2023 14:35:29 +0000 (09:35 -0500)] 
func_channel: Expose previously unsettable options.

Certain channel options are not set anywhere or
exposed in any way to users, making them unusable.
This exposes some of these options which make sense
for users to manipulate at runtime.

Resolves: #442
(cherry picked from commit 147f014072f23bd2e59971b5d7915f26bd8f8240)

18 months agoapp.c: Allow ampersands in playback lists to be escaped.
Sean Bright [Tue, 7 Nov 2023 20:03:53 +0000 (15:03 -0500)] 
app.c: Allow ampersands in playback lists to be escaped.

Any function or application that accepts a `&`-separated list of
filenames can now include a literal `&` in a filename by wrapping the
entire filename in single quotes, e.g.:

```
exten = _X.,n,Playback('https://example.com/sound.cgi?a=b&c=d'&hello-world)
```

Fixes #172

UpgradeNote: Ampersands in URLs passed to the `Playback()`,
`Background()`, `SpeechBackground()`, `Read()`, `Authenticate()`, or
`Queue()` applications as filename arguments can now be escaped by
single quoting the filename. Additionally, this is also possible when
using the `CONFBRIDGE` dialplan function, or configuring various
features in `confbridge.conf` and `queues.conf`.

(cherry picked from commit 6b4d7f2125c32729a1dcb6241b846588e2106bc0)

18 months agouri.c: Simplify ast_uri_make_host_with_port()
Sean Bright [Thu, 9 Nov 2023 23:06:22 +0000 (18:06 -0500)] 
uri.c: Simplify ast_uri_make_host_with_port()

(cherry picked from commit c25271f2ae346248af727e07b6f720d5d698e850)

18 months agofunc_curl.c: Remove CURLOPT() plaintext documentation.
Sean Bright [Tue, 14 Nov 2023 01:06:13 +0000 (20:06 -0500)] 
func_curl.c: Remove CURLOPT() plaintext documentation.

I assume this was missed when initially converting to XML
documentation and we've been kicking the can down the road since.

(cherry picked from commit b91f97577d953b2302bdce7ca4be558ddb841d54)

18 months agores_http_websocket.c: Set hostname on client for certificate validation.
Sean Bright [Thu, 9 Nov 2023 22:59:19 +0000 (17:59 -0500)] 
res_http_websocket.c: Set hostname on client for certificate validation.

Additionally add a `assert()` to in the TLS client setup code to
ensure that hostname is set when it is supposed to be.

Fixes #433

(cherry picked from commit 992ea8698121b6623dd371ffe7d472ae8167d188)

18 months agolive_ast: Add astcachedir to generated asterisk.conf.
Sean Bright [Thu, 9 Nov 2023 14:11:33 +0000 (09:11 -0500)] 
live_ast: Add astcachedir to generated asterisk.conf.

`astcachedir` (added in b0842713) was not added to `live_ast` so
continued to point to the system `/var/cache` directory instead of the
one in the live environment.

(cherry picked from commit 04fd8704e1e68ab621d6eb8688b99b123571664d)

18 months agoSECURITY.md: Update with correct documentation URL
George Joseph [Thu, 9 Nov 2023 18:45:08 +0000 (11:45 -0700)] 
SECURITY.md: Update with correct documentation URL

(cherry picked from commit 08cadf999e3a9aeafa8c4e47d198fdebd4f2a746)

18 months agofunc_lock: Add missing see-also refs to documentation.
Naveen Albert [Thu, 9 Nov 2023 15:01:18 +0000 (10:01 -0500)] 
func_lock: Add missing see-also refs to documentation.

Resolves: #423
(cherry picked from commit 44b0590e5954850e5a1b5c6a7c62400994febbe4)

18 months agoapp_followme.c: Grab reference on nativeformats before using it
Matthew Fredrickson [Thu, 26 Oct 2023 02:14:48 +0000 (21:14 -0500)] 
app_followme.c: Grab reference on nativeformats before using it

Fixes a crash due to a lack of proper reference on the nativeformats
object before passing it into ast_request().  Also found potentially
similar use case bugs in app_chanisavail.c, bridge.c, and bridge_basic.c

Fixes: #388
(cherry picked from commit eeae61b2f827bd3b32820344d66ba4a85e3ae3cc)

18 months agoconfigs: Improve documentation for bandwidth in iax.conf.
Naveen Albert [Thu, 9 Nov 2023 15:12:15 +0000 (10:12 -0500)] 
configs: Improve documentation for bandwidth in iax.conf.

This improves the documentation for the bandwidth setting
in iax.conf by making it clearer what the ramifications
of this setting are. It also changes the sample default
from low to high, since only high is compatible with good
codecs that people will want to use in the vast majority
of cases, and this is a common gotcha that trips up new users.

Resolves: #425
(cherry picked from commit 1f66a9fc284753ef2d0db616f81dfb55979f30a4)

18 months agologger: Add channel-based filtering.
Naveen Albert [Wed, 9 Aug 2023 22:12:55 +0000 (22:12 +0000)] 
logger: Add channel-based filtering.

This adds the ability to filter console
logging by channel or groups of channels.
This can be useful on busy systems where
an administrator would like to analyze certain
calls in detail. A dialplan function is also
included for the purpose of assigning a channel
to a group (e.g. by tenant, or some other metric).

ASTERISK-30483 #close

Resolves: #242

UserNote: The console log can now be filtered by
channels or groups of channels, using the
logger filter CLI commands.

(cherry picked from commit 318710cf6e5ec8bbe0f1c161a08b468c4197ed41)

18 months agochan_iax2.c: Don't send unsanitized data to the logger.
Sean Bright [Wed, 8 Nov 2023 13:47:42 +0000 (08:47 -0500)] 
chan_iax2.c: Don't send unsanitized data to the logger.

This resolves an issue where non-printable characters could be sent to
the console/log files.

(cherry picked from commit 7b297cb90d4067ed12e6050fd4f206b4b1d644ea)

18 months agocodec_ilbc: Disable system ilbc if version >= 3.0.0
George Joseph [Tue, 7 Nov 2023 23:24:37 +0000 (16:24 -0700)] 
codec_ilbc: Disable system ilbc if version >= 3.0.0

Fedora 37 started shipping ilbc 3.0.4 which we don't yet support.
configure.ac now checks the system for "libilbc < 3" instead of
just "libilbc".  If true, the system version of ilbc will be used.
If not, the version included at codecs/ilbc will be used.

Resolves: #84
(cherry picked from commit bee37b74042b145a484f327aeb10f2662be888ac)

18 months agoresource_channels.c: Explicit codec request when creating UnicastRTP.
Sean Bright [Mon, 6 Nov 2023 23:10:02 +0000 (18:10 -0500)] 
resource_channels.c: Explicit codec request when creating UnicastRTP.

Fixes #394

(cherry picked from commit 59e296df01fe7bf8180215e9b4ec2569b94a48fa)

18 months agodoc: Update IP Quality of Service links.
Sean Bright [Tue, 7 Nov 2023 13:39:09 +0000 (08:39 -0500)] 
doc: Update IP Quality of Service links.

Fixes #328

(cherry picked from commit 092bd618fb559b65b1e860c6b2b884413c43a376)

18 months agochan_pjsip: Add PJSIPHangup dialplan app and manager action
George Joseph [Tue, 31 Oct 2023 21:08:14 +0000 (15:08 -0600)] 
chan_pjsip: Add PJSIPHangup dialplan app and manager action

See UserNote below.

Exposed the existing Hangup AMI action in manager.c so we can use
all of it's channel search and AMI protocol handling without
duplicating that code in dialplan_functions.c.

Added a lookup function to res_pjsip.c that takes in the
string represenation of the pjsip_status_code enum and returns
the actual status code.  I.E.  ast_sip_str2rc("DECLINE") returns
603.  This allows the caller to specify PJSIPHangup(decline) in
the dialplan, just like Hangup(call_rejected).

Also extracted the XML documentation to its own file since it was
almost as large as the code itself.

UserNote: A new dialplan app PJSIPHangup and AMI action allows you
to hang up an unanswered incoming PJSIP call with a specific SIP
response code in the 400 -> 699 range.

(cherry picked from commit 9a93ce04095068250744659350e8da6c93388c13)

18 months agochan_iax2.c: Ensure all IEs are displayed when dumping frame contents.
Sean Bright [Mon, 6 Nov 2023 16:45:33 +0000 (11:45 -0500)] 
chan_iax2.c: Ensure all IEs are displayed when dumping frame contents.

When IAX2 debugging was enabled (`iax2 set debug on`), if the last IE
in a frame was one that may not have any data - such as the CALLTOKEN
IE in an NEW request - it was not getting displayed.

(cherry picked from commit 744bd4f9ac83322a7e779f572a35a33718848a54)

18 months agochan_dahdi: Warn if nonexistent cadence is requested.
Naveen Albert [Thu, 2 Nov 2023 20:51:22 +0000 (16:51 -0400)] 
chan_dahdi: Warn if nonexistent cadence is requested.

If attempting to ring a channel using a nonexistent cadence,
emit a warning, before falling back to the default cadence.

Resolves: #409
(cherry picked from commit beb968928874bee286f103cc7d5301348b2f761e)