]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
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

2 years agoapp_confbridge: Fix memory leak on updated menu options.
Naveen Albert [Mon, 1 Aug 2022 00:30:00 +0000 (00:30 +0000)] 
app_confbridge: Fix memory leak on updated menu options.

If the CONFBRIDGE function is used to dynamically set
menu options, a memory leak occurs when a menu option
that has been set is overridden, since the menu entry
is not destroyed before being freed. This ensures that
it is.

Additionally, logic that duplicates the destroy function
is removed in lieu of the destroy function itself.

ASTERISK-28422 #close

Change-Id: I71cfb5c24e636984d41086d1333a416dc12ff995

3 years agoGeolocation: Wiki Documentation
George Joseph [Tue, 19 Jul 2022 14:05:53 +0000 (08:05 -0600)] 
Geolocation: Wiki Documentation

Change-Id: I68ba22db0a69d9e2eabcc2141b48a2395f7f1a23

3 years agomanager: Remove documentation for nonexistent action.
Naveen Albert [Thu, 28 Jul 2022 11:10:35 +0000 (11:10 +0000)] 
manager: Remove documentation for nonexistent action.

The manager XML documentation documents a "FilterList"
action, but there is no such action. Therefore, this can
lead to confusion when people try to use a documented
action that does not, in fact, exist. This is removed
as the action never did exist in the past, nor would it
be trivial to add since we only store the regex_t
objects, so the filter list can't actually be provided
without storing that separately. Most likely, the
documentation was originally added (around version 10)
in anticipation of something that never happened.

ASTERISK-29917 #close

Change-Id: I846b16fd6f80a91d4ddc5d8a861b522d7c6f8f97

3 years agoapp_confbridge: Add missing AMI documentation.
Naveen Albert [Sat, 23 Jul 2022 23:14:15 +0000 (23:14 +0000)] 
app_confbridge: Add missing AMI documentation.

Documents the ConfbridgeListRooms AMI response,
which is currently not documented.

ASTERISK-30020 #close

Change-Id: Id6fff7a936244bae7b52686301eb740c1169cdea

3 years agogeneral: Improve logging levels of some log messages.
Naveen Albert [Fri, 22 Jul 2022 20:57:05 +0000 (20:57 +0000)] 
general: Improve logging levels of some log messages.

Adjusts some logging levels to be more or less important,
that is more prominent when actual problems occur and less
prominent for less noteworthy things.

ASTERISK-30153 #close

Change-Id: Ifc8f7df427aa018627db462125ae744986d3261b

3 years agocdr.conf: Remove obsolete app_mysql reference.
Naveen Albert [Wed, 27 Jul 2022 18:34:57 +0000 (18:34 +0000)] 
cdr.conf: Remove obsolete app_mysql reference.

The CDR sample config still mentions that app_mysql
is available in the addons directory, but this is
incorrect as it was removed as of 19. This removes
that to avoid confusion.

ASTERISK-30160 #close

Change-Id: Ie5293ccb4f2b365896981811b480544e67bb9cd7

3 years agogeneral: Remove obsolete SVN references.
Naveen Albert [Wed, 27 Jul 2022 18:28:47 +0000 (18:28 +0000)] 
general: Remove obsolete SVN references.

There are a handful of files in the tree that
reference an SVN link for the coding guidelines.

This removes these because the links are dead
and the vast majority of source files do not
contain these links, so this is more consistent.

app_skel still maintains an (up to date) link
to the coding guidelines.

ASTERISK-30159 #close

Change-Id: I35bbb20f66982e98099cff3029ede20091ffdac7

3 years agoapp_meetme: Add missing AMI documentation.
Naveen Albert [Sat, 23 Jul 2022 23:07:18 +0000 (23:07 +0000)] 
app_meetme: Add missing AMI documentation.

The MeetmeList and MeetmeListRooms AMI
responses are currently completely undocumented.
This adds documentation for these responses.

ASTERISK-30018 #close

Change-Id: Id93135b7edf01de6f8fba266e2122989dc8996b8

3 years agofunc_srv: Document field parameter.
Naveen Albert [Sat, 23 Jul 2022 22:37:17 +0000 (22:37 +0000)] 
func_srv: Document field parameter.

Adds missing documentation for the field parameter
for the SRVRESULT function.

ASTERISK-30151
Reported by: Chris Young

Change-Id: I4385a2e0892a07e30dea1a8a0588e2c1bea2b1f1

3 years agoUpdate CHANGES and UPGRADE.txt for 19.6.0
Asterisk Development Team [Thu, 28 Jul 2022 15:42:21 +0000 (10:42 -0500)] 
Update CHANGES and UPGRADE.txt for 19.6.0

3 years agopbx_functions.c: Manually update ast_str strlen.
Naveen Albert [Sat, 23 Jul 2022 22:17:28 +0000 (22:17 +0000)] 
pbx_functions.c: Manually update ast_str strlen.

When ast_func_read2 is used to read a function using
its read function (as opposed to a native ast_str read2
function), the result is copied directly by the function
into the ast_str buffer. As a result, the ast_str length
remains initialized to 0, which is a bug because this is
not the real string length.

This can cascade and have issues elsewhere, such as when
reading substrings of functions that only register read
as opposed to read2 callbacks. In this case, since reading
ast_str_strlen returns 0, the returned substring is empty
as opposed to the actual substring. This has caused
the ast_str family of functions to behave inconsistently
and erroneously, in contrast to the pbx_variables substitution
functions which work correctly.

This fixes this issue by manually updating the ast_str length
when the result is copied directly into the ast_str buffer.

Additionally, an assertion and a unit test that previously
exposed these issues are added, now that the issue is fixed.

ASTERISK-29966 #close

Change-Id: I4e2dba41410f9d4dff61c995d2ca27718248e07f

3 years agobuild: fix bininstall launchd issue on cross-platform build
Sergey V. Lobanov [Fri, 18 Feb 2022 21:59:02 +0000 (00:59 +0300)] 
build: fix bininstall launchd issue on cross-platform build

configure script detects /sbin/launchd, but the result of this
check is not used in Makefile (bininstall). Makefile also detects
/sbin/launchd file to decide if it is required to install
safe_asterisk.

configure script correctly detects cross compile build and sets
PBX_LAUNCHD=0

In case of building asterisk on MacOS host for Linux target using
external toolchain (e.g. OpenWrt toolchain), bininstall does not
install safe_asterisk (due to /sbin/launchd detection in Makefile),
but it is required on target (Linux).

This patch adds HAVE_SBIN_LAUNCHD=@PBX_LAUNCHD@ to makeopts.in to
use the result of /sbin/launchd detection from configure script in
Makefile.
Also this patch uses HAVE_SBIN_LAUNCHD in Makefile (bininstall) to
decide if it is required to install safe_asterisk.

ASTERISK-29905 #close

Change-Id: Iff61217276cd188f43f51ef4cdbffe39d9f07f65

3 years agodb: Add AMI action to retrieve DB keys at prefix.
Naveen Albert [Mon, 11 Jul 2022 11:32:39 +0000 (11:32 +0000)] 
db: Add AMI action to retrieve DB keys at prefix.

Adds the DBGetTree action, which can be used to
retrieve all of the DB keys beginning with a
particular prefix, similar to the capability
provided by the database show CLI command.

ASTERISK-30136 #close

Change-Id: I3be9425e53be71f24303fdd4d2923c14e84337e6

3 years agomanager: Fix incomplete filtering of AMI events.
Naveen Albert [Tue, 12 Jul 2022 21:38:12 +0000 (21:38 +0000)] 
manager: Fix incomplete filtering of AMI events.

The global event filtering code was only in one
possible execution path, so not all events were
being properly filtered out if requested. This moves
that into the universal AMI handling code so all
events are properly handled.

Additionally, the CLI listing of disabled events can
also get truncated, so we now print out everything.

ASTERISK-30137 #close

Change-Id: If8c42edcb2abc5158552da7eba2a8ff6b20e1959

3 years agores_pjsip: delay contact pruning on Asterisk start
Michael Neuhauser [Tue, 14 Jun 2022 09:12:47 +0000 (11:12 +0200)] 
res_pjsip: delay contact pruning on Asterisk start

Move the call to ast_sip_location_prune_boot_contacts() *after* the call
to ast_res_pjsip_init_options_handling() so that
res/res_pjsip/pjsip_options.c is informed about the contact deletion and
updates its sip_options_contact_statuses list. This allows for an AMI
event to be sent by res/res_pjsip/pjsip_options.c if the endpoint
registers again from the same remote address and port (i.e., same URI)
as used before the Asterisk restart.

ASTERISK-30109
Reported-by: Michael Neuhauser
Change-Id: I1ba4478019e4931a7085f62708d9b66837e901a8

3 years agoqueues.conf.sample: Correction of typo
Sam Banks [Sun, 10 Jul 2022 22:31:13 +0000 (10:31 +1200)] 
queues.conf.sample: Correction of typo

ASTERISK-30126 #close

Change-Id: I009c4dcbf9338a13e3baf87b52a5bbe4f9f81a42

3 years agochan_dahdi: Add POLARITY function.
Naveen Albert [Fri, 1 Apr 2022 20:17:15 +0000 (20:17 +0000)] 
chan_dahdi: Add POLARITY function.

Adds a POLARITY function which can be used to
retrieve the current polarity of an FXS channel
as well as set the polarity of an FXS channel
to idle or reverse at any point during a call.

ASTERISK-30000 #close

Change-Id: If6f50998f723e4484bf68e2473f5cedfeaf9b8f1

3 years agochan_dahdi: Fix buggy and missing Caller ID parameters
Naveen Albert [Tue, 29 Mar 2022 01:35:43 +0000 (01:35 +0000)] 
chan_dahdi: Fix buggy and missing Caller ID parameters

There are several things wrong with analog Caller ID
handling that are fixed by this commit:

callerid.c's Caller ID generation function contains the
logic to use the presentation to properly send the proper
Caller ID. However, currently, DAHDI does not pass any
presentation information to the Caller ID module, which
means that presentation is completely ignored on all calls.
This means that lines could be getting Caller ID information
they aren't supposed to.

Part of the reason this has been obscured is because the
simple switch logic for handling the built in *67 and *82
is completely wrong. Rather than modifying the presentation
for the call accordingly (which is what it's supposed to do),
it simply blanks out the Caller ID or fills it in. This is
wrong, so wrong that it makes a mockery of the specification.
Additionally, it would leave to the "UNAVAILABLE" disposition
being used for Caller ID generation as opposed to the "PRIVATE"
disposition that it should have been using. This is now fixed
to only update the presentation and not modify the number and
name, so that the simple switch *67/*82 work correctly.

Next, sig_analog currently only copies over the name and number,
nothing else, when it is filling in a duplicated caller id
structure. Thus, we also now copy over the presentation
information so that is available for the Caller ID spill.
Additionally, this meant that "valid" was implicitly 0,
and as such presentation would always fail to "Unavailable".
The validity is therefore also copied over so it can be used
by ast_party_id_presentation.

As part of this fix, new API is added so that all the relevant
Caller ID information can be passed in to the Caller ID generation
functions. Parameters that are also completely missing from the
Caller ID spill have also been added, to enhance the compatibility,
correctness, and completeness of the Asterisk Caller ID implementation.

ASTERISK-29991 #close

Change-Id: Icc44a5e09979916f4c18a440f96e10dc1c76ae15

3 years agoMakefile: Avoid git-make user conflict
Mike Bradeen [Thu, 2 Jun 2022 02:03:06 +0000 (20:03 -0600)] 
Makefile: Avoid git-make user conflict

make_version now silently checks if the required git commands will
fail.  If they do, then return UNKNOWN__git_check_fail to
distinguish this failure from other UNKNOWN__ version failures

Makefile checks for this value on install and exits out with
instructions

ASTERISK-30029

Change-Id: If8f10cac8f509c08981120f17555762342020221

3 years agoapp_confbridge: Always set minimum video update interval.
Naveen Albert [Sat, 18 Jun 2022 12:17:50 +0000 (12:17 +0000)] 
app_confbridge: Always set minimum video update interval.

Currently, if multiple video-enabled ConfBridges are
conferenced together, we immediately get into a scenario
where an infinite sequence of video updates fills up
the taskprocessor queue and causes memory consumption
to climb unabated until Asterisk is killed. This is due
to the core bridging mechanism that provides video updates
(softmix_bridge_write_control in bridge_softmix.c)
continously updating all the channels in the bridge with
video updates.

The logic to do so in the core is that the video updates
should be provided if the video_update_discard property
for the bridge is 0, or if enough time has elapsed since
the last video update. Thus, we already have a safeguard
built in to ensure the scenario described above does not
happen. Currently, however, this safeguard is not being
adequately ensured.

In app_confbridge, the video_update_discard property
defaults to 2000, which is a healthy value that should
completely prevent this issue. However, this value is
only set onto the bridge in the SFU video mode. This
leaves video modes such as follow_talker completely
vulnerable, since video_update_discard will actually
be 0, since the default or set value was never applied.
As a result, the core bridging mechanism will always
try to provide video updates regardless of when the last
one was sent.

To prevent this issue from happening, we now always
set the video_update_discard property on the bridge
with the value from the bridge profile. The app_confbridge
defaults will thus ensure that infinite video updates
no longer happen in any video mode.

ASTERISK-29907 #close

Change-Id: I4accb2536ac62797950468e9930f12ef7dd486b2

3 years agopbx.c: Simplify ast_context memory management.
Sean Bright [Tue, 5 Jul 2022 15:24:58 +0000 (11:24 -0400)] 
pbx.c: Simplify ast_context memory management.

Allocate all of the ast_context's character data in the structure's
flexible array member and eliminate the clunky fake_context. This will
simplify future changes to ast_context.

Change-Id: I98357de75d8ac2b3c4c9f201223632e6901021ea

3 years agogeoloc_eprofile.c: Fix setting of loc_src in set_loc_src()
George Joseph [Wed, 13 Jul 2022 18:38:10 +0000 (12:38 -0600)] 
geoloc_eprofile.c: Fix setting of loc_src in set_loc_src()

line 196:    loc_src = '\0';
should have been
line 196:    *loc_src = '\0';

The issue was caught by the gcc optimizer complaining that
loc_src had a zero length because the pointer itself was being
set to NULL instead of the _contents_ of the pointer being set
to the NULL terminator.

ASTERISK-30138
Reported-by: Sean Bright
Change-Id: Id247be113cc8510f043ca053d5b4f5f3d32acd29

3 years agoGeolocation: chan_pjsip Capability Preview
George Joseph [Thu, 7 Jul 2022 15:32:38 +0000 (09:32 -0600)] 
Geolocation:  chan_pjsip Capability Preview

This commit adds res_pjsip_geolocation which gives chan_pjsip
the ability to use the core geolocation capabilities.

This commit message is intentionally short because this isn't
a simple capability.  See the documentation at
https://wiki.asterisk.org/wiki/display/AST/Geolocation
for more information.

THE CAPABILITIES IMPLEMENTED HERE MAY CHANGE BASED ON
USER FEEDBACK!

ASTERISK-30128

Change-Id: Ie2e2bcd87243c2cfabc43eb823d4427c7086f4d9

3 years agoGeolocation: Core Capability Preview
George Joseph [Tue, 15 Feb 2022 13:29:50 +0000 (06:29 -0700)] 
Geolocation:  Core Capability Preview

This commit adds res_geolocation which creates the core capabilities
to manipulate Geolocation information on SIP INVITEs.

An upcoming commit will add res_pjsip_geolocation which will
allow the capabilities to be used with the pjsip channel driver.

This commit message is intentionally short because this isn't
a simple capability.  See the documentation at
https://wiki.asterisk.org/wiki/display/AST/Geolocation
for more information.

THE CAPABILITIES IMPLEMENTED HERE MAY CHANGE BASED ON
USER FEEDBACK!

ASTERISK-30127

Change-Id: Ibfde963121b1ecf57fd98ee7060c4f0808416303

3 years agogeneral: Fix various typos.
Naveen Albert [Wed, 1 Jun 2022 00:49:12 +0000 (00:49 +0000)] 
general: Fix various typos.

ASTERISK-30089 #close

Change-Id: I1f5db911fd05a3a211c522c13e990fa1d0e62275

3 years agocel_odbc & res_config_odbc: Add support for SQL_DATETIME field type
Kevin Harwell [Mon, 6 Jun 2022 20:09:44 +0000 (15:09 -0500)] 
cel_odbc & res_config_odbc: Add support for SQL_DATETIME field type

See also: ASTERISK_30023

ASTERISK-30096 #close
patches:
  inline on issue - submitted by Morvai Szabolcs

Change-Id: I79c0b74862100acd9c8319dca5cc456a654d02eb

3 years agochan_iax2: Allow compiling without OpenSSL.
Naveen Albert [Mon, 4 Jul 2022 10:21:24 +0000 (10:21 +0000)] 
chan_iax2: Allow compiling without OpenSSL.

ASTERISK_30007 accidentally made OpenSSL a
required depdendency. This adds an ifdef so
the relevant code is compiled only if OpenSSL
is available, since it only needs to be executed
if OpenSSL is available anyways.

ASTERISK-30083 #close

Change-Id: Iad05c1a9a8bd2a48e7edf8d234eaa9f80779e34d

3 years agowebsocket / aeap: Handle poll() interruptions better.
Joshua C. Colp [Tue, 28 Jun 2022 11:59:40 +0000 (08:59 -0300)] 
websocket / aeap: Handle poll() interruptions better.

A sporadic test failure was happening when executing the AEAP
Websocket transport tests. It was originally thought this was
due to things not getting cleaned up fast enough, but upon further
investigation I determined the underlying cause was poll()
getting interrupted and this not being handled in all places.

This change adds EINTR and EAGAIN handling to the Websocket
client connect code as well as the AEAP Websocket transport code.
If either occur then the code will just go back to waiting
for data.

The originally disabled failure test case has also been
re-enabled.

ASTERISK-30099

Change-Id: I1711a331ecf5d35cd542911dc6aaa9acf1e172ad

3 years agores_cliexec: Add dialplan exec CLI command.
Naveen Albert [Sat, 14 May 2022 21:25:04 +0000 (21:25 +0000)] 
res_cliexec: Add dialplan exec CLI command.

Adds a CLI command similar to "dialplan eval function" except for
applications: "dialplan exec application", useful for quickly
testing certain application behavior directly from the CLI
without writing any dialplan.

ASTERISK-30062 #close

Change-Id: I42e9fa9b60746c21450d40f99a026d48d2486dde

3 years agofeatures: Update documentation for automon and automixmon
Trevor Peirce [Sun, 3 Jul 2022 21:29:44 +0000 (14:29 -0700)] 
features: Update documentation for automon and automixmon

The current documentation is out of date and does not reflect actual
behaviour.  This change makes documentation clearer and accurately
reflect the purpose of relevant channel variables.

ASTERISK-30123

Change-Id: I160d0b01fce862477ad55ac1aa708a730473eb6f

3 years agoGeolocation: Base Asterisk Prereqs
George Joseph [Mon, 27 Jun 2022 17:31:04 +0000 (11:31 -0600)] 
Geolocation: Base Asterisk Prereqs

* Added ast_variable_list_from_quoted_string()
  Parse a quoted string into an ast_variable list.

* Added ast_str_substitute_variables_full2()
  Perform variable/function/expression substitution on an ast_str.

* Added ast_strsep_quoted()
  Like ast_strsep except you can specify a specific quote character.
  Also added unit test.

* Added ast_xml_find_child_element()
  Find a direct child element by name.

* Added ast_xml_doc_dump_memory()
  Dump the specified document to a buffer

* ast_datastore_free() now checks for a NULL datastore
  before attempting to destroy it.

Change-Id: I5dcefed2f5f93a109e8b489e18d80d42e45244ec

3 years agopbx_lua: Remove compiler warnings
Boris P. Korzun [Fri, 24 Jun 2022 11:09:43 +0000 (14:09 +0300)] 
pbx_lua: Remove compiler warnings

Improved variable definitions (specified correct type) for avoiding
compiler warnings.

ASTERISK-30117 #close

Change-Id: I3b00c1befb658ee9379ddabd9a9132765ca9201a