summaryrefslogtreecommitdiff
path: root/main/pbx.c
AgeCommit message (Collapse)Author
2013-08-12Unlock outgoing dial lock on off nominal pathMatthew Jordan
If the thread servicing the dial request isn't created successfully, the outgoing dial lock will still be held when the function returns. This patch unlocks the lock on this off nominal path. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-10Unlock the dial operation lock on a failed dialMatthew Jordan
If a dial operation fails, the pbx_outgoing_attempt routine will exit without first having unlocked the outgoing dial lock. This would be a "bad thing". git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-09pbx: Make originate threads indicate dial status when synchronousJonathan Rose
This makes it so that we can detect failures to originate as with earlier versions of Asterisk, which restores the Asterisk 11 behavior for the originate manager action. This was causing the ACL tests for SIP and IAX2 to fail since those tests expected originate failures when ACLs would cause rejections. Also, this patch fixes crashes in chan_sip when ACLs rejected peers during registration verification. (closes issue ASTERISK-22212) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2753/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-06Check result of ast_var_assign() calls for memory allocation failure.Walter Doekes
We try to keep the system running even when all available memory is spent. Review: https://reviewboard.asterisk.org/r/2734/ ........ Merged revisions 396279 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396287 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-05Fix res_ari_asterisk load issueDavid M. Lee
The new res_ari_asterisk.so module presents several config options from asterisk main. Unfortunately, they aren't exported, so the module won't load on Linux. This patch renames the variables, adding the ast_ prefix so they will be exported. Review: https://reviewboard.asterisk.org/r/2737 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02Remove dead code from features.c; refactor pickup code into pickup.cMatthew Jordan
This patch does the following: * It moves the pickup code out of features.c and into pickup.c * It removes the vast majority of dead code out of features.c. In particular, this includes the parking code. (issue ASTERISK-22134) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396060 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-20Add transfer support to CELKinsey Moore
This adds CEL support for blind and attended transfers and call pickup. During the course of adding this functionality I noticed that CONF_ENTER, CONF_EXIT, and BRIDGE_TO_CONF events are particularly useless without a bridge identifier, so I added that as well. This adds tests for blind transfers, several types of attended transfers, and call pickup. The extra field in CEL records now consists of a JSON blob whose fields are defined on a per-event basis. Review: https://reviewboard.asterisk.org/r/2658/ (closes issue ASTERISK-21565) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-08Refactor operations to access the stasis cache instead of objects directly ↵Joshua Colp
when retrieving information. (closes issue ASTERISK-21883) Review: https://reviewboard.asterisk.org/r/2645/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-07Handle hangup logic in the Stasis message bus and consumers of Stasis messagesMatthew Jordan
This patch does the following: * It adds a new soft hangup flag AST_SOFTHANGUP_HANGUP_EXEC that is set when a channel is executing dialplan hangup logic, i.e., the 'h' extension or a hangup handler. Stasis messages now also convey the soft hangup flag so consumers of the messages can know when a channel is executing said hangup logic. * It adds a new channel flag, AST_FLAG_DEAD, which is set when a channel is well and truly dead. Not just a zombie, but dead, Jim. Manager, CEL, CDRs, and other consumers of Stasis have been updated to look for this flag to know when the channel should by lying six feet under. * The CDR engine has been updated to better handle a channel entering and leaving a bridge. Previously, a new CDR was automatically created when a channel left a bridge and put into the 'Pending' state; however, this way of handling CDRs made it difficult for the 'endbeforehexten' logic to work correctly - there was always a new CDR waiting in the hangup logic and, even if 'ended', wouldn't be the CDR people wanted to inspect in the hangup routine. This patch completely removes the Pending state and instead defers creation of the new CDR until it gets a new message that requires a new CDR. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-01Prevent crash during synchronous AMI origination by ref bumping returned channelMatthew Jordan
The originate APIs allow callers to provide a pointer to a channel that will point to the originated channel if the function call succeeds. This is used by AMI to provide channel information when the originate is performed synchronously. Unfortunately, if the originate fails in certain ways, the outbound channel is already disposed of during the dialing itself. This results in the channel being improperly dereferenced by the internal originate function in pbx.c. This patch ref bumps the channel to prevent this from occurring. Callers must now unlock and unref the channel (which is more in line with general channel management guidelines anyway). This only affects manager, as it is the only consumer of this API function that actually passes in a channel pointer. Review: https://reviewboard.asterisk.org/r/2617/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-22Merge in current pimp_my_sip work, including:Joshua Colp
1. Security events 2. Websocket support 3. Diversion header + redirecting support 4. An anonymous endpoint identifier 5. Inbound extension state subscription support 6. PIDF notify generation 7. One touch recording support (special thanks Sean Bright!) 8. Blind and attended transfer support 9. Automatic inbound registration expiration 10. SRTP support 11. Media offer control dialplan function 12. Connected line support 13. SendText() support 14. Qualify support 15. Inband DTMF detection 16. Call and pickup groups 17. Messaging support Thanks everyone! Side note: I'm reminded of the song "How Far We've Come" by Matchbox Twenty. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392565 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-13Refactor CEL channel events on top of Stasis-CoreKinsey Moore
This uses the channel state change events from Stasis-Core to determine when channel-related CEL events should be raised. Those refactored in this patch are: * AST_CEL_CHANNEL_START * AST_CEL_ANSWER * AST_CEL_APP_START * AST_CEL_APP_END * AST_CEL_HANGUP * AST_CEL_CHANNEL_END Retirement of Linked IDs is also refactored. CEL configuration has been refactored to use the config framework. Note: Some HANGUP events are not generated correctly because the bridge layer does not propagate hangupcause/hangupsource information yet. Review: https://reviewboard.asterisk.org/r/2544/ (closes issue ASTERISK-21563) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-07res_parking: Automatically generate extensions, hints, etc.Jonathan Rose
(closes issue ASTERISK-21645) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2545/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-31Refactor code and fix a reference leakKinsey Moore
Refactor some channel blob publishing code to use ast_channel_publish_blob now that it is available and fix a JSON reference leak that was occurring during varset publishing. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-28Adds support for a core attended transfer function plus adds some hiding of ↵Mark Michelson
masquerades. The attended transfer API call can complete the attended transfer in a number of ways depending on the current bridged states of the channels involved. The hiding of masquerades is done in some bridging-related functions, such as the manager Bridge action and the Bridge dialplan application. In addition, call pickup was edited to "move" a channel rather than masquerade it. Review: https://reviewboard.asterisk.org/r/2511 (closes issue ASTERISK-21334) Reported by Matt Jordan (closes issue Asterisk-21336) Reported by Matt Jordan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389848 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-20Set the AST_CDR_FLAG_ORIGINATED flag on originated channel's CDRsMatthew Jordan
This may alleviate some of the CDR woes with originated channels, as CDRs do like to know when a channel was originated. Eventually this will get converted to be a channel flag, so its location is still good to know post the great CDR shakeup of 2013. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-19Don't hold the outgoing lock for a prolonged period of time as it may block ↵Joshua Colp
the originator. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-19If the caller of the originate API calls wants the channel ensure it has ↵Joshua Colp
been requested and dialed. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-18Fix a bug where synchronous origination (oddly enough triggered by doing an ↵Joshua Colp
async manager Originate) would not work properly. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-18Move origination to use the dialing API and send Stasis messages on dial ↵Joshua Colp
begin and end. (closes issue ASTERISK-21549) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2512/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389053 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-13pbx: Fix lack of cleanup on macrolock and context_tableJonathan Rose
(closes issue ASTERISK-21723) Reported by: Corey Farrell Patches: core-pbx-cleanup.patch uploaded by Correy Farrell (license 5909) ........ Merged revisions 388532 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388578 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16Move presence state distribution to Stasis-coreKinsey Moore
Convert presence state events to Stasis-core messages and remove redundant serializers where possible. Review: https://reviewboard.asterisk.org/r/2410/ (closes issue ASTERISK-21102) Patch-by: Kinsey Moore <kmoore@digium.com> git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16Move device state distribution to Stasis-coreKinsey Moore
In the move from Asterisk's event system to Stasis, this makes distributed device state aggregation always-on, removes unnecessary task processors where possible, and collapses aggregate and non-aggregate states into a single cache for ease of retrieval. This also removes an intermediary step in device state aggregation. Review: https://reviewboard.asterisk.org/r/2389/ (closes issue ASTERISK-21101) Patch-by: Kinsey Moore <kmoore@digium.com> git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-08Add multi-channel Stasis messages; refactor Dial AMI events to StasisMatthew Jordan
This patch does the following: * A new Stasis payload has been defined for multi-channel messages. This payload can store multiple ast_channel_snapshot objects along with a single JSON blob. The payload object itself is opaque; the snapshots are stored in a container keyed by roles. APIs have been provided to query for and retrieve the snapshots from the payload object. * The Dial AMI events have been refactored onto Stasis. This includes dial messages in app_dial, as well as the core dialing framework. The AMI events have been modified to send out a DialBegin/DialEnd events, as opposed to the subevent type that was previously used. * Stasis messages, types, and other objects related to channels have been placed in their own file, stasis_channels. Unit tests for some of these objects/messages have also been written. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-28Break the world. Stasis message type accessors should now all be named ↵Kinsey Moore
correctly. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-22Move more channel events to Stasis; move res_json.c to main/json.c.David M. Lee
This patch started out simply as fixing the bouncing tests introduced in r382685, but required some other changes to give it a decent implementation. To fix the bouncing tests, the UserEvent and Newexten AMI events needed to be refactored to dispatch via Stasis. Dispatching directly to AMI resulted in those events sometimes getting ahead of the associated Newchannel events, which would understandably confuse anyone. I found that instead of creating a zillion different message types and structures associated with them, it would be preferable to define a message type that has a channel snapshot and a blob of structured data with a small bit of additional information. The JSON object model provides a very nice way of representing structured data, so I went with that. * Move JSON support from res_json.c to main/json.c * Made libjansson-dev a required dependency * Added an ast_channel_blob message type, which has a channel snapshot and JSON blob of data. * Changed UserEvent and Newexten events so that they are dispatched via ast_channel_blob messages on the channel's topic. * Got rid of the ast_channel_varset message; used ast_channel_blob instead. * Extracted the manager functions converting Stasis channel events to AMI events into manager_channel.c. (issue ASTERISK-21096) Review: https://reviewboard.asterisk.org/r/2381/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-08This patch adds a new message bus API to Asterisk.David M. Lee
For the initial use of this bus, I took some work kmoore did creating channel snapshots. So rather than create AMI events directly in the channel code, this patch generates Stasis events, which manager.c uses to then publish the AMI event. This message bus provides a generic publish/subscribe mechanism within Asterisk. This message bus is: - Loosely coupled; new message types can be added in seperate modules. - Easy to use; publishing and subscribing are straightforward operations. In addition to basic publish/subscribe, the patch also provides mechanisms for message forwarding, and for message caching. (issue ASTERISK-20887) (closes issue ASTERISK-20959) Review: https://reviewboard.asterisk.org/r/2339/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14Revamp of terminal color codesKinsey Moore
The core module related to coloring terminal output was old and needed some love. The main thing here was an attempt to get rid of the obscene number of stack-local buffers that were allocated for no other reason than to colorize some output. Instead, this uses a simple trick to allocate several buffers within threadlocal storage, then automatically rotates between them, so that you can make multiple calls to the colorization routine within one function and not need to allocate multiple buffers. Review: https://reviewboard.asterisk.org/r/2241/ Patches: bug.patch uploaded by Tilghman Lesher git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-09pbx: Fix regression caused by taking advantage of the function name sort.Richard Mudgett
Taking advantage of the sorted order of the registered functions container requires that they are actually inserted in the expected sort order. * Insert the registered functions into the container in case sensitive position. As a result, only the complete_functions() routine needs to search the entire container because it does a case insensitive search for convenience. Caught by the unit tests. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-09pbx: Make function and application containers take advantage of being sorted.Richard Mudgett
* Fixed "core show function" tab completion and token count checking. * Refactored function and application container handling code to reduce redundancy. * Made __ast_pbx_run() return using the defines the caller should expect. Doesn't change the returned values. Just made use the defines. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11Cleanup pbx on exit.Richard Mudgett
* Cleanup CLI commands on exit. * Unreference hints and statecbs containers on exit. (issue ASTERISK-20649) Reported by: Corey Farrell Patches: pbx-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell pbx-cleanup-10.patch (license #5909) patch uploaded by Corey Farrell pbx-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell Modified ........ Merged revisions 377806 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 377807 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 377808 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-28Fix extension matching with the '-' char.Richard Mudgett
The '-' char is supposed to be ignored by the dialplan extension matching. Unfortunately, it's treatment is not handled consistently throughout the extension matching code. * Made the old exten matching code consistently ignore '-' chars. * Made the old exten matching code consistently handle case in the matching. * Made ignore empty character sets. * Fixed ast_extension_cmp() to return -1, 0, or 1 as documented. The only user of it in pbx_lua.c was testing for -1. It was originally returning the strcmp() value for less than which is not usually going to be -1. * Fix character set sorting if the sets have the same number of characters and start with the same character. Character set [0-9] now sorts before [02-9a] as originally intended. * Updated some extension label and priority already in use warnings to also indicate if the extension is aliased. (closes issue ASTERISK-19205) Reported by: Philippe Lindheimer, Birger "WIMPy" Harzenetter Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2201/ ........ Merged revisions 376688 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 376689 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376690 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-12Properly check if the "Context" and "Extension" headers are empty in a ↵Joshua Colp
ShowDialPlan action. The code which handles the ShowDialPlan action wrongly assumed that a non-NULL return value from the function which retrieves headers from an action indicates that the header has a value. This is incorrect and the contents must be checked to see if they are blank. (closes issue ASTERISK-20628) Reported by: jkroon Patches: asterisk-showdialplan-incorrect-error.patch uploaded by jkroon ........ Merged revisions 376166 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 376167 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376168 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-12Fix Dynamic Hints Variable Substition - Underscore ProblemMichael L. Young
When adding a dynamic hint, if an extension contains an underscore no variable subsitution is being performed. This patch changes from checking if the extension contains an underscore to checking if the extension begins with an underscore. (closes issue ASTERISK-20639) Reported by: Steven T. Wheeler Tested by: Steven T. Wheeler, Michael L. Young Patches: asterisk-20639-dynamic-hint-underscore.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2188/ ........ Merged revisions 376142 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 376143 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376144 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07Multiple revisions 375993-375994Mark Michelson
........ r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines Fix misuses of timeouts throughout the code. Prior to this change, a common method for determining if a timeout was reached was to call a function such as ast_waitfor_n() and inspect the out parameter that told how many milliseconds were left, then use that as the input to ast_waitfor_n() on the next go-around. The problem with this is that in some cases, submillisecond timeouts can occur, resulting in the out parameter not decreasing any. When this happens thousands of times, the result is that the timeout takes much longer than intended to be reached. As an example, I had a situation where a 3 second timeout took multiple days to finally end since most wakeups from ast_waitfor_n() were under a millisecond. This patch seeks to fix this pattern throughout the code. Now we log the time when an operation began and find the difference in wall clock time between now and when the event started. This means that sub-millisecond timeouts now cannot play havoc when trying to determine if something has timed out. Part of this fix also includes changing the function ast_waitfor() so that it is possible for it to return less than zero when a negative timeout is given to it. This makes it actually possible to detect errors in ast_waitfor() when there is no timeout. (closes issue ASTERISK-20414) reported by David M. Lee Review: https://reviewboard.asterisk.org/r/2135/ ........ r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines Remove some debugging that accidentally made it in the last commit. ........ Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375995 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376014 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29Make evaluation of channel variables consistently case-sensitive.Mark Michelson
Due to inconsistencies in how variable names were evaluated, the decision was made to make all evaluations case-sensitive. See the UPGRADE.txt file or https://wiki.asterisk.org/wiki/display/AST/Case+Sensitivity for more details. (closes issue ASTERISK-20163) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2160 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-17Change a few warnings to debug and the inverse.Walter Doekes
Remove the "RTP Read too short" warning for RTP keepalives. Remove the the warning about the application delimiter switch from pipe to comma. (You should've done this by now.) Make cdr_odbc report more when an insert fails. Make chan_sip warn less when the peer wants SRTP (and we don't) or sends a zero port to disable a media type. Review: https://reviewboard.asterisk.org/r/2167 (closes issue ASTERISK-20538) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-09Fix execution of 'i' extension due to uninitialized variable.Richard Mudgett
The fix for ASTERISK-18243 added code that could potentially use dst_exten[] uninitialized. As a result the 'i' exten may not be executed when it should. (closes issue ASTERISK-20455) Reported by: Richard Miller Patches: pbx-1.8.16.0.diff (license #5685) patch uploaded by Richard Miller Made some cosmetic modifications. ........ Merged revisions 374758 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374763 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374771 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02Fix a variety of ref counting issuesMatthew Jordan
This patch resolves a number of ref leaks that occur primarily on Asterisk shutdown. It adds a variety of shutdown routines to core portions of Asterisk such that they can reclaim resources allocate duringd initialization. Review: https://reviewboard.asterisk.org/r/2137 ........ Merged revisions 374177 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374178 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374196 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22Doxygen Updates Janitor WorkAndrew Latham
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags. * Add cleanup to Makefile for the Doxygen configuration update * Start updating Doxygen configuration for cleaner output * Enable inclusion of configuration files into documentation * remove mantisworkflow... * update documentation README * Add markup to Tilghman's email and talk with him about updating his email, he knows... * no code changes on this commit other than the mentioned Makefile change (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05Ensure counts generated in manager_show_dialplan_helper are correctKinsey Moore
When manager_show_dialplan_helper was written, the counter increment for the total number of contexts was placed with the extensions increment instead of in the enclosing loop. This function should now generate correct context counts. (closes issue AST-970) Reported-by: John Bigelow ........ Merged revisions 372337 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372338 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372340 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30Clean up doxygen warningsMatthew Jordan
This patch fixes numerous doxygen warnings across Asterisk. It also updates the makefile to regenerate the doxygen configuration on the local system before running doxygen to help prevent warnings/errors on the local system. Much thanks to Andrew for tackling one of the Asterisk janitor projects! (issue ASTERISK-20259) Reported by: Andrew Latham Patches: doxygen_partial.diff uploaded by Andrew Latham (license 5985) make_progdocs.diff uploaded by Andrew Latham (license 5985) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-09Extend extension state callbacks to have more information.Mark Michelson
Quote from review board: This patch extends the extension state callbacks so that monitoring channels (as chan_sip) get more information of the devices which are responsible for an extension state change. The additional information is needed by chan_sip to present names/numbers of the caller and callee in an early-state SIP notification. Users of extenstion state callback not interested in the additional information are not affected by the changes. Motivation: to present the involved party's name/number in an early-state nofification (used by the notified device as a pickup offer) one after another so that a user can see which call he will pick up in an undirected pickup. Such a pickup offer to a user shall indicate the same call (number/name-A calls number/name-B) as the call which would be picked up when an undirected pickup is executed. Users interested in additional state info must use the new functions ast_extension_state_add_extended() resp. ast_extension_state_add_destroy_extended() to register an extended state callback. When the callback is registered this way, an extra member device_state_info of struct ast_state_cb_info is passed to the callback in addition to the aggregated extension state. This container holds an object for every device of the monitored extension hint consisting of the device name, the device state and a channel reference to the channel which (presumably) caused the device state. The information is used by chan_sip for early-state notifications. When the state of a device changes and the new state contains AST_EVENT_RINGING, an early-state notification is sent to the subscribed devices with the caller/callee names/numbers of the oldest ringing channel of the monitored extension. The notified user may then invoke a direct pickup, which will pickup exactly this channel. Users of the old non-extended callbacks will only be called when the aggregated state did change (same behavior as before). Users of the extended callback will also be called when the state is unchanged but does contain AST_EVENT_RINGING. That could be the case if two channels are ringing at one device and one of them hangs up, so the aggregated state does not change. This way the monitoring channel can create a new early-state notification with the now ringing party-ids. Review: https://reviewboard.asterisk.org/r/2048 This contribution comes from Guenther Kelleter git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08Allow support for early media on AMI originates and call files.Mark Michelson
This is based on the work done by Olle Johansson on review board. The idea is that the channel specified in an AMI originate or call file is typically not connected to the outgoing extension until the channel has been answered. With this change, an EarlyMedia header can be specified for AMI originates and an early_media option can be specified in call files. With this option set, once early media is received on a channel, it will be connected with the outgoing extension. (closes issue ASTERISK-18644) Reported by Olle Johansson Review: https://reviewboard.asterisk.org/r/1472 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31Clean up and ensure proper usage of alloca()Kinsey Moore
This replaces all calls to alloca() with ast_alloca() which calls gcc's __builtin_alloca() to avoid BSD semantics and removes all NULL checks on memory allocated via ast_alloca() and ast_strdupa(). (closes issue ASTERISK-20125) Review: https://reviewboard.asterisk.org/r/2032/ Patch-by: Walter Doekes (wdoekes) ........ Merged revisions 370642 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3