summaryrefslogtreecommitdiff
path: root/main
AgeCommit message (Collapse)Author
2017-07-12Merge "Avoid setting maxfiles for a remote asterisk"Joshua Colp
2017-07-11Merge "http.c: Reduce log spam"Jenkins2
2017-07-11Avoid setting maxfiles for a remote asteriskTzafrir Cohen
Setting maxfiles (maximum number of open files) has no practical effect on a remote asterisk (rasterisk, rasterisk -x). It has an ill effect of printing an extra message, which may be annoying in case of -x. ASTERISK-27105 #close Change-Id: Iaf9eb344e4b4b517df91b736b27ec55f6a6921a2
2017-07-11http.c: Reduce log spamGeorge Joseph
Messages like "fwrite() failed: Connection reset by peer" are no help whatsoever, especially since they can be caused simply by a client disconnecting. * Make those WARNINGs DEBUGs. * Check the return from ast_iostream_printf of headers. Change-Id: I17bd5f3621514152a7b2b263c801324c5e96568b
2017-07-07json.c: Add backtrace log to find 'Invalid UTF-8 string' errorsRichard Mudgett
Change-Id: I9020ff9f2b3749904317c0c173f47a1bbed6f929
2017-07-07Merge "core: Remove 'Data Retrieval API'"Jenkins2
2017-07-05core: Remove 'Data Retrieval API'Sean Bright
This API was not actively maintained, was not added to new modules (such as res_pjsip), and there exist better alternatives to acquire the same information, such as the ARI. Change-Id: I4b2185a83aeb74798b4ad43ff8f89f971096aa83
2017-07-01channel: Clear channel flag in error branch.Corey Farrell
Clear channel flag AST_FLAG_END_DTMF_ONLY in ast_waitfordigit_full when ast_read returns NULL. ASTERISK-27100 #close Change-Id: Id3039e9a4e74e0cb359f636c9fd0c9740ebf7d9d
2017-06-28chan_pjsip: Add support for multiple streams of the same type.Mark Michelson
The stream topology (list of streams and order) is now stored with the configured PJSIP endpoints and used during the negotiation process. Media negotiation state information has been changed to be stored in a separate object. Two of these objects exist at any one time on a session. The active media state information is what was previously negotiated and the pending media state information is what the media state will become if negotiation succeeds. Streams and other state information is stored in this object using the index (or position) of each individual stream for easy lookup. The ability for a media type handler to specify a callback for writing has been added as well as the ability to add file descriptors with a callback which is invoked when data is available to be read on them. This allows media logic to live outside of the chan_pjsip module. Direct media has been changed so that only the first audio and video stream are directly connected. In the future once the RTP engine glue API has been updated to know about streams each individual stream can be directly connected as appropriate. Media negotiation itself will currently answer all the provided streams on an offer within configured limits and on an offer will use the topology created as a result of the disallow/allow codec lines. If a stream has been removed or declined we will now mark it as such within the resulting SDP. Applications can now also request that the stream topology change. If we are told to do so we will limit any provided formats to the ones configured on the endpoint and send a re-invite with the new topology. Two new configuration options have also been added to PJSIP endpoints: max_audio_streams: determines the maximum number of audio streams to offer/accept from an endpoint. Defaults to 1. max_video_streams: determines the maximum number of video streams to offer/accept from an endpoint. Defaults to 1. ASTERISK-27076 Change-Id: I8afd8dd2eb538806a39b887af0abd046266e14c7
2017-06-21Merge "bridge: stuck channel(s) after failed attended transfer"Jenkins2
2017-06-21core_local: local channel data not being properly unref'ed and unlockedKevin Harwell
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
2017-06-21bridge: stuck channel(s) after failed attended transferKevin Harwell
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
2017-06-19Merge "res_stasis: Plug reference leak on stolen channels"Joshua Colp
2017-06-19Merge "SDP: Add get/set option calls for RTP sched context per type."George Joseph
2017-06-16res_stasis: Plug reference leak on stolen channelsGeorge Joseph
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
2017-06-16Core/PBX: Deadlock between dialplan execution and application unregistration.Frederic LE FOLL
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
2017-06-16Merge "SDP: Search for the ice-lite attribute in the right place."Joshua Colp
2017-06-16Merge changes from topic 'sdp_api_adjustments'Jenkins2
* 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.
2017-06-16Merge "stream: Add ast_stream_topology_del_stream() and unit test."Jenkins2
2017-06-15Merge "channel: Fix reference counting in ast_channel_suppress."Joshua Colp
2017-06-15SDP: Add get/set option calls for RTP sched context per type.Richard Mudgett
Change-Id: I82dc75c63c48904e9e5a49e2205dcc06e88487e4
2017-06-15SDP: Search for the ice-lite attribute in the right place.Richard Mudgett
* 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
2017-06-15SDP: Set the remote c= line in RTP instance.Richard Mudgett
Change-Id: I23b646392082deab65bedeb19b12dcbcb9216d0c
2017-06-15stream: Add ast_stream_topology_del_stream() and unit test.Richard Mudgett
Change-Id: If07e3c716a2e3ff85ae905c17572ea6ec3cdc1f9
2017-06-15SDP: Add t= line in sdp_create_from_state()Richard Mudgett
Change-Id: I4060391328a893101ed87d0d9bacbbab4fd8b141
2017-06-15stream: Ignore declined streams for some topology calls.Richard Mudgett
* 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
2017-06-15channel: Fix reference counting in ast_channel_suppress.Joshua Colp
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
2017-06-13bridge: Add a deferred queue.Joshua Colp
This change adds a deferred queue to bridging. If a bridge technology determines that a frame can not be written and should be deferred it can indicate back to bridging to do so. Bridging will then requeue any deferred frames upon a new channel joining the bridge. This change has been leveraged for T.38 request negotiate control frames. Without the deferred queue there is a race condition between the bridge receiving the T.38 request negotiate and the second channel joining and being in the bridge. If the channel is not yet in the bridge then the T.38 negotiation fails. A unit test has also been added that confirms that a T.38 request negotiate control frame is deferred when no other channel is in the bridge and that it is requeued when a new channel joins the bridge. ASTERISK-26923 Change-Id: Ie05b08523f399eae579130f4a5f562a344d2e415
2017-06-13Merge "BuildSystem: Add patches to allow building with recent LibreSSL"Jenkins2
2017-06-09BuildSystem: Add patches to allow building with recent LibreSSLGuido Falsi
Add some #if defined checks which allow building against LibreSSL. These patchess come from OpenBSD ports: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/telephony/asterisk/patches/ ASTERISK-27043 #close Reported by: OpenBSD ports Change-Id: I2f6c08a5840b85ad4d2b75370b947ddde7a9a572
2017-06-08BuildSystem: Fix build on FreeBSD due to missing crypt.hGuido Falsi
FreeBSD does not include a crypt.h include file. Definitions for crypt() and crypt_r() are in unistd.h ASTERISK-27042 #close Change-Id: Ib307ee5e384870c6af50efa89fb73722dd0c3a7e
2017-06-07Merge "channel: ast_write frame wrongly freed after call to audiohooks"Jenkins2
2017-06-06Merge "format: Reintroduce smoother flags"Jenkins2
2017-06-06Merge "Confbridge: Add "sfu" video mode to bridge profile options."Joshua Colp
2017-06-06Merge "Add primitive SFU support to bridge_softmix."Jenkins2
2017-06-05channel: ast_write frame wrongly freed after call to audiohooksKevin Harwell
ASTERISK-26419 introduced a bug when calling ast_audiohook_write_list in ast_write. It would free the frame given to ast_write if the frame returned by ast_audiohook_write_list was different than the given one. The frame give to ast_write should never be freed within that function. It is the caller's resposibility to free the frame after writing (or when it its done with it). By freeing it within ast_write this of course led to some memory corruption problems. This patch makes it so the frame given to ast_write is no longer freed within the function. The frame returned by ast_audiohook_write_list is now subsequently used in ast_write and is freed later. It is freed either after translate if the frame returned by translate is different, or near the end of ast_write prior to function exit. ASTERISK-26973 #close Change-Id: Ic9085ba5f555eeed12f6e565a638c3649695988b
2017-05-31pbx_builtin: Properly handle hangup during BackgroundSean Bright
Before this patch, when a user hung up during a Background, we would stuff 0xff into a char and attempt a dialplan lookup of it. This caused problems for some realtime engines which interpreted the value as the beginning of an invalid UTF-8 sequence. ASTERISK-19291 #close Reported by: Andrew Nowrot Change-Id: I8ca6da93252d61c76ebdb46a4aa65e73ca985358
2017-05-31channel / app_meetme: Fix parentheses.Joshua Colp
ASTERISK-27025 Change-Id: Id736b0aa4ec6b6b0f04663d64fa8d151f81fdbed
2017-05-30format: Reintroduce smoother flagsSean Bright
In review 4843 (ASTERISK-24858), we added a hack that forced a smoother creation when sending signed linear so that the byte order was adjusted during transmission. This was needed because smoother flags were lost during the new format work that was done in Asterisk 13. Rather than rolling that same hack into res_rtp_multicast, re-introduce smoother flags so that formats can dictate their own options. Change-Id: I77b835fba0e539c6ce50014a984766f63cab2c16
2017-05-30Confbridge: Add "sfu" video mode to bridge profile options.Mark Michelson
A previous commit added plumbing to bridge_softmix to allow for an SFU experience with Asterisk. This commit adds an option to app_confbridge that allows for a confbridge to actually make use of the SFU video mode. SFU mode is implemented in a "set it and forget it" kind of way. That is, when the bridge is created, if SFU mode is enabled, then the video mode gets set to SFU and cannot be changed. Future improvements may allow for a hybrid experience (e.g. forward multiple video streams, specifically those of the most recent talkers), but for this addition, no such capability is present. Change-Id: I87bbcb63dec6dbbb42488f894871b86f112b2020
2017-05-30Add primitive SFU support to bridge_softmix.Mark Michelson
This sets up the "plumbing" in bridge_softmix to be able to accommodate Asterisk asking as an SFU (selective forwarding unit) for conferences. The way this works is that whenever a channel enters or leaves a conference, all participants in the bridge get sent a stream topology change request. The topologies consist of the channels' original topology, along with video destination streams corresponding to each participants' source video streams. So for instance, if Alice, Bob, and Carol are in the conference, and each supplies one video stream, then the topologies for each would look like so: Alice: Audio, Source video(Alice), Destination Video(Bob), Destination video (Carol) Bob: Audio, Source video(Bob) Destination Video(Alice), Destination video (Carol) Carol: Audio, Source video(Carol) Destination Video(Alice), Destination video (Bob) This way, video that arrives from a source video stream can then be copied out to the destination video streams on the other participants' channels. Once the bridge gets told that a topology on a channel has changed, the bridge constructs a map in order to get the video frames routed to the proper destination streams. This is done using the bridge channel's stream_map. This change is bare-bones with regards to SFU support. Some key features are missing at this point: * Stream limits. This commit makes no effort to limit the number of streams on a specific channel. This means that if there were 50 video callers in a conference, bridge_softmix will happily send out topology change requests to every channel in the bridge, requesting 50+ streams. * Configuration. The plumbing has been added to bridge_softmix, but there has been nothing added as of yet to app_confbridge to enable SFU video mode. * Testing. Some functions included here have unit tests. However, the functionality as a whole has only been verified by hand-tracing the code. * Selectivenss. For a "selective" forwarding unit, this does not currently have any means of being selective. * Features. Presumably, someone might wish to only receive video from specific sources. There are no external-facing functions at the moment that allow for users to select who they receive video from. * Efficiency. The current scheme treats all video streams as being unidirectional. We could be re-using a source video stream as a desetnation, too. But to simplify things on this first round, I did it this way. Change-Id: I7c44a829cc63acf8b596a337b2dc3c13898a6c4d
2017-05-26manager: Clear the flag on the other channel.Joshua Colp
During the channel flag audit an incorrect change was done. The flag should be cleared on the second channel. ASTERISK-26469 Change-Id: I770c5a389550a2fb5a6ade942fccbb2e1d9199c8
2017-05-26Merge "asterisk: Audit locking of channel when manipulating flags."Jenkins2
2017-05-24unittests: Add a unit test that causes a SEGV and...George Joseph
...that can only be run by explicitly calling it with 'test execute category /DO_NOT_RUN/ name RAISE_SEGV' This allows us to more easily test CI and debugging tools that should do certain things when asterisk coredumps. To allow this a new member was added to the ast_test_info structure named 'explicit_only'. If set by a test, the test will be skipped during a 'test execute all' or 'test execute category ...'. Change-Id: Ia3a11856aae4887df9a02b6b081cc777b36eb6ed
2017-05-17core/conversions: Added string to unsigned integer and long conversionsKevin Harwell
Added functions that convert a string to an unsigned integer or unsigned long. A couple of unit test were also created to test the routines. The reasons for adding these conversion utilities (and hopefully eventually more) are as follows: * Conversion routines are functionally contained with consistent and better error checking * The function names offer a better description of what is happening * It encourages code reuse for easier bug fixing at a single source * It's simpler to use * It's unit testable For instance, currently in a lot of places when converting to an integer or similar the "sscanf" function is used. When using "sscanf" it may not be immediately clear what's happening as it lacks semantic naming. Limited error checking is usually done as well. For example, most of the time a check is done to make sure the value converted, but does not check for overflows or negative valued conversions when converting unsigned numbers. Why use/wrap "strtoul" and not "sscanf" then? Primarily, it lacks some of the built in error handling that "strtoul" has. For instance "strtoul" contains overflow checks. Less so, but can still factor as reasons, "sscanf" is slightly more complex in its use. And maybe a bit controversial, but it may be ("big if") potentially slower than "strtoul" in some cases. Change-Id: If7eaca4a48f8c7b89cc8b5a1f4bed2852fca82bb
2017-05-16asterisk: Audit locking of channel when manipulating flags.Joshua Colp
When manipulating flags on a channel the channel has to be locked to guarantee that nothing else is also manipulating the flags. This change introduces locking where necessary to guarantee this. It also adds helper functions that manipulate channel flags and lock to reduce repeated code. ASTERISK-26789 Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10
2017-05-12Merge changes from topic 'sdp_api_adjustments'George Joseph
* changes: SDP: Make process possible multiple fmtp attributes per rtpmap. SDP: Explicitly stop a RTP instance before destoying it. SDP: Rework merge_capabilities(). SDP: Update ast_get_topology_from_sdp() to keep RTP map.
2017-05-12Merge "SDP: Remove sdp_state.remote_capabilities"George Joseph
2017-05-12Merge "SDP: Add interface_address to specify our address to use."Jenkins2
2017-05-11Merge "logger: Added logger_queue_limit to the configuration options."Jenkins2