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
This test was occasionally failing, with:
WARNING[5812]: http.c:1939 httpd_helper_thread: Failed to set
TCP_NODELAY on HTTP connection: Bad file descriptor
ERROR[5812]: iostream.c:91 ast_iostream_nonblock: Failed to get
fcntl() flags for file descriptor: Bad file descriptor
ERROR[5812]: iostream.c:569 ast_iostream_close: close() failed: Bad
file descriptor
Disabled for now by making the test explicit only.
Change-Id: I778f6cbb6104c6b4e89737a2eaf1a9540888d351
This reverts commit 29115e2384.
That commit closed a long standing hole which allowed subscriptions
to mailboxes that weren't configured in voicemail.conf. This
caused an issue with FreePBX which depdended on that behavior.
The commit is being reverted until FreePBX can handle the new
behavior.
ASTERISK-28151
Reported by: Ronald Raikes
Change-Id: I57b7b85e75d7dd97c742b5c69d718a0f61260c15
These are only a few of the leaks. The large number of macros
and return paths in this file would make a weeks worth of work
to plug them all.
Change-Id: Ie2369fa944023d44767871c5c30974cb077ffb56
* The bridging core no longer uses the stasis cache for bridge
snapshots. The latest bridge snapshot is now stored on the
ast_bridge structure itself.
* The following APIs are no longer available since the stasis cache
is no longer used:
ast_bridge_topic_cached()
ast_bridge_topic_all_cached()
* A topic pool is now used for individual bridge topics.
* The ast_bridge_cache() function was removed since there's no
longer a separate container of snapshots.
* A new function "ast_bridges()" was created to retrieve the
container of all bridges. Users formerly calling
ast_bridge_cache() can use the new function to iterate over
bridges and retrieve the latest snapshot directly from the
bridge.
* The ast_bridge_snapshot_get_latest() function was renamed to
ast_bridge_get_snapshot_by_uniqueid().
* A new function "ast_bridge_get_snapshot()" was created to retrieve
the bridge snapshot directly from the bridge structure.
* The ast_bridge_topic_all() function now returns a normal topic
not a cached one so you can't use stasis cache functions on it
either.
* The ast_bridge_snapshot_type() stasis message now has the
ast_bridge_snapshot_update structure as it's data. It contains
the last snapshot and the new one.
* cdr, cel, manager and ari have been updated to use the new
arrangement.
Change-Id: I7049b80efa88676ce5c4666f818fa18ad1985369
When a channel snapshot was created it used to be done
from scratch, copying all data (many strings). This incurs
a cost when doing so.
This change segments the channel snapshot into different
components which can be reused if unchanged from the
previous snapshot creation, reducing the cost. In normal
cases this results in some pointers being copied with
reference count being bumped, some integers being set,
and a string or two copied. The other benefit is that it
is now possible to determine if a channel snapshot update
is redundant and thus stop it before a message is published
to stasis.
The specific segments in the channel snapshot were split up
based on whether they are changed together, how often they
are changed, and their general grouping. In practice only
1 (or 0) of the segments actually get changed in normal
operation.
Invalidation is done by setting a flag on the channel when
the segment source is changed, forcing creation of a new
segment when the channel snapshot is created.
ASTERISK-28119
Change-Id: I5d7ef3df963a88ac47bc187d73c5225c315f8423
Channels no longer use the Stasis cache for channel snapshots. Instead
they are stored in a hash table in stasis_channels which reduces the
number of Stasis messages created and allows better storage.
As a result the following APIs are no longer available since the stasis
cache is no longer used:
ast_channel_topic_cached()
ast_channel_topic_all_cached()
The ast_channel_cache_all() and ast_channel_cache_by_name() functions
now return an ao2_container of ast_channel_snapshots rather than
a container of stasis_messages therefore you can't (and don't need
to) call stasis_cache functions on it.
The ast_channel_topic_all() function now returns a normal topic not
a cached one so you can't use stasis cache functions on it either.
The ast_channel_snapshot_type() stasis message now has the
ast_channel_snapshot_update structure as it's data. It contains the
last snapshot and the new one.
ast_channel_snapshot_get_latest() still returns the latest snapshot.
The latest snapshot is now stored on the channel itself to eliminate
cache hits when Stasis messages that have the snapshot as a payload
are created.
ASTERISK-28102
Change-Id: I9334febff60a82d7c39703e49059fa3a68825786
This brings in jansson-2.12, removes all patches that were merged
upstream. README is created in third-party/jansson/patches to explain
how to add patches but also because the patches folder must exist for
the build process to succeed.
Change-Id: If0f2d541c50997690660c21fb7b03d625a5cdadd
The marker bit set on the voice packet indicates the start
of a new stream and a new time stamp.
Need to reset the DTMF last sequence number and the timestamp
of the last END packet.
If the new time stamp is lower then the timestamp of the last DTMF END packet
the asterisk drops all DTMF frames as out of order.
This bug was caught using Cisco ip-phone SPA50X and codec g722.
On SIP session update the SPA50X resets stream indicating it with market bit
and a new timestamp is twice smaller then the previous.
ASTERISK-28162 #close
Change-Id: If9c5742158fa836ad549713a9814d46a5d2b1620
Replace usage of ao2_container_alloc with ao2_container_alloc_hash or
ao2_container_alloc_list. Remove ao2_container_alloc macro.
Change-Id: I0907d78bc66efc775672df37c8faad00f2f6c088
Create ao2_container_dup_weakproxy_objs to perform a similar function to
ao2_container_dup. This function expects the source container to have
weakproxy objects, inserts the associated non-weak objects into the
destination container. Orphaned weakproxy objects are ignored.
Create test for this new function and for ao2_weakproxy_find.
Change-Id: I898387f058057e08696fe9070f8cd94ef3a27482
This patch makes it so only matching non-empty key names, and keys created by
the HASH function are eligible for inclusion in the comma separated string. It
also fixes a bug where it was possible to write to a negative index if the
result buffer was empty.
ASTERISK-28159
patches:
ASTERISK-28159.diff submitted by Michael Walton (license 6502)
Change-Id: I6e57fe7307dfd856271753aed5ba64c59b511487
The job timeouts were hard coded in the jenkinsfiles which
means changes had to go through gerrit. Now they are taken
from the following environment variables (and their defaults) that
can be set in Jenkins configuration...
TIMEOUT_GATES = "60 MINUTES"
TIMEOUT_DAILIES = "3 HOURS"
TIMEOUT_REF_DEBUG = "24 HOURS"
TIMEOUT_UNITTESTS = "30 MINUTES"
Change-Id: I673a551c1780bf665a3bc160b245da574aa4bbab
This replaces the inline functions with macros. This removes the need
to directly use __ao2_ref, opts instead for standard ao2_bump and
ao2_cleanup macros.
Change-Id: If4e04e9bab2e3c883188437cb9f487b3e498a21b
We've been seeing crashes in libbfd when we attempt to generate
a stack trace from multiple threads. It turns out that libbfd
is NOT thread-safe. It can cache the bfd structure and give it to
multiple threads without protecting itself. To get around this,
we've added a global mutex around the bfd functions and also have
refactored the use of those functions to be more efficient and
to provide more information about inlined functions.
Also added a few more tests to test_pbx.c. One just calls
ast_assert() and the other calls ast_log_backtrace(). Neither are
run by default.
WARNING: This change necessitated changing the return value of
ast_bt_get_symbols() from an array of strings to a VECTOR of
strings. However, the use of this function outside Asterisk is not
likely.
ASTERISK-28140
Change-Id: I79d02862ddaa2423a0809caa4b3b85c128131621
When a subscribe or unsubscribe occurs a message is published
containing this information. This change makes it so that the
message no longer uses stringfields or a lock, as both are not
really needed for the message.
Change-Id: I3f4831931d79f94fd979baf48048738df5dc1632
New dialplan function PJSIP_PARSE_URI added to parse an URI and return
a specified part of the URI.
This is useful when need to get part of the URI instead of cutting it
using a CUT function.
For example to get 'user' part of Remote URI
${PJSIP_PARSE_URI(${CHANNEL(pjsip,remote_uri)},user)}
ASTERISK-28144 #close
Change-Id: I5d828fb87f6803b6c1152bb7b44835f027bb9d5a
This change adds the ability for subscriptions to indicate
which message types they are interested in accepting. By
doing so the filtering is done before being dispatched
to the subscriber, reducing the amount of work that has
to be done.
This is optional and if a subscriber does not add
message types they wish to accept and set the subscription
to selective filtering the previous behavior is preserved
and they receive all messages.
There is also the ability to explicitly force the reception
of all messages for cases such as AMI or ARI where a large
number of messages are expected that are then generically
converted into a different format.
ASTERISK-28103
Change-Id: I99bee23895baa0a117985d51683f7963b77aa190
The testsuite can now use a user-specified work directory for
all it's temp files. This allows the docker containers to use
a tmpfs backed directory for the temp files instead of it's
own write-layer image.
* runTestsuite.sh now accepts a --work-dir command line argument
that gets exported as AST_WORK_DIR before running the testsuite.
* gates.jenkinsfile now specifies --work-dir to be
<testsuite_dir>/astroot.
Since the Asterisk CI docker hosts now mount /srv/jenkins/workspace
on a tmpfs, asterisk should be compiled and the testsuite run all in
memory.
Change-Id: If5ee905a15821296c355bb84cda38950ad8edc45
(cherry picked from commit a335f4c9ad)
The res_ari(POST /channels/create handler) deos not check the endpoint
parameter length. And it causes core
dump.
Fixed it to check the parameter length. Also fixed memory leak.
ASTERISK-28169
Change-Id: Ibf10a9eb8a2e3a9ee1e13fbe748b2ecf955c3993