summaryrefslogtreecommitdiff
path: root/bridges/bridge_native_rtp.c
AgeCommit message (Collapse)Author
2015-11-09ast_format_cap_get_names: To display all formats, the buffer was increased.Alexander Traud
ASTERISK-25533 #close Change-Id: Ie1a9d1a6511b3f1a56b93d04475fbf8a4e40010a
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-04-09bridge_native_rtp.c: Defer allocation and check if it fails in ↵Richard Mudgett
native_rtp_bridge_compatible(). Review: https://reviewboard.asterisk.org/r/4601/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@434508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08Bridging: Eliminate the unnecessary make channel compatible with bridge ↵Richard Mudgett
operation. When a channel enters the bridging system it is first made compatible with the bridge and then the bridge technology makes the channel compatible with the technology. For all but the DAHDI native and softmix bridge technologies the make channel compatible with the bridge step is an effective noop because the other technologies allow all audio formats. For the DAHDI native bridge technology it doesn't matter because it is not an initial bridge technology and chan_dahdi allows only one native format per channel. For the softmix bridge technology, it is a noop at best and harmful at worst because the wrong translation path could be setup if the channel's native formats allow more than one audio format. This is an intermediate patch for a series of patches aimed at improving translation path choices. * Removed code dealing with the unnecessary step of making the channel compatible with the bridge. ASTERISK-24841 Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/4600/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@434424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-06bridge_native_rtp: Change local/remote message from debug/2 to verb/4George Joseph
Change the "Locally bridged"/"Remotely bridged" messages from dbg/2 to verb/4. Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4300/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-09bridge_native_rtp: Fix T.38 issues with remote bridgesMatthew Jordan
After r425242 the fax/sip/directmedia_reinvite_t38 test started failing due to the surviving channel not being re-INVITEd back from T.38 to audio. This patch fixes that bug - a deeper explanation of what happened follows. When two RTP channels are in a native bridge, the bridging layer will investigate each via the get_rtp_info glue callback. This callback returns the native bridge preference of the channel *at that moment in time* (that part is key). At different points during the bridging, the native bridging layer will inform the RTP capable channels of the status of the bridge via the update_peer glue callback. In a T.38 scenario with audio direct media, the sequence of events will often look like the following: * SIP/A and SIP/B both have audio and enter a native bridge. * Asterisk re-INVITEs audio between SIP/A and SIP/B directly (via an update_peer callback). * SIP/A sends a re-INVITE to T.38, which causes Asterisk to send a re-INVITE to T.38 to SIP/B. Assuming everyone 200 OKs the process, the UDPTL stack receives UDPTL packets in Asterisk from both endpoints. From the perspective of the channels, we are now in a local bridge for T.38, even though we are technically still in a remote bridge in bridge_native_rtp. (YAY!) * When one side hangs up, bridge_native_rtp is told to stop bridging. It then re-evaluates the channels and asks them how they are bridged - and since T.38 is enabled, they reply with a Local bridge (which is correct), but is wrong because the audio portion is still technically in a remote bridge. * Asterisk releases the surviving channel, whose audio is *not* re-INVITED back to Asterisk as bridge_native_rtp incorrectly assumes that it was in a local bridge. Ironically, prior to r425242, this used to work mostly due to a fluke in the bridging layer. The purpose of the get_rtp_info callback shouldn't be modified: it should tell the bridging layer what kind of bridge the channel prefers at that moment in time. If you have T.38 enabled, that *must* be a local bridge, as the UDPTPL stack must be in the media path. As such, this patch does not modify that part of the code. However, we have to tell the channels to re-evaluate themselves when they come out of a native bridge, since we can no longer trust the get_rtp_info callbacks when the native bridge is being stopped. Something else may have changed in the channels, and they may now be lying to us. As such, this patch makes it so that we unilaterally tell the channels that they are no longer bridged via the update_peer callback. This is actually what the channels expect anyway: code in both chan_sip and chan_pjsip's callbacks look at the T.38 state and - if they were in T.38 - send a re-INVITE to get the audio back to Asterisk. Review: https://reviewboard.asterisk.org/r/4157/ ........ Merged revisions 427582 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-17bridge_native_rtp: Fix audio issues when moving from remote bridge to softmixMatthew Jordan
When a native RTP bridge that is remotely bridging its participants switches to a softmix bridge, it may not properly re-INVITE the media for one or both participants back to Asterisk. This is due to the current bridge_native_rtp code only re-INVITEs if it believes the channel will survive the bridge operation. Currently, that code is failing, as it expects the channels to have a soft hangup flag set on it indicating that a redirect has occurred or that the channel is going to leave the bridge. (The code did not take into account a smart bridge operation). This patch also renames a few things to be more reflective of the underlying types. Review: https://reviewboard.asterisk.org/r/3997/ ASTERISK-24327 #close ........ Merged revisions 425760 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@425761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-10bridge: During a smart bridge operation provide a more complete bridge to ↵Joshua Colp
the old technology. When a smart bridge operation occurs and a bridge transitions from one technology to another the old technology is provided the channels formerly in it and told that they are leaving. Unfortunately the bridge provided along with them is incomplete. The bridge, despite there being channels in it, contains none. This forces technology implementations to have additional logic when channels are leaving or to store their own duplicated state. This change makes the bridge more complete so it contains the expected channels. Now that the bridge is complete special logic within bridge_native_rtp is no longer needed and has been removed. Review: https://reviewboard.asterisk.org/r/4057/ ........ Merged revisions 425242 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@425243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-20media formats: re-architect handling of media for performance improvementsMatthew Jordan
In the old times media formats were represented using a bit field. This was fast but had a few limitations. 1. Asterisk was limited in how many formats it could handle. 2. Formats, being a bit field, could not include any attribute information. A format was strictly its type, e.g., "this is ulaw". This was changed in Asterisk 10 (see https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal for notes on that work) which led to the creation of the ast_format structure. This structure allowed Asterisk to handle attributes and bundle information with a format. Additionally, ast_format_cap was created to act as a container for multiple formats that, together, formed the capability of some entity. Another mechanism was added to allow logic to be registered which performed format attribute negotiation. Everywhere throughout the codebase Asterisk was changed to use this strategy. Unfortunately, in software, there is no free lunch. These new capabilities came at a cost. Performance analysis and profiling showed that we spend an inordinate amount of time comparing, copying, and generally manipulating formats and their related structures. Basic prototyping has shown that a reasonably large performance improvement could be made in this area. This patch is the result of that project, which overhauled the media format architecture and its usage in Asterisk to improve performance. Generally, the new philosophy for handling formats is as follows: * The ast_format structure is reference counted. This removed a large amount of the memory allocations and copying that was done in prior versions. * In order to prevent race conditions while keeping things performant, the ast_format structure is immutable by convention and lock-free. Violate this tenet at your peril! * Because formats are reference counted, codecs are also reference counted. The Asterisk core generally provides built-in codecs and caches the ast_format structures created to represent them. Generally, to prevent inordinate amounts of module reference bumping, codecs and formats can be added at run-time but cannot be removed. * All compatibility with the bit field representation of codecs/formats has been moved to a compatibility API. The primary user of this representation is chan_iax2, which must continue to maintain its bit-field usage of formats for interoperability concerns. * When a format is negotiated with attributes, or when a format cannot be represented by one of the cached formats, a new format object is created or cloned from an existing format. That format may have the same codec underlying it, but is a different format than a version of the format with different attributes or without attributes. * While formats are reference counted objects, the reference count maintained on the format should be manipulated with care. Formats are generally cached and will persist for the lifetime of Asterisk and do not explicitly need to have their lifetime modified. An exception to this is when the user of a format does not know where the format came from *and* the user may outlive the provider of the format. This occurs, for example, when a format is read from a channel: the channel may have a format with attributes (hence, non-cached) and the user of the format may last longer than the channel (if the reference to the channel is released prior to the format's reference). For more information on this work, see the API design notes: https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite Finally, this work was the culmination of a large number of developer's efforts. Extra thanks goes to Corey Farrell, who took on a large amount of the work in the Asterisk core, chan_sip, and was an invaluable resource in peer reviews throughout this project. There were a substantial number of patches contributed during this work; the following issues/patch names simply reflect some of the work (and will cause the release scripts to give attribution to the individuals who work on them). Reviews: https://reviewboard.asterisk.org/r/3814 https://reviewboard.asterisk.org/r/3808 https://reviewboard.asterisk.org/r/3805 https://reviewboard.asterisk.org/r/3803 https://reviewboard.asterisk.org/r/3801 https://reviewboard.asterisk.org/r/3798 https://reviewboard.asterisk.org/r/3800 https://reviewboard.asterisk.org/r/3794 https://reviewboard.asterisk.org/r/3793 https://reviewboard.asterisk.org/r/3792 https://reviewboard.asterisk.org/r/3791 https://reviewboard.asterisk.org/r/3790 https://reviewboard.asterisk.org/r/3789 https://reviewboard.asterisk.org/r/3788 https://reviewboard.asterisk.org/r/3787 https://reviewboard.asterisk.org/r/3786 https://reviewboard.asterisk.org/r/3784 https://reviewboard.asterisk.org/r/3783 https://reviewboard.asterisk.org/r/3778 https://reviewboard.asterisk.org/r/3774 https://reviewboard.asterisk.org/r/3775 https://reviewboard.asterisk.org/r/3772 https://reviewboard.asterisk.org/r/3761 https://reviewboard.asterisk.org/r/3754 https://reviewboard.asterisk.org/r/3753 https://reviewboard.asterisk.org/r/3751 https://reviewboard.asterisk.org/r/3750 https://reviewboard.asterisk.org/r/3748 https://reviewboard.asterisk.org/r/3747 https://reviewboard.asterisk.org/r/3746 https://reviewboard.asterisk.org/r/3742 https://reviewboard.asterisk.org/r/3740 https://reviewboard.asterisk.org/r/3739 https://reviewboard.asterisk.org/r/3738 https://reviewboard.asterisk.org/r/3737 https://reviewboard.asterisk.org/r/3736 https://reviewboard.asterisk.org/r/3734 https://reviewboard.asterisk.org/r/3722 https://reviewboard.asterisk.org/r/3713 https://reviewboard.asterisk.org/r/3703 https://reviewboard.asterisk.org/r/3689 https://reviewboard.asterisk.org/r/3687 https://reviewboard.asterisk.org/r/3674 https://reviewboard.asterisk.org/r/3671 https://reviewboard.asterisk.org/r/3667 https://reviewboard.asterisk.org/r/3665 https://reviewboard.asterisk.org/r/3625 https://reviewboard.asterisk.org/r/3602 https://reviewboard.asterisk.org/r/3519 https://reviewboard.asterisk.org/r/3518 https://reviewboard.asterisk.org/r/3516 https://reviewboard.asterisk.org/r/3515 https://reviewboard.asterisk.org/r/3512 https://reviewboard.asterisk.org/r/3506 https://reviewboard.asterisk.org/r/3413 https://reviewboard.asterisk.org/r/3410 https://reviewboard.asterisk.org/r/3387 https://reviewboard.asterisk.org/r/3388 https://reviewboard.asterisk.org/r/3389 https://reviewboard.asterisk.org/r/3390 https://reviewboard.asterisk.org/r/3321 https://reviewboard.asterisk.org/r/3320 https://reviewboard.asterisk.org/r/3319 https://reviewboard.asterisk.org/r/3318 https://reviewboard.asterisk.org/r/3266 https://reviewboard.asterisk.org/r/3265 https://reviewboard.asterisk.org/r/3234 https://reviewboard.asterisk.org/r/3178 ASTERISK-23114 #close Reported by: mjordan media_formats_translation_core.diff uploaded by kharwell (License 6464) rb3506.diff uploaded by mjordan (License 6283) media_format_app_file.diff uploaded by kharwell (License 6464) misc-2.diff uploaded by file (License 5000) chan_mild-3.diff uploaded by file (License 5000) chan_obscure.diff uploaded by file (License 5000) jingle.diff uploaded by file (License 5000) funcs.diff uploaded by file (License 5000) formats.diff uploaded by file (License 5000) core.diff uploaded by file (License 5000) bridges.diff uploaded by file (License 5000) mf-codecs-2.diff uploaded by file (License 5000) mf-app_fax.diff uploaded by file (License 5000) mf-apps-3.diff uploaded by file (License 5000) media-formats-3.diff uploaded by file (License 5000) ASTERISK-23715 rb3713.patch uploaded by coreyfarrell (License 5909) rb3689.patch uploaded by mjordan (License 6283) ASTERISK-23957 rb3722.patch uploaded by mjordan (License 6283) mf-attributes-3.diff uploaded by file (License 5000) ASTERISK-23958 Tested by: jrose rb3822.patch uploaded by coreyfarrell (License 5909) rb3800.patch uploaded by jrose (License 6182) chan_sip.diff uploaded by mjordan (License 6283) rb3747.patch uploaded by jrose (License 6182) ASTERISK-23959 #close Tested by: sgriepentrog, mjordan, coreyfarrell sip_cleanup.diff uploaded by opticron (License 6273) chan_sip_caps.diff uploaded by mjordan (License 6283) rb3751.patch uploaded by coreyfarrell (License 5909) chan_sip-3.diff uploaded by file (License 5000) ASTERISK-23960 #close Tested by: opticron direct_media.diff uploaded by opticron (License 6273) pjsip-direct-media.diff uploaded by file (License 5000) format_cap_remove.diff uploaded by opticron (License 6273) media_format_fixes.diff uploaded by opticron (License 6273) chan_pjsip-2.diff uploaded by file (License 5000) ASTERISK-23966 #close Tested by: rmudgett rb3803.patch uploaded by rmudgetti (License 5621) chan_dahdi.diff uploaded by file (License 5000) ASTERISK-24064 #close Tested by: coreyfarrell, mjordan, opticron, file, rmudgett, sgriepentrog, jrose rb3814.patch uploaded by rmudgett (License 5621) moh_cleanup.diff uploaded by opticron (License 6273) bridge_leak.diff uploaded by opticron (License 6273) translate.diff uploaded by file (License 5000) rb3795.patch uploaded by rmudgett (License 5621) tls_fix.diff uploaded by mjordan (License 6283) fax-mf-fix-2.diff uploaded by file (License 5000) rtp_transfer_stuff uploaded by mjordan (License 6283) rb3787.patch uploaded by rmudgett (License 5621) media-formats-explicit-translate-format-3.diff uploaded by file (License 5000) format_cache_case_fix.diff uploaded by opticron (License 6273) rb3774.patch uploaded by rmudgett (License 5621) rb3775.patch uploaded by rmudgett (License 5621) rtp_engine_fix.diff uploaded by opticron (License 6273) rtp_crash_fix.diff uploaded by opticron (License 6273) rb3753.patch uploaded by mjordan (License 6283) rb3750.patch uploaded by mjordan (License 6283) rb3748.patch uploaded by rmudgett (License 5621) media_format_fixes.diff uploaded by opticron (License 6273) rb3740.patch uploaded by mjordan (License 6283) rb3739.patch uploaded by mjordan (License 6283) rb3734.patch uploaded by mjordan (License 6283) rb3689.patch uploaded by mjordan (License 6283) rb3674.patch uploaded by coreyfarrell (License 5909) rb3671.patch uploaded by coreyfarrell (License 5909) rb3667.patch uploaded by coreyfarrell (License 5909) rb3665.patch uploaded by mjordan (License 6283) rb3625.patch uploaded by coreyfarrell (License 5909) rb3602.patch uploaded by coreyfarrell (License 5909) format_compatibility-2.diff uploaded by file (License 5000) core.diff uploaded by file (License 5000) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-18Channels: Masquerades to automatically move frame/audio hooksJonathan Rose
Whenever possible, audiohooks and framehooks will now be copied over to the channel that the masquerading channel gets cloned into. This should occur for all audiohooks and most framehooks. As a result, in Asterisk 12.5 and up, the AUDIOHOOK_INHERIT function is now deprecated and its behavior is essentially the new default for all audiohooks, plus some additional audiohooks/framehooks. Review: https://reviewboard.asterisk.org/r/3721/ ........ Merged revisions 418914 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-08bridges/bridge_native_rtp: Reconfigure bridge on removal of framehookMatthew Jordan
This patch is a re-do of r414122. When r414122 was merged, a major problem with it was uncovered. UNBRIDGE soft hangup flags have a catastrophic effect on the pbx core if they leak out from the bridge layer: the channel gets hung up. With the number of threads involved in a blind transfer, and with the initial patch, it was likely that this would occur. This caused a large number of test failures This patch is nearly identical with the one proposed in r414122, save for the following changes: - We explicitly clear the UNBRIDGE flag when setting an after goto on a channel in a bridge - Defensively, if we encounter an UNBRIDGE flag in the pbx core, we handle it https://reviewboard.asterisk.org/r/3585/ ........ Merged revisions 415443 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415444 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-01bridge_native_rtp: Take the bridge type choice of both channels into account.Joshua Colp
The bridge_native_rtp module currently uses the bridge result of the first channel that joins a bridge as the ultimate result. This means that if the first channel has direct media enabled but the second does not a direct media bridge will still occur. This change makes it so that both sides are taken into account. If either side forbids the bridge or responds with a local bridge result then either a generic or local bridge occurs. ASTERISK-23541 #close Reported by: Justin E Review: https://reviewboard.asterisk.org/r/3577/ ........ Merged revisions 414975 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-19Undo r414123Matthew Jordan
The Test Suite caught a few problems, undoing until those are resolved git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-18bridge_native_rtp/bridge_channel: Fix direct media issues due to frame hookMatthew Jordan
This patch fixes issues with direct media bridges that occur after a blind transfer. These issues were caught by the (currently failing) pjsip/transfers/blind_transfer/caller_direct_media test. The test currently fails primarily for two reasons: (1) When Bob and Charlie (the transfer target and the transfer destination) enter a bridge together, the framehook remains on the transfer target channel until both channels are in the bridge. As it consumes voice frames, the initial bridge type is a simple bridge. The framehook is removed when both channels are in the bridge; however, this does not currently cause the bridging framework to re-evaluate the bridge. This patch adds a AST_SOFTHANGUP_UNBRIDGE poke to the transfer target channel when a framehook is removed so the bridge can re-evaluate itself. (2) When a channel leaves a native RTP bridge, it may be leaving due to being hung up. Sending a re-INVITE to a channel that is about to be hung up is not nice - in fact, there's a good chance we'll send the BYE request before the channel has had a chance to send back a 200 OK. To be somewhat nicer, this patch adds a function to channel.h that allows the bridging framework to query for exactly why a channel is leaving a bridge via the channel's soft hangup flags. This allows it to only send the re-INVITE if there's a chance the channel will survive the native bridging experience. Review: https://reviewboard.asterisk.org/r/3535/ ........ Merged revisions 414122 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-11framehooks: Add callback for determining if a hook is consuming frames of a ↵Joshua Colp
specific type. In the past framehooks have had no capability to determine what frame types a hook is actually interested in consuming. This has meant that code has had to assume they want all frames, thus preventing native bridging. This change adds a callback which allows a framehook to be queried for whether it is consuming a frame of a specific type. The native RTP bridging module has also been updated to take advantange of this, allowing native bridging to occur when previously it would not. ASTERISK-23497 #comment Reported by: Etienne Lessard ASTERISK-23497 #close Review: https://reviewboard.asterisk.org/r/3522/ ........ Merged revisions 413681 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-11Undoing framehook support. Issues were uncovered by Bamboo.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-10framehooks: Add callback for determining if a hook is consuming frames of a ↵Joshua Colp
specific type. In the past framehooks have had no capability to determine what frame types a hook is actually interested in consuming. This has meant that code has had to assume they want all frames, thus preventing native bridging. This change adds a callback which allows a framehook to be queried for whether it is consuming a frame of a specific type. The native RTP bridging module has also been updated to take advantange of this, allowing native bridging to occur when previously it would not. ASTERISK-23497 #comment Reported by: Etienne Lessard ASTERISK-23497 #close Review: https://reviewboard.asterisk.org/r/3522/ ........ Merged revisions 413650 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05bridge_native_rtp: Fix crash involving masqueradeKinsey Moore
It is possible for a channel to be masqueraded out of a bridge which means it may no longer have RTP glue to check upon leaving said bridge. If this situation occurred (it's possible at least during dial and call pickup) then Asterisk would crash. This change makes sure the glue is checked before use. (closes issue AST-1290) Reported by: John Bigelow ........ Merged revisions 409900 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-13bridge_native_rtp: Deadlock during 4-way conference creationKevin Harwell
The change contains a slightly adjusted patch that was on the issue (submitted by kmoore). A fix was made by adding in a bridge lock while calling bridge_start/stop from the framehook callback. Since the framehook callback is not called from the bridging core the bridge is not locked, but needs to be before calling bridge_start. (closes issue ASTERISK-22749) Reported by: Kinsey Moore Review: https://reviewboard.asterisk.org/r/3066/ Patches: lock_inversion.diff uploaded by kmoore (license 6273) ........ Merged revisions 403767 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-29bridge_native_rtp: Ensure bridge is torn downKinsey Moore
When a bridge transitions away from one tech to another, the tech going away is provided a dummy bridge with no channels in it to tear down. Currently this means that the teardown code exits prematurely and does not tear anything down. This change tears down RTP bridging for the channel provided in the leave bridge tech callback. This also reverts the majority of r400403 since it is now redundant. (closes issue ASTERISK-22628) (closes issue ASTERISK-22676) Reported by: John Bigelow Reported by: Kevin Harwell Tested by: John Bigelow Review: https://reviewboard.asterisk.org/r/2905/ Patches: native_rtp_fix.diff uploaded by Kinsey Moore (License 6273) ........ Merged revisions 402148 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03Fix assumption in bridge_native_rtp.c regarding number of participants in a ↵Mark Michelson
bridge. When a party leaves a bridge, there may be more participants in the bridge than expected. As such, it is important not to make assumptions regarding the list of channels in a bridge. This change makes it so that when a party leaves a native RTP bridge, we unbridge it and the party it was bridged with. Previously, the first and last channels in the list were unbridged since it was assumed that these were the two channels that had been bridged. As previously stated, a new party had been inserted into the bridge, so this logic did not work properly. (closes issue ASTERISK-22615) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2899 ........ Merged revisions 400403 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400452 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-27Fix refleaks of ast_rtp_instance structures.Mark Michelson
These refleaks were causing bridged calls not to close their RTP ports. Thus a call would leave open 4 ports (RTP for party A, RTCP for party A, RTP for party B, and RTCP for party B). This led to an eventual depletion of available RTP ports. ........ Merged revisions 399924 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23bridge_native_rtp: Fix hold chain bugs caused by native RTP bridge framehookJonathan Rose
Issuing hold/unhold would lead to odd behavior. Between two chan_sip devices, a hold could cause an endless chain of updates while with pjsip a similar chain would begin but then end somewhat randomly. This patch fixes that by no longer tweaking the RTP glue on both sides of the call for every HOLD/UNHOLD/UPDATE_RTP_PEER frame. (issue ASTERISK-22217) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2794/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-09bridge_native_rtp: Remove some unnecessary NULL checks on c1.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-31Fix hold/unhold in bridge_native_rtp, use tech_pvt instead of bridge_pvt, ↵Joshua Colp
reduce bridging attempts, and fix breaking native RTP bridges. (closes issue ASTERISK-22128) (closes issue ASTERISK-22104) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395866 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-24Add missing line terminator to debug message.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23Fix a check in bridge_native_rtp which determined if attaching the framehook ↵Joshua Colp
failed or not. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23Add some debug messages to make it clear what RTP bridging functionality is ↵Joshua Colp
in use. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23Fix some logic so native RTP bridge will occur when monitor, audiohooks, or ↵Joshua Colp
framehooks are not present. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-19Extract a repeated test into ast_channel_has_audio_frame_or_monitor().Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394825 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-12Fix memory leaks in stasis_channels and bridge_native_rtpMatthew Jordan
This patch fixes two memory leaks: * A memory leak in packing channels into a multi-channel blob payload when publishing dial messages. The multi-channel blob payload does not steal the references - this approach was chosen because it works well with the RAII_VAR macro. Unfortunately, this does mean that you actually have to use the RAII_VAR macro (or manually deref it yourself) * RTP instances returned as a result of one of the glue operations are ref counted and have to be de-ref'd appropriately. We now do that, as saying that we should do it and then not would be silly. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-11bridge_native_rtp: Fix native bridge tech being incompatible when it should be.Jonathan Rose
When checking compatability for the native RTP bridge technology there is a race condition between clearing framehooks that are destroyed when leaving certain bridges with certain technologies (such as bridge_native_rtp) and joining bridges with the bridge_native_rtp technology. Yes, that means a channel in a native RTP bridge could move to another native RTP bridge and be considered incompatible with the new native RTP bridge causing it to revert to a simple bridge technology0. This fixes that bug by ignoring framehooks that have been marked for destruction when checking for compatibility with the bridge_native_rtp technology. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-11bridge_native_rtp: Fix possible segfaults on leaves/joinsJonathan Rose
native_rtp_bridge_get can return any result from the ast_rtp_glue_result enumerator and the join/leave functions for bridge_native_rtp seem to assume that if the result wasn't local that it was remote. Meanwhile forbid can be returned by that function which can mean certain glue pointers are NULL. Then when the join/leave functions try to use members of that pointer, boom. Segfault. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-04Add BUGBUG comment.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390440 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-04Simple lock, assignment, unlock sandwich optimization.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390439 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