]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
5 years agores_rtp_asterisk: Re-order RTP destruction.
Joshua C. Colp [Sun, 31 May 2020 22:10:29 +0000 (19:10 -0300)] 
res_rtp_asterisk: Re-order RTP destruction.

The destructor for RTP deallocated transport resources
before terminating the ICE support. This could result
in a crash as the thread handling ICE would access already
freed parts of the RTP data.

This change re-orders the destruction so that ICE is
stopped before destroying things.

ASTERISK-28885

Change-Id: Ie71add549f12b6cdea7e9dbf976d1bd1d2fc0bdc

5 years agores_pjsip_logger.c: correct the return value checks when writing to pcap
Pirmin Walthert [Fri, 29 May 2020 09:28:57 +0000 (11:28 +0200)] 
res_pjsip_logger.c: correct the return value checks when writing to pcap
files

fwrite() does return the number of elements written and not the
number of bytes. However asterisk is currently comparing the return
value to the size of the written element what means that asterisk logs
five WARNING messages on every packet written to the pcap file.

This patch changes the code to check for the correct value, which will
always be 1.

ASTERISK-28921 #close

Change-Id: I2455032d9cb4c5a500692923f9e2a22e68b08fc2

5 years agoUpdate CHANGES and UPGRADE.txt for 13.34.0
Asterisk Development Team [Thu, 28 May 2020 12:05:36 +0000 (07:05 -0500)] 
Update CHANGES and UPGRADE.txt for 13.34.0

5 years agores_pjsip: Use correct pool for storing the contact_user value.
Joshua C. Colp [Wed, 27 May 2020 14:35:42 +0000 (11:35 -0300)] 
res_pjsip: Use correct pool for storing the contact_user value.

When replacing the user portion of the Contact URI the code
was using the ephemeral pool instead of the tdata pool. This
could cause the Contact user value to become invalid after a
period of time.

The code will now use the tdata pool which persists for the
lifetime of the message instead.

ASTERISK-28794

Change-Id: I31e7b958e397cbdaeedd0ebb70bcf8dd2ed3c4d5

5 years agores_pjsip_nat.c: remove x-ast-orig-host from request URI and To header
Pirmin Walthert [Wed, 13 May 2020 12:06:19 +0000 (14:06 +0200)] 
res_pjsip_nat.c: remove x-ast-orig-host from request URI and To header

While asterisk is filtering out the x-ast-orig-host parameter from the
contact on response messages, it is not filtering it out from the
request URI and the to header on SIP requests (for example INVITE).

ASTERISK-28884 #close

Change-Id: Id032b33098a1befea9b243ca994184baecccc59e

5 years agores_sorcery_config: Always reload configuration on errors.
Joshua C. Colp [Tue, 19 May 2020 12:55:32 +0000 (09:55 -0300)] 
res_sorcery_config: Always reload configuration on errors.

When a configuration file in Asterisk is loaded
information about it is stored such that on a
reload it is not reloaded if nothing has changed.
This can be problematic when an error exists in
a configuration file in PJSIP since the error
will be output at start and not subsequently on
reload if the file is unchanged.

This change makes it so that if an error is
encountered when res_sorcery_config is loading
a configuration file a reload will always read
in the configuration file, allowing the error
to be seen easier.

Change-Id: If2e05a017570f1f5f4f49120da09601e9ecdf9ed

5 years agobridge_softmix: Always remove audio from mixed frame.
Joshua C. Colp [Tue, 19 May 2020 09:18:58 +0000 (06:18 -0300)] 
bridge_softmix: Always remove audio from mixed frame.

When receiving audio from a channel we determine if it
is talking or silence based on a threshold value. If
this threshold is met we always mix the audio into the
conference bridge. If this threshold is not met we also
mix the audio into the conference bridge UNLESS the
drop silence option is enabled.

The code that removed the audio from the mixed frame
assumed that it was always not present if it did not
meet the threshold to be considered talking. This is
incorrect. If it has been stated that the audio was
mixed into the mixed frame then it has been mixed into
the mixed frame. By not removing audio that was
considered non-talking it was possible for a channel
to receive a slight echo of audio of itself at times.

This change ensures that the audio is always removed
from the mixed frame going back to the channel so it
no longer receives the slight echo.

ASTERISK-28898

Change-Id: I7b1b582cc1bcdb318ecc60c9d2e3d87ae31d55cb

5 years agores_pjsip_logger: Expand functionality to improve logging.
Joshua C. Colp [Thu, 30 Apr 2020 22:57:08 +0000 (19:57 -0300)] 
res_pjsip_logger: Expand functionality to improve logging.

The PJSIP packet logger now has the following CLI commands:

pjsip set logger pcap <filename>

When used this will create a pcap file containing the incoming
and outgoing SIP packets, in unencrypted form.

pjsip set logger verbose <on / off>

This allows you to toggle logging to verbose on and off.

pjsip set logger host <IP/subnet mask> add

This allows you to add an additional IP address or subnet
mask to logging, allowing you to log multiple instead of
just a single IP address or all traffic.

The normal "pjsip set logger host" CLI command has also been
expanded to allow subnet masks as well.

ASTERISK-28895

Change-Id: If5859161a72b0d7dd2d1f92d45bed88e0cd07d0e

5 years agores_rtp_asterisk.c: Fixed memory leak
sungtae kim [Mon, 18 May 2020 16:31:58 +0000 (16:31 +0000)] 
res_rtp_asterisk.c: Fixed memory leak

Added freeifaddrs() for memory releasing.

ASTERISK-28904

Change-Id: I109403866e85a30659351946903a679de9727a8f

5 years agopjproject: Fix race condition when building with parallel make
Guido Falsi [Fri, 8 May 2020 11:11:47 +0000 (13:11 +0200)] 
pjproject: Fix race condition when building with parallel make

Pjproject makefiles miss some dependencies which can cause race
conditions when building with parallel make processes. This patch
adds such dependencies correctly.

ASTERISK-28879 #close
Reported-by: Dmitry Wagin <dmitry.wagin@ya.ru>
Change-Id: Ie1b0dc365dafe4a84c5248097fe8d73804043c22

5 years agores_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered.
Roger James [Sat, 9 May 2020 07:46:51 +0000 (08:46 +0100)] 
res_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered.

Changed source and destination address fields in struct
pjsip_history_entry so that they are long enough to hold an IPv6
address.

ASTERISK-28854

Change-Id: Id65bb9aa961e9ecbcb500815e18170f774e34d3e

5 years agotcptls: Fix notice when TLS is enabled but not supported.
traud [Wed, 1 Apr 2020 13:50:28 +0000 (15:50 +0200)] 
tcptls: Fix notice when TLS is enabled but not supported.

ASTERISK-28797

Change-Id: Iab364a2c2519fd9d11d1c28293fda43d61b64c28

5 years agoapp_osplookup: Avoid a format truncation.
traud [Sat, 4 Apr 2020 09:28:06 +0000 (11:28 +0200)] 
app_osplookup: Avoid a format truncation.

Ensure that output buffers for the osp_convert_inout
function have sufficient space for additional data
such as brackets and ports.

ASTERISK-28804

Change-Id: Ie54c8241ff0cc653910539c2db00ff2a4869750b

5 years agoapp.c: make sure that no non-async-signal-safe syscalls are used after
Pirmin Walthert [Tue, 14 Apr 2020 16:02:19 +0000 (18:02 +0200)] 
app.c: make sure that no non-async-signal-safe syscalls are used after
fork before exec

Posix does only allow async-signal-safe syscalls after fork before exec.
As asterisk ignores this, functions like TrySystem or System sometimes
end up in a deadlocked child process. The patch prevents the use of
non-async-signal-safe syscalls.

ASTERISK-28776

Change-Id: Idc76365c0592ee3f3b3bd72a4f48f7a098978e8e

5 years agoapp_queue: track masquerades in app_queue to avoid leaked stasis subscriptions
Nathan Bruning [Wed, 8 Apr 2020 23:41:55 +0000 (01:41 +0200)] 
app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions

Add a new "masquarade" channel event, and use it in app_queue to track unique id's.

Testcase is submitted as https://gerrit.asterisk.org/c/testsuite/+/14210

ASTERISK-28829 #close
ASTERISK-25844 #close

Change-Id: Ifc5f9f9fd70903f3c6e49738d3bc632b085d2df6

5 years agopjproject: Remove bashism from configure.m4 script
Guido Falsi [Sun, 3 May 2020 10:30:15 +0000 (12:30 +0200)] 
pjproject: Remove bashism from configure.m4 script

The configure.m4 script for pjproject contains some += syntax, which
is specific to bash, replacing it with string substitutions makes
the script compatible with traditional Bourne shells.

ASTERISK-28866 #close
Reported-by: Christoph Moench-Tegeder <cmt@FreeBSD.org>
Change-Id: I382a78160e028044598b7da83ec7e1ff42b91c05

5 years agoRemove #include <sys/cdefs.h>
Jaco Kroon [Mon, 4 May 2020 08:29:44 +0000 (10:29 +0200)] 
Remove #include <sys/cdefs.h>

These are not provided by standards, and as a result causes failure to
compile on musl.

https://wiki.musl-libc.org/faq.html#Q:-When-compiling-something-against-musl,-I-get-error-messages-about-%3Ccode%3Esys/cdefs.h%3C/code%3E

Change-Id: I6a357cefd106c72cfecafd898638f6b5692c2e05

5 years agoapp_voicemail: Add workaround for a gcc 10 issue with -Wrestrict
George Joseph [Thu, 30 Apr 2020 15:56:03 +0000 (09:56 -0600)] 
app_voicemail: Add workaround for a gcc 10 issue with -Wrestrict

The gcc 10 -Wrestrict option was causing "overlap" errors when
snprintf was copying one char[256] structure member to another
char[256] member in the same structure.

Using ast_alloca instead of declaring the structure inline
solves the issue.

Here's a link to the "enhancement":
https://gcc.gnu.org/legacy-ml/gcc-patches/2019-10/msg00570.html

We may follow up with a gcc bug report.

Change-Id: Ie0099adcb0a9727bd9aa99e024dd912a67eaf534

5 years agocore_local: Local calls are always secure.
Alexander Traud [Mon, 27 Apr 2020 15:28:01 +0000 (17:28 +0200)] 
core_local: Local calls are always secure.

In a Dialplan, the channel drivers 'chan_sip' and 'chan_iax2' support
the channel items 'secure_bridge_media' and 'secure_bridge_signaling'.
That way, a channel can be forced to use encryption even if not
specified in its configuration.

However, when the Local Proxy kicks in, for example, in case of a
forwarding (SIP status 302), Local Proxy stated it does not know those
items. Consequently, such a call could not be proxied how clever your
Dialplan was. Because local calls within Asterisk are always secure,
Local Proxy accepts such a request now.

ASTERISK-22920

Change-Id: I4c143bb70f686790953cc04c5a4b810bbb03636c

5 years agopjsip: Increase maximum ICE candidate count.
Joshua C. Colp [Tue, 28 Apr 2020 15:31:28 +0000 (12:31 -0300)] 
pjsip: Increase maximum ICE candidate count.

In practice it has been seen that some users come
close to our maximum ICE candidate count of 32.
In case people have gone over this increases the
count to 64, giving ample room.

ASTERISK-28859

Change-Id: I35cd68948ec0ada86c14eb53092cdaf8b62996cf

5 years agores_rtp_asterisk: Protect access to nochecksums with #ifdef
Guido Falsi [Sun, 26 Apr 2020 10:56:47 +0000 (12:56 +0200)] 
res_rtp_asterisk: Protect access to nochecksums with #ifdef

Recently code accessing nochecksums variable has been added without including #ifdef SO_NO_CHECK protection, while the variable is created only when such constant is defined.

ASTERISK-28852 #close

Change-Id: I381718893b80599ab8635f2b594a10c1000d595e

5 years agochan_mobile: Add smoother to make SIP/RTP endpoints happy.
Peter Turczak [Fri, 17 Apr 2020 07:39:09 +0000 (08:39 +0100)] 
chan_mobile: Add smoother to make SIP/RTP endpoints happy.

In contrast to RFC 3551, section 4.2, several SIP/RTP clients misbehave
severly (up to crashing). This patch adds another smoother for the audio
received via bt. Therefore the audio frames sent to the core will be
CHANNEL_FRAME_SIZE.

ASTERISK-28832 #close

Change-Id: Ic5f9e2f35868ae59cc9356afbd1388b779a1267f

5 years agoUpdate CHANGES and UPGRADE.txt for 13.33.0
Asterisk Development Team [Thu, 23 Apr 2020 16:01:09 +0000 (11:01 -0500)] 
Update CHANGES and UPGRADE.txt for 13.33.0

5 years agores_ari_channels: Fixed endpoint 80 characters limit
sungtae kim [Tue, 21 Apr 2020 15:40:14 +0000 (15:40 +0000)] 
res_ari_channels: Fixed endpoint 80 characters limit

Fixed it to copy the entire string from the requested endpoint body except tech-prefix.

ASTERISK-28847

Change-Id: I91b5f6708a1200363f3267b847dd6a0915222c25

5 years agores_pjsip: Fixed format of IPv6 addresses for external media addresses
DanielYK [Wed, 15 Apr 2020 20:13:39 +0000 (22:13 +0200)] 
res_pjsip: Fixed format of IPv6 addresses for external media addresses

ASTERISK-28835

Change-Id: I66289afd164c5cdd6c5caa39e79d629a467e7a26

5 years agochan_sip: externhost/externaddr with non-default TCP/TLS ports.
Alexander Traud [Mon, 20 Apr 2020 18:11:42 +0000 (20:11 +0200)] 
chan_sip: externhost/externaddr with non-default TCP/TLS ports.

ASTERISK-28372
Reported by: Anton Satskiy

ASTERISK-24428
Reported by: sstream

Change-Id: I2b7432a9bf3b09dc8515297ff955636db7a6224c

5 years agocurl: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 11:51:31 +0000 (13:51 +0200)] 
curl: Add build-time dependency.

ASTERISK-28838

Change-Id: I34724e799e1ffaf723eb2c358abe8934dbadcd52

5 years agores_pjsip_refer: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 09:18:25 +0000 (11:18 +0200)] 
res_pjsip_refer: Add build-time dependency.

ASTERISK-28838

Change-Id: Ic693c3f464e35ec0db242afdb0a1415806af4e25

5 years agoapp_getcpeid: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 10:25:42 +0000 (12:25 +0200)] 
app_getcpeid: Add build-time dependency.

ASTERISK-28838

Change-Id: I68b78e7e4718be82507247433127ce3992a5ba96

5 years agores_pjsip: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 09:55:32 +0000 (11:55 +0200)] 
res_pjsip: Add build-time dependency.

ASTERISK-28838

Change-Id: Icb08304744ae3f34dce6ccb76f94379b8382a074

5 years agopjproject_bundled: Honor --without-pjproject.
Alexander Traud [Wed, 15 Apr 2020 18:01:58 +0000 (20:01 +0200)] 
pjproject_bundled: Honor --without-pjproject.

ASTERISK-28837

Change-Id: Id057324912a3cfe6f50af372675626bb515907d9

5 years agochan_sip: DiffServ/ToS not only on UDP but also on TCP and TLS sockets.
Alexander Traud [Wed, 15 Apr 2020 06:20:46 +0000 (08:20 +0200)] 
chan_sip: DiffServ/ToS not only on UDP but also on TCP and TLS sockets.

ASTERISK-27195
Reported by: Joshua Roys

Change-Id: I6e72ecb874200dec7a3865c7babaf5ac0d3101de

5 years agoinstall_prereq: Add libcap for high bits in DiffServ/ToS.
Alexander Traud [Wed, 15 Apr 2020 12:16:00 +0000 (14:16 +0200)] 
install_prereq: Add libcap for high bits in DiffServ/ToS.

works automatically; see Mantis 7047 (now ASTERISK-6863)

Change-Id: I27d2c109180bd857b6757fd532de48eddb78aee6

5 years agoBuildSystem: Only if found LibPRI, check its optional parts.
Alexander Traud [Wed, 15 Apr 2020 11:09:11 +0000 (13:09 +0200)] 
BuildSystem: Only if found LibPRI, check its optional parts.

Change-Id: If8445f899ee4ce0c606c484943d4ce0c8e43b5da

5 years agoBuildSystem: Only if found external PJProject, check its optional parts.
Alexander Traud [Wed, 15 Apr 2020 07:38:23 +0000 (09:38 +0200)] 
BuildSystem: Only if found external PJProject, check its optional parts.

Change-Id: I11d5693d25c166c99d8cebffc16184d58f6362de

5 years agores_rtp_asterisk.c: Check for first DTMF having timestamp set to 0
bernard merindol [Wed, 8 Apr 2020 10:29:42 +0000 (12:29 +0200)] 
res_rtp_asterisk.c: Check for first DTMF having timestamp set to 0

When the first DTMF receive in RF2833 codec have TimeStamp at 0
is not processed.

ASTERISK-28812

Change-Id: I3196803a062dd2daee4938c9a778c3810cb7e504

5 years agofunc_volume: Accept decimal number as argument
Jean Aunis [Tue, 7 Apr 2020 12:05:22 +0000 (14:05 +0200)] 
func_volume: Accept decimal number as argument

Allow voice volume to be multiplied or divided by a floating point number.

ASTERISK-28813

Change-Id: I5b42b890ec4e1f6b0b3400cb44ff16522b021c8c

5 years agores_rtp_asterisk: iterate all local addresses looking to populate ICE.
Jaco Kroon [Tue, 3 Dec 2019 18:35:20 +0000 (20:35 +0200)] 
res_rtp_asterisk: iterate all local addresses looking to populate ICE.

By using pjproject to give us a list of candidates, and then filtering,
if the host has >32 addresses configured, then it is possible that we
end up filtering out all 32 of those, and ending up with no candidates
at all.  Instead, get getifaddrs (which pjsip is using underlying
anyway) to retrieve all local addresses, and iterate those, adding the
first 32 addresses not excluded by the ICE ACL.

In our setup at any point in time We've got between 6 and 328 addresses
on any given system.  The lower limit is the lower limit but the upper
limit is growing on a near daily basis currently.

Change-Id: I109eaffc3e2b432f00bf958e3caa0f38cacb4edb
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
5 years agopjproject_bundled: Repair ./configure --with-ssl without ARG.
Alexander Traud [Fri, 10 Apr 2020 13:13:34 +0000 (15:13 +0200)] 
pjproject_bundled: Repair ./configure --with-ssl without ARG.

ASTERISK-28758
Reported by: Patrick Wakano
Reported by: Dmitriy Serov

Change-Id: Ifb6b85c559d116739af00bc48d1f547caa85efac

5 years agores_pjsip: document legal dtls_verify endpoint options.
Jaco Kroon [Sat, 11 Apr 2020 19:03:39 +0000 (21:03 +0200)] 
res_pjsip: document legal dtls_verify endpoint options.

Change-Id: I7fa7c5c8a7ddb0bd525982f58bff3264ebbd9a1b

5 years agoBuildSystem: Search for Python/C API when possibly needed only.
Alexander Traud [Sun, 12 Apr 2020 14:53:50 +0000 (16:53 +0200)] 
BuildSystem: Search for Python/C API when possibly needed only.

The Python/C API is used only if the Test Framework was enabled in Asterisk
'make menuselect'. The Test Framework is available only if the Developer Mode
was enabled in Asterisk './configure --enable-dev-mode'. And that Python/C API
is used only if the PJProject was found and not disabled in Asterisk; the user
did not go for './configure --without-pjproject'.

Furthermore, because version 2 of that Python/C API is required (currently) and
because some platforms do not offer a generic version 2, the script searches
for 2.7 explicitly as well.

To avoid version mismatch between the Python/C API and the Python environment,
the script searches for the latter in the same versions, in the same the order
as well. Because this Python/C API is just for (some) Asterisk contributors,
the script also goes for the Python 3 environment as a last resort for all
other Asterisk users. This allows 'make full' even on minimal installations of
Ubuntu 18.04 LTS and newer.

Because the Python/C API is Asterisk contributor specific, the Python packages
are removed from the script './contrib/scripts/install_prereq' as this script
is intended for Asterisk users. Asterisk contributors have to install much more
packages in any case, like:
sudo apt install autoconf automake git git-review python2.7-dev

ASTERISK-28824
ASTERISK-27717

Change-Id: Id46d357e18869f64dcc217b8fdba821b63eeb876

5 years agochan_sip: TCP/TLS client without server.
traud [Wed, 1 Apr 2020 16:52:58 +0000 (18:52 +0200)] 
chan_sip: TCP/TLS client without server.

It is possible to configure a TCP/TLS client without having a TCP/TLS
server. In that case, no error or warning was printed but the headers
Contact and Via in SIP REGISTER were "(null)".

ASTERISK-28798

Change-Id: I387ca5cb6a65f1eb675a29c5e41df8ec6c242ab2

5 years ago_pjsua: Build even with Clang.
Alexander Traud [Mon, 13 Apr 2020 17:05:48 +0000 (19:05 +0200)] 
_pjsua: Build even with Clang.

Change-Id: Iebf7687613aa0295ea3c82256460b337f1595be2

5 years agores_rtp_asterisk: Build without PJProject.
Alexander Traud [Mon, 13 Apr 2020 16:27:28 +0000 (18:27 +0200)] 
res_rtp_asterisk: Build without PJProject.

Change-Id: Ifc5059cd867e77b9c92ed9f4b895a9a91200d3ec

5 years agochan_pjsip: digit_begin - constant DTMF tone if RTP is not setup yet
Kevin Harwell [Wed, 8 Apr 2020 19:01:55 +0000 (14:01 -0500)] 
chan_pjsip: digit_begin - constant DTMF tone if RTP is not setup yet

If chan_pjsip is configured for DTMF_RFC_4733, and the core triggers a
digit begin before media, or rtp has been setup then it's possible the
outgoing channel will hear a constant DTMF tone upon answering.

This happens because when there is no media, or rtp chan_pjsip notifies
the core to initiate inband DTMF. However, upon digit end if media, and
rtp become available then chan_pjsip does not notify the core to stop
inband DTMF. Thus the tone continues playing.

This patch makes it so chan_pjsip only notifies the core to start
inband DTMF in only the required cases. Now if there is no media, or
rtp availabe upon digit begin chan_pjsip does nothing, but tells the
core it handled it.

ASTERISK-28817 #close

Change-Id: I0dbea9fff444a2595fb18c64b89653e90d2f6eb5

5 years agoBuildSystem: Remove doc/tex and doc/pdf leftovers.
traud [Tue, 7 Apr 2020 17:44:49 +0000 (19:44 +0200)] 
BuildSystem: Remove doc/tex and doc/pdf leftovers.

Furthermore, the nowhere used compress is removed.

ASTERISK-28816

Change-Id: I77daab80cfabb56d51c3ea6b1d14bd9b9fbc577c

5 years agoBuildSystem: Allow space in path.
Alexander Traud [Thu, 9 Apr 2020 12:05:54 +0000 (14:05 +0200)] 
BuildSystem: Allow space in path.

ASTERISK-28818

Change-Id: Ib7f246896457d9e3b14d7f5199136d6545ce0b6f

5 years agostasis: Avoid always true warnings with clang.
traud [Thu, 2 Apr 2020 17:14:41 +0000 (19:14 +0200)] 
stasis: Avoid always true warnings with clang.

ASTERISK-28801

Change-Id: I63ba125226b9fe8a018bd28825c877603eb8f398

5 years agofunc_channel: allow reading 4 fields from dialplan
Sebastien Duthil [Tue, 31 Mar 2020 20:14:51 +0000 (16:14 -0400)] 
func_channel: allow reading 4 fields from dialplan

The following fields return an error when read from dialplan:

- exten
- context
- userfield
- channame

ASTERISK-28796 #close

Change-Id: Ieacaac629490f8710fdacc9de80ed5916c5f6ee2

5 years agochan_unistim: Avoid tautological warnings with clang.
traud [Fri, 3 Apr 2020 17:25:37 +0000 (19:25 +0200)] 
chan_unistim: Avoid tautological warnings with clang.

ASTERISK-28803

Change-Id: I15449621b68d0ad4d57b7c337c1167adb15135af

5 years agoRevert "res_config_odbc: Preserve empty strings returned by the database"
Sean Bright [Mon, 6 Apr 2020 14:29:13 +0000 (09:29 -0500)] 
Revert "res_config_odbc: Preserve empty strings returned by the database"

This reverts commit a3a2fbaec685d931d56f669f2d4171220e9977ac.

Reason for revert: There is a lot of code that relies on the broken
behavior that this fixes.

Change-Id: I410c395a0168acbdaf89e616e3cb5e1312d190cb

5 years agotest_stasis: Avoid always true warning with clang.
traud [Mon, 6 Apr 2020 11:56:39 +0000 (13:56 +0200)] 
test_stasis: Avoid always true warning with clang.

ASTERISK-28808

Change-Id: I5e76831373532d7b8065d024e66cd1fb75dedd80

5 years agomain/backtrace: binutils-2.34 fix.
Jaco Kroon [Wed, 1 Apr 2020 09:00:14 +0000 (11:00 +0200)] 
main/backtrace: binutils-2.34 fix.

My tester missed this one previously, have confirmed a positive build
this time round.

Change-Id: Id06853375954a200f03f9a1b9c97fe0b10d31fbf

5 years agores_pjsip: Don't set endpoint to unavailable in all cases.
Joshua C. Colp [Thu, 26 Mar 2020 22:42:27 +0000 (19:42 -0300)] 
res_pjsip: Don't set endpoint to unavailable in all cases.

When an AOR is modified endpoints are updated that reference
the AOR so they can start receiving updates and reflect the
correct state. If this is the case then we shouldn't change
the endpoint to be offline if it does not reference the AOR
but instead only when the endpoint is completely updated for
all its AORs.

ASTERISK-28056
patches:
  pjsip_options-aor.diff submitted by jhord (license 6978)

Change-Id: I3ee00023be2393113cd4e056599f23f3499ef164

5 years agotest_utils: Avoid incorrect error message on load.
traud [Tue, 24 Mar 2020 11:43:37 +0000 (12:43 +0100)] 
test_utils: Avoid incorrect error message on load.

In case of no OpenSSL headers, the module was built but did not load.

ASTERISK-28789

Change-Id: Ie007e84296bcf2bd4237f19d68ba5f932b84cd02

5 years agofunc_aes: Avoid incorrect error message on load.
traud [Mon, 23 Mar 2020 17:25:30 +0000 (18:25 +0100)] 
func_aes: Avoid incorrect error message on load.

In case of no OpenSSL headers, the module func_aes was built but did not load.

ASTERISK-28788

Change-Id: I0b99b8468cbeb3b0eab23069cbd64062ef885ffc

5 years agodial.c: Removed dial string 80 character limitation
sungtae kim [Thu, 26 Mar 2020 22:18:17 +0000 (22:18 +0000)] 
dial.c: Removed dial string 80 character limitation

The dial application had 80 characters of destination length
limitation. But this limitation causes unexpected dial string
cut if the dial string is long.

Removed unnecessary limited buffer to support longer dial
destination.

ASTERISK-27946

Change-Id: I72c8f0319a4b47e8180817a66a7e9bde063cb330

5 years agores_pjsip_session: implement processing of Content-Disposition
Torrey Searle [Thu, 19 Mar 2020 09:34:42 +0000 (10:34 +0100)] 
res_pjsip_session: implement processing of Content-Disposition

RFC5621 requires any content type with a Content-Disposition
with handling=required to be rejected with a 415 response

ASTERISK-28782 #close

Change-Id: Iad969df75936730254b95c1a8bc3b48497070bb4

5 years agoacl: implement a centralized ACL output mechanism for HAs and ACLs.
Jaco Kroon [Wed, 18 Mar 2020 13:49:56 +0000 (15:49 +0200)] 
acl: implement a centralized ACL output mechanism for HAs and ACLs.

named_acl.c (which is really a named_ha) now uses ast_ha_output.

I've also updated main/manager.c to output the actual ACL on "manager
show user <username>" if one is set.  If this works then we can add
similar to other modules as required.

Change-Id: I0ec9876a90dddd379c80ec078d48e3ee6991eb0f

5 years agochan_sip: Send 403 when ACL fails.
Joshua C. Colp [Thu, 26 Mar 2020 13:49:54 +0000 (10:49 -0300)] 
chan_sip: Send 403 when ACL fails.

Change-Id: I0910c79196f2b7c7e5ad6f1db95e83800ac737a2

5 years agoast_coredumper: add Asterisk information dump
Kevin Harwell [Tue, 17 Mar 2020 20:54:25 +0000 (15:54 -0500)] 
ast_coredumper: add Asterisk information dump

This patch makes it so ast_coredumper now outputs the following information to
a *-info.txt file when processing a core file:

  asterisk version and "built by" string
  BUILD_OPTS
  system start, and last reloaded date/time
  taskprocessor list
  equivalent of "bridge show all"
  equivalent of "core show channels verbose"

Also a slight modification was made when trying to obtain the pid(s) of a
running Asterisk. If it fails to retrieve any it now reports an error.

Change-Id: I54f35c19ab69b8f8dc78cc933c3fb7c99cef346b

5 years agonetsock2: compile fixes.
Jaco Kroon [Fri, 20 Mar 2020 14:12:05 +0000 (16:12 +0200)] 
netsock2: compile fixes.

This fixes ast_addressfamily_to_sockaddrsize to reference the
provided argument, and ast_sockaddr_from_sockaddr to not use the name of
a structure as argument.

Change-Id: Ibf5db469c47c3b4214edf8456326086174e8edd7

5 years agodahdiras: Only set plugin dahdi.so to pppd if we're running as root.
Jaco Kroon [Wed, 18 Mar 2020 09:21:21 +0000 (11:21 +0200)] 
dahdiras: Only set plugin dahdi.so to pppd if we're running as root.

Users of this should set plugin dahdi.so in their options file.

ASTERISK-16676

Change-Id: I6d01ad0a10e9fea477876d0941c3f38aac357e91

5 years agodundi: fix NULL dereference.
Jaco Kroon [Wed, 18 Mar 2020 09:38:30 +0000 (11:38 +0200)] 
dundi:  fix NULL dereference.

If a negative (error) return is received from dundi_lookup_internal,
this is not handled correctly when assigning the result to the buffer.
As such, use a signed integer in the assignment and do a proper
comparison.

ASTERISK-21205

Change-Id: I5214ebb6491e2bd14f90c7d3ce229da86888f739

5 years agores_pjsip_session: Fixed wrong session termination
Sungtae Kim [Fri, 14 Feb 2020 08:45:33 +0000 (08:45 +0000)] 
res_pjsip_session: Fixed wrong session termination

When the Asterisk receives 200 OK with invalid SDP,
the Asterisk/PJPROJECT terminating the session.
But if the channel was in the Bridge, Asterisk tries send
the Re-Invite before terminating the session.
And when the Asterisk sending the Re-Invite, it doesn't check
the SDP is NULL or not. This crashes the Asterisk.

Fixed it to close the session correctly if the UAS sends the
200 OK with wrong SDP.

ASTERISK-28743

Change-Id: Ifa864e0e125b1a7ed2f3abd4164187e1dddc56da

5 years agobuild: enable building with uClibc
Jaco Kroon [Wed, 18 Mar 2020 09:49:39 +0000 (11:49 +0200)] 
build: enable building with uClibc

This patch has been included in Gentoo distribution for at least since
asterisk 1.8, but there are references in the logs going back as far as
1.0.0 - not sure if this is still required in any way, it does apply,
and it doesn't (as far as we can determine) cause build failures.

Change-Id: I46d8845e30200205e80580680bf060aa3012ba54

5 years agobuild: search from newest to oldest for gmime.
Jaco Kroon [Wed, 18 Mar 2020 09:43:21 +0000 (11:43 +0200)] 
build: search from newest to oldest for gmime.

We (Gentoo distribution) reckon that in the case of multiple versions of
gmime installed we should prefer the newest one.

Change-Id: Idf7be613230232eb1d573d93c4a5a8297f4ecd2d

5 years agochan_psip, res_pjsip_sdp_rtp: ignore rtptimeout if direct-media is active
Michael Neuhauser [Fri, 6 Mar 2020 16:50:00 +0000 (17:50 +0100)] 
chan_psip, res_pjsip_sdp_rtp: ignore rtptimeout if direct-media is active

Do not hang up a PJSIP channel on RTP timeout if that channel is in
a direct-media bridge. Also reset the time of the last received RTP packet when
direct-media ends (wait full rtp_timeout period before checking first time after
audio came back to Asterisk).

ASTERISK-28774
Reported-by: Michael Neuhauser
Change-Id: I8b62012be7685849e8fb2b1c5dd39d35313ca2d1

5 years agores_rtp_asterisk: implement ACL mechanism for ICE and STUN addresses.
Jaco Kroon [Wed, 27 Nov 2019 13:54:39 +0000 (15:54 +0200)] 
res_rtp_asterisk: implement ACL mechanism for ICE and STUN addresses.

A pure blacklist is not good enough, we need a whitelist mechanism as
well, and the simplest way to do that is to re-use existing ACL
infrastructure.

This makes it simpler to blacklist say an entire block (/24) except a
smaller block (eg, a /29 or even a /32).  Normally you'd need to
recursively split the block, so if you want to blacklist a /24 except
for a /29 you'd end up with a blacklit for a /25, /26, /27 and /28.  I
feel that having an ACL instead of a blacklist only is clearer.

Change-Id: Id57a8df51fcfd3bd85ea67c489c85c6c3ecd7b30
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
5 years agoUpdate main/backtrace.c to deal with changes in binutils 2.34.
Jaco Kroon [Mon, 16 Mar 2020 10:11:11 +0000 (12:11 +0200)] 
Update main/backtrace.c to deal with changes in binutils 2.34.

binutils 2.34 merged this commit:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;\
h=fd3619828e94a24a92cddec42cbc0ab33352eeb4

Which effectively does things like:

-#define bfd_section_size(bfd, ptr) ((ptr)->size)
-#define bfd_get_section_size(ptr) ((ptr)->size)

+#define bfd_section_size(sec) ((sec)->size)

So in order to remain backwards compatible we need to detect this API
change, and adjust accordingly.  The simplest is to notice that the
bfd_get_section_size and bfd_get_section_vma MACROs are no longer
defined, and define then onto the new API.  The alternative is to litter
the code with a number of #ifdef #else #endif splatters right through
the code.

Change-Id: I3efe0f8e8f3e338d16fcbc2b26a505367b6e172f

5 years agofunc_odbc.conf.sample: Clarify sample documentation
Sean Bright [Sun, 15 Mar 2020 14:07:03 +0000 (10:07 -0400)] 
func_odbc.conf.sample: Clarify sample documentation

ASTERISK-20325 #close

Change-Id: I06cb9b467b0fd06c8af2a5aee049f872c09cc4b6

5 years agochan_vpb: Fix 'catching polymorphic type ... by value' error
Sean Bright [Fri, 13 Mar 2020 18:43:05 +0000 (14:43 -0400)] 
chan_vpb: Fix 'catching polymorphic type ... by value' error

Fixes the following compile error:

    chan_vpb.cc:2688:26: error: catching polymorphic type
        ‘class std::exception’ by value

Change-Id: Ic87bc357d72427d77626735c83200fd278a7a649

5 years agoaudiohook: Don't allow audiohooks to attach to hung up channels.
Joshua C. Colp [Thu, 12 Mar 2020 14:22:06 +0000 (11:22 -0300)] 
audiohook: Don't allow audiohooks to attach to hung up channels.

Given a scenario where MixMonitor was initiated over AMI it
was possible for the channel and MixMonitor thread to remain
alive past hang up of the channel. This scenario required
the AMI initiated MixMonitor to retrieve the channel, a
hangup to occur on the channel in another thread, and then
for MixMonitor to actually start. If this occurred the
MixMonitor thread would remain alive indefinitely and
the channel reference would remain.

This change ensures that audiohooks are never able to
be attached to channels that have been hung up. An
additional fix has also been done in app_mixmonitor to
properly release the channel reference if this occurs.

ASTERISK-28780

Change-Id: I8044c06daa06f0f16607788c596f55623be26f58

5 years agoCI: Create generic jenkinsfile
George Joseph [Wed, 4 Mar 2020 21:45:40 +0000 (14:45 -0700)] 
CI: Create generic jenkinsfile

This is a generic jenkinsfile to build Asterisk and optionally
perform one or more of the following:
 * Publish the API docs to the wiki
 * Run the Unit tests
 * Run Testsuite Tests

This job can be triggered manually from Jenkins or be triggered
automatically on a schedule based on a cron string.

Change-Id: Id9d22a778a1916b666e0e700af2b9f1bacda0852

5 years agores_rtp_asterisk: Send correct sender SSRC when p2p bridge in use
Torrey Searle [Fri, 6 Mar 2020 16:13:34 +0000 (17:13 +0100)] 
res_rtp_asterisk: Send correct sender SSRC when p2p bridge in use

bridge_p2p_rtp_write will forward rtp to the bridged rtp instance
without modifying the ssrc.  However, it is not updating the SSRC
in the bridged rtp.  Thus, when SSRC packets are generated, they
have the correct SSRC for the sender.

ASTERISK-28773 #close

Change-Id: I39f923bde28ebb4f0fddc926b92494aed294a478

5 years agores_rtp_asterisk: Fix unused warning for "ice".
Joshua C. Colp [Wed, 11 Mar 2020 14:55:06 +0000 (11:55 -0300)] 
res_rtp_asterisk: Fix unused warning for "ice".

Change-Id: I31e022f722509214cd600c428939c91ace0c59fd

5 years agoMerge "res_pjsip_sdp_rtp: Don't wait for ICE if not negotiated" into 13
George Joseph [Tue, 10 Mar 2020 18:36:26 +0000 (13:36 -0500)] 
Merge "res_pjsip_sdp_rtp: Don't wait for ICE if not negotiated" into 13

5 years agoMerge "chan_pjsip: Check audio frame when remote SSRC changes." into 13
George Joseph [Tue, 10 Mar 2020 16:58:56 +0000 (11:58 -0500)] 
Merge "chan_pjsip: Check audio frame when remote SSRC changes." into 13

5 years agoMerge "enum.c: Make ast_get_txt() actually do something." into 13
George Joseph [Mon, 9 Mar 2020 15:04:08 +0000 (10:04 -0500)] 
Merge "enum.c: Make ast_get_txt() actually do something." into 13

5 years agoMerge "enum.c: Add support for regular expression flag in NAPTR record" into 13
George Joseph [Mon, 9 Mar 2020 15:02:06 +0000 (10:02 -0500)] 
Merge "enum.c: Add support for regular expression flag in NAPTR record" into 13

5 years agoMerge "res_rtp_asterisk: Add 'rtp show settings' cli command" into 13
Joshua Colp [Mon, 9 Mar 2020 13:56:57 +0000 (08:56 -0500)] 
Merge "res_rtp_asterisk: Add 'rtp show settings' cli command" into 13

5 years agochan_pjsip: Check audio frame when remote SSRC changes.
Paulo Vicentini [Wed, 26 Feb 2020 00:30:04 +0000 (01:30 +0100)] 
chan_pjsip: Check audio frame when remote SSRC changes.

If the SSRC of a received RTP packet differed from the previous SSRC
an SSRC change control frame would be queued ahead of the media
frame. In the case of audio this would result in the format of the
audio frame not being checked, and if it differed or was not allowed
then it could cause the call to drop due to failure to set up a
translation path.

The chan_pjsip module will now no longer assume the first frame
will be the audio frame and instead goes through the complete list
to find it.

ASTERISK-28759

Change-Id: I6d854cc523f343e299a615636fc65bdbd5f809ec

5 years agoenum.c: Add support for regular expression flag in NAPTR record
Sean Bright [Fri, 6 Mar 2020 20:59:37 +0000 (15:59 -0500)] 
enum.c: Add support for regular expression flag in NAPTR record

A regular expression in a NAPTR response record can have a trailing
'i' flag to indicate that the expression should be evaluated in a
case-insensitive way. We were not checking for that flag which caused
the record parsing to fail on otherwise valid input.

Although this change will initially go into Asterisk 13, 16, and 17,
it is my intention to replace the majority of this code in 16 and up -
including this fix - by changing enum.c to consume the new DNS API
which duplicates most of this logic already. Asterisk 13 doesn't have
the DNS API, so this fix will be as good as it gets.

ASTERISK-26711 #close
Reported by: Vitold

Change-Id: I33943a5b3e7539c6dca3a5079982ee15a08186f0

5 years agoindications.conf.sample: Add indication tones for Indonesia
Jared Smith [Fri, 6 Mar 2020 12:10:11 +0000 (12:10 +0000)] 
indications.conf.sample: Add indication tones for Indonesia

These tones come from http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf

ASTERISK-23407

Change-Id: I48e2285f1e5bb29b3335f762006f66c423d0fcb8

5 years agores_rtp_asterisk: Add 'rtp show settings' cli command
Rodrigo Ramírez Norambuena [Tue, 3 Mar 2020 14:42:16 +0000 (14:42 +0000)] 
res_rtp_asterisk: Add 'rtp show settings' cli command

This change introduce a CLI command for the RTP to display the general
configuration.

In the first step add the follow fields of the configurations:
  - rtpstart
  - rtpend
  - dtmftimeout
  - rtpchecksum
  - strictrtp
  - learning_min_sequential
  - icesupport

Change-Id: Ibe5450898e2c3e1ed68c10993aa1ac6bf09b821f

5 years agoUpdate CHANGES and UPGRADE.txt for 13.32.0
Asterisk Development Team [Thu, 5 Mar 2020 17:20:48 +0000 (12:20 -0500)] 
Update CHANGES and UPGRADE.txt for 13.32.0

5 years agores_pjsip_sdp_rtp: Don't wait for ICE if not negotiated
Torrey Searle [Thu, 5 Mar 2020 09:08:54 +0000 (10:08 +0100)] 
res_pjsip_sdp_rtp: Don't wait for ICE if not negotiated

If ICE support is enabled but not negotiated, the rtp->ice structure is
not being destroyed. This leads to Asterisk waiting for ICE to complete
instead of immediately starting the DTLS handshake, resulting in the
call leg having no RTP.

ASTERISK-28769 #close

Change-Id: I17c137546dc9ecfb9583c24dcf4c2ced8bbd7a27

5 years agoenum.c: Make ast_get_txt() actually do something.
Sean Bright [Wed, 4 Mar 2020 22:53:57 +0000 (17:53 -0500)] 
enum.c: Make ast_get_txt() actually do something.

The ast_get_txt() API function (and by extension, the TXTCIDNAME
dialplan function) were broken in
65b8381550a9f46fdce84de79960073e9d51b05d such that we would never
actually make a DNS TXT query as described.

This patch restores the documented behavior.

ASTERISK-19460 #close
Reported by: George Joseph

Change-Id: I1b19aea711488cb1ecd63843cddce05010e39376

5 years agores_pjsip_refer: ensure refer progress is still sent after Proceeding()
lvl [Tue, 3 Mar 2020 16:57:27 +0000 (16:57 +0000)] 
res_pjsip_refer: ensure refer progress is still sent after Proceeding()

ASTERISK-28766 #close

Change-Id: I5ce2210062f9325db762edbf6e46075079bb2cd1

5 years agoMerge "check_expr2: fix cross-compile/hardening issues" into 13
Joshua Colp [Wed, 4 Mar 2020 12:27:20 +0000 (06:27 -0600)] 
Merge "check_expr2: fix cross-compile/hardening issues" into 13

5 years agoMerge "message & stasis/messaging: make text message variables work in ARI" into 13
Joshua Colp [Wed, 4 Mar 2020 12:09:41 +0000 (06:09 -0600)] 
Merge "message & stasis/messaging: make text message variables work in ARI" into 13

5 years agocheck_expr2: fix cross-compile/hardening issues
Sebastian Kemper [Sun, 12 Jan 2020 11:37:46 +0000 (12:37 +0100)] 
check_expr2: fix cross-compile/hardening issues

When building check_expr2 with ASLR PIE hardening enabled the linker
fails. This is resolved by adding the regular compiler flags when
building the object files from ast_expr2f.c and ast_expr2.c.

Note: The STANDALONE define is removed because it is already defined in
_ASTCFLAGS. YY_NO_INPUT is defined so that the compile survives
'--enable-dev-mode'.

Also, a Makefile variable "CROSS_COMPILING" is added so that the
build system doesn't try to run check_expr2 when cross-compiling,
because that will fail the build as will.

ASTERISK-28685 #close

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
Change-Id: If435b7db9f9ad8266245bda51c81c220f9658915

5 years agoMerge "res/res_pjsip_sdp_rtp: Fix MOH transitions" into 13
Kevin Harwell [Mon, 2 Mar 2020 20:16:52 +0000 (14:16 -0600)] 
Merge "res/res_pjsip_sdp_rtp: Fix MOH transitions" into 13

5 years agomessage & stasis/messaging: make text message variables work in ARI
Kevin Harwell [Fri, 28 Feb 2020 18:53:40 +0000 (12:53 -0600)] 
message & stasis/messaging: make text message variables work in ARI

When a text message was received any associated variable was not written to
the ARI TextMessageReceived event. This occurred because Asterisk only wrote
out "send" variables. However, even those "send" variables would fail ARI
validation due to a TextMessageVariable formatting bug.

Since it seems the TextMessageReceived event has never been able to include
actual variables it was decided to remove the TextMessageVariable object type
from ARI, and simply return a JSON object of key/value pairs for variables.
This aligns more with how the ARI sendMessage handles variables, and other
places in ARI.

That being the case, and since this is technically an API breaking change (no
one should really be affected since things never really worked) the ARI version
was updated to reflect that.

ASTERISK-28755 #close

Change-Id: Ia6051c01a53b30cf7edef84c27df4ed4479b8b6f

5 years agoMerge "addons/res_config_mysql: silense warnings about printf format errors." into 13
Kevin Harwell [Thu, 27 Feb 2020 20:44:14 +0000 (14:44 -0600)] 
Merge "addons/res_config_mysql: silense warnings about printf format errors." into 13

5 years agoMerge "app_queue: Refactor odd placement of if's around say_position" into 13
Kevin Harwell [Thu, 27 Feb 2020 20:41:54 +0000 (14:41 -0600)] 
Merge "app_queue: Refactor odd placement of if's around say_position" into 13

5 years agores/res_pjsip_sdp_rtp: Fix MOH transitions
Torrey Searle [Mon, 24 Feb 2020 15:00:08 +0000 (16:00 +0100)] 
res/res_pjsip_sdp_rtp: Fix MOH transitions

Update the state of remote_hold immediately on receipt of remote
SDP so that the information is available when building the SDP
answer

ASTERISK-28754 #close

Change-Id: I7026032a807e9c95081cb8f060400b05deb4836f

5 years agoMerge "say: Remove unused "plural" option from main/say" into 13
Kevin Harwell [Thu, 27 Feb 2020 19:42:39 +0000 (13:42 -0600)] 
Merge "say: Remove unused "plural" option from main/say" into 13

5 years agoMerge "format_cap: make function parameters 'const'" into 13
Kevin Harwell [Thu, 27 Feb 2020 19:15:51 +0000 (13:15 -0600)] 
Merge "format_cap: make function parameters 'const'" into 13

5 years agoMerge "pjsip: Update ACLs on named ACL changes." into 13
Kevin Harwell [Thu, 27 Feb 2020 18:52:45 +0000 (12:52 -0600)] 
Merge "pjsip: Update ACLs on named ACL changes." into 13