summaryrefslogtreecommitdiff
path: root/bridges/bridge_softmix.c
AgeCommit message (Collapse)Author
2014-05-09Allow Asterisk to compile under GCC 4.10Kinsey Moore
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-17Fix stuck channel in ARI through the introduction of synchronous bridge actions.Mark Michelson
Playing back a file to a channel in an ARI bridge would attempt to wait until the playback concluded before returning. The method used involved signaling the waiting thread in the ARI custom playback function. The problem with this is that there were some corner cases that were not accounted for: * If a bridge channel could not be found, then we never would attempt the playback but would still attempt to wait for the playback to complete. * If the bridge playfile action failed to queue, we would still attempt to wait for the playback to complete. * If the bridge playfile action were queued but some circumstance caused the playback not to occur (the bridge dies, the channel is removed from the bridge), then we would never be notified. The solution to this is to move the waiting logic into the bridge code. A new bridge API function is added to queue a synchronous action on a bridge. The waiting thread is notified when the queued frame has been freed, either due to an error occurring or due to successful playback. As a failsafe, the waiting thread has a 10 minute timeout just in case there is a frame leak somewhere. Review: https://reviewboard.asterisk.org/r/3338 ........ Merged revisions 410673 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-11Softmix: Fix crash when switching from softmix to another bridge technology.Richard Mudgett
The crash is caused by a race condition when switching between native RTP and softmix bridging technologies. In this situation, the bridging technology is switched from native RTP to softmix, and then back to native RTP fast enough that the softmix private data gets destroyed before the softmix mixing thread gets started. Thanks to Kinsey Moore for the crash analysis. * Fix race condition when starting the softmix mixing thread and switching to another bridge technology. (closes issue ASTERISK-22678) Reported by: John Bigelow Patches: jira_asterisk_22678_v12.patch (license #5621) patch uploaded by rmudgett Tested by: John Bigelow ........ Merged revisions 400849 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03Cache string values of formats on ast_format_cap() to save processing.Mark Michelson
Channel snapshots have string representations of the channel's native formats. Prior to this change, the format strings were re-created on ever channel snapshot creation. Since channel native formats rarely change, this was very wasteful. Now, string representations of formats may optionally be stored on the ast_format_cap for cases where string representations may be requested frequently. When formats are altered, the string cache is marked as invalid. When strings are requested, the cache validity is checked. If the cache is valid, then the cached strings are copied. If the cache is invalid, then the string cache is rebuilt and copied, and the cache is marked as being valid again. Review: https://reviewboard.asterisk.org/r/2879 ........ Merged revisions 400356 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-18Add a WARNING in bridge_softmix when a timing module isn't loadedMatthew Jordan
If bridge_softmix fails to be created because no timing source is present in Asterisk, this will currently fail gracefully but with (most likely) a generic error message by whatever module tried to create the softmix bridge. This patch adds a more explicit warning so you can actually diagnose and fix the problem. Review: https://reviewboard.asterisk.org/r/2857/ ........ Merged revisions 399353 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399365 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-15Resolve some BUGBUG comments.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-25A great big renaming patchMatthew Jordan
This patch renames the bridging* files to bridge*. This may seem pedantic and silly, but it fits better in line with current Asterisk naming conventions: * channel is not "channeling" * monitor is not "monitoring" etc. A bridge is an object. It is a first class citizen in Asterisk. "Bridging" is the act of using a bridge on a set of channels - and the API that fulfills that role is more than just the action. (closes issue ASTERISK-22130) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-25Move after bridge callbacks into their own fileMatthew Jordan
One more major refactoring to go. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23Pull softmix bridge parameters into a sub structure.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23Restore chan_dahdi native bridging and PRI tromboned call elimination.Richard Mudgett
Created a native_dahdi bridging technology for use with the new bridging API. The new bridging technology is part of the chan_dahdi channel driver because it is very specific to that driver. Rather than include the new code directly into chan_dahdi.c the new bridge technology is in its own file and linked into chan_dahdi.so. A large part of this change is the mechanical process of moving declarations around so chan_dahdi.c can be split up into more files later. * Changed the bridging core to pass NULL frames into the channel technologies instead of discarding them. The channel technologies may need the proding to determine if their configuration is still valid. (closes issue ASTERISK-21886) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2681/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-21Extract a useful routine from the softmix bridge technology.Richard Mudgett
* Extract a useful routine from the softmix bridge technology for other technologies. Make other technologies use it if they can. * Made native and 1-1 bridges write to all parties if the bridge channel writing the frame into the bridge is NULL. Softmix will also do the same for frame types that make sense. * Tweak the bridge write routine return value meaning and adjust the bridge technologies to match. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-21Change several bridge functions to return error status.Richard Mudgett
The bridge frame queue functions need to return an error status if the frame failed to be queued because of an error condition. The main calls that needed to return the status are: ast_bridge_channel_queue_action_data() and ast_bridge_channel_write_action_data(). The other return changes are ripple effects. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-08Fix a crash when a bridge switches from the softmix bridge technology to ↵Richard Mudgett
another. A three party bridge uses the softmix bridging technology. This technology has a dedicated thread used to perform the analog mixing. When one of these parties leaves the bridge, the bridge technology is changed from the softmix technology to a two-party mixing technology. Changing technologies is done by removing channels from the old technology and adding them to the new technology. Since the remaining channels do not leave the bridge, the softmix mixing thread could continue to process all channels in the bridge. If the bridge code is not able to start destruction of the softmix technology before the softmix mixing thread wakes up, a crash happens. * Added a stop technology callback that technologies can use to request any helper threads to stop in preparation for being destroyed. (closes issue AST-1156) Reported by: John Bigelow git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-08The bridge uniqueid is available for softmix destructor.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-08Add some bridge identifiers to some softmix messages.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-21Merge in the bridge_construction branch to make the system use the Bridging API.Richard Mudgett
Breaks many things until they can be reworked. A partial list: chan_agent chan_dahdi, chan_misdn, chan_iax2 native bridging app_queue COLP updates DTMF attended transfers Protocol attended transfers git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-25More trivial bridge code cleanup.Richard Mudgett
* Breaking long lines * Word wrapping comment blocks. * Removing redundant initializers. * Debug message wording. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-09Trivial misc bridge code changes.Richard Mudgett
* softmix_bridge_thread() was redundantly initializing an 8K buffer. * Promoted a debug message to a warning in multiplexed_add_or_remove(). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-05Refactor ast_timer_ack to return an error and handle the error in timer usersMatthew Jordan
Currently, if an acknowledgement of a timer fails Asterisk will not realize that a serious error occurred and will continue attempting to use the timer's file descriptor. This can lead to situations where errors stream to the CLI/log file. This consumes significant resources, masks the actual problem that occurred (whatever caused the timer to fail in the first place), and can leave channels in odd states. This patch propagates the errors in the timing resource modules up through the timer core, and makes users of these timers handle acknowledgement failures. It also adds some defensive coding around the use of timers to prevent using bad file descriptors in off nominal code paths. Note that the patch created by the issue reporter was modified slightly for this commit and backported to 1.8, as it was originally written for Asterisk 10. Review: https://reviewboard.asterisk.org/r/2178/ (issue ASTERISK-20032) Reported by: Jeremiah Gowdy patches: jgowdy-timerfd-6-22-2012.diff uploaded by Jeremiah Gowdy (license 6358) ........ Merged revisions 375893 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375894 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 375895 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-30Fix ConfBridge crash if no timing module loaded.Richard Mudgett
(closes issue ASTERISK-19448) Reported by: feyfre Patches: smfix.patch (license #6099) patch uploaded by feyfre Modified for coding guidelines. ........ Merged revisions 375496 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 375506 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24Opaquification for ast_format structs in struct ast_channelTerry Wilson
Review: https://reviewboard.asterisk.org/r/1770/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14Merged revisions 328247 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce <support_level> tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-11Updates follow_talker video_mode in confbridge application.David Vossel
follow_talker mode originally echoed the same video stream to all participants. As the primary talker switched around, the video stream would result in the talker seeing themselves. Now the primary talker sees the last person who was talking rather than themselves. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@327640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-30Video support for ConfBridge.David Vossel
Review: https://reviewboard.asterisk.org/r/1288/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@325931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05Fixes reliability issues with func_jitterbuffer's usage in the new ↵David Vossel
ConfBridge application. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-21New HD ConfBridge conferencing application.David Vossel
Includes a new highly optimized and customizable ConfBridge application capable of mixing audio at sample rates ranging from 8khz-192khz. Review: https://reviewboard.asterisk.org/r/1147/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-22Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd ↵David Vossel
audio ConfBridge, and other stuff -Functional changes 1. Dynamic global format list build by codecs defined in codecs.conf 2. SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf 3. Negotiation of SILK attributes in chan_sip. 4. SPEEX 32khz with translation 5. SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation using codec_resample.c 6. Various changes to RTP code required to properly handle the dynamic format list and formats with attributes. 7. ConfBridge now dynamically jumps to the best possible sample rate. This allows for conferences to take advantage of HD audio (Which sounds awesome) 8. Audiohooks are no longer limited to 8khz audio, and most effects have been updated to take advantage of this such as Volume, DENOISE, PITCH_SHIFT. 9. codec_resample now uses its own code rather than depending on libresample. -Organizational changes Global format list is moved from frame.c to format.c Various format specific functions moved from frame.c to format.c Review: https://reviewboard.asterisk.org/r/1104/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03Asterisk media architecture conversion - no more format bitfieldsDavid Vossel
This patch is the foundation of an entire new way of looking at media in Asterisk. The code present in this patch is everything required to complete phase1 of my Media Architecture proposal. For more information about this project visit the link below. https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal The primary function of this patch is to convert all the usages of format bitfields in Asterisk to use the new format and format_cap APIs. Functionally no change in behavior should be present in this patch. Thanks to twilson and russell for all the time they spent reviewing these changes. Review: https://reviewboard.asterisk.org/r/1083/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18fixes confbridge crash when no timing module is loaded.David Vossel
(closes issue #16471) Reported by: kjotte Patches: M16471.diff uploaded by junky (license 177) Tested by: kjotte, junky git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04Expand codec bitfield from 32 bits to 64 bits.Tilghman Lesher
Reviewboard: https://reviewboard.asterisk.org/r/416/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27Improve timing interface to remember which provider provided a timerKevin P. Fleming
The ability to load/unload timing interfaces is nice, but it means that when a timer is allocated, it may come from provider A, but later provider B becomes the 'preferred' provider. If this happens, all timer API calls on the timer that was provided by provider A will actually be handed to provider B, which will say WTF and return an error. This patch changes the timer API to include a pointer to the provider of the timer handle so that future operations on the timer will be forwarded to the proper provider. (closes issue #14697) Reported by: moy Review: http://reviewboard.digium.com/r/211/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27Fix a potential timer leak in bridge_softmix.Joshua Colp
It is possible for a bridge to be created without actually being used. In that scenario a timing file descriptor would be opened and not closed. To fix this the timing file descriptor is now closed in the destroy callback, not the thread function. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27Remove a cast that is not needed.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27Fix a potential race condition when creating a software based mixing bridge.Joshua Colp
It was possible for no timer to become available between creating the bridge and starting it. We now open a timer when creating it and keep it open until the bridge is destroyed. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-05Merge phase 1 support for the new bridging architecture.Joshua Colp
This commit brings in the bridging core, bridging technologies, and the ConfBridge application. For usage information on the ConfBridge application please see the output of "core show application ConfBridge" from the CLI. For API documentation please see the doxygen page describing the architecture and the documentation for each API call. Review: http://reviewboard.digium.com/r/93/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180369 65c4cc65-6c06-0410-ace0-fbb531ad65f3