In an earlier version of Asterisk a local channel [un]lock all functions were
added in order to keep a crash from occurring when a channel hung up too early
during an attended transfer. Unfortunately, when a transfer failure occurs and
depending on the timing, the local channels sometime do not get properly
unlocked and deref'ed after being locked and ref'ed. This happens because the
underlying local channel structure gets NULLed out before unlocking.
This patch reworks those [un]lock functions and makes sure the values that get
locked and ref'ed later get unlocked and deref'ed.
ASTERISK-27074 #close
Change-Id: Ice96653e29bd9d6674ed5f95feb6b448ab148b09
If an attended transfer failed it was possible for some of the channels
involved to get "stuck" because Asterisk was not hanging up the transfer target.
This patch ensures Asterisk hangs up the transfer target when an attended
transfer failure occurs.
ASTERISK-27075 #close
Change-Id: I98a6ecd92d3461ab98c36f0d9451d23adaf3e5f9
If the endpoint's last contact is deleted unsolicited MWI has to be
unsubscribed.
ASTERISK-27051 #close
Change-Id: I33e174e0b9dba0998927d16d6d100fda5c7254e0
When a stasis channel is stolen by another app, the control
structure is unreffed but never unlinked from the app_controls
container. This causes the channel reference to leak.
Added OBJ_UNLINK to the callback in channel_stolen_cb.
Also added some additional channel lifecycle debug messages to
channel.c.
ASTERISK-27059 #close
Repoorted-by: George Joseph
Change-Id: Ib820936cd49453f20156971785e7f4f182c56e14
Not easy to reproduce, but we have noticed deadlocks when unloading a module
while dialplan is handling a request.
The deadlock is between :
1) Dialplan execution: pbx_extension_helper() first taking conlock,
then pbx_findapp() [when called] asking for lock on apps list.
2) Application unregistration: ast_unregister_application() first taking lock
on apps list, then unreference_cached_app() [when called] asking for conlock.
As a protection, I suggest to modify ast_unregister_application(), so that it
anticipates the need of conlock, before taking the lock on apps list.
The side effect is a longer unavailability of conlock when unregistering an
application.
ASTERISK-27041
Change-Id: I0db0f1eb320da6a5758cce3a47d765be1face8e2
* changes:
SDP: Set the remote c= line in RTP instance.
SDP: Add t= line in sdp_create_from_state()
stream: Ignore declined streams for some topology calls.
This option was added to control whether to notify dialog-info state
'early' or 'confirmed' on Ringing when already INUSE.
The value "yes" is useful for some SIP phones (Cisco SPA)
to be able to indicate and pick up ringing devices.
ASTERISK-26919 #close
Change-Id: Ie050bc30023543c7dfb4365c5be3ce58c738c711
In Corosync 2.x libraries were changed to use LibQB IPC.
Sadly LibQB IPC doesn't support copy-free access to received buffer, so
Corosync libraries were rewritten to use stack as buffer. Mostly the
needed stack size is quite small, but for all *_dispatch functions, 1MiB
is needed.
Asterisk function ast_pthread_create_background set stack size for new
thread to much smaller AST_BACKGROUND_STACKSIZE (~500KiB).
This results in Asterisk crash when running with Corosync 2.x.
Patch solves this issue by creating it's own version of
ast_pthread_create_background which sets stack size to much higher value
(actually it's AST_BACKGROUND_STACKSIZE + 3MiB).
Another problem may appear when "corosync show members" netconsole
command is executed. It is also executed in thread and also has only
500KiB stack size. Sadly it calls corosync_cfg_get_node_addrs which
again needs at least 1MiB stack.
Solution is to use HAVE_COROSYNC_CFG_STATE_TRACK as a discriminator
between Corosync 1.x and 2.x. If 1.x is found, nothing changes. If 2.x
is found, NodeID is displayed instead of IP address.
ASTERISK-25370 #close
Reported by: mdu113
Change-Id: Id95b0d21ab6e708e7d74ad8786c587211676fa08
The recent change to make the use of LOAD_DECLINE more consistent
caused res_ari to unload itself before declining if the ari.conf
file wasn't found. The ari stubs though still tried to use the
configuration resulting in segfaults.
This patch creates a new CHECK_ARI_MODULE_LOADED macro which tests
to see if res_ari is actually loaded and causes the stubs to also
decline if it isn't. The macro was then added to the mustache
template's "load_module" function.
ASTERISK-27026 #close
Reported-by: Ronald Raikes
Change-Id: I263d56efa628ee3c411bdcd16d49af6260c6c91d
The construction of the returned string assumed incorrectly that the
supplied buffer would always be initialized as an empty string. If it is
not an empty string we could overrun the supplied buffer by the length of
the non-empty buffer string plus one. It is also theoreticaly possible
for the supplied buffer to be overrun by a string terminator during a read
operation even if the supplied buffer is an empty string.
* Fix the assumption that the supplied buffer would already be an empty
string. The buffer is not guaranteed to contain an empty string by all
possible callers.
* Fix string terminator buffer overrun potential.
Change-Id: If6a0806806527678c8554b1dcb34fd7808aa95c9
* Pulled finding the rtcp-mux attribute flag out of the ICE candidate for
loop. Also ordered the RTCP ICE candidate skip test to fail earlier.
Change-Id: I8905d9c68563027a46cd3ae14dbcc27e9c814809
* Made ast_format_cap_from_stream_topology() not include any formats from
declined streams.
* Made ast_stream_topology_get_first_stream_by_type() ignore declined
streams to return the first active stream of the type.
* Updated unit tests to check these changes have the expected effect.
Change-Id: Iabbc6a3e8edf263a25fd3056c3c614407c7897df
The ast_channel_suppress function wrongly decremented the
reference count of the underlying structure used to keep
track of what should be suppressed on a channel if the
function was called multiple times on the same channel.
This change cleans up the reference counting a bit so
this no longer occurs.
ASTERISK-27016
Change-Id: I2eed4077cb4916e6626f9f120b63b963acc5c136
destroy_subscription was attempting to get the id of the
subscription tree's endpoint after we'd already called ao2_cleanup
on it causing a segfault.
Moved the cleanup until after the debug statement and since
endpoint could also be NULL at this point, check for that as well.
ASTERISK-27057 #close
Reported-by: Ryan Smith
Change-Id: Ice0a7727f560cf204d870a774c6df71e159b1678
There was a typo introduced in commit 776ffd77 which was preventing
the transport's external media address from being used.
ASTERISK-27024 #close
Reported-by: Christopher van de Sande
patches:
patch.diff submitted by Florian Floimair (license 6892)
Change-Id: I7ec617171eaa2d86d2680b00cf37d5088adafc27