This prevents use-after-scope issues when unwinding the stack,
which happens in reverse order. The varname variable needs to
remain alive for the destruction to be able to access it.
Issue was found using clang + address-sanitizer.
ASTERISK-28232 #close
Change-Id: I00811c34ae910836a5fb6d22304528aef92624db
When using the 'b' option to Queue with a queue that was not configured
for ring all a crash would occur as the wrong pointer would be used.
ASTERISK-28218
Change-Id: If1390f64e321047dff24fd2410c95dde74904980
An int64_t is not likely the same size as a long.
* Changed the int64_t values in the statistics structs to longs so casting
is not necessary when generating the formatted CLI output. The offending
members did not need to be int64_t anyway as they were only set by an int
type variable which was already truncating bits.
* Reordered the statistics structs to reduce potential padding bytes.
Change-Id: Ic090a070e9dc4ca650ebdb9c01ed50a581289962
This reverts commit 5ec6d2c33e.
This commit caused issues with polling when combined with
the revert commit "Revert "app_voicemail: Remove need to subscribe to stasis"
ASTERISK-28222
Reported by: abelbeck
Change-Id: I1e83a433e4202574181bc128dce876ef24936a52
In order to get a dump of the running process, we need to find the
pid of the main asterisk process. This can be tricky if there are
also instances of "asterisk -r" running or if an alternate location
for asterisk.conf was specified on the command line with the -C
option that also specified an alternation location for the pid file.
So now...
1. We find the asterisk executable with "which" or the --asterisk-bin
command line option.
2. If there's only 1 process with an executable path that matches,
we use that pid. If not...
3. We try "<asterisk-bin> -rx 'core show settings'" and parse the
output to find the pidfile, then read that for the pid. If that
didn't work...
4. We get a list of all the pids matching <asterisk-bin> and look
in /proc/<pid>/cmdline for a -C argument and retry the "core show
settings" using the same -C option. We can't parse the output
of "ps" to get the -C path because it may contain spaces. The
contents of /proc/<pid>/cmdline are delimited by NULLs. For BSDs
we may have to mount /proc first. :(
ASTERISK-28221
Reported by: Andrew Nagy
Change-Id: I8aa1f3f912f949df2b5348908803c636bde1d57c
The backtrace library bfd.h include file does not get the sizes of
pointers and ints right on some platforms. On my old test box the size
of bfd_vma is 8 while the size of a pointer is 4. gcc on the box
complains of the integer casting to/from pointers size mismatch.
* uintptr_t to the rescue by doing an appropriate two stage cast.
Change-Id: Icb2621583f50c8728de08a3c824d95fe53cc45d0
The free_user function was automatically deleting the stasis mailbox
state but this only makes sense when the mailbox is actually
deleted, not just the structure freed. This was causing issues
where leave_voicemail would publish the mwi message to stasis and
delete the state before the message could be processed by
res_pjsip_mwi.
* Removed the delete of state from free_user().
* Created a new free_user_final() function that both frees the data
structure and deletes the state. This function is only called
during module load/unload where it's appropriate to delete the
state.
ASTERISK-28215
Change-Id: I305e8b3c930e9ac41d901e5dc8a58fd7904d98dd
All of the fields that were removed were no longer referenced except for
'lastrxts' and 'rxseqno' which were only ever written to.
Change-Id: I5a5d31eb33e97663843698f58d0d97f22a76627c
The profile-iop octet (the 2nd) of profile-level-id can be zero
according to RFC 6184 Section 8.1. So we ignore its value when deciding
to include profile-level-id in the outgoing SDP.
ASTERISK-27959 #close
Reported by: David Kuehling
Change-Id: Id28cd916a3d7748058fe9609b585d07d9e243f73
This is how features behaved up through Asterisk 11, but was changed
when the new bridging framework was implemented in Asterisk 12.
Reported by rrittgarn in #asterisk.
Change-Id: I72cf86223947a8118c75f46e2c603dbc11e3125b
Currently the file sound_only_person is not played when a marked
user (with announce_only_user=yes) joins an empty conference.
This patch fixes it.
ASTERISK-28201 #close
Change-Id: I85b67687e6b220939c3af8091d83a70a7b174cf4
This change adds statistics gathering to Stasis topics,
subscriptions, and message types. These can be viewed using
CLI commands and provide insight into how Stasis is used
and how long certain operations take to execute.
These are only available when Asterisk is compiled in
developer mode and do not have any impact under normal
operation.
ASTERISK-28117
Change-Id: I94411b53767f89ee01714daaecf0c2f1666e863f
The ARI DELETE /channels command takes a "reason" parameter
Previously, there were only five reasons implemented
This patch adds more reasons to choose from for more
complex setups
ASTERISK-28198 #close
Change-Id: I85996f1076c9946d65c778413f040a845a90fecc
Some platforms provide an implementation of socket() and pipe2() that allow the
caller to specify that the resulting file descriptors should be non-blocking.
Using these allows us to potentially elide 3 calls into 1 by avoiding extraneous
calls to fcntl() to set the O_NONBLOCK flag afterwards.
In passing, change ast_alertpipe_init() to use pipe2() directly instead of the
wrapper if it is available.
Change-Id: I3ebe654fb549587537161506c6c950f4ab298bb0
A subscriber can now indicate that it only wants messages
that have formatters of a specific type. For instance,
manager can indicate that it only wants messages that have a
"to_ami" formatter. You can combine this with the existing
filter for message type to get only messages with specific
formatters or messages of specific types.
ASTERISK-28186
Change-Id: Ifdb7a222a73b6b56c6bb9e4ee93dc8a394a5494c
* Added ---no-configure, --no-menuselect, --no-make and --no-alembic
options that prevent those actions from being performed. Useful
for testing and re-running portions of the build after fixing
earlier failures.
* Added "set -e" to abort the script on command failure.
Not sure why this wasn't there in the first place.
* Fixed a few echos that were redirecting to stderr when they shouldn't
have been.
* Catch more alembic failures by actually trying to generate the SQL.
Change-Id: I9f395fa4e9254be7299e7c1014f1a13db78faffb
This adds documentation to handle_cli_malloc_trim() indicating how it
can be useful when debugging OOM conditions.
Change-Id: I1936185e78035bf123cd5e097b793a55eeebdc78
We've had multiple opportunities where Richard Mudgett's
malloc_trim patch has been useful. Let's get it
pushed up to gerrit and merged.
Since malloc_trim is only available in libc, an entry is
added to configure.ac to create a definition for
HAVE_MALLOC_TRIM.
Change-Id: Ia38308c550149d9d6eae4ca414a649957de9700c