]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
21 months ago.github: Minor tweak to Asterisk Releaser 19
George Joseph [Wed, 12 Jul 2023 12:34:57 +0000 (06:34 -0600)] 
.github: Minor tweak to Asterisk Releaser

21 months ago.github: Fix cherry-pick reminder issues
George Joseph [Mon, 17 Jul 2023 15:23:08 +0000 (09:23 -0600)] 
.github: Fix cherry-pick reminder issues

21 months ago.github: Update workflow-application-token-action to v2
George Joseph [Thu, 31 Aug 2023 13:23:56 +0000 (07:23 -0600)] 
.github: Update workflow-application-token-action to v2

21 months ago.github: Fix job prereqs in PROpenedUpdated
George Joseph [Mon, 9 Oct 2023 13:22:49 +0000 (07:22 -0600)] 
.github: Fix job prereqs in PROpenedUpdated

21 months ago.github: Block PR tests until approved
George Joseph [Thu, 5 Oct 2023 16:23:13 +0000 (10:23 -0600)] 
.github: Block PR tests until approved

21 months ago.github: Update AsteriskReleaser for security releases
George Joseph [Fri, 7 Jul 2023 17:06:24 +0000 (11:06 -0600)] 
.github: Update AsteriskReleaser for security releases

21 months ago.github: Minor tweak to Asterisk Releaser
George Joseph [Wed, 12 Jul 2023 12:34:57 +0000 (06:34 -0600)] 
.github: Minor tweak to Asterisk Releaser

22 months agoari-stubs: Fix more local anchor references
George Joseph [Tue, 5 Sep 2023 19:02:19 +0000 (13:02 -0600)] 
ari-stubs: Fix more local anchor references

Also allow CreateDocs job to be run manually with default branches.

22 months agoari-stubs: Fix more local anchor references
George Joseph [Tue, 5 Sep 2023 19:02:19 +0000 (13:02 -0600)] 
ari-stubs: Fix more local anchor references

Also allow CreateDocs job to be run manually with default branches.

22 months agoari-stubs: Fix broken documentation anchors
George Joseph [Tue, 5 Sep 2023 15:51:19 +0000 (09:51 -0600)] 
ari-stubs: Fix broken documentation anchors

All of the links that reference page anchors with capital letters in
the ids (#Something) have been changed to lower case to match the
anchors that are generated by mkdocs.

23 months agoalembic: Fix quoting of the 100rel column
George Joseph [Mon, 28 Aug 2023 13:11:27 +0000 (07:11 -0600)] 
alembic: Fix quoting of the 100rel column

Add quoting around the ps_endpoints 100rel column in the ALTER
statements.  Although alembic doesn't complain when generating
sql statements, postgresql does (rightly so).

Resolves: #274

23 months ago.github: Use generic releaser
George Joseph [Tue, 15 Aug 2023 19:04:38 +0000 (13:04 -0600)] 
.github: Use generic releaser

2 years ago.github: Suppress cherry-pick reminder for some situations
George Joseph [Tue, 11 Jul 2023 12:31:04 +0000 (06:31 -0600)] 
.github: Suppress cherry-pick reminder for some situations

In PROpenedOrUpdated, the cherry-pick reminder will now be
suppressed if there are already valid 'cherry-pick-to' comments
in the PR or the PR contained a 'cherry-pick-to: none' comment.

2 years agoapply_patches: Use globbing instead of file/sort.
Sean Bright [Thu, 6 Jul 2023 17:51:32 +0000 (13:51 -0400)] 
apply_patches: Use globbing instead of file/sort.

This accomplishes the same thing as a `find ... | sort` but with the
added benefit of clarity and avoiding a call to a subshell.

Additionally drop the -s option from call to patch as it is not POSIX.

2 years agobundled_pjproject: Backport 2 SSL patches from upstream
George Joseph [Thu, 6 Jul 2023 16:06:59 +0000 (10:06 -0600)] 
bundled_pjproject: Backport 2 SSL patches from upstream

* Fix double free of ossock->ossl_ctx in case of errors
https://github.com/pjsip/pjproject/commit/863629bc65d6

* free SSL context and reset context pointer when setting the cipher
  list fails
https://github.com/pjsip/pjproject/commit/0fb32cd4c0b2

Resolves: #194

2 years agobundled_pjproject: Backport security fixes from pjproject 2.13.1
George Joseph [Wed, 5 Jul 2023 13:35:28 +0000 (07:35 -0600)] 
bundled_pjproject: Backport security fixes from pjproject 2.13.1

Merge-pull-request-from-GHSA-9pfh-r8x4-w26w.patch
Merge-pull-request-from-GHSA-cxwq-5g9x-x7fr.patch
Locking-fix-so-that-SSL_shutdown-and-SSL_write-are-n.patch
Don-t-call-SSL_shutdown-when-receiving-SSL_ERROR_SYS.patch

Resolves: #188

2 years agotest_statis_endpoints: Fix channel_messages test again
George Joseph [Mon, 12 Jun 2023 14:34:16 +0000 (08:34 -0600)] 
test_statis_endpoints:  Fix channel_messages test again

2 years agotest_stasis_endpoints.c: Make channel_messages more stable
George Joseph [Fri, 9 Jun 2023 16:41:13 +0000 (10:41 -0600)] 
test_stasis_endpoints.c: Make channel_messages more stable

The channel_messages test was assuming that stasis would return
messages in a specific order.  This is an incorrect assumption as
message ordering was never guaranteed.  This was causing the test
to fail occasionally.  We now test all the messages for the
required message types instead of testing one by one.

Resolves: #158

2 years agoapply_patches: Sort patch list before applying
George Joseph [Thu, 6 Jul 2023 12:37:50 +0000 (06:37 -0600)] 
apply_patches: Sort patch list before applying

The apply_patches script wasn't sorting the list of patches in
the "patches" directory before applying them. This left the list
in an indeterminate order. In most cases, the list is actually
sorted but rarely, they can be out of order and cause dependent
patches to fail to apply.

We now sort the list but the "sort" program wasn't in the
configure scripts so we needed to add that and regenerate
the scripts as well.

Resolves: #193

2 years ago.github: Add workflow to this branch
George Joseph [Wed, 5 Jul 2023 14:02:57 +0000 (08:02 -0600)] 
.github: Add workflow to this branch

2 years agorest-api: Updates for new documentation site
George Joseph [Mon, 26 Jun 2023 12:55:49 +0000 (06:55 -0600)] 
rest-api: Updates for new documentation site

The new documentation site uses traditional markdown instead
of the Confluence flavored version.  This required changes in
the mustache templates and the python that generates the files.

2 years agores_pjsip_transport_websocket: Add remote port to transport
George Joseph [Fri, 23 Dec 2022 12:02:43 +0000 (05:02 -0700)] 
res_pjsip_transport_websocket: Add remote port to transport

When Asterisk receives a new websocket conenction, it creates a new
pjsip transport for it and copies connection data into it.  The
transport manager then uses the remote IP address and port on the
transport to create a monitor for each connection.  However, the
remote port wasn't being copied, only the IP address which meant
that the transport manager was creating only 1 monitoring entry for
all websocket connections from the same IP address. Therefore, if
one of those connections failed, it deleted the transport taking
all the the connections from that same IP address with it.

* We now copy the remote port into the created transport and the
  transport manager behaves correctly.

ASTERISK-30369

Change-Id: Ib506d40897ea6286455ac0be4dfbb0ed43b727e1

2 years agoUpdate CHANGES and UPGRADE.txt for 19.8.0
Asterisk Development Team [Thu, 15 Dec 2022 12:39:06 +0000 (07:39 -0500)] 
Update CHANGES and UPGRADE.txt for 19.8.0

2 years agores_geoloc: fix NULL pointer dereference bug
Alexandre Fournier [Fri, 9 Dec 2022 19:37:13 +0000 (14:37 -0500)] 
res_geoloc: fix NULL pointer dereference bug

The `ast_geoloc_datastore_add_eprofile` function does not return 0 on
success, it returns the size of the underlying datastore. This means
that the datastore will be freed and its pointer set to NULL when no
error occured at all.

ASTERISK-30346

Change-Id: Iea9b209bd1244cc57b903b9496cb680c356e4bb9

2 years agopjproject: 2.13 security fixes
Ben Ford [Tue, 29 Nov 2022 20:02:26 +0000 (14:02 -0600)] 
pjproject: 2.13 security fixes

Backports two security fixes (c4d3498 and 450baca) from pjproject 2.13.

ASTERISK-30338

Change-Id: I86fdc003d5d22cb66e7cc6dc3313a8194f27eb69

2 years agopjsip_transport_events: Fix possible use after free on transport
George Joseph [Mon, 10 Oct 2022 14:35:54 +0000 (08:35 -0600)] 
pjsip_transport_events: Fix possible use after free on transport

It was possible for a module that registered for transport monitor
events to pass in a pjsip_transport that had already been freed.
This caused pjsip_transport_events to crash when looking up the
monitor for the transport.  The fix is a two pronged approach.

1. We now increment the reference count on pjsip_transports when we
create monitors for them, then decrement the count when the
transport is going to be destroyed.

2. There are now APIs to register and unregister monitor callbacks
by "transport key" which is a string concatenation of the remote ip
address and port.  This way the module needing to monitor the
transport doesn't have to hold on to the transport object itself to
unregister.  It just has to save the transport_key.

* Added the pjsip_transport reference increment and decrement.

* Changed the internal transport monitor container key from the
  transport->obj_name (which may not be unique anyway) to the
  transport_key.

* Added a helper macro AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR() that
  fills a buffer with the transport_key using a passed-in
  pjsip_transport.

* Added the following functions:
  ast_sip_transport_monitor_register_key
  ast_sip_transport_monitor_register_replace_key
  ast_sip_transport_monitor_unregister_key
  and marked their non-key counterparts as deprecated.

* Updated res_pjsip_pubsub and res_pjsip_outbound_register to use
  the new "key" monitor functions.

NOTE: res_pjsip_registrar also uses the transport monitor
functionality but doesn't have a persistent object other than
contact to store a transport key.  At this time, it continues to
use the non-key monitor functions.

ASTERISK-30244

Change-Id: I1a20baf2a8643c272dcf819871d6c395f148f00b

2 years agomanager: prevent file access outside of config dir
Mike Bradeen [Mon, 3 Oct 2022 18:54:40 +0000 (12:54 -0600)] 
manager: prevent file access outside of config dir

Add live_dangerously flag to manager and use this flag to
determine if a configuation file outside of AST_CONFIG_DIR
should be read.

ASTERISK-30176

Change-Id: I46b26af4047433b49ae5c8a85cb8cda806a07404

2 years agoooh323c: not checking for IE minimum length
Mike Bradeen [Mon, 6 Jun 2022 23:11:30 +0000 (17:11 -0600)] 
ooh323c: not checking for IE minimum length

When decoding q.931 encoded calling/called number
now checking for length being less than minimum required.

ASTERISK-30103

Change-Id: I3dcfce0f35eca258dc450f87c92d4d7af402c2e7

2 years agotcptls: Prevent crash when freeing OpenSSL errors.
Naveen Albert [Thu, 27 Oct 2022 11:32:12 +0000 (11:32 +0000)] 
tcptls: Prevent crash when freeing OpenSSL errors.

write_openssl_error_to_log has been erroneously
using ast_free instead of free, which will
cause a crash when MALLOC_DEBUG is enabled since
the memory was not allocated by Asterisk's memory
manager. This changes it to use the actual free
function directly to avoid this.

ASTERISK-30278 #close

Change-Id: Iac8b6468b718075809c45d8ad16b101af21a474d

2 years agores_pjsip: prevent crash on websocket disconnect
Mike Bradeen [Thu, 13 Oct 2022 16:19:17 +0000 (10:19 -0600)] 
res_pjsip: prevent crash on websocket disconnect

When a websocket (or potentially any stateful connection) is quickly
created then destroyed, it is possible that the qualify thread will
destroy the transaction before the initialzing thread is finished
with it.

Depending on the timing, this can cause an assertion within pjsip.

To prevent this, ast_send_stateful_response will now create the group
lock and add a reference to it before creating the transaction.

While this should resolve the crash, there is still the potential that
the contact will not be cleaned up properly, see:ASTERISK~29286. As a
result, the contact has to 'time out' before it will be removed.

ASTERISK-28689

Change-Id: Id050fded2247a04d8f0fc5b8a2cf3e5482cb8cee

2 years agores_pjsip_outbound_registration: Allow to use multiple proxies for registration
Igor Goncharovsky [Fri, 9 Sep 2022 17:20:18 +0000 (23:20 +0600)] 
res_pjsip_outbound_registration: Allow to use multiple proxies for registration

Current registration code use pjsip_parse_uri to verify outbound_proxy
that is different from the reading this option for the endpoint. This
made value with multiple proxies invalid for registration pjsip settings.
Removing URI validation helps to use registration through multiple proxies.

ASTERISK-30217 #close

Change-Id: I064558e66f04b9f3260c46181812a01349761357

2 years agotests: Fix compilation errors on 32-bit.
Naveen Albert [Sun, 23 Oct 2022 15:16:31 +0000 (15:16 +0000)] 
tests: Fix compilation errors on 32-bit.

Fix compilation errors caused by using size_t
instead of uintmax_t and non-portable format
specifiers.

ASTERISK-30273 #close

Change-Id: I363e6057ef84d54b88af80d23ad6147eef9216ee

2 years agores_pjsip: return all codecs on a re-INVITE without SDP
Henning Westerholt [Fri, 26 Aug 2022 08:59:16 +0000 (08:59 +0000)] 
res_pjsip: return all codecs on a re-INVITE without SDP

Currently chan_pjsip on receiving a re-INVITE without SDP will only
return the codecs that are previously negotiated and not offering
all enabled codecs.

This causes interoperability issues with different equipment (e.g.
from Cisco) for some of our customers and probably also in other
scenarios involving 3PCC infrastructure.

According to RFC 3261, section 14.2 we SHOULD return all codecs
on a re-INVITE without SDP

The PR proposes a new parameter to configure this behaviour:
all_codecs_on_empty_reinvite. It includes the code, documentation,
alembic migrations, CHANGES file and example configuration additions.

ASTERISK-30193 #close

Change-Id: I69763708d5039d512f391e296ee8a4d43a1e2148

2 years agores_pjsip_logger: Add method-based logging option.
Naveen Albert [Thu, 21 Jul 2022 00:03:34 +0000 (00:03 +0000)] 
res_pjsip_logger: Add method-based logging option.

Expands the pjsip logger to support the ability to filter
by SIP message method. This can make certain types of SIP debugging
easier by only logging messages of particular method(s).

ASTERISK-30146 #close

Co-authored-by: Sean Bright <sean@seanbright.com>
Change-Id: I9c8cbb6fc8686ef21190eb42e08bc9a9b147707f

2 years agores_pjsip_notify: Add option support for AMI.
Naveen Albert [Fri, 14 Oct 2022 22:24:00 +0000 (22:24 +0000)] 
res_pjsip_notify: Add option support for AMI.

The PJSIP notify CLI commands allow for using
"options" configured in pjsip_notify.conf.

This allows these same options to be used in
AMI actions as well.

Additionally, as part of this improvement,
some repetitive common code is refactored.

ASTERISK-30263 #close

Change-Id: Ie4496b322b63b61eaf9672183a959ab99a04b6b5

2 years agoDialing API: Cancel a running async thread, may not cancel all calls
Frederic LE FOLL [Thu, 6 Oct 2022 16:51:36 +0000 (18:51 +0200)] 
Dialing API: Cancel a running async thread, may not cancel all calls

race condition: ast_dial_join() may not cancel outgoing call, if
function is called just after called party answer and before
application execution (bit is_running_app not yet set).

This fix adds ast_softhangup() calls in addition to existing
pthread_kill() when is_running_app is not set.

ASTERISK-30258

Change-Id: Idbdd5c15122159661aa8e996a42d5800083131e4

2 years agochan_dahdi: Fix unavailable channels returning busy.
Naveen Albert [Sun, 23 Oct 2022 22:46:24 +0000 (22:46 +0000)] 
chan_dahdi: Fix unavailable channels returning busy.

This fixes dahdi_request to properly set the cause
code to CONGESTION instead of BUSY if no channels
were actually available.

Currently, the cause is erroneously set to busy
if the channel itself is found, regardless of its
current state. However, if the channel is not available
(e.g. T1 down, card not operable, etc.), then the
channel itself may not be in a functional state,
in which case CHANUNAVAIL is the correct cause to use.

This adds a simple check to ensure that busy tone
is only returned if a channel is encountered that
has an owner, since that is the only possible way
that a channel could actually be busy.

ASTERISK-30274 #close

Change-Id: Iad5870223c081240c925b19df8d6af136953b994

2 years agores_pjsip_pubsub: Prevent removing subscriptions.
Naveen Albert [Sun, 16 Oct 2022 20:35:29 +0000 (20:35 +0000)] 
res_pjsip_pubsub: Prevent removing subscriptions.

pjproject does not provide any mechanism of removing
event packages, which means that once a subscription
handler is registered, it is effectively permanent.

pjproject will assert if the same event package is
ever registered again, so currently unloading and
loading any Asterisk modules that use subscriptions
will cause a crash that is beyond our control.

For that reason, we now prevent users from being
able to unload these modules, to prevent them
from ever being loaded twice.

ASTERISK-30264 #close

Change-Id: I7fdcb1a5e44d38b7ba10c44259fe98f0ae9bc12c

2 years agosay: Don't prepend ampersand erroneously.
Naveen Albert [Wed, 28 Sep 2022 12:38:37 +0000 (12:38 +0000)] 
say: Don't prepend ampersand erroneously.

Some logic in say.c for determining if we need
to also add an ampersand for file seperation was faulty,
as non-successful files would increment the count, causing
a leading ampersand to be added improperly.

This is fixed, and a unit test that captures this regression
is also added.

ASTERISK-30248 #close

Change-Id: I02c1d3a11d82fe4ea8b462070cbd1effb5834d2b

2 years agores_crypto: handle unsafe private key files
Philip Prindeville [Fri, 16 Sep 2022 18:45:55 +0000 (12:45 -0600)] 
res_crypto: handle unsafe private key files

ASTERISK-30213 #close

Change-Id: I4a77143d41615b7c4fc25bb1251c0a9cb87b417a

2 years agoaudiohook: add directional awareness
Mike Bradeen [Thu, 29 Sep 2022 20:55:20 +0000 (14:55 -0600)] 
audiohook: add directional awareness

Add enum to allow setting optional direction. If set to only one
direction, only feed matching-direction frames to the associated
slin factory.

This prevents mangling the transcoder on non-mixed frames when the
READ and WRITE frames would have otherwise required it.  Also
removes the need to mute or discard the un-wanted frames as they
are no longer added in the first place.

res_stasis_snoop is changed to use this addition to set direction
on audiohook based on spy direction.

If no direction is set, the ast_audiohook_init will init this enum
to BOTH which maintains existing functionality.

ASTERISK-30252

Change-Id: If8716bad334562a5d812be4eeb2a92e4f3be28eb

2 years agocdr: Allow bridging and dial state changes to be ignored.
Naveen Albert [Wed, 1 Jun 2022 16:06:14 +0000 (16:06 +0000)] 
cdr: Allow bridging and dial state changes to be ignored.

Allows bridging, parking, and dial messages to be globally
ignored for all CDRs such that only a single CDR record
is generated per channel.

This is useful when CDRs should endure for the lifetime of
an entire channel and bridging and dial updates in the
dialplan should not result in multiple CDR records being
created for the call. With the ignore bridging option,
bridging changes have no impact on the channel's CDRs.
With the ignore dial state option, multiple Dials and their
outcomes have no impact on the channel's CDRs. The
last disposition on the channel is preserved in the CDR,
so the actual disposition of the call remains available.

These two options can reduce the amount of "CDR hacks" that
have hitherto been necessary to ensure that CDR was not
"spoiled" by these messages if that was undesired, such as
putting a dummy optimization-disabled local channel between
the caller and the actual call and putting the CDR on the channel
in the middle to ensure that CDR would persist for the entire
call and properly record start, answer, and end times.
Enabling these options is desirable when calls correspond
to the entire lifetime of channels and the CDR should
reflect that.

Current default behavior remains unchanged.

ASTERISK-30091 #close

Change-Id: I393981af42732ec5ac3ff9266444abb453b7c832

2 years agores_tonedetect: Add ringback support to TONE_DETECT.
Naveen Albert [Fri, 30 Sep 2022 11:24:19 +0000 (11:24 +0000)] 
res_tonedetect: Add ringback support to TONE_DETECT.

Adds support for detecting audible ringback tone
to the TONE_DETECT function using the p option.

ASTERISK-30254 #close

Change-Id: Ie2329ff245248768367d26749c285fbe823f6414

2 years agochan_dahdi: Resolve format truncation warning.
Naveen Albert [Sat, 1 Oct 2022 22:08:12 +0000 (22:08 +0000)] 
chan_dahdi: Resolve format truncation warning.

Fixes a format truncation warning in notify_message.

ASTERISK-30256 #close

Change-Id: I983a423c0214641ca4f8c9dfe0b19c47448fdee1

2 years agores_crypto: don't modify fname in try_load_key()
Philip Prindeville [Fri, 16 Sep 2022 23:29:36 +0000 (17:29 -0600)] 
res_crypto: don't modify fname in try_load_key()

"fname" is passed in as a const char *, but strstr() mangles that
into a char *, and we were attempting to modify the string in place.
This is an unwanted (and undocumented) side-effect.

ASTERISK-30213

Change-Id: Ifa36d352aafeb7f9beec3f746332865c7d21e629

2 years agores_crypto: use ast_file_read_dirs() to iterate
Philip Prindeville [Fri, 16 Sep 2022 03:45:22 +0000 (21:45 -0600)] 
res_crypto: use ast_file_read_dirs() to iterate

ASTERISK-30213

Change-Id: I115f5f8942ffcfb23cd2559a55bac8a2eba081e0

2 years agores_geolocation: Update wiki documentation
George Joseph [Tue, 27 Sep 2022 14:35:35 +0000 (08:35 -0600)] 
res_geolocation: Update wiki documentation

Also added a note to the geolocation.conf.sample file
and added a README to the res/res_geolocation/wiki
directory.

Change-Id: I89c3c5db8c0701b33127993622d5e4f904bddfbc

2 years agores_pjsip: Add mediasec capabilities.
Maximilian Fridrich [Tue, 26 Jul 2022 12:01:04 +0000 (14:01 +0200)] 
res_pjsip: Add mediasec capabilities.

This patch adds support for mediasec SIP headers and SDP attributes.
These are defined in RFC 3329, 3GPP TS 24.229 and
draft-dawes-sipcore-mediasec-parameter. The new features are
implemented so that a backbone for RFC 3329 is present to streamline
future work on RFC 3329.

With this patch, Asterisk can communicate with Deutsche Telekom trunks
which require these fields.

ASTERISK-30032

Change-Id: Ia7f5b5ba42db18074fdd5428c4e1838728586be2

2 years agoUpdate CHANGES and UPGRADE.txt for 19.7.0
Asterisk Development Team [Wed, 28 Sep 2022 12:41:13 +0000 (07:41 -0500)] 
Update CHANGES and UPGRADE.txt for 19.7.0

2 years agomanager.h: Bump version to 8.0.2
George Joseph [Wed, 28 Sep 2022 11:58:57 +0000 (05:58 -0600)] 
manager.h: Bump version to 8.0.2

Change-Id: I99c16241f74a909c792cec3c722a3142a1892197

2 years agores_prometheus: Do not crash on invisible bridges
Holger Hans Peter Freyther [Tue, 20 Sep 2022 00:53:18 +0000 (08:53 +0800)] 
res_prometheus: Do not crash on invisible bridges

Avoid crashing by skipping invisible bridges and checking the
snapshot for a null pointer. In effect this is how the bridges
are enumerated in res/ari/resource_bridges.c already.

ASTERISK-30239
ASTERISK-30237

Change-Id: I58ef9f44036feded5966b5fc70ae754f8182883d

2 years agodb: Fix incorrect DB tree count for AMI.
Naveen Albert [Sat, 24 Sep 2022 12:08:14 +0000 (12:08 +0000)] 
db: Fix incorrect DB tree count for AMI.

The DBGetTree AMI action's ListItem previously
always reported 1, regardless of the count. This
is corrected to report the actual count.

ASTERISK-30245 #close
patches:
  gettreecount.diff submitted by Birger Harzenetter (license 5870)

Change-Id: I46d8992710f1b8524426b1255f57d1ef4a4934d4

2 years agores_pjsip_geolocation: Change some notices to debugs.
Naveen Albert [Mon, 19 Sep 2022 17:35:40 +0000 (17:35 +0000)] 
res_pjsip_geolocation: Change some notices to debugs.

If geolocation is not in use for an endpoint, the NOTICE
log level is currently spammed with messages about this,
even though nothing is wrong and these messages provide
no real value. These log messages are therefore changed
to debugs.

ASTERISK-30241 #close

Change-Id: I656b355d812f67cc0f0fdf09b00b0e1458598bb4

2 years agofunc_logic: Don't emit warning if both IF branches are empty.
Naveen Albert [Wed, 21 Sep 2022 23:17:13 +0000 (23:17 +0000)] 
func_logic: Don't emit warning if both IF branches are empty.

The IF function currently emits warnings if both IF branches
are empty. However, there is no actual necessity that either
branch be non-empty as, unlike other conditional applications/
functions, nothing is inherently done with IF, and both
sides could legitimately be empty. The warning is thus turned
into a debug message.

ASTERISK-30243 #close

Change-Id: I5250625dd720f95e1859b5dfb933905d7e7a730e

2 years agofeatures: Add no answer option to Bridge.
Naveen Albert [Sun, 11 Sep 2022 22:13:02 +0000 (22:13 +0000)] 
features: Add no answer option to Bridge.

Adds the n "no answer" option to the Bridge application
so that answer supervision can not automatically
be provided when Bridge is executed.

Additionally, a mechanism (dialplan variable)
is added to prevent bridge targets (typically the
target of a masquerade) from answering the channel
when they enter the bridge.

ASTERISK-30223 #close

Change-Id: I76f73fcd8e403bcd18f2abb40c658f537ac1ba6d

2 years agoapp_bridgewait: Add option to not answer channel.
Naveen Albert [Fri, 9 Sep 2022 00:12:05 +0000 (00:12 +0000)] 
app_bridgewait: Add option to not answer channel.

Adds the n option to not answer the channel when calling
BridgeWait, so the application can be used without
forcing answer supervision.

ASTERISK-30216 #close

Change-Id: I6b85ef300b1f7b5170f8537e2b10889cc2e6605a

2 years agoapp_amd: Add option to play audio during AMD.
Naveen Albert [Mon, 15 Aug 2022 19:59:02 +0000 (19:59 +0000)] 
app_amd: Add option to play audio during AMD.

Adds an option that will play an audio file
to the party while AMD is running on the
channel, so the called party does not just
hear silence.

ASTERISK-30179 #close

Change-Id: I4af306274552b61b3d9f0883c33f698abd4699b6

2 years agotest: initialize capture structure before freeing
Philip Prindeville [Fri, 16 Sep 2022 03:35:21 +0000 (21:35 -0600)] 
test: initialize capture structure before freeing

ASTERISK-30232 #close

Change-Id: I2603e2cef8f93f6b0a6ef39f7eac744251bb3902

2 years agofunc_export: Add EXPORT function
Naveen Albert [Mon, 17 May 2021 14:19:30 +0000 (10:19 -0400)] 
func_export: Add EXPORT function

Adds the EXPORT function, which allows write
access to variables and functions on other
channels.

ASTERISK-29432 #close

Change-Id: I7492645ae4307553d0f586d78e13a4f586231fdf

2 years agores_pjsip: Add 100rel option "peer_supported".
Maximilian Fridrich [Tue, 26 Jul 2022 13:40:26 +0000 (15:40 +0200)] 
res_pjsip: Add 100rel option "peer_supported".

This patch adds a new option to the 100rel parameter for pjsip
endpoints called "peer_supported". When an endpoint with this option
receives an incoming request and the request indicated support for the
100rel extension, then Asterisk will send 1xx responses reliably. If
the request did not indicate 100rel support, Asterisk sends 1xx
responses normally.

ASTERISK-30158

Change-Id: Id6d95ffa8f00dab118e0b386146e99f254f287ad

2 years agomanager: be more aggressive about purging http sessions.
Jaco Kroon [Mon, 5 Sep 2022 06:59:30 +0000 (08:59 +0200)] 
manager: be more aggressive about purging http sessions.

If we find that n_max (currently hard wired to 1) sessions were purged,
schedule the next purge for 1ms into the future rather than 5000ms (as
per current).  This way we will purge up to 1000 sessions per second
rather than 1 every 5 seconds.

This mitigates a build-up of sessions should http sessions gets
established faster than 1 per 5 seconds.

Change-Id: I9820d39aa080109df44fe98c1325cafae48d54f5
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2 years agofunc_scramble: Fix null pointer dereference.
Naveen Albert [Sat, 10 Sep 2022 15:15:08 +0000 (15:15 +0000)] 
func_scramble: Fix null pointer dereference.

Fix segfault due to null pointer dereference
inside the audiohook callback.

ASTERISK-30220 #close

Change-Id: Ideb80f606974366e89d619d908744230b5a5a259

2 years agofunc_strings: Add trim functions.
Naveen Albert [Sun, 11 Sep 2022 20:40:39 +0000 (20:40 +0000)] 
func_strings: Add trim functions.

Adds TRIM, LTRIM, and RTRIM, which can be used
for trimming leading and trailing whitespace
from strings.

ASTERISK-30222 #close

Change-Id: I50fb0c40726d044a7a41939fa9026f3da4872554

2 years agores_crypto: Memory issues and uninitialized variable errors
George Joseph [Fri, 16 Sep 2022 14:58:40 +0000 (08:58 -0600)] 
res_crypto: Memory issues and uninitialized variable errors

ASTERISK-30235

Change-Id: Ia1e326e7b52cd06fd5e6c9009e3e63193c92f6cd

2 years agores_geolocation: Fix issues exposed by compiling with -O2
George Joseph [Fri, 16 Sep 2022 13:43:00 +0000 (07:43 -0600)] 
res_geolocation: Fix issues exposed by compiling with -O2

Fixed "may be used uninitialized" errors in geoloc_config.c.

ASTERISK-30234

Change-Id: I1ea336bf7abbc16fa59b75720f0db8f1d960b3d4

2 years agores_crypto: don't complain about directories
Philip Prindeville [Tue, 13 Sep 2022 19:41:45 +0000 (13:41 -0600)] 
res_crypto: don't complain about directories

ASTERISK-30226 #close

Change-Id: I5695fb0c9521f112f754b8362cff2a8f3eff05c5

2 years agoUpdate CHANGES and UPGRADE.txt for 19.7.0
Asterisk Development Team [Wed, 14 Sep 2022 14:14:10 +0000 (09:14 -0500)] 
Update CHANGES and UPGRADE.txt for 19.7.0

2 years agores_pjsip: Add user=phone on From and PAID for usereqphone=yes
Mike Bradeen [Mon, 15 Aug 2022 19:30:53 +0000 (13:30 -0600)] 
res_pjsip: Add user=phone on From and PAID for usereqphone=yes

Adding user=phone to local-side uri's when user_eq_phone=yes is set for
an endpoint. Previously this would only add the header to the To and R-URI.

ASTERISK-30178

Change-Id: Id3bfb5d225d762e7d2668c023fe09e4541ae8600

2 years agores_geolocation: Fix segfault when there's an empty element
George Joseph [Tue, 13 Sep 2022 13:14:37 +0000 (07:14 -0600)] 
res_geolocation: Fix segfault when there's an empty element

Fixed a segfault caused by var_list_from_loc_info() encountering
an empty location info element.

Fixed an issue in ast_strsep() where a value with only whitespace
wasn't being preserved.

Fixed an issue in ast_variable_list_from_quoted_string() where
an empty value was considered a failure.

ASTERISK-30215
Reported by: Dan Cropp

Change-Id: Ieca64e061a6d9298f0196c694b60d986ef82613a

2 years agores_musiconhold: Add option to not play music on hold on unanswered channels
sungtae kim [Sat, 13 Aug 2022 16:32:06 +0000 (01:32 +0900)] 
res_musiconhold: Add option to not play music on hold on unanswered channels

This change adds an option, answeredonly, that will prevent music on
hold on channels that are not answered.

ASTERISK-30135

Change-Id: I1ab0defa43a29a26ae39f94c623596cf90fddc08

2 years agores_pjsip: Add TEL URI support for basic calls.
Ben Ford [Tue, 2 Aug 2022 17:15:36 +0000 (12:15 -0500)] 
res_pjsip: Add TEL URI support for basic calls.

This change allows TEL URI requests to come through for basic calls. The
allowed requests are INVITE, ACK, BYE, and CANCEL. The From and To
headers will now allow TEL URIs, as well as the request URI.

Support is only for TEL URIs present in traffic from a remote party.
Asterisk does not generate any TEL URIs on its own.

ASTERISK-26894

Change-Id: If5729e6cd583be7acf666373bf9f1b9d653ec29a

2 years agores_crypto: Use EVP API's instead of legacy API's
Philip Prindeville [Thu, 24 Mar 2022 19:22:05 +0000 (13:22 -0600)] 
res_crypto: Use EVP API's instead of legacy API's

ASTERISK-30046 #close

Change-Id: I5c738756de75fd27ebad54be144c0ac6193f21b2

2 years agotest: Add coverage for res_crypto
Philip Prindeville [Wed, 4 May 2022 00:27:48 +0000 (18:27 -0600)] 
test: Add coverage for res_crypto

We're validating the following functionality:

encrypting a block of data with RSA
decrypting a block of data with RSA
signing a block of data with RSA
verifying a signature with RSA
encrypting a block of data with AES-ECB
encrypting a block of data with AES-ECB

as well as accessing test keys from the keystore.

ASTERISK-30045 #close

Change-Id: I0d10e7b41009c5290a4356c6480e636712d5c96d

2 years agores_crypto: make keys reloadable on demand for testing
Philip Prindeville [Tue, 26 Jul 2022 17:38:32 +0000 (11:38 -0600)] 
res_crypto: make keys reloadable on demand for testing

ASTERISK-30045

Change-Id: If59bbb50c1771084bfe2fef307a6077c90d35ce8

2 years agotest: Add test coverage for capture child process output
Philip Prindeville [Tue, 3 May 2022 18:12:10 +0000 (12:12 -0600)] 
test: Add test coverage for capture child process output

ASTERISK-30037 #close

Change-Id: I0273e85eeeb6b8e46703f24cd74d84f3daf0a69a

2 years agomain/utils: allow checking for command in $PATH
Philip Prindeville [Tue, 26 Jul 2022 19:38:10 +0000 (13:38 -0600)] 
main/utils: allow checking for command in $PATH

ASTERISK-30037

Change-Id: I4b6f7264c8c737c476c798d2352f3232b263bbdf

2 years agotest: Add ability to capture child process output
Philip Prindeville [Tue, 3 May 2022 04:49:54 +0000 (22:49 -0600)] 
test: Add ability to capture child process output

ASTERISK-30037

Change-Id: Icbf84ce05addb197a458361c35d784e460d8d6c2

2 years agores_crypto: Don't load non-regular files in keys directory
Philip Prindeville [Wed, 27 Apr 2022 01:44:32 +0000 (19:44 -0600)] 
res_crypto: Don't load non-regular files in keys directory

ASTERISK-30046

Change-Id: Ie77e0648f8b0b1c2159fb24662d1989cfd4cc36d

2 years agofunc_frame_trace: Remove bogus assertion.
Naveen Albert [Thu, 8 Sep 2022 14:12:34 +0000 (14:12 +0000)] 
func_frame_trace: Remove bogus assertion.

The FRAME_TRACE function currently asserts if it sees
a MASQUERADE_NOTIFY. However, this is a legitimate thing
that can happen so asserting is inappropriate, as there
are no clear negative ramifications of such a thing. This
is adjusted to be like the other frames to print out
the subclass.

ASTERISK-30210 #close

Change-Id: I8ecbdcf17e35f64bdeab42868471f581ad1d1a56

2 years agolock.c: Add AMI event for deadlocks.
Naveen Albert [Wed, 27 Jul 2022 19:54:43 +0000 (19:54 +0000)] 
lock.c: Add AMI event for deadlocks.

Adds an AMI event to indicate that a deadlock
has likely started, when Asterisk is compiled
with DETECT_DEADLOCKS enabled. This can make
it easier to perform automated deadlock detection
and take appropriate action (such as doing a core
dump). Unlike the deadlock warnings, the AMI event
is emitted only once per deadlock.

ASTERISK-30161 #close

Change-Id: Ifc6ed3e390f8b4cff7f8077a50e4d7a5b54e42fb

2 years agoapp_confbridge: Add end_marked_any option.
Naveen Albert [Sun, 4 Sep 2022 19:38:56 +0000 (19:38 +0000)] 
app_confbridge: Add end_marked_any option.

Adds the end_marked_any option, which can be used
to kick a user from a conference if any marked user
leaves.

ASTERISK-30211 #close

Change-Id: I9e8da7ccb892e522546c0f2b5476d172e022c2f5

2 years agores_geolocation: Add two new options to GEOLOC_PROFILE
George Joseph [Thu, 25 Aug 2022 13:00:33 +0000 (07:00 -0600)] 
res_geolocation: Add two new options to GEOLOC_PROFILE

Added an 'a' option to the GEOLOC_PROFILE function to allow
variable lists like location_info_refinement to be appended
to instead of replacing the entire list.

Added an 'r' option to the GEOLOC_PROFILE function to resolve all
variables before a read operation and after a Set operation.

Added a few missing parameters to the ones allowed for writing
with GEOLOC_PROFILE.

Fixed a bug where calling GEOLOC_PROFILE to read a parameter
might actually update the profile object.

Cleaned up XML documentation a bit.

ASTERISK-30190

Change-Id: I75f541db43345509a2e86225bfa4cf8e242e5b6c

2 years agores_geolocation: Allow location parameters on the profile object
George Joseph [Thu, 18 Aug 2022 12:29:09 +0000 (06:29 -0600)] 
res_geolocation:  Allow location parameters on the profile object

You can now specify the location object's format, location_info,
method, location_source and confidence parameters directly on
a profile object for simple scenarios where the location
information isn't common with any other profiles.  This is
mutually exclusive with setting location_reference on the
profile.

Updated appdocsxml.dtd to allow xi:include in a configObject
element.  This makes it easier to link to complete configOptions
in another object.  This is used to add the above fields to the
profile object without having to maintain the option descriptions
in two places.

ASTERISK-30185

Change-Id: Ifd5f05be0a76f0a6ad49fa28d17c394027677569

2 years agores_geolocation: Add profile parameter suppress_empty_ca_elements
George Joseph [Wed, 17 Aug 2022 13:15:00 +0000 (07:15 -0600)] 
res_geolocation: Add profile parameter suppress_empty_ca_elements

Added profile parameter "suppress_empty_ca_elements" that
will cause Civic Address elements that are empty to be
suppressed from the outgoing PIDF-LO document.

Fixed a possible SEGV if a sub-parameter value didn't have a
value.

ASTERISK-30177

Change-Id: I924ccc5aa2f45110a3155b22e53dfaf3ef2092dd

2 years agores_geolocation: Add built-in profiles
George Joseph [Tue, 16 Aug 2022 12:25:10 +0000 (06:25 -0600)] 
res_geolocation:  Add built-in profiles

The trigger to perform outgoing geolocation processing is the
presence of a geoloc_outgoing_call_profile on an endpoint. This
is intentional so as to not leak location information to
destinations that shouldn't receive it.   In a totally dynamic
configuration scenario however, there may not be any profiles
defined in geolocation.conf.  This makes it impossible to do
outgoing processing without defining a "dummy" profile in the
config file.

This commit adds 4 built-in profiles:
  "<prefer_config>"
  "<discard_config>"
  "<prefer_incoming>"
  "<discard_incoming>"
The profiles are empty except for having their precedence
set and can be set on an endpoint to allow processing without
entries in geolocation.conf.  "<discard_config>" is actually the
best one to use in this situation.

ASTERISK-30182

Change-Id: I1819ccfa404ce59802a3a07ad1cabed60fb9480a

2 years agores_pjsip_sdp_rtp: Skip formats without SDP details.
Joshua C. Colp [Tue, 30 Aug 2022 13:01:29 +0000 (10:01 -0300)] 
res_pjsip_sdp_rtp: Skip formats without SDP details.

When producing an outgoing SDP we iterate through the configured
formats and produce SDP information. It is possible for some
configured formats to not have SDP information available. If this
is the case we skip over them to allow the SDP to still be
produced.

ASTERISK-29185

Change-Id: I3e37569aa4ca341260e6ca5904dc2f75e46a1749

2 years agocli: Prevent assertions on startup from bad ao2 refs.
Naveen Albert [Tue, 3 May 2022 12:53:28 +0000 (12:53 +0000)] 
cli: Prevent assertions on startup from bad ao2 refs.

If "core show channels" is run before startup has completed, it
is possible for bad ao2 refs to occur because the system is not
yet fully initialized. This will lead to an assertion failing.

To prevent this, initialization of CLI builtins is moved to be
later along in the main load sequence. Core CLI commands are
loaded at the same time, but channel-related commands are loaded
later on.

ASTERISK-29846 #close

Change-Id: If6b3cde802876bd738c1b4cf2683bea6ddc615b6

2 years agopjsip: Add TLS transport reload support for certificate and key.
Joshua C. Colp [Fri, 19 Aug 2022 13:24:33 +0000 (10:24 -0300)] 
pjsip: Add TLS transport reload support for certificate and key.

This change adds support using the pjsip_tls_transport_restart
function for reloading the TLS certificate and key, if the filenames
remain unchanged. This is useful for Let's Encrypt and other
situations. Note that no restart of the transport will occur if
the certificate and key remain unchanged.

ASTERISK-30186

Change-Id: I9bc95a6bf791830a9491ad9fa43c17d4010028d0

2 years agores_tonedetect: Fix typos referring to wrong variables.
Naveen Albert [Thu, 25 Aug 2022 11:51:03 +0000 (11:51 +0000)] 
res_tonedetect: Fix typos referring to wrong variables.

Fixes two typos that cause fax detection to not work.
One refers to the wrong frame variable, and the other
refers to the subclass.integer instead of the frametype
as it should.

ASTERISK-30192 #close

Change-Id: I7b35fdb7bcf25a29a212eee37c20812c64ab3ef1

2 years agoalembic: add missing ps_endpoints columns
Mike Bradeen [Wed, 17 Aug 2022 18:30:21 +0000 (12:30 -0600)] 
alembic: add missing ps_endpoints columns

The following required columns were missing,
now added to the ps_endpoints table:

incoming_call_offer_pref
outgoing_call_offer_pref
stir_shaken_profile

ASTERISK-29453

Change-Id: I5cf565edf30195844d6acbc1e1de8c5f0d837568

2 years agochan_dahdi.c: Resolve a format-truncation build warning.
Sean Bright [Fri, 19 Aug 2022 16:02:07 +0000 (12:02 -0400)] 
chan_dahdi.c: Resolve a format-truncation build warning.

With gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0:

> chan_dahdi.c:4129:18: error: ā€˜%s’ directive output may be truncated
>   writing up to 255 bytes into a region of size between 242 and 252
>   [-Werror=format-truncation=]

This removes the error-prone sizeof(...) calculations in favor of just
doubling the size of the base buffer.

Change-Id: I2d276785286730d3d5d0a921bcea2e065dbf27c5

2 years agores_pjsip_pubsub: Postpone destruction of old subscriptions on RLS update
Alexei Gradinari [Wed, 3 Aug 2022 14:55:47 +0000 (10:55 -0400)] 
res_pjsip_pubsub: Postpone destruction of old subscriptions on RLS update

Set termination state to old subscriptions to prevent queueing and sending
NOTIFY messages on exten/device state changes.

Postpone destruction of old subscriptions until all already queued tasks
that may be using old subscriptions have completed.

ASTERISK-29906

Change-Id: I96582aad3a26515ca73a8460ee6756f56f6ba23b

2 years agochannel.h: Remove redundant declaration.
Sean Bright [Mon, 15 Aug 2022 12:34:35 +0000 (08:34 -0400)] 
channel.h: Remove redundant declaration.

The DECLARE_STRINGFIELD_SETTERS_FOR() declares ast_channel_name_set()
for us, so no need to declare it separately.

Change-Id: I4813a884ada475ddc62bca480bceb4a53b3ec59a

2 years agofeatures: Add transfer initiation options.
Naveen Albert [Sat, 5 Feb 2022 12:13:56 +0000 (12:13 +0000)] 
features: Add transfer initiation options.

Adds additional control options over the transfer
feature functionality to give users more control
in how the transfer feature sounds and works.

First, the "transfer" sound that plays when a transfer is
initiated can now be customized by the user in
features.conf, just as with the other transfer sounds.

Secondly, the user can now specify the transfer extension
in advance by using the TRANSFER_EXTEN variable. If
a valid extension is contained in this variable, the call
will automatically be transferred to this destination.
Otherwise, it will fall back to collecting the extension
from the user as is always done now.

ASTERISK-29899 #close

Change-Id: Ibff309caa459a2b958706f2ed0ca393b1ef502e3

2 years agoCI: Fixing path issue on venv check
Mike Bradeen [Wed, 31 Aug 2022 19:16:12 +0000 (13:16 -0600)] 
CI: Fixing path issue on venv check

ASTERISK-26826

Change-Id: I07388d16f74452cebc9c981f99044eb6b77df792

2 years agoCI: use Python3 virtual environment
Mike Bradeen [Thu, 11 Aug 2022 18:39:06 +0000 (12:39 -0600)] 
CI: use Python3 virtual environment

Requires Python3 testsuite changes

ASTERISK-26826

Change-Id: I92ec7dec751ad455503a584d6e860db88c56d6bc

2 years agogeneral: Very minor coding guideline fixes.
Naveen Albert [Thu, 28 Jul 2022 21:12:09 +0000 (21:12 +0000)] 
general: Very minor coding guideline fixes.

Fixes a few coding guideline violations:
* Use of C99 comments
* Opening brace on same line as function prototype

ASTERISK-30163 #close

Change-Id: I07771c4c89facd41ce8d323859f022ddbddf6ca7

2 years agoUpdate CHANGES and UPGRADE.txt for 19.6.0
Asterisk Development Team [Thu, 11 Aug 2022 15:52:26 +0000 (10:52 -0500)] 
Update CHANGES and UPGRADE.txt for 19.6.0

2 years agores_geolocation: Address user issues, remove complexity, plug leaks
George Joseph [Fri, 5 Aug 2022 13:50:49 +0000 (07:50 -0600)] 
res_geolocation: Address user issues, remove complexity, plug leaks

* Added processing for the 'confidence' element.
* Added documentation to some APIs.
* removed a lot of complex code related to the very-off-nominal
  case of needing to process multiple location info sources.
* Create a new 'ast_geoloc_eprofile_to_pidf' API that just takes
  one eprofile instead of a datastore of multiples.
* Plugged a huge leak in XML processing that arose from
  insufficient documentation by the libxml/libxslt authors.
* Refactored stylesheets to be more efficient.
* Renamed 'profile_action' to 'profile_precedence' to better
  reflect it's purpose.
* Added the config option for 'allow_routing_use' which
  sets the value of the 'Geolocation-Routing' header.
* Removed the GeolocProfileCreate and GeolocProfileDelete
  dialplan apps.
* Changed the GEOLOC_PROFILE dialplan function as follows:
  * Removed the 'profile' argument.
  * Automatically create a profile if it doesn't exist.
  * Delete a profile if 'inheritable' is set to no.
* Fixed various bugs and leaks
* Updated Asterisk WiKi documentation.

ASTERISK-30167

Change-Id: If38c23f26228e96165be161c2f5e849cb8e16fa0

2 years agochan_iax2: Add missing options documentation.
Naveen Albert [Sat, 30 Jul 2022 21:15:34 +0000 (21:15 +0000)] 
chan_iax2: Add missing options documentation.

Adds missing dial resource option documentation.

ASTERISK-30164 #close

Change-Id: I674e1fc9b1e5d67a20599bd4b418ce294d48fc83