summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-07-07Merge "res_pjsip_mwi.c: Use safer loop coding in ↵Matt Jordan
mwi_subscription_mailboxes_str()."
2015-07-07Merge "res_pjsip_mwi.c: Fix MWI subscription memory corruption crash."Matt Jordan
2015-07-07Merge "PJSIP XML, XPIDF: Fix buffer size overwrite memory corruption error."Joshua Colp
2015-07-07Merge topic 'res_pjsip_mwi_cleanups'Joshua Colp
* changes: res_pjsip_mwi.c: Eliminate a simple RAII_VAR. res_pjsip_mwi.c: Fix mid-line log message line breaks.
2015-07-07Merge "PJSIP FAX: Fix T.38 automatic reject timer NULL channel pointer ↵Joshua Colp
dereferences."
2015-07-07Merge "res_pjsip_t38.c: Fix always false if test."Joshua Colp
2015-07-07Merge "res/res_http_websocket: Don't send HTTP response fragmented."Joshua Colp
2015-07-07res_rtp_asterisk: Prevent simultaneous access to DTLS SSL context.Joshua Colp
This change moves logic for setting up the DTLS SSL contexts to when the SDP is done being processed instead of when ICE negotiation completes. It also stops handshakes from being initiated when we are acting as a server. Manipulating the SSL context when ICE negotiation has completed is problematic as the SSL context is not protected and if acting as a client the remote side may have started DTLS negotiation already. The retransmission timeout timer code has also been split up and simplified some. Both RTP and RTCP now have their own timers and the points at which the timer is stopped and started is now more specific. When a packet is sent the timer is started. When a response is received but before it is processed the timer is stopped. This provides a guarantee that the timeout is not occurring while the response is processed. ASTERISK-22805 #close ASTERISK-24550 #close ASTERISK-24651 #close ASTERISK-24832 #close ASTERISK-25103 #close ASTERISK-25127 #close Change-Id: Ib75ea2546f29d6efc3d2d37c58df6986c7bd9b91
2015-07-06res_pjsip_mwi.c: Fix MWI subscription memory corruption crash.Richard Mudgett
MWI subscriptions can crash or corrupt memory when using the subscription datastore to access the MWI subscription object because the datastore is not holding a reference to the object. * Give the subscription datastore a ref to the MWI subscription object. It is unfortunate that the ref causes a circular ref chain that must be explicitly broken to allow the memory to get released. The loop is broken when the subscription is shutdown and if the subscription setup fails. ASTERISK-25168 #close Reported by: Carl Fortin Change-Id: Ice4fa823f138ff10a6c74d280699c41a82836d4f
2015-07-06PJSIP XML, XPIDF: Fix buffer size overwrite memory corruption error.Richard Mudgett
When res_pjsip body generator modules were generating XML or XPIDF response bodies, there was a chance that the generated body would be the exact size of the supplied buffer. Adding the nul string terminator would then write beyond the end of the buffer and potentially corrupt memory. * Fix MALLOC_DEBUG high fence violations caused by adding a nul string terminator on the end of a buffer for XML or XPIDF response bodies. * Made calls to pj_xml_print() safer if the XML prolog is requested. Due to a bug in pjproject, the return value could be -1 _or_ AST_PJSIP_XML_PROLOG_LEN if the supplied buffer is not large enough. * Updated the doxygen comment of AST_PJSIP_XML_PROLOG_LEN to describe the return value of pj_xml_print() when the supplied buffer is not large enough. ASTERISK-25168 Reported by: Carl Fortin Change-Id: Id70e1d373a6a2b2bd9e678b5cbc5e55b308981de
2015-07-06PJSIP FAX: Fix T.38 automatic reject timer NULL channel pointer dereferences.Richard Mudgett
When a caller calls a FAX number and then hangs up right after the call is answered then the T.38 re-INVITE automatic reject timer may still be running after the channel goes away. * Added session NULL channel checks on the code paths that get executed by t38_automatic_reject() to prevent a crash when the T.38 re-INVITE automatic reject timer expires. ASTERISK-25168 Reported by: Carl Fortin Change-Id: I07b6cd23815aedce5044f8f32543779e2f7a2403
2015-07-06res_pjsip_mwi.c: Use safer loop coding in mwi_subscription_mailboxes_str().Richard Mudgett
Change-Id: I6f39d809a6d1b47b35bb32b298f5a12f35d6f907
2015-07-06res_pjsip_mwi.c: Eliminate a simple RAII_VAR.Richard Mudgett
Change-Id: Ib1843f81e826a6c760c424c88eb70c350d9d61da
2015-07-06res_pjsip_mwi.c: Fix mid-line log message line breaks.Richard Mudgett
* Add create_mwi_subscriptions_for_endpoint() doxygen comment. Change-Id: I3c3f921f4ec749fb65b62d2f6fa0d4d1888b94e2
2015-07-06res_pjsip_t38.c: Fix always false if test.Richard Mudgett
Calling t38_change_state() sets the t38 state so it makes little sense to then check the state right after the call for something else. * Made the code in t38_interpret_parameters() reject or exit T.38 mode as intended but not implemented. Change-Id: Ib281263a6ed44da9448132c4e6df1e183b8a3df2
2015-07-06Merge "res_pjsip: Failover when server is not available"Mark Michelson
2015-07-06res_pjsip: Failover when server is not availableKevin Harwell
Previously Asterisk did not properly failover to the next resolved DNS address when a endpoint could not be reached. With this patch, and while using res_pjsip, SIP requests (both in/out of dialog) now attempt to use the next address in the list of resolved addresses until a proper response is received or no more addresses are left. ASTERISK-25076 #close Reported by: Joshua Colp Change-Id: Ief14f4ebd82474881f72f4538f4577f30af2a764
2015-07-06res_sorcery_memory_cache: Execute stale unit test last.Joshua Colp
In Jenkins there is currently a sporadic test failure of a variable number of sorcery memory cache unit tests. I have not been able to reproduce this on the build agents themselves or on my development machine. My working theory is that the stale unit test is causing a sorcery instance to persist longer than expected, causing subsequent tests to fail when setting up and initializing the next sorcery instance. To see if this is the case this change moves the stale unit test to execute last so no subsequent unit tests can have issues initializing their sorcery instance. Change-Id: Ifd6550a949613be774b75fa5db12c02110f82c4a
2015-07-04Merge "chan_sip: Fix early call pickup channel leak."Joshua Colp
2015-07-04res/res_http_websocket: Don't send HTTP response fragmented.Joshua Colp
This change makes it so that when accepting a WebSocket connection the HTTP response is sent as one packet instead of fragmented. Browsers don't like it when you send it fragmented. ASTERISK-25103 Change-Id: I9b82c4ec2949b0bce692ad0bf6f7cea9709e7f69
2015-07-04Makefile: Remove coverage files on 'make clean'Matt Jordan
This patch updates a variety of Makefiles in Asterisk's build system to remove .gcda and .gcno files when 'make clean' is executed. These files are generated when '--enable-coverage' is passed to the Asterisk configure script. Change-Id: Ib70b41eea2ee2908885bff02e80faf9f40c84602
2015-07-02Merge "chan_vpb.cc: Fix compiler warning Jenkins found."Joshua Colp
2015-07-02Merge "dns: Fix crash when invoking cancel in DNS recurring unit test."Matt Jordan
2015-07-02chan_sip: Fix early call pickup channel leak.Walter Doekes
When handle_invite_replaces() was called, and either ast_bridge_impart() failed or there was no bridge (because the channel we're picking up was still ringing), chan_sip would leak a channel. Thanks Matt and Corey for checking the bridge path. ASTERISK-25226 #close Change-Id: Ie736bb182170a73eef5bcef0ab0376f645c260c8
2015-07-02Merge "sorcery/realtime: Add a bit of debug and warning messages for bad ↵Matt Jordan
configs"
2015-07-02Merge "res_timing: Don't close FD 0 when out of open files."Joshua Colp
2015-07-02Merge "rtp_engine: Skip useless self-assignment in ↵Joshua Colp
ast_rtp_engine_unload_format."
2015-07-02Merge "astfd: Fix buffer overflow in DEBUG_FD_LEAKS."Joshua Colp
2015-07-02Merge "chan_mgcp: Don't call close on fd -1."Joshua Colp
2015-07-02sorcery/realtime: Add a bit of debug and warning messages for bad configsMatt Jordan
When a mapping does not exist between a sorcery.conf defined object and a realtime mapping in extconf, currently, the user will receive a slew of ERROR messages that don't really tell what is happening. Some ERROR messages may even be misleading, as they occur after the sorcery API has already given up on the attempt to load and create the sorcery object. This patch adds a bit of debug and a useful WARNING message for when a wizard's open callback fails for a particular object type. In the bad configurations that resulted in this patch, this provided a 'root cause' WARNING message that pointed in the right direction of the configuration problem. Change-Id: I1cc7344f2b015b8b9c85a7e6ebc8cb4753a8f80b
2015-07-02dns: Fix crash when invoking cancel in DNS recurring unit test.Joshua Colp
The recurring unit test expects the user data on a DNS query created as a result of a recurring DNS query to be the recurring structure itself. This is true, mostly. When invoking the user provided callback this user data is changed to the user provided data. This presents a race condition where the data may or may not point to the recurring data. This change simplifies the callback of the user provided callback by creating a new query and populating it with the expected values. This leaves the recurring DNS query alone and fixes the race condition. This is more in line with how the API should be used overall. ASTERISK-25222 #close Change-Id: I10fb6deec025dff097157e7ec17e6e4921778478
2015-07-02chan_mgcp: Don't call close on fd -1.Walter Doekes
ASTERISK-25220 #close Change-Id: Ic48f3a82f51ada87f2fb0e016c9efe0ad56f1ee3
2015-07-02rtp_engine: Skip useless self-assignment in ast_rtp_engine_unload_format.Walter Doekes
When running valgrind on Asterisk, it complained about: ==32423== Source and destination overlap in memcpy(0x85a920, 0x85a920, 304) ==32423== at 0x4C2F71C: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/...) ==32423== by 0x55BA91: ast_rtp_engine_unload_format (rtp_engine.c:2292) ==32423== by 0x4EEFB7: ast_format_attr_unreg_interface (format.c:1437) The code in question is a struct assignment, which may be performed by memcpy as a compiler optimization. It is changed to only copy the struct contents if source and destination are different. ASTERISK-25219 #close Change-Id: I6d3546c326b03378ca8e9b8cefd41c16e0088b9a
2015-07-02astfd: Fix buffer overflow in DEBUG_FD_LEAKS.Walter Doekes
If DEBUG_FD_LEAKS was used and more file descriptors than the default of 1024 were available, some DEBUG_FD_LEAKS-patched functions would overwrite memory past the fixed-size (1024) fdleaks buffer. This change: - adds bounds checks to __ast_fdleak_fopen and __ast_fdleak_pipe - consistently uses ARRAY_LEN() instead of sizeof() or 1023 or 1024 - stores pointers to constants instead of copying the contents - reorders the fdleaks struct for possibly tighter packing - adds a tiny bit of documentation ASTERISK-25212 #close Change-Id: Iacb69e7701c0f0a113786bd946cea5b6335a85e5
2015-07-02res_timing: Don't close FD 0 when out of open files.Walter Doekes
This fixes so a failure to get a timer file descriptor does not cascade to closing FD 0. On error, both res_timing_kqueue and res_timing_timerfd would call the destructor before setting the file handle. The file handle had been initialized to 0, causing FD 0 to be closed. This in turn, resulted in floods of "CLI>" messages and an unusable terminal. ASTERISK-19277 #close Reported by: Barry Chern For the master branch, this was already fixed. This patch only ensures that we do not attempt to close a negative file descriptor. Change-Id: I147d7e33726c6e5a2751928d56561494f5800350
2015-07-01chan_vpb.cc: Fix compiler warning Jenkins found.Richard Mudgett
Change-Id: I0ec7fd10d56d90d5a60b12b5a7d6807f265ac5e0
2015-07-01Channel alert pipe: improve diagnostic error returnScott Griepentrog
When a frame is queued on a channel, any failure in ast_channel_alert_write is logged along with errno. This change improves the diagnostic message through aligning the errno value with actual failure cases. ASTERISK-25224 Reported by: Andrey Biglari Change-Id: I1bf7b3337ad392789a9f02c650589cd065d20b5b
2015-06-30Merge "res_sorcery_realtime: Fix leak of sorcery object type."Joshua Colp
2015-06-30Merge "channel: Remove ignore of answer on non-outgoing channels."Matt Jordan
2015-06-29res_sorcery_realtime: Fix leak of sorcery object type.Mark Michelson
This prevents a leak of a sorcery object type when realtime sorcery objects are retrieved by fields or when multiple objects are retrieved. The extent of this leak is that sorcery object types would be leaked. These are allocated whenever an object type is registered with sorcery, meaning that on module shutdown, these objects would be leaked. This could be problematic if many reloads were performed, but it is not as severe as if every sorcery object retrieved from realtime were being leaked. ASTERISK-25165 #close Reported by Corey Farrell Change-Id: I625c3b50eee4576670b7eeb013c81ad043b4b4f8
2015-06-29Merge "res_pjsip_nat: Adjust when contact should be rewritten."Matt Jordan
2015-06-29Merge "res/res_corosync: Always decline module load, instead of failing"Matt Jordan
2015-06-26res/res_corosync: Always decline module load, instead of failingMatt Jordan
Returns a 'failure' from the module load routine indicates to Asterisk that it should abort loading completely. This is rarely - in fact, really, never - a good option. Aborting load of Asterisk from a dynamic module implies that the core, and the rest of the dynamic modules, don't matter: we should abandon all processing. res_corosync is really not that important. This patch updates the module such that, if it fails to load, it politely declines (emitting ERROR messages along the way), and allows Asterisk to continue to function. Note that this issue was keeping Asterisk unit tests from running on certain build agents. Change-Id: I252249e81fb9b1a68e0da873f54f47e21d648f0f
2015-06-26main/pbx: Resolve case sensitivity regression in PBX hintsMatt Jordan
When 8297136f was merged for ASTERISK-25040, a regression was introduced surrounding the case sensitivity of device names within hints. Previously, device names - such as 'sip/foo' - were compared in a case insensitive fashion. Thus, 'sip/foo' was equivalent to 'SIP/foo'. After that patch, only the case sensitive name would match, i.e., 'SIP/foo'. As a result, some dialplan hints stopped working. This patch re-introduces case insensitive matching for device names in hints. ASTERISK-25040 ASTERISK-25202 #close Change-Id: If5046a7d14097e1e3c12b63092b9584bb1e9cb4c (cherry picked from commit 96bbcf495a1da9e607d9b04a44b5c4f49e83cc03)
2015-06-26res_pjsip_nat: Adjust when contact should be rewritten.Mark Michelson
A previous change made the contact only get rewritten if the dialog's route set was not marked frozen. Unfortunately, while the intent of this is correct, the dialog's route set actually gets marked as frozen earlier than expected, especially for UAS dialogs. Instead, the idea is that the contact needs to not be rewritten if there is a pre-existing route set on the dialog. This is now accomplished by checking the dialog's route set list instead of checking if the route set is frozen. Doing this causes some broken tests to begin passing again. ASTERISK-25196 Reported by Mark Michelson Change-Id: I525ab251fd40a52ede327a52a2810a56deb0529e
2015-06-26res_pjsip_outbound_registration.c: Add a serializer shutdown group.Richard Mudgett
The client_state objects contain a serializer used to send the outbound REGISTER messages. Once all those message transactions are complete then the module can shutdown. ASTERISK-24907 #close Reported by: Kevin Harwell Change-Id: Ibb2fe558f98190f2a06da830e0fadfa25516f547
2015-06-26Merge "threadpool, res_pjsip: Add serializer group shutdown API calls."Matt Jordan
2015-06-26Merge "res_pjsip_outbound_registration.c: Fix ↵Matt Jordan
handle_client_state_destruction() refs"
2015-06-26Merge "res_pjsip_outbound_registration.c: Use ↵Matt Jordan
ast_sorcery_object_unregister() API"
2015-06-26Merge "res_pjsip_refer: Prevent sending duplicate headers."Matt Jordan