Add checks for allocation errors, cleanup and report failure when they
occur.
* ast_duplicate_acl_list: Replace log warnings with errors, add missing
line-feed.
* ast_append_acl: Add missing line-feed to logger message.
* ast_append_ha: Avoid ast_strdupa in loop by moving debug message to
separate function.
* ast_ha_join: Use two separate calls to ast_str_append to avoid using
ast_strdupa in a loop.
Change-Id: Ia19eaaeb0b139ff7ce7b971c7550e85c8b78ab76
This is a fun one.
Given the following attended transfer scenario:
1. Transfer target is called
2. Transferer hangs up
3. Transfer target call attempt reaches timeout
4. Transfer target is told to hang up
5. Transfer target answers before channel is hung up
6. Transferer recall target is called
A crash would occur. This is because the transfer target call
attempt, despite being told to hang up, would raise a recall
target answer before the recall target had been answered. As it
had not answered there would be no recall target channel and it
would implode.
This change makes it so that if the transfer target has been
hung up we don't tell the attended transfer code that it has
answered. We also clear out the stimulus that the recall target
has been answered after telling the transfer target to hang up,
in case it was able to raise the information before we told it
to hangup.
ASTERISK-27361
Change-Id: Ifb8b255a9c4d2c5c1b8ad77bf54f659ed286df99
We were not \0 terminating this string, so any attempt to print it would
in the best case show an empty string and in the worst case potentially
crash.
Change-Id: I63d96ef8f7516ac02a0f91e22dfa8acdc615042c
Beanstalkd is a simple to use job queue. It provides a means to
create multiple job queues called "tubes". Each tube can store
multiple jobs, with varying priorities with the queue. Queue
processing is available via a simple TCP socket or via well defined
libraries, avaialble at
https://github.com/kr/beanstalkd/wiki/client-libraries
This module is based upon the beanstalk-client library, available
for download at: https://github.com/deepfryed/beanstalk-client
This module currently doesn't support user defined events.
Change-Id: Ic3a087faeeac045d69a2a018e60e29831ddb95ab
Memory corruption happened to the media frame caches when an audio hook
freed a frame when it shouldn't. I think the freed frame was because a
jitter buffer interpolated a missing frame and the audio hook
unconditionally freed it.
* Made audiohook.c:audio_audiohook_write_list() not free an interpolated
frame if it is the same frame as what was passed into the routine.
* Made plc.c:normalise_history() use memmove() instead of memcpy() on a
memory block that could overlap. Found by valgrind investigating this
issue.
ASTERISK-27238
ASTERISK-27412
Change-Id: I548d86894281fc4529aefeb9f161f2131ecc6fde
We've been calling pbx_builtin_setvar_helper to set the
RECORD_STATUS variable before actually closing the recorded file.
If a client is watching VarSet events and tries to do something with
the file when a RECORD_STATUS event is seen, they might attempt to
do so while the file it's still open.
We now delay calling pbx_builtin_setvar_helper until after we close
the file.
ASTERISK-27423
Change-Id: I7fe9de99953e46b4bafa2b38cf151fe8f6488254
The OUTPUTDIR environment variable can now be set either in the
environment itself or in ast_debug_tools.conf. If set, it's used
for all work products instead of /tmp.
Also added the --tarball-config option that includes the contents
of /etc/asterisk when either --tarball-coredumps or --tarball-results
are used.
Change-Id: I66b2553319df61caea5b313d084f51978f730b4c
Previously for PJSIP the local address of WebSocket connections
was set to the remote address. For logging purposes this is
not particularly useful.
The WebSocket API has been extended to allow the local
address to be queried and this is used in PJSIP to set the
local address to the correct value.
The PJSIP HEP support has also been tweaked so that reliable
transports always use the local address on the transport
and do not try to (wrongly) guess. As they are connection
based it is impossible for the source to be anything else.
ASTERISK-26758
ASTERISK-27363
Change-Id: Icd305fd038ad755e2682ab2786e381f6bf29e8ca
Reduce the signal monitoring thread file descriptor use from two to one
on systems that support eventfd.
Change-Id: Id4041a237d481ff699639e153ea6982fee14a462
The remote console socket path is the combination of asterisk.conf
settings astrundir from [directories] and astctl from [files].
Unconditionally combine the two strings after processing all values
to ensure we end up with the correct socket path.
ASTERISK-27415
Change-Id: Ib1e2805d55d6b0955c6430a1a2a93acbf9b091e8
The default return code for pjsip_find_msg was PJ_SUCCESS so if
a Content-Length header wasn't found at all, pjsip_find_msg was
returning PJ_SUCCESS instead of PJSIP_EMISSINGHDR.
Also added the volatile keyword to a few variables that are used
both inside and outside the PJ_TRY/PJ_CATCH block.
Partial fix for ASTERISK_27408
Change-Id: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a
Update from 2.7 to 2.7.1 for bundled pjproject. Changed version
and removed patch files included in the update.
Change-Id: I55cea8e734b318c2df9daf86aa0802c559ec8357
Some consumers of the sorcery API use ast_sorcery_retrieve_by_regex
only so that they can anchor the potential match as a prefix and not
because they truly need regular expressions.
Rather than using regular expressions for simple prefix lookups, add
a new operation - ast_sorcery_retrieve_by_prefix - that does them.
Change-Id: I56f4e20ba1154bd52281f995c27a429a854f6a79
This is a rewrite of ast_cli_completion_matches using a vector to build
the list. The original function calls the vector version, NULL
terminates the vector and extracts the elements array.
One change in behavior the results are now sorted and deduplicated. This
will solve bugs where some duplicate checking was done before the list
was sorted.
Change-Id: Iede20c5b4d965fa5ec71fda136ce9425eeb69519
* AST_VECTOR_STEAL_ELEMENTS - steal the array of elements for use
with non-vector code.
* struct ast_vector_string - a vector of 'char *'.
Change-Id: I104d1b204be03fccf67e02a195596adcb5ab1e42
The media frame cache gets in the way of finding use after free errors of
media frames. Tools like valgrind and MALLOC_DEBUG don't know when a
frame is released because it gets put into the cache instead of being
freed.
* Added the "cache_media_frames" option to asterisk.conf. Disabling the
option helps track down media frame mismanagement when using valgrind or
MALLOC_DEBUG. The cache gets in the way of determining if the frame is
used after free and who freed it. NOTE: This option has no effect when
Asterisk is compiled with the LOW_MEMORY compile time option enabled
because the cache code does not exist.
To disable the media frame cache simply disable the cache_media_frames
option in asterisk.conf and restart Asterisk.
Sample asterisk.conf setting:
[options]
cache_media_frames=no
ASTERISK-27413
Change-Id: I0ab2ce0f4547cccf2eb214901835c2d951b78c00
This change causes the configure script to fail if the C compiler does
not support both function attributes constructor and destructor. These
were already required as modules cannot function without these attributes
and Asterisk requires modules.
This also has AST_GCC_ATTRIBUTE set a variable
ax_cv_have_func_attribute_$1. This is the same variable name used by
autoconf-archive's AX_GCC_FUNC_ATTRIBUTE, used for the same purpose.
Change-Id: Id68e8a1447f2a6d707c54b56350e7bfdb33fb663
If a transport is created with the same transport type, source
IP address, and source port as one that already exists the old
transport is moved into a linked list called "tp_list".
If this old transport is later shutdown it will not be destroyed
as the process checks whether the transport is valid or not. This
check does not look at the "tp_list" when making the determination
causing the transport to not be destroyed.
This change updates the logic to query not just the main storage
method for transports but also the "tp_list".
Upstream issue https://trac.pjsip.org/repos/ticket/2061
ASTERISK-27411
Change-Id: Ic5c2bb60226df0ef1c8851359ed8d4cd64469429
This ensures that the root Makefile runs only a single target at a time.
SUBMAKE will still honor requested parallelism, so 'make -j8' will build
one directory at a time but allow 8 jobs at once when building a sub
directory.
This will fix some display glitches related to rebuild of XML
documentation. It will also prevent some edge case errors where
bundled pjproject needs to be rebuild before other parts of Asterisk.
Change-Id: I4f2ec6fbbec1ada0ccb1109a28ea303524239b1e