summaryrefslogtreecommitdiff
path: root/channels/chan_iax2.c
AgeCommit message (Collapse)Author
2013-12-05Reverting r403311. It's causing ARI tests to hang.David M. Lee
........ Merged revisions 403398 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-03Add channel locking for channel snapshot creation.Mark Michelson
This adds channel locks around calls to create channel snapshots as well as other functions which operate on a channel and then end up creating a channel snapshot. Functions that expect the channel to be locked prior to being called have had their documentation updated to indicate such. ........ Merged revisions 403311 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-05chan_iax2: Fix incorrect usage of ast_get_ip involving uninitialized structMatthew Jordan
This started off as a fix for the failing IAX2 acl_call test in the Asterisk Test Suite. When inspecting why that test was failing, it became clear that all attempts to bind to any local loopback address was failing: [Nov 2 15:56:28] VERBOSE[15787] chan_iax2.c: == Binding IAX2 to address 127.0.0.1:4569 [Nov 2 15:56:28] DEBUG[15787] netsock2.c: Splitting '127.0.0.1' into... [Nov 2 15:56:28] DEBUG[15787] netsock2.c: ...host '127.0.0.1' and port ''. [Nov 2 15:56:28] ERROR[15787] netsock2.c: getaddrinfo("127.0.0.1", "(null)", ...): ai_family not supported [Nov 2 15:56:28] WARNING[15787] acl.c: Unable to lookup '127.0.0.1' While there's conceivably other ways for getaddrino to return EAI_FAMILY, the most common way is if AF_INET, AF_INET6, or AF_UNSPEC is not provided as the desired family. The culprit was the call to ast_get_ip, defined in acl.h. This function uses the family from the passed in addr object (which it will also populate when it returns!) when it eventually calls getaddrinfo. This patch fixes the use of ast_get_ip that were not specifying the family in chan_iax2. This prevents uninitialized use of the structure, so that the addresses resolve correctly. Review: https://reviewboard.asterisk.org/r/2991 ........ Merged revisions 402505 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-23chan_iax2: Fix Binding To Multiple Addresses AgainMichael L. Young
When reworking chan_iax2 for IPv6, the ability to bind to multiple addresses was removed by mistake. This patch restores this functionality and adds notes about IPv6 addresses in the sample config. (closes issue ASTERISK-22741) Reported by: Joshua Colp Tested by: Michael L. Young Patches: asterisk-22741-fix-binding-multiple-addr.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2945/ ........ Merged revisions 401488 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-19Fix IAX2 incoming call address lookupsKinsey Moore
This fixes address lookup for incoming calls without a peer definition. The address family was unset instead of being set to AST_AF_UNSPEC which was causing lookup failures on "127.0.0.1". This is one of the causes of the current failure of the app_page integration test. Review: https://reviewboard.asterisk.org/r/2933/ ........ Merged revisions 401291 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-15chan_iax2: Fix channel left locked in off nominal code path.Richard Mudgett
........ Merged revisions 401016 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 401017 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04Add IPv6 Support To chan_iax2Michael L. Young
This patch adds IPv6 support to chan_iax2. Yay! (closes issue ASTERISK-22025) Patches: iax2-ipv6-v5-reviewboard.diff by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2660/ ........ Merged revisions 400567 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400568 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-10-02Cast Integer Argument To Unsigned CharMichael L. Young
The member reg in the peercnt structure is an unsigned char and peercnt_modify() is expecting an unsigned char argument which gets assigned to peercnt->reg. This patch fixes that by casting the integer argument being passed to peercnt_modify to unsigned char. ........ Merged revisions 400314 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400315 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 400316 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02Reduce channel snapshot creation and publishing by up to 50%.Joshua Colp
This change introduces the ability to stage channel snapshot creation and publishing by suppressing the implicit creation and publishing that some functions have. Once all operations are executed the staging is marked as done and a single snapshot is created and published. Review: https://reviewboard.asterisk.org/r/2889/ ........ Merged revisions 400265 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30Multiple revisions 399887,400138,400178,400180-400181David M. Lee
........ r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line Minor performance bump by not allocate manager variable struct if we don't need it ........ r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines Stasis performance improvements This patch addresses several performance problems that were found in the initial performance testing of Asterisk 12. The Stasis dispatch object was allocated as an AO2 object, even though it has a very confined lifecycle. This was replaced with a straight ast_malloc(). The Stasis message router was spending an inordinate amount of time searching hash tables. In this case, most of our routers had 6 or fewer routes in them to begin with. This was replaced with an array that's searched linearly for the route. We more heavily rely on AO2 objects in Asterisk 12, and the memset() in ao2_ref() actually became noticeable on the profile. This was #ifdef'ed to only run when AO2_DEBUG was enabled. After being misled by an erroneous comment in taskprocessor.c during profiling, the wrong comment was removed. Review: https://reviewboard.asterisk.org/r/2873/ ........ r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines Taskprocessor optimization; switch Stasis to use taskprocessors This patch optimizes taskprocessor to use a semaphore for signaling, which the OS can do a better job at managing contention and waiting that we can with a mutex and condition. The taskprocessor execution was also slightly optimized to reduce the number of locks taken. The only observable difference in the taskprocessor implementation is that when the final reference to the taskprocessor goes away, it will execute all tasks to completion instead of discarding the unexecuted tasks. For systems where unnamed semaphores are not supported, a really simple semaphore implementation is provided. (Which gives identical performance as the original taskprocessor implementation). The way we ended up implementing Stasis caused the threadpool to be a burden instead of a boost to performance. This was switched to just use taskprocessors directly for subscriptions. Review: https://reviewboard.asterisk.org/r/2881/ ........ r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines Optimize how Stasis forwards are dispatched This patch optimizes how forwards are dispatched in Stasis. Originally, forwards were dispatched as subscriptions that are invoked on the publishing thread. This did not account for the vast number of forwards we would end up having in the system, and the amount of work it would take to walk though the forward subscriptions. This patch modifies Stasis so that rather than walking the tree of forwards on every dispatch, when forwards and subscriptions are changed, the subscriber list for every topic in the tree is changed. This has a couple of benefits. First, this reduces the workload of dispatching messages. It also reduces contention when dispatching to different topics that happen to forward to the same aggregation topic (as happens with all of the channel, bridge and endpoint topics). Since forwards are no longer subscriptions, the bulk of this patch is simply changing stasis_subscription objects to stasis_forward objects (which, admittedly, I should have done in the first place.) Since this required me to yet again put in a growing array, I finally abstracted that out into a set of ast_vector macros in asterisk/vector.h. Review: https://reviewboard.asterisk.org/r/2883/ ........ r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines Remove dispatch object allocation from Stasis publishing While looking for areas for performance improvement, I realized that an unused feature in Stasis was negatively impacting performance. When a message is sent to a subscriber, a dispatch object is allocated for the dispatch, containing the topic the message was published to, the subscriber the message is being sent to, and the message itself. The topic is actually unused by any subscriber in Asterisk today. And the subscriber is associated with the taskprocessor the message is being dispatched to. First, this patch removes the unused topic parameter from Stasis subscription callbacks. Second, this patch introduces the concept of taskprocessor local data, data that may be set on a taskprocessor and provided along with the data pointer when a task is pushed using the ast_taskprocessor_push_local() call. This allows the task to have both data specific to that taskprocessor, in addition to data specific to that invocation. With those two changes, the dispatch object can be removed completely, and the message is simply refcounted and sent directly to the taskprocessor. Review: https://reviewboard.asterisk.org/r/2884/ ........ Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-24chan_iax2: Prevent some needless breaking of the native IAX2 bridge.Richard Mudgett
* Clean up some twisted code in the iax2_bridge() loop. * Add AST_CONTROL_VIDUPDATE and AST_CONTROL_SRCCHANGE to a list of frames to prevent the native bridge loop from breaking. * Passing the AST_CONTROL_T38_PARAMETERS frame should also allow FAX over a native IAX2 bridge. (issue ABE-2912) Review: https://reviewboard.asterisk.org/r/2870/ ........ Merged revisions 399697 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399708 from http://svn.asterisk.org/svn/asterisk/branches/11 For v12 and above this is really just documentation until IAX2 native bridging is restored. ........ Merged revisions 399736 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-16chan_iax2: Fix saving the wrong expiry time in astdb.Richard Mudgett
When a new IAX2 client registers, the astdb database is updated with the value of minregexpire defined in iax.conf instead of using the expiry time that is provided by the client. The provided expiry time of the client is updated after inserting the astdb entry. As a consequence, restarting or reloading asterisk creates clients whose registration may expire before they reregister. The clients are therefore unavailable after minregexpire seconds until they reregister. * Move updating of the expiry time to before inserting into the astdb. (closes issue ASTERISK-22504) Reported by: Stefan Wachtler Patches: chan_iax2.c.patch (license #6533) patch uploaded by Stefan Wachtler ........ Merged revisions 399158 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399159 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399160 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-05chan_iax2: Reduce indentation in __attempt_transmit().Richard Mudgett
* Reduce indentation in __attempt_transmit(). * Don't update the static last error time variable every time in __schedule_action() and socket_read(). ........ Merged revisions 398456 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398457 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398458 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-05chan_iax2: Fix stray reference to worker thread idle_list.Richard Mudgett
* Fix stray reference to idle_list in cleanup_thread_list(). This may be the reason for the note in iax2_process_thread() about threads not being removed from the task lists. * Move cleanup_thread_list(&idle_list) to after the other lists are cleaned up. ........ Merged revisions 398416 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398417 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398418 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-05chan_iax2: Fix bridgecallno deadlock avoidance.Richard Mudgett
* Fix bridgecallno deadlock avoidance. When doing deadlock avoidance, you need to retest the status of values for each loop to see if you still need the lock for bridgecallno. * As a safety check, after acquiring the bridgecallno lock you should check if iaxs[bridgecallno] is NULL just like the current callno checks. * Move setting thread->iostate to IAX_IOSTATE_IDLE to after processing any deferred frames to ensure that the iostate is IDLE when it is placed back into the idle list. defer_full_frame() tries to ensure iax2_process_thread() wakes up to process the frame. ........ Merged revisions 398379 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398380 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398381 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-27Fix uninitialized value in struct ast_control_pvt_cause_code usage.Richard Mudgett
........ Merged revisions 397744 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 397745 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17Strip down the old event systemKinsey Moore
This removes unused code, event types, IE pltypes, and event IE types where possible and makes several functions private that were once public. This includes a renumbering of the remaining event and IE types which breaks binary compatibility with previous versions. The last remaining consumers of the old event system (or parts thereof) are main/security_events.c, res/res_security_log.c, tests/test_cel.c, tests/test_event.c, main/cel.c, and the CEL backends. Review: https://reviewboard.asterisk.org/r/2703/ (closes issue ASTERISK-22139) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-15Remove some dead code dealing with: AST_BRIDGE_REC_CHANNEL_0, ↵Richard Mudgett
AST_BRIDGE_REC_CHANNEL_1, and AST_BRIDGE_IGNORE_SIGS. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-14chan_iax2: Conditionally remove native support for now.Richard Mudgett
(issue ASTERISK-21944) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02Get rid of ast_bridged_channel() and the bridged_channel field on ast_channels.Mark Michelson
This commit is smaller than the initial review placed on review board. This is because a change to allow for channel drivers to access parking functionality externally was committed and invalidated quite a few of the changes initially made. (closes issue ASTERISK-22039) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2717 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01Support externally initiated parking requests; remove some dead codeMatthew Jordan
This patch does the following: * It adds support for externally initiated parking requests. In particular, chan_skinny has a protocol level message that initiates a call park. This patch now supports that option, as well as the protocol specific mechanisms in chan_dahdi/sig_analog and chan_mgcp. * A parking bridge features virtual table has been added that provides access to the parking functionality that the Bridging API needs. This includes requests to park an entire 'call' (with little or no additional information, thank you chan_skinny), perform a blind transfer to a parking extension, determine if an extension is a parking extension, as well as the actual "do the parking" request from the Bridging API. * Refactoring in chan_mgcp, chan_skinny, and chan_dahdi to make use of the new functions * The removal of some - but not all - dead parking code from features.c This also fixed blind transferring a multi-party bridge to a parking lot (which was implemented, but had at least one code path where using the parking features kK might not have worked) Review: https://reviewboard.asterisk.org/r/2710 (closes issue ASTERISK-22134) Reported by: Matt Jordan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01Split caching out from the stasis_caching_topic.David M. Lee
In working with res_stasis, I discovered a significant limitation to the current structure of stasis_caching_topics: you cannot subscribe to cache updates for a single channel/bridge/endpoint/etc. To address this, this patch splits the cache away from the stasis_caching_topic, making it a first class object. The stasis_cache object is shared amongst individual stasis_caching_topics that are created per channel/endpoint/etc. These are still forwarded to global whatever_all_cached topics, so their use from most of the code does not change. In making these changes, I noticed that we frequently used a similar pattern for bridges, endpoints and channels: single_topic ----------------> all_topic ^ | single_topic_cached ----+----> all_topic_cached | +----> cache This pattern was extracted as the 'Stasis Caching Pattern', defined in stasis_caching_pattern.h. This avoids a lot of duplicate code between the different domain objects. Since the cache is now disassociated from its upstream caching topics, this also necessitated a change to how the 'guaranteed' flag worked for retrieving from a cache. The code for handling the caching guarantee was extracted into a 'stasis_topic_wait' function, which works for any stasis_topic. (closes issue ASTERISK-22002) Review: https://reviewboard.asterisk.org/r/2672/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395954 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-08Move channel driver Registry manager events to core.Jason Parker
This also shuffles the stasis system topic and related handling. (closes issue ASTERISK-21488) Review: https://reviewboard.asterisk.org/r/2631/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-01Refactor extraneous channel eventsKinsey Moore
This change removes JitterBufStats, ChannelReload, and ChannelUpdate and refactors the following events to travel over Stasis-Core: * LocalBridge * DAHDIChannel * AlarmClear * SpanAlarmClear * Alarm * SpanAlarm * DNDState * MCID * SIPQualifyPeerDone * SessionTimeout Review: https://reviewboard.asterisk.org/r/2627/ (closes issue ASTERISK-21476) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-28Add stasis publications for blind and attended transfers.Mark Michelson
This creates stasis messages that are sent during a blind or attended transfer. The stasis messages also are converted to AMI events. Review: https://reviewboard.asterisk.org/r/2619 (closes issue ASTERISK-21337) Reported by Matt Jordan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-22Migrate PeerStatus events to stasis, add stasis endpoints, and add ↵Joshua Colp
chan_pjsip device state. (closes issue ASTERISK-21489) (closes issue ASTERISK-21503) Review: https://reviewboard.asterisk.org/r/2601/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17Update Asterisk's CDRs for the new bridging frameworkMatthew Jordan
This patch is the initial push to update Asterisk's CDR engine for the new bridging framework. This patch guts the existing CDR engine and builds the new on top of messages coming across Stasis. As changes in channel state and bridge state are detected, CDRs are built and dispatched accordingly. This fundamentally changes CDRs in a few ways. (1) CDRs are now *very* reflective of the actual state of channels and bridges. This means CDRs track well with what an actual channel is doing - which is useful in transfer scenarios (which were previously difficult to pin down). It does, however, mean that CDRs cannot be 'fooled'. Previous behavior in Asterisk allowed for CDR applications, channels, and other properties to be spoofed in parts of the code - this no longer works. (2) CDRs have defined behavior in multi-party scenarios. This behavior will not be what everyone wants, but it is a defined behavior and as such, it is predictable. (3) The CDR manipulation functions and applications have been overhauled. Major changes have been made to ResetCDR and ForkCDR in particular. Many of the options for these two applications no longer made any sense with the new framework and the (slightly) more immutable nature of CDRs. There are a plethora of other changes. For a full description of CDR behavior, see the CDR specification on the Asterisk wiki. (closes issue ASTERISK-21196) Review: https://reviewboard.asterisk.org/r/2486/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-11IAX2: Transfer Reject: Lock bridgecallno before touching it, refactorAlec L Davis
1). When touching the bridgecallno, we need to lock it. 2). Remove magic number '0' and replace with TRANSFER_NONE. 3). Exit early if no bridgecallno. 4). Reduce indentation. Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2613/ ........ Merged revisions 391333 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391334 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10chan_iax2: nativebridge refactor, missed unlock bridgecallnoAlec L Davis
........ Merged revisions 391143 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391148 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10fix bad edit after conflict resolutionAlec L Davis
........ Merged revisions 391107 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391111 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10IAX2: refactor nativebridge transferAlec L Davis
remove triple checking of iaxs[fr->callno]->transferring reduce indentation. Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2602/ ........ Merged revisions 391065 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391084 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10IAX2: fix race condition with nativebridge transfers.Alec L Davis
1). When touching the bridgecallno, we need to lock it. 2). stop_stuff() which calls iax2_destroy_helper() Assumes the lock on the pvt is already held, when iax2_destroy_helper() is called. Thus we need to lock the bridgecallno pvt before we call stop_stuff(iaxs[fr->callno]->bridgecallno); 3). When evaluating the state of 'callno->transferring' of the current leg, we can't change it to READY unless the bridgecallno is locked. Why, if we are interrupted by the other call leg before 'transferring = TRANSFER_RELEASED', the interrupt will find that it is READY and that the bridgecallno is also READY so Releases the legs. (closes issue ASTERISK-21409) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2594/ ........ Merged revisions 391062 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391063 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-24Split Hold event into Hold/Unhold, and move it into core.Jason Parker
(closes issue ASTERISK-21487) Review: https://reviewboard.asterisk.org/r/2565/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-24Migrate a large number of AMI events over to Stasis-CoreMatthew Jordan
This patch moves a number of AMI events over to the Stasis-Core message bus. This includes: * ChanSpyStart/Stop * MonitorStart/Stop * MusicOnHoldStart/Stop * FullyBooted/Reload * All Voicemail/MWI related events In addition, it adds some Stasis-Core and AMI support for generic AMI messages, refactors the message router in AMI to use a single router with topic forwarding for the topics that AMI cares about, and refactors MWI message types and topics to be more name compliant. Review: https://reviewboard.asterisk.org/r/2532 (closes issue ASTERISK-21462) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389733 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-05-17Fix shutdown assertions in stasis-coreDavid M. Lee
In r388005, macros were introduced to consistently define message types. This added an assert if a message type was used either before it was initialized or after it had been cleaned up. It turns out that this assertion fires during shutdown. This actually exposed a hidden shutdown ordering problem. Since unsubscribing is asynchronous, it's possible that the message types used by the subscription could be freed before the final message of the subscription was processed. This patch adds stasis_subscription_join(), which blocks until the last message has been processed by the subscription. Since joining was most commonly done right after an unsubscribe, a stasis_unsubscribe_and_join() convenience function was also added. Similar functions were also added to the stasis_caching_topic and stasis_message_router, since they wrap subscriptions and have similar problems. Other code in trunk was refactored to join() where appropriate, or at least verify that the subscription was complete before being destroyed. Review: https://reviewboard.asterisk.org/r/2540 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17Remove Character Limit On "inkeys" For IAX2Michael L. Young
Currently, the buffer for processing "inkeys" is limited to 256 characters. If the user has many keys and the names of those key files are long, the 256 character limit is not enough. * Change inkeys buffer to be dynamic (closes issue ASTERISK-21398) Reported by: Pavel Kopchyk Tested by: Pavel Kopchyk, Michael L. Young Patches: asterisk-21398-iax2-inkeys-dynamic-buffer_v3.diff by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2501/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17Stasis: Update security events to use StasisJonathan Rose
Also moves ACL messages to the security topic and gets rid of the ACL topic (closes issue ASTERISK-21103) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2496/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-03Stasis: Convert network change events into network change stasis messagesJonathan Rose
(issue ASTERISK-21103) Review: https://reviewboard.asterisk.org/r/2490/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01Remove some unnecessary calls to ast_bridged_channel() in chan_iax2.cRichard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-30Stasis Core: Refactor ACL Change events to go out over the stasis core msg busJonathan Rose
(issue ASTERISK-21103) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2481/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12IAX2 defer_full_frames fail to get sentAlec L Davis
Ensure iax2_process_thread is signalled when a deferred frame is queued to it. (closes issue ASTERISK-18827) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2426/ ........ Merged revisions 385429 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385430 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12IAX2, prevent network thread starting before all helper threads are readyAlec L Davis
On startup, it's possible for a frame to arrive before the processing threads were ready. In iax2_process_thread() the first pass through falls into ast_cond_wait, should a frame arrive before we are at ast_cond_wait, the signal will be ignored. The result iax2_process_thread stays at ast_cond_wait forever, with deferred frames being queued. Fix: When creating initial idle iax2_process_threads, wait for init_cond to be signalled after each thread is started. (issue ASTERISK-18827) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2427/ ........ Merged revisions 385402 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385403 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27Convert MWI state message type to the new stasis naming conventionKinsey Moore
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-16Transition MWI to Stasis-coreKinsey Moore
Remove MWI's dependency on the event system by moving it to Stasis-core. This also introduces forwarding topic pools in Stasis-core which aggregate many dynamically allocated topics into a single primary topic. Review: https://reviewboard.asterisk.org/r/2368/ (closes issue ASTERISK-21097) Patch-by: Kinsey Moore git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-28Prevent deadlock in chan_iax2 when attempting to set caller IDMatthew Jordan
A deadlock can occur in chan_iax2 when it attempts to set the caller ID, as it already holds the iax2 private lock and improperly fails to obtain the channel lock before calling ast_set_callerid. By not safely obtaining the channel lock, a locking inversion can take place, causing a deadlock. This patch solves this by calling the required deadlock avoidance functions that obtain the channel lock before setting the caller ID. Thanks to Pavel for fixing my syntax errors and testing this patch out. (closes issue ASTERISK-21128) Reported by: Pavel Troller Tested by: Pavel Troller patches: ASTERISK-21128-1.8.diff uploaded by mjordan (license 6283) ASTERISK-21128-modified-1.8.diff uploaded by Pavel Troller (license 6302) ........ Merged revisions 382233 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382234 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14Use a shuffling algorithm to find unused IAX2 call numbers.Sean Bright
While adding red-black tree containers to astobj2 in r376575, Richard pointed out the way chan_iax2 finds unused call numbers will prevent ao2_container integrity checks at runtime. This patch removes the ao2_container and instead uses fixed sized arrays and a modified Fisher-Yates-Durstenfeld shuffle to maintain the call number list. While the locking semantics are similar to the ao2_container implementation, this implementation should be faster and more memory efficient. Review: https://reviewboard.asterisk.org/r/2288/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-31Move IAX firmware related functionality into separate files.Sean Bright
This patch is mostly a reorganization of existing code with a few exceptions: * Added doxygen comments to all of the extracted functions. * Split reload_firmware(int unload) into iax_firmware_reload() and iax_firmware_unload() for readability. * Create iax_firmware_traverse() to support the 'iax2 show firmware' CLI command. * Renamed iax_check_version() to iax_firmware_get_version() and change its arguments and return value so that it returns a success/failure value and sets the selected version into an out parameter to avoid confusion with failure and version 0. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380695 65c4cc65-6c06-0410-ace0-fbb531ad65f3