summaryrefslogtreecommitdiff
path: root/main/features.c
AgeCommit message (Collapse)Author
2013-04-26Clean up resources in features on exitMatthew Jordan
This patch cleans up two things features: * It properly unregisters the CLI commands that features registered * It cancels and performs a pthread_join on the created parking thread. This not only properly joins a non-detached thread, but also prevents disposing of the parking lots prior to the parking thread completely exiting. (closes issue ASTERISK-21407) Reported by: Corey Farrell patches: features_shutdown-r2.patch uploaded by Corey Farrell (License 5909) ........ Merged revisions 386641 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386642 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-10Eliminated dial_features_destroy() since it is equivalent to ast_free_ptr()Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-10* Fix unlocked accesses to feature_list. The feature_list is now alsoRichard Mudgett
protected by the features_lock. * Made all calls to ast_find_call_feature() have the features_lock held. * Fixed set_config_flags() to actually use find_group() to look for feature groups in DYNAMIC_FEATURES. The code originally assumed all feature groups were listed in DYNAMIC_FEATURES. * Make everyone use ast_rdlock_call_features(), ast_unlock_call_features(), and new ast_wrlock_call_features() instead of directly calling the rwlock API on features_lock. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-09Rename struct feature_ds to struct feature_datastore.Richard Mudgett
Because "struct feature_ds *feature_ds" is not a good thing. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-09Add inheritance support to FEATURE()/FEATUREMAP().Russell Bryant
The settings saved on the channel for FEATURE()/FEATUREMAP() were only for that channel. This patch adds the ability to have these settings inherited to child channels if you set FEATURE(inherit)=yes. Closes issue ASTERISK-21306. Review: https://reviewboard.asterisk.org/r/2415/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385088 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-02-19Write the correct callid to the data1 field in queue_log for transfer events.Kevin Harwell
The incorrect callid was being written to the "data1" field in queue_log table for transfer events. The callid of the queue was being written instead of the transfer target's callid. This now gets the correct "transfer to" number and places that in the "data1" field of the queue_log table when a transfer event is triggered. (closes issue ASTERISK-19960) Reported by: vladimir shmagin ........ Merged revisions 381770 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381791 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14End stuck DTMF if AST_SOFTHANGUP_ASYNCGOTO because it isn't a real hangup.Richard Mudgett
It doesn't hurt to check AST_SOFTHANGUP_UNBRIDGE either, but it should not be set outside of a bridge. (issue ASTERISK-20492) ........ Merged revisions 381466 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381467 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-11features: Don't cache a struct ast_app pointer.Richard Mudgett
Caching a struct ast_app pointer is not a good idea because someone could unload the application. After the applicaiton unload the cached ast_app pointer is no longer valid. Only pbx.c can cache the pointer because it knows when the application is unloaded and removes the pointer. * Fixed one-touch Monitor and MixMonitor to not cache the ast_app pointer and not use the silly monitor_ok/mixmonitor_ok/stopmixmonitor_ok flags. * Extracted bridge_check_monitor() from ast_bridge_call() and use propper locking. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-08Call Parking: Set PARKINGLOT and PARKINGSLOT variables on all parked callsJonathan Rose
These two variables were previously not being set when comebacktoorigin=yes and the example configs seemed to imply that they should be. Since there is no harm in this and since calls that are sent back to origin are capable of continuing in the dialplan, this seemed like a no-brainer. Also it supports some bridging tests I've been working on. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-29call_parking: Make sure fallbacks are used when lacking a flat channel extenJonathan Rose
A regression was introduced which removed automatic fallback behavior from the PBX. This behavior was used by call parking (or at least documented as how the feature works) in order to select an extension when the flat channel extension wasn't available from the comebackcontext. Parking now handles the fallbacks internally in order to keep behavior matching with how it is documented. (closes issue ASTERISK-20716) Reported by: Chris Gentle Review: https://reviewboard.asterisk.org/r/2296/ ........ Merged revisions 380348 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02Fix AMI redirect action with two channels failing to redirect both channels.Richard Mudgett
The AMI redirect action can fail to redirect two channels that are bridged together. There is a race between the AMI thread redirecting the two channels and the bridge thread noticing that a channel is hungup from the redirects. * Made the bridge wait for both channels to be redirected before exiting. * Made the AMI redirect check that all required headers are present before proceeding with the redirection. * Made the AMI redirect require that any supplied ExtraChannel exist before proceeding. Previously the code fell back to a single channel redirect operation. (closes issue ASTERISK-18975) Reported by: Ben Klang (closes issue ASTERISK-19948) Reported by: Brent Dalgleish Patches: jira_asterisk_19948_v11.patch (license #5621) patch uploaded by rmudgett Tested by: rmudgett, Thomas Sevestre, Deepak Lohani, Kayode Review: https://reviewboard.asterisk.org/r/2243/ ........ Merged revisions 378356 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378358 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02Prevent exhaustion of system resources through exploitation of event cacheMatthew Jordan
Asterisk maintains an internal cache for devices in the event subsystem. The device state cache holds the state of each device known to Asterisk, such that consumers of device state information can query for the last known state for a particular device, even if it is not part of an active call. The concept of a device in Asterisk can include entities that do not have a physical representation. One way that this occurred was when anonymous calls are allowed in Asterisk. A device was automatically created and stored in the cache for each anonymous call that occurred; this was possible in the SIP and IAX2 channel drivers and through channel drivers that utilized the res_jabber/res_xmpp resource modules (Gtalk, Jingle, and Motif). These devices are never removed from the system, allowing anonymous calls to potentially exhaust a system's resources. This patch changes the event cache subsystem and device state management to no longer cache devices that are not associated with a physical entity. (issue ASTERISK-20175) Reported by: Russell Bryant, Leif Madsen, Joshua Colp Tested by: kmoore patches: event-cachability-3.diff uploaded by jcolp (license 5000) ........ Merged revisions 378303 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378320 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 378321 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-14Features: BRIDGE_FEATURES variable automixmonitor support and use proper partyJonathan Rose
BRIDGE_FEATURES did not previously support the automixmonitor feature. Now it does. In addition, the BRIDGE_FEATURES variable would not apply features to the proper party based on whether the feature option letter was in caps or in lowercase (both ways would apply it to the caller). Now uppercase applies to the caller while lowercase applies to the callee (like with the dial option) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-12Convert Dynamic Features Buffer To Use ast_strMichael L. Young
Currently, the buffer for the dynamic features list is set to a fixed size of 128. If the list is bigger than that, it results in the dynamic feature(s) not being recognized. This patch changes the buffer from a fixed size to a dynamic one. (closes issue ASTERISK-20680) Reported by: Clod Patry Tested by: Michael L. Young Patches: asterisk-20680-dynamic-features-v2.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2221/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11Add test events necessary for bridging tests to be able to properly run.Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-06Fix stuck DTMF when bridge is broken.Richard Mudgett
When a bridge is broken by an AMI Redirect action or the ChannelRedirect application, an in progress DTMF digit could be stuck sending forever. * Made simulate a DTMF end event when a bridge is broken and a DTMF digit was in progress. (closes issue ASTERISK-20492) Reported by: Jeremiah Gowdy Patches: bridge_end_dtmf-v3.patch.txt (license #6358) patch uploaded by Jeremiah Gowdy Modified to jira_asterisk_20492_v1.8.patch jira_asterisk_20492_v1.8.patch (license #5621) patch uploaded by rmudgett Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2169/ ........ Merged revisions 375964 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375965 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 375966 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29Fix the Park 'r' option when a channel parks itself.Richard Mudgett
When a channel uses the Park appliation to park itself with the 'r' option, the channel hears music-on-hold instead of the requested ringing. * Added a missing check for the 'r' option when a channel parks itself. (closes issue ASTERISK-19382) Reported by: James Stocks Patches by: dsessions Review: https://reviewboard.asterisk.org/r/2148/ ........ Merged revisions 375388 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375389 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 375390 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-18Doxygen Updates - Title updateAndrew Latham
Update and extend the configuration_file group and enable linking. Commit other cleanups from multi-version Doxygen testing. Update title that was left behind many years ago. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375182 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-20Named call pickup groups. Fixes, missing functionality, and improvements.Richard Mudgett
* ASTERISK-20383 Missing named call pickup group features: CHANNEL(callgroup) - Need CHANNEL(namedcallgroup) CHANNEL(pickupgroup) - Need CHANNEL(namedpickupgroup) Pickup() - Needs to also select from named pickup groups. * ASTERISK-20384 Using the pickupexten, the pickup channel selection could fail even though there was a call it could have picked up. In a call pickup race when there are multiple calls to pickup and two extensions try to pickup a call, it is conceivable that the loser will not pick up any call even though it could have picked up the next oldest matching call. Regression because of the named call pickup group feature. * See ASTERISK-20386 for the implementation improvements. These are the changes in channel.c and channel.h. * Fixed some locking issues in CHANNEL(). (closes issue ASTERISK-20383) Reported by: rmudgett (closes issue ASTERISK-20384) Reported by: rmudgett (closes issue ASTERISK-20386) Reported by: rmudgett Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2112/ ........ Merged revisions 373220 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-11Fix bad channel application data reference.Mark Michelson
When channels get bridged due to an AMI bridge action or a DTMF attended transfer, the two channels that get bridged have their application data pointing to the other channel's name. This means that if one channel is hung up but the other moves on, it means that the channel that moves on will have its application data pointing at freed memory. (issue ASTERISK-20335) Reported by: aragon ........ Merged revisions 372840 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372841 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372886 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-10Add private representation of caller, connected and redirecting party ids.Richard Mudgett
This patch adds the feature "Private representation of caller, connected and redirecting party ids", as previously discussed with us (DATUS) and Digium. 1. Feature motivation Until now it is quite difficult to modify a party number or name which can only be seen by exactly one particular instantiated technology channel subscriber. One example where a modified party number or name on one channel is spread over several channels are supplementary services like call transfer or pickup. To implement these features Asterisk internally copies caller and connected ids from one channel to another. Another example are extension subscriptions. The monitoring entities (watchers) are notified of state changes and - if desired - of party numbers or names which represent the involving call parties. One major feature where a private representation of party names is essentially needed, i.e. where a party name shall be exclusively signaled to only one particular user, is a private user-specific name resolution for party numbers. A lookup in a private destination-dependent telephone book shall provide party names which cannot be seen by any other user at any time. 2. Feature Description This feature comes along with the implementation of additional private party id elements for caller id, connected id and redirecting ids inside Asterisk channels. The private party id elements can be read or set by the user using Asterisk dialplan functions. When a technology channel is initiating a call, receives an internal connected-line update event, or receives an internal redirecting update event, it merges the corresponding public id with the private id to create an effective party id. The effective party id is then used for protocol signaling. The channel technologies which initially support the private id representation with this patch are SIP (chan_sip), mISDN (chan_misdn) and PRI (chan_dahdi). Once a private name or number on a channel is set and (implicitly) made valid, it is generally used for any further protocol signaling until it is rewritten or invalidated. To simplify the invalidation of private ids all internally generated connected/redirecting update events and also all connected/redirecting update events which are generated by technology channels -- receiving regarding protocol information - automatically trigger the invalidation of private ids. If not using the private party id representation feature at all, i.e. if using only the 'regular' caller-id, connected and redirecting related functions, the current characteristic of Asterisk is not affected by the new extended functionality. 3. User interface Description To grant access to the private name and number representation from the Asterisk dialplan, the CALLERID, CONNECTEDLINE and REDIRECTING dialplan functions are extended by the following data types. The formats of these data types are equal to the corresponding regular 'non-private' already existing data types: CALLERID: priv-all priv-name priv-name-valid priv-name-charset priv-name-pres priv-num priv-num-valid priv-num-plan priv-num-pres priv-subaddr priv-subaddr-valid priv-subaddr-type priv-subaddr-odd priv-tag CONNECTEDLINE: priv-name priv-name-valid priv-name-pres priv-name-charset priv-num priv-num-valid priv-num-pres priv-num-plan priv-subaddr priv-subaddr-valid priv-subaddr-type priv-subaddr-odd priv-tag REDIRECTING: priv-orig-name priv-orig-name-valid priv-orig-name-pres priv-orig-name-charset priv-orig-num priv-orig-num-valid priv-orig-num-pres priv-orig-num-plan priv-orig-subaddr priv-orig-subaddr-valid priv-orig-subaddr-type priv-orig-subaddr-odd priv-orig-tag priv-from-name priv-from-name-valid priv-from-name-pres priv-from-name-charset priv-from-num priv-from-num-valid priv-from-num-pres priv-from-num-plan priv-from-subaddr priv-from-subaddr-valid priv-from-subaddr-type priv-from-subaddr-odd priv-from-tag priv-to-name priv-to-name-valid priv-to-name-pres priv-to-name-charset priv-to-num priv-to-num-valid priv-to-num-pres priv-to-num-plan priv-to-subaddr priv-to-subaddr-valid priv-to-subaddr-type priv-to-subaddr-odd priv-to-tag Reported by: Thomas Arimont Review: https://reviewboard.asterisk.org/r/2030/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-10Fix pickup extension channel reference error.Richard Mudgett
You cannot unref a pointer and then expect to ref it again later. * Fix potential NULL pointer deref if the call pickup search fails. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07Add named callgroups/pickupgroupsMatthew Jordan
This patch adds named calledgroups/pickupgroups to Asterisk. Named groups are implemented in parallel to the existing numbered callgroup/pickupgroup implementation. However, unlike the existing implementation, which is limited to a maximum of 64 defined groups, the number of defined groups allowed for named callgroups/pickupgroups is effectively unlimited. Named groups are configured with the keywords "namedcallgroup" and "namedpickupgroup". This corresponds to the numbered group definitions of "callgroup" and "pickupgroup". Note that as the implementation of named groups coexists with the existing numbered implementation, a defined named group of "4" does not equate to numbered group 4. Support for the named groups has been added to the SIP, DAHDI, and mISDN channel drivers. Review: https://reviewboard.asterisk.org/r/2043 Uploaded by: Guenther Kelleter(license #6372) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370831 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
2012-07-11Don't perform an XInclude to a document node that may not always be presentMatthew Jordan
Because some of the manager events are defined in the top of the source, due to the macro calls not containing all necessary information to have the documentation colocated with the call itself, several include statements were failing when built with 'make'. While this did not cause any problems in compilation or validation, it did result in a number of warnings being dumped to stderr. This patch changes those references such that they always resolve, regardless of the documentation build options. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-10Add some additional documentation for core AMI eventsMatthew Jordan
This patch adds some basic documentation for a number of modules. This includes core source files in Asterisk (those in main), as well as chan_agent, chan_dahdi, chan_local, sig_analog, and sig_pri. The DTD has also been updated to allow referencing of AMI commands. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-29Hangup handlers - Dialplan subroutines that run when the channel hangs up.Richard Mudgett
Hangup handlers are an alternative to the h extension. They can be used in addition to the h extension. The idea is to attach a Gosub routine to a channel that will execute when the call hangs up. Whereas which h extension gets executed depends on the location of dialplan execution when the call hangs up, hangup handlers are attached to the call channel. You can attach multiple handlers that will execute in the order of most recently added first. (closes issue ASTERISK-19549) Reported by: Mark Murawski Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2002/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-26Unique Call ID logging Phases III and IVJonathan Rose
Adds call ID logging changes to specific channel drivers that weren't handled handled in phase II of Call ID Logging. Also covers logging for threads for threads created by systems that may be involved with many different calls. Extra special thanks to Richard for rigorous review of chan_dahdi and its various signalling modules. review: https://reviewboard.asterisk.org/r/1927/ review: https://reviewboard.asterisk.org/r/1950/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-25Fix Bridge application occasionally returning to the wrong location.Richard Mudgett
* Fix do_bridge_masquerade() getting the resume location from the zombie channel. The code must not touch a clone channel after it has masqueraded it. The clone channel has become a zombie and is starting to hangup. (closes issue ASTERISK-19985) Reported by: jamicque Patches: jira_asterisk_19985_v1.8.patch (license #5621) patch uploaded by rmudgett Tested by: jamicque ........ Merged revisions 369327 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369328 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-23Fix F and F(x) action logic in Bridge application.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-23Fix Bridge application and AMI Bridge action error handling.Richard Mudgett
* Fix AMI Bridge action disconnecting the AMI link on error. * Fix AMI Bridge action and Bridge application not checking if their masquerades were successful. * Fix Bridge application running the h-exten when it should not. * Made do_bridge_masquerade() return if the masquerade was successful so the Bridge application and AMI Bridge action could deal with it correctly. * Made bridge_call_thread_launch() hangup the passed in channels if the bridge_call_thread fails to start. Those channels would have been orphaned. * Made builtin_atxfer() check the success of the transfer masquerade setup. ........ Merged revisions 369282 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369283 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-18Fix AST_CONTROL_PVT_CAUSE_CODE handlingKinsey Moore
When the IAX2 Who Hung Up? changes were added, they uncovered a bug in the way AST_CONTROL_PVT_CAUSE_CODE was handled in feature_request_and_dial(). This particular frame subtype was being treated like more terminal control frames causing the function to be exited prematurely. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-18Fix monitoring calls put in a parking lot.Richard Mudgett
* Fix a regression that was introduced by -r366167 which effectively disabled monitoring parked calls. (closes issue ASTERISK-20012) Reported by: sdolloff Tested by: rmudgett ........ Merged revisions 369043 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369044 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-06Fix parked call performing a DTMF blind transfer after being retrieved.Richard Mudgett
When a parked call was retrieved from the parking lot, it could not do a blind transfer because it caused the involved calls to be hung up unconditionally. * Made the ParkedCall application return the ast_bridge_call() return value. (closes issue ABE-2862) Reported by: Vlad Povorozniuc ........ Merged revisions 368567 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368568 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-06Make builtin_blindtransfer() fully use ast_async_goto() abilities.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-05Convert AST_FLAG_ANSWERED_ELSEWHERE usage to AST_CAUSE_ANSWERED_ELSEWHEREKinsey Moore
This was essentially duplicated functionality where normal channels used AST_CAUSE_ANSWERED_ELSEWHERE while local channels and queues used AST_FLAG_ANSWERED_ELSEWHERE. This removes the flag and converts that usage into AST_CAUSE_ANSWERED_ELSEWHER usage. Review: https://reviewboard.asterisk.org/r/1944 (closes issue ASTERISK-19865) Patch-by: Birger Harzenetter git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04Merge changes dealing with support for Digium phones.Mark Michelson
Presence support has been added. This is accomplished by allowing for presence hints in addition to device state hints. A dialplan function called PRESENCE_STATE has been added to allow for setting and reading presence. Presence can be transmitted to Digium phones using custom XML elements in a PIDF presence document. Voicemail has new APIs that allow for moving, removing, forwarding, and playing messages. Messages have had a new unique message ID added to them so that the APIs will work reliably. The state of a voicemail mailbox can be obtained using an API that allows one to get a snapshot of the mailbox. A voicemail Dialplan App called VoiceMailPlayMsg has been added to be able to play back a specific message. Configuration hooks have been added. Configuration hooks allow for a piece of code to be executed when a specific configuration file is loaded by a specific module. This is useful for modules that are dependent on the configuration of other modules. chan_sip now has a public method that allows for a custom SIP INFO request to be sent mid-dialog. Digium phones use this in order to display progress bars when files are played. Messaging support has been expanded a bit. The main visible difference is the addition of an AMI action MessageSend. Finally, a ParkingLots manager action has been added in order to get a list of parking lots. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-31Coverity Report: Fix issues for error type REVERSE_INULL (core modules)Richard Mudgett
* Fixes findings: 0-2,5,7-15,24-26,28-31 (issue ASTERISK-19648) Reported by: Matt Jordan ........ Merged revisions 368039 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368042 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18Fix a variety of memory leaksMatthew Jordan
This patch addresses a number of memory leaks in a variety of modules that were found by a static analysis tool. A brief summary of the changes: * app_minivm: free ast_str objects on off nominal paths * app_page: free the ast_dial object if the requested channel technology cannot be appended to the dialing structure * app_queue: if a penalty rule failed to match any existing rule list names, the created rule would not be inserted and its memory would be leaked * app_read: dispose of the created silence detector in the presence of off nominal circumstances * app_voicemail: dispose of an allocated unique ID field for MWI event un-subscribe requests in off nominal paths; dispose of configuration objects when using the secret.conf option * chan_dahdi: dispose of the allocated frame produced by ast_dsp_process * chan_iax2: properly unref peer in CLI command "iax2 unregister" * chan_sip: dispose of the allocated frame produced by sip_rtp_read's call of ast_dsp_process; free memory in parse unit tests * func_dialgroup: properly deref ao2 object grhead in nominal path of dialgroup_read * func_odbc: free resultset in off nominal paths of odbc_read * cli: free match_list in off nominal paths of CLI match completion * config: free comment_buffer/list_buffer when configuration file load is unchanged; free the same buffers any time they were created and config files were processed * data: free XML nodes in various places * enum: free context buffer in off nominal paths * features: free ast_call_feature in off nominal paths of applicationmap config processing * netsock2: users of ast_sockaddr_resolve pass in an ast_sockaddr struct that is allocated by the method. Failures in ast_sockaddr_resolve could result in the users of the method not knowing whether or not the buffer was allocated. The method will now not allocate the ast_sockaddr struct if it will return failure. * pbx: cleanup hash table traversals in off nominal paths; free ignore pattern buffer if it already exists for the specified context * xmldoc: cleanup various nodes when we no longer need them * main/editline: various cleanup of pointers not being freed before being assigned to other memory, cleanup along off nominal paths * menuselect/mxml: cleanup of value buffer for an attribute when that attribute did not specify a value * res_calendar*: responses are allocated via the various *_request method returns and should not be allocated in the various write_event methods; ensure attendee buffer is freed if no data exists in the parsed node; ensure that calendar objects are de-ref'd appropriately * res_jabber: free buffer in off nominal path * res_musiconhold: close the DIR* object in off nominal paths * res_rtp_asterisk: if we run out of ports, close the rtp socket object and free the rtp object * res_srtp: if we fail to create the session in libsrtp, destroy the temporary ast_srtp object (issue ASTERISK-19665) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1922 ........ Merged revisions 366880 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366881 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14Commit framework for HANGUPCAUSE (replacement for SIP_CAUSE)Kinsey Moore
This is the starting point for the Asterisk 11: Who Hung Up work and provides a framework which will allow channel drivers to report the types of hangup cause information available in SIP_CAUSE without incurring the overhead of the MASTER_CHANNEL dialplan function. The initial implementation only includes cause generation for chan_sip and does not include cause code translation utilities. This change deprecates SIP_CAUSE and replaces its method of reporting cause codes with the new framework. This change also deprecates the 'storesipcause' option in sip.conf. Review: https://reviewboard.asterisk.org/r/1822/ (Closes issue SWP-4221) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10Resolve FORWARD_NULL static analysis warningsKinsey Moore
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20, 22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111, and 115. Finding numbers 26, 33, and 29 were already resolved. Those skipped were either extended/deprecated or in areas of code that shouldn't be disturbed. (Closes issue ASTERISK-19650) ........ Merged revisions 366167 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366168 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10Coverity Report: Fix issues for error type CHECKED_RETURN for coreJonathan Rose
(issue ASTERISK-19658) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1905/ ........ Merged revisions 366094 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366106 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10Coverity Report: Fix issues for error type UNINIT in Core supported modulesJonathan Rose
(issue ASTERISK-19652) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1909/ ........ Merged revisions 366048 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366049 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-07Change comment to use local channel name designators in features.cRichard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-04Fix many issues from the NULL_RETURNS Coverity reportKinsey Moore
Most of the changes here are trivial NULL checks. There are a couple optimizations to remove the need to check for NULL and outboundproxy parsing in chan_sip.c was rewritten to avoid use of strtok. Additionally, a bug was found and fixed with the parsing of outboundproxy when "outboundproxy=," was set. (Closes issue ASTERISK-19654) ........ Merged revisions 365398 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 365399 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-28features: Add FEATURE() and FEATUREMAP() functions.Russell Bryant
Add two new dialplan functions: FEATURE() and FEATUREMAP(). FEATURE() lets you set some of the configuration options from the [general] section of features.conf on a per-channel basis. FEATUREMAP() lets you customize the key sequence used to activate built-in features, such as blindxfer, and automon. See the built-in documentation for details. Review: https://reviewboard.asterisk.org/r/1871/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-26Fix DTMF atxfer running h exten after the wrong bridge ends.Richard Mudgett
When party B does an attended transfer of party A to party C, the attending bridge between party B and C should not be running an h exten when the bridge ends. Running an h exten now sets a softhangup flag to ensure that an AGI will run in dead AGI mode. * Set the AST_FLAG_BRIDGE_HANGUP_DONT on the party B channel for the attending bridge between party B and C. (closes issue AST-870) (closes issue ASTERISK-19717) Reported by: Mario (closes issue ASTERISK-19633) Reported by: Andrey Solovyev Patches: jira_asterisk_19633_v1.8.patch (license #5621) patch uploaded by rmudgett Tested by: rmudgett, Andrey Solovyev, Mario ........ Merged revisions 364060 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 364065 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25Fix recalled party B feature flags for a failed DTMF atxfer.Richard Mudgett
1) B calls A with Dial option T 2) B DTMF atxfer to C 3) B hangs up 4) C does not answer 5) B is called back 6) B answers 7) B cannot initiate transfers anymore * Add dial features datastore to recalled party B channel that is a copy of the original party B channel's dial features datastore. * Extracted add_features_datastore() from add_features_datastores(). * Renamed struct ast_dial_features features_caller and features_callee members to my_features and peer_features respectively. These better names eliminate the need for some explanatory comments. * Simplified code accessing the struct ast_dial_features datastore. (closes issue ASTERISK-19383) Reported by: lgfsantos ........ Merged revisions 363428 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 363429 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363430 65c4cc65-6c06-0410-ace0-fbb531ad65f3