summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-07-14ARI: Added new functionality to unload a single module.Benjamin Ford
An http request can be sent to unload an Asterisk module. If the module can not be unloaded or is already unloaded, an error response will be returned. The command "curl -v -u user:pass -X DELETE 'http://localhost:8088 /ari/asterisk/modules/{moduleName}'" (or something similar, depending on configuration) can be run in the terminal to access this new functionality. For more information, see: https://wiki.asterisk.org/wiki.display/~bford/Asterisk+ARI+Resource * Added new ARI functionality * Asterisk modules can be unloaded through http requests ASTERISK-25173 Change-Id: I535a95f5676deb02651522761ecbdc0b00b5ac57
2015-07-13ARI: Added new functionality to load a single module.Benjamin Ford
An http request can be sent to load an Asterisk module. If the module can not be loaded or is loaded already, an error response will be returned. The command curl -v -u user:pass -X POST 'http://localhost:8088/ari /asterisk/modules/{moduleName}'" (or something similar, depending on configuration) can be run in the terminal to access this new functionality. For more information, see: https://wiki.asterisk.org/wiki.display/~bford/Asterisk+ARI+Resource * Added new ARI functionality * Asterisk modules can be loaded through http requests ASTERISK-25173 Change-Id: I9e05d5b8c5c666ecfef341504f9edc1aa84fda33
2015-07-13Merge "ARI: Added new functionality to get information on a single module." ↵Mark Michelson
into 13
2015-07-13Merge "bridge.c: Fixed race condition during attended transfer" into 13Mark Michelson
2015-07-13ARI: Added new functionality to get information on a single module.Benjamin Ford
An http request can be sent to retrieve information on a single module, including the resource name, description, use count, status, and support level. The command "curl -v -u user:pass -X GET 'http://localhost:8088/ari /asterisk/modules/{moduleName}'" (or something similar, depending on configuration) can be run in the terminal to access this new functionality. For more information, see: https://wiki.asterisk.org/wiki.display/~bford/Asterisk+ARI+Resource * Added new ARI functionality * Information on a single module can now be retrieved ASTERISK-25173 Change-Id: Ibce5a94e70ecdf4e90329cf0ba66c33a62d37463
2015-07-13bridge.c: Fixed race condition during attended transferKevin Harwell
During an attended transfer a thread is started that handles imparting the bridge channel. From the start of the thread to when the bridge channel is ready exists a gap that can potentially cause problems (for instance, the channel being swapped is hung up before the replacement channel enters the bridge thus stopping the transfer). This patch adds a condition that waits for the impart thread to get to a point of acceptable readiness before allowing the initiating thread to continue. ASTERISK-24782 Reported by: John Bigelow Change-Id: I08fe33a2560da924e676df55b181e46fca604577
2015-07-13Merge "main/format_cap: Parse capabilities generated by ↵Matt Jordan
ast_format_cap_get_names" into 13
2015-07-12main/sorcery: Don't fail object set creation from JSON if field failsMatt Jordan
Some individual fields may fail their conversion due to their default values being invalid for their custom handlers. In particular, configuration values that depend on others being enabled (and thus have an empty default value) are notorious for tripping this routine up. An example of this are any of the DTLS options for endpoints. Any of the DTLS options will fail to be applied (as DTLS is not enabled), causing the entire object set to be aborted. This patch makes it so that we log a debug message when skipping a field, and rumble on anyway. ASTERISK-25238 Change-Id: I0bea13de79f66bf9f9ae6ece0e94a2dc1c026a76
2015-07-12main/format_cap: Parse capabilities generated by ast_format_cap_get_namesMatt Jordan
We have a strange relationship between the parsing of format capabilities from a string and their representation as a string. We expect the format capabilities to be expressed as a string in the following format: allow = !all,ulaw,alaw disallow = g722 While we would generate the string representation of those formats as: allow = (ulaw|alaw) disallow = (ulaw|alaw|g729...) When the configuration framework needs to store values as a string, it generates the format capabilities using the second representation; this representation however cannot be parsed when the entry is rehydrated. This patch fixes that by updating ast_format_cap_update_by_allow_disallow to parse an entry as if it were in the generated format if it has a leading '(' and a trailing ')'. ASTERISK-25238 Change-Id: I904d43caf4cf45af06f6aee0c9e58556eb91d6ca
2015-07-11Merge "tests/test_devicestate: Add additional tests for the device state ↵Matt Jordan
API" into 13
2015-07-11Merge "res/res_sorcery_memory_cache: Fix test registration issues" into 13Matt Jordan
2015-07-11Merge "tests/test_sorcery_memory_cache_thrash: Fix test loading problems" ↵Matt Jordan
into 13
2015-07-11tests/test_devicestate: Add additional tests for the device state APIMatt Jordan
This patch adds more tests that exercise the device state API. This includes: * Tests that cover adding a device state provider, as well as deleting a device state provider. This also verifies that you cannot add an already added device state provider, and cannot delete an already deleted device state provider. * A test that covers changing device state and receiving said updates from a device state subscriber. This also covers hitting both the device state cache as well as a custom device state provider. * A test that covers converting device state to channel state and device state values to a string representation and back. * A test that covers obtaining device state from an active channel and a channel driver that provides its own device state. Change-Id: I2adca67ffb405cd8625a5d6df1e3f9b3d945c08d
2015-07-11main/devicestate: Prevent duplicate registration of device state providersMatt Jordan
Currently, the device state provider API will allow you to register a device state provider with the same case insensitive name more than once. This could cause strange issues, as the duplicate device state providers will not be queried when a device's state has to be polled. This patch updates the API such that a device state provider with the same name as one that has already registered will be rejected. Change-Id: I4a418a12280b7b6e4960bd44f302e27cd036ceb2
2015-07-10res/res_sorcery_memory_cache: Fix test registration issuesMatt Jordan
Again, tests now need to not end with a newline. This patch makes it so the tests can register again, unit tests will actually pass, and we can stop wasting time trying to figure out why builds are failing when they really aren't failing. Change-Id: Ide519fbeba89f413c733446c5ff7b224fc4ce840
2015-07-10Merge "ARI: Added new functionality to get all module information." into 13Matt Jordan
2015-07-10tests/test_sorcery_memory_cache_thrash: Fix test loading problemsMatt Jordan
Because unit tests now want descriptions to not end with a newline, the sorcery memory cache thrash tests failed to register. This patch corrects their descriptions. Change-Id: Id004b1becfdeed8ee3c846f49beab76a5c0f68b6
2015-07-10ARI: Added new functionality to get all module information.Benjamin Ford
An http request can be sent to retrieve a list of all existing modules, including the resource name, description, use count, status, and support level. The command "curl -v -u user:pass -X GET 'http://localhost:8088/ari/ asterisk/modules" (or something similar, depending on configuration) can be run in the terminal to access this new functionality. For more information, see: https://wiki.asterisk.org/wiki.display/~bford/Asterisk+ARI+Resource * Added new ARI functionality * Information on modules can now be retrieved Change-Id: I63cbbf0ec0c3544cc45ed2a588dceabe91c5e0b0
2015-07-10Merge "bridge_native_rtp.c: Don't start native RTP bridging after attended ↵Matt Jordan
transfer." into 13
2015-07-09bridge_native_rtp.c: Don't start native RTP bridging after attended transfer.Joshua Colp
The bridge_native_rtp module adds a frame hook to channels which are in a native RTP bridge. This frame hook is used to intercept when a hold or unhold frame traverses the bridge so native RTP can be stopped or started as appropriate. This is expected but exposes a specific bug when attended transfers are involved. Upon completion of an attended transfer an unhold frame is queued up to take one of the channels involved off hold. After this is done the channel is moved between bridges. When the frame hook is involved in this case for the unhold it releases the channel lock and acquires the bridge lock. This allows the bridge core to step in and move the channel (potentially changing the bridging techology) from another thread. Once completed the bridge lock is released by the bridge core. The frame hook is then able to acquire the bridge lock and wrongfully starts native RTP again, despite the channel no longer being in the bridge or needing to start native RTP. In fact at this point the frame hook is no longer attached to the channel. This change makes it so the native RTP bridge data is available to the frame hook when it is invoked. Whether the frame hook has been detached or not is stored on the native RTP bridge data and is checked by the frame hook before starting or stopping native RTP bridging. If the frame hook has been detached it does nothing. ASTERISK-25240 #close Change-Id: I13a73186a05f4e5a764f81e5cd0ccec1ed1891d2
2015-07-09res_sorcery_memory_cache: Backport to 13Joshua Colp
Gerrit is complaining of conflicts when trying to create a patch series of all of the cherry-picked master commits, so I have instead squashed it all into one commit. ASTERISK-25067 #close Reported by: Matt Jordan Change-Id: I6dda90343fae24a75dc5beec84980024e8d61eb9
2015-07-08res_rtp_asterisk: Ensure DTLS timeout timer is -1 if DTLS is not used.Joshua Colp
This change fixes a bug where the DTLS timeout timer would be initialized to 0 if DTLS was not used for an RTP session. ASTERISK-25103 Change-Id: If8d26bb054f1d300838850da5b8db9044c2fe2ac
2015-07-07Merge "res_pjsip_mwi.c: Use safer loop coding in ↵Matt Jordan
mwi_subscription_mailboxes_str()." into 13
2015-07-07Merge "res_pjsip_mwi.c: Fix MWI subscription memory corruption crash." into 13Matt Jordan
2015-07-07Merge "PJSIP XML, XPIDF: Fix buffer size overwrite memory corruption error." ↵Joshua Colp
into 13
2015-07-07Merge topic 'res_pjsip_mwi_cleanups' into 13Joshua 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." into 13
2015-07-07Merge "res_pjsip_t38.c: Fix always false if test." into 13Joshua Colp
2015-07-07Merge "res_pjsip: Need to use the same serializer for a pjproject SIP ↵Joshua Colp
transaction." into 13
2015-07-07Merge "res/res_http_websocket: Don't send HTTP response fragmented." into 13Joshua 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_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-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_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: Need to use the same serializer for a pjproject SIP transaction.Richard Mudgett
All send/receive processing for a SIP transaction needs to be done under the same threadpool serializer to prevent reentrancy problems inside pjproject and res_pjsip. * Add threadpool API call to get the current serializer associated with the worker thread. * Pick a serializer from a pool of default serializers if the caller of res_pjsip.c:ast_sip_push_task() does not provide one. This is a simple way to ensure that all outgoing SIP request messages are processed under a serializer. Otherwise, any place where a pushed task is done that would result in an outgoing out-of-dialog request would need to be modified to supply a serializer. Serializers from the default serializer pool are picked in a round robin sequence for simplicity. A side effect is that the default serializer pool will limit the growth of the thread pool from random tasks. This is not necessarily a bad thing. * Made pjsip_distributor.c save the thread's serializer name on the outgoing request tdata struct so the response can be processed under the same serializer. This is a cherry-pick from master. **** ASTERISK-25115 Change-Id: Iea71c16ce1132017b5791635e198b8c27973f40a NOTE: session_inv_on_state_changed() is disassociating the dialog from the session when the invite dialog becomes PJSIP_INV_STATE_DISCONNECTED. Unfortunately this is a tad too soon because our BYE request transaction has not completed yet. ASTERISK-25183 #close Reported by: Matt Jordan Change-Id: I8bad0ae1daf18d75b8c9e55874244b7962df2d0a
2015-07-04Merge "chan_sip: Fix early call pickup channel leak." into 13Joshua 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." into 13Joshua Colp
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" into 13
2015-07-02Merge "res_timing: Don't close FD 0 when out of open files." into 13Joshua Colp
2015-07-02Merge "rtp_engine: Skip useless self-assignment in ↵Joshua Colp
ast_rtp_engine_unload_format." into 13
2015-07-02Merge "astfd: Fix buffer overflow in DEBUG_FD_LEAKS." into 13Joshua Colp
2015-07-02Merge "chan_mgcp: Don't call close on fd -1." into 13Joshua Colp
2015-07-02chan_mgcp: Don't call close on fd -1.Walter Doekes
ASTERISK-25220 #close Change-Id: Ic48f3a82f51ada87f2fb0e016c9efe0ad56f1ee3