summaryrefslogtreecommitdiff
path: root/main/manager.c
AgeCommit message (Collapse)Author
2013-01-16Further fix misinformation in the description of manager MailboxStatus command.Mark Michelson
The description still claimed that it returned the number of messages rather than whether there were messages waiting. ........ Merged revisions 379310 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 379311 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379312 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
2012-12-06Fix memory leak in 'manager show event' when command entered incorrectlyMatthew Jordan
When the CLI command 'manager show event' was run incorrectly and its usage instructions returned, a reference to the event container was leaked. This would prevent the container from being reclaimed when Asterisk exits. We now properly decrement the count on the ao2 object using the nifty RAII_VAR macro. Thanks to Russell for helping me stumble on this, and Terry for writing that ridiculously helpful macro. ........ Merged revisions 377319 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377324 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-28manager: Make challenge work with allowmultiplelogin=noJonathan Rose
Prior to this patch, challenge would yield a multiple logins error if used without providing the username (which isn't really supposed to be an argument to challenge) if allowmultiplelogin was set to no because allowmultiplelogin finds a user with a zero length login name. This check is simply disabled for the challenge action when the username is empty by this patch. (closes issue ASTERISK-20677) Reported by: Vladimir Patches: challenge_action_nomultiplelogin.diff uploaded by Jonathan Rose (license 6182) ........ Merged revisions 376725 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 376726 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376727 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376728 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-04Don't attempt to purge sessions when no sessions existMatthew Jordan
Manager's tcp/tls objects have a periodic function that purge old manager sessions periodically. During shutdown, the underlying container holding those sessions can be disposed of and set to NULL before the tcp/tls periodic function is stopped. If the periodic function fires, it will attempt to iterate over a NULL container. This patch checks for whether or not the sessions container exists before attempting to purge sessions out of it. If the sessions container is NULL, we simply return. Note that this error was also caught by the Asterisk Test Suite. ........ Merged revisions 375800 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375801 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 375802 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-04Properly clean up manager resources on exitMatthew Jordan
This patch does two things: 1) It properly unregisters the manager CLI commands 2) It cleans up AMI users on exit. Prior to this patch, the AMI users were not being disposed of properly, resulting in a memory leak. (closes issue ASTERISK-20646) Reported by: Corey Farrell patches: manager_shutdown.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 375793 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375794 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 375795 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375796 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-17manager: remove curses dependent stuff from r375103Jonathan Rose
Upon further examination, this code was causing compliation problems on CentOS at the least (possibly on any machine without curses) and also the local value of COLS is used even with a remote console, so it is less than ideal. (issue ASTERISK-20396) Reported by: Johan Wilfer git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-16manager: Change display of 'manager show commands' and 'manager show command'Jonathan Rose
manager show commands now shows the full name of the command being displayed regardless of size. The privilege column has also been removed from this display. It will also now use the full length of the terminal if curses is available. Manager show command will now always display the privilege of the manager command within the CLI. (closes ASTERISK-20396) Reported by: Johan Wilfer Review: https://reviewboard.asterisk.org/r/2143/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11Continue to group config filesAndrew Latham
(issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-10Fix segfault regression from r370681Kinsey Moore
Due to usage of ast_hook_send_action, AMI action handling code should be able to handle a NULL mansession->session. This would cause a crash on NULL dereference if action_originate was called from ast_hook_send_action. (closes issue ASTERISK-20544) ........ Merged revisions 374792 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-05Multiple revisions 374570,374581David M. Lee
........ r374570 | dlee | 2012-10-05 15:14:41 -0500 (Fri, 05 Oct 2012) | 22 lines Improve AMI long line error handling In AMI's parser, when it receives a long line (> 1024 characters), it discards that line, but continues to process the message normally. Typically, this is not a problem because a) who has lines that long and b) usually a discarded line results in an invalid message. But if that line is specifying an optional field, then the message will be processed, you get a 'Response: Success', but things don't work the way you expected them to. This patch changes the behavior when a line-too-long parse error occurs. * Changes the log message to avoid way-too-long (and truncated anyways) log messages * Adds a 'parsing' status flag to Response: Success * Sets parsing = MESSAGE_LINE_TOO_LONG if, well, a line is too long * Responds with an appropriate error if parsing != MESSAGE_OKAY (closes issue AST-961) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/2142/ ........ r374581 | dlee | 2012-10-05 15:20:28 -0500 (Fri, 05 Oct 2012) | 1 line I've committed too much. Reverting part of r374570. ........ Merged revisions 374570,374581 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374586 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374587 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374588 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-21Doxygen Updates - janitor workAndrew Latham
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style. Some missing txt file links are removed but their content or essense will be included in some later updates. A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen. Further updates coming. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-18Don't crash when passing a NULL message to __astman_get_header.Sean Bright
Before this commit, __astman_get_header would blindly dereference the passed in 'struct message *' to traverse the header list. There are cases, however, such as '*CLI> sip qualify peer foo' where the message pointer is NULL, so we need to check for that. ........ Merged revisions 373131 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 373132 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 373133 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05Correct documentation for ModuleLoad AMI actionKinsey Moore
The documentation incorrectly listed 'rtp' as a reloadable subsystem and left out many other reloadable subsystems. It is now also documented that subsystems may only be reloaded, not loaded or unloaded. (closes issue AST-977) Reported-by: John Bigelow ........ Merged revisions 372354 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372358 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372365 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30AST-2012-012: Resolve AMI User Unauthorized Shell Access through ExternalIVRMatthew Jordan
The AMI Originate action can allow a remote user to specify information that can be used to execute shell commands on the system hosting Asterisk. This can result in an unwanted escalation of permissions, as the Originate action, which requires the "originate" class authorization, can be used to perform actions that would typically require the "system" class authorization. Previous attempts to prevent this permission escalation (AST-2011-006, AST-2012-004) have sought to do so by inspecting the names of applications and functions passed in with the Originate action and, if those applications/functions matched a predefined set of values, rejecting the command if the user lacked the "system" class authorization. As noted by IBM X-Force Research, the "ExternalIVR" application is not listed in the predefined set of values. The solution for this particular vulnerability is to include the "ExternalIVR" application in the set of defined applications/functions that require "system" class authorization. Unfortunately, the approach of inspecting fields in the Originate action against known applications/functions has a significant flaw. The predefined set of values can be bypassed by creative use of the Originate action or by certain dialplan configurations, which is beyond the ability of Asterisk to analyze at run-time. Attempting to work around these scenarios would result in severely restricting the applications or functions and prevent their usage for legitimate means. As such, any additional security vulnerabilities, where an application/function that would normally require the "system" class authorization can be executed by users with the "originate" class authorization, will not be addressed. Instead, the README-SERIOUSLY.bestpractices.txt file has been updated to reflect that the AMI Originate action can result in commands requiring the "system" class authorization to be executed. Proper system configuration can limit the impact of such scenarios. (closes issue ASTERISK-20132) Reported by: Zubair Ashraf of IBM X-Force Research ........ Merged revisions 371998 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371999 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372000 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-27Fix incorrect documentation of the MailboxStatus manager command.Mark Michelson
The "Waiting" field was misdocumented as reporting the number of messages waiting. In reality, it simply indicated the presence or absence of waiting messages. ........ Merged revisions 371782 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371783 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371784 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371785 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-08-08Add AMI_CLIENT dialplan functionTerry Wilson
Implementation of a dialplan function for checking manager accounts. Right now it only returns the number of logged in sessions for a manager account, but other attributes can be added later. Patch by: Olle Johansson Review: https://reviewboard.asterisk.org/r/421/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-01Fix a possible crash due to passing NULL to ast_variables_dup()Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31Add "setvar" option to manager.conf.Mark Michelson
With this option set, channel variables can be set on every manager originate. The Variable header can still be used to set additional channel variables for individual calls if desired. This work was completed by Olle Johansson on review board. I have applied the review feedback and am committing it in order to get this into trunk before Asterisk 11 is branched. Review: https://reviewboard.asterisk.org/r/1412 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370681 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-11Named ACLs: Introduces a system for creating and sharing ACLsJonathan Rose
This patch adds Named ACL functionality to Asterisk. This allows system administrators to define an ACL and refer to it by a unique name. Configurable items can then refer to that name when specifying access control lists. It also includes updates to all core supported consumers of ACLs. That includes manager, chan_sip, and chan_iax2. This feature is based on the deluxepine-trunk by Olle E. Johansson and provides a subset of the Named ACL functionality implemented in that branch. For more information on this feature, see acl.conf and/or the Asterisk wiki. Review: https://reviewboard.asterisk.org/r/1978/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369959 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-25Update "manager show event" to support tab completionMatthew Jordan
Thank you rmudgett for pointing out that I was missing this in the initial check-in for AMI event documentation (r369346) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-25Add AMI event documentationMatthew Jordan
This patch adds the core changes necessary to support AMI event documentation in the source files of Asterisk, and adds documentation to those AMI events defined in the core application modules. Event documentation is built from the source by two new python scripts, located in build_tools: get_documentation.py and post_process_documentation.py. The get_documentation.py script mirrors the actions of the existing AWK get_documentation scripts, except that it will scan the entirety of a source file for Asterisk documentation. Upon encountering it, if the documentation happens to be an AMI event, it will attempt to extract information about the event directly from the manager event macro calls that raise the event. The post_process_documentation.py script combines manager event instances that are the same event but documented in multiple source files. It generates the final core-[lang].xml file. As this process can take longer to complete than a typical 'make all', it is only performed if a new make target, 'full', is chosen. Review: https://reviewboard.asterisk.org/r/1967/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-20Add IPv6 Support To ManagerMichael L. Young
This patch adds IPv6 support to AMI. (Closes issue ASTERISK-19965) Reported by: Michael L. Young Tested by: Michael L. Young Patches: ami_ipv6_v3.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/1968/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-08Fix error paths in action_hangup() for AMI Hangup action.Richard Mudgett
* Check allocation function return values for failure. Crashing is bad. * Tweak ast_regex_string_to_regex_pattern() parameters for proper ast_str usage. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368714 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-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-01Prevent a potential crash when using manager hooks.Jason Parker
Found by me while poking at DPMA-127. ........ Merged revisions 364841 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 364842 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-23AST-2012-004: Fix an error that allows AMI users to run shell commands sans ↵Jonathan Rose
authorization. As detailed in the advisory, AMI users without write authorization for SYSTEM class AMI actions were able to run system commands by going through other AMI commands which did not require that authorization. Specifically, GetVar and Status allowed users to do this by setting their variable/s options to the SHELL or EVAL functions. Also, within 1.8, 10, and trunk there was a similar flaw with the Originate action that allowed users with originate permission to run MixMonitor and supply a shell command in the Data argument. That flaw is fixed in those versions of this patch. (closes issue ASTERISK-17465) Reported By: David Woolley Patches: 162_ami_readfunc_security_r2.diff uploaded by jrose (license 6182) 18_ami_readfunc_security_r2.diff uploaded by jrose (license 6182) 10_ami_readfunc_security_r2.diff uploaded by jrose (license 6182) ........ Merged revisions 363117 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2 ........ Merged revisions 363141 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 363156 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17Fix places in main where a negative return value could impact executionMatthew Jordan
This patch addresses a number of modules in main that did not handle the negative return value from function calls adequately, or were not sufficiently clear that the conditions leading to improper handling of the return values could not occur. This includes: * asterisk.c: A negative return value from the read function would be used directly as an index into a buffer. We now check for success of the read function prior to using its result as an index. * manager.c: Check for failures in mkstemp and lseek when handling the temporary file created for processing data returned from a CLI command in action_command. Also check that the result of an lseek is sanitized prior to using it as the size of a memory map to allocate. (issue ASTERISK-19655) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1863/ ........ Merged revisions 362359 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 362360 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-16Add IPv6 address support to security events framework.Michael L. Young
The current Security Events Framework API only supports IPv4 when it comes to generating security events. This patch does the following: * Changes the Security Events Framework API to support IPV6 and updates the components that use this API. * Eliminates an error message that was being generated since the current implementation was treating an IPv6 socket address as if it was IPv4. * Some copyright dates were updated on files touched by this patch. (closes issue ASTERISK-19447) Reported by: Michael L. Young Tested by: Michael L. Young Patches: security_events_ipv6v3.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/1777/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-03Allow the Hangup manager action to match channels by regexMark Murawki
* Hangup now can take a regular expression as the Channel option. If you want to hangup multiple channels, use /regex/ as the Channel option. Existing behavior to hanging up a single channel is unchanged, but if you pass a regex, the manager will send you a list of channels back that were hung up. (closes issue ASTERISK-19575) Reported by: Mark Murawski Tested by: Mark Murawski git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22Kill off red blobs in most of main/*Kinsey Moore
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-20Allow AMI action callback to be reentrant.Richard Mudgett
Fix AMI module reload deadlock regression from ASTERISK-18479 when it tried to fix the race between calling an AMI action callback and unregistering that action. Refixes ASTERISK-13784 broken by ASTERISK-17785 change. Locking the ao2 object guaranteed that there were no active callbacks that mattered when ast_manager_unregister() was called. Unfortunately, this causes the deadlock situation. The patch stops locking the ao2 object to allow multiple threads to invoke the callback re-entrantly. There is no way to guarantee a module unload will not crash because of an active callback. The code attempts to minimize the chance with the registered flag and the maximum 5 second delay before ast_manager_unregister() returns. The trunk version of the patch changes the API to fix the race condition correctly to prevent the module code from unloading from memory while an action callback is active. * Don't hold the lock while calling the AMI action callback. (closes issue ASTERISK-19487) Reported by: Philippe Lindheimer Review: https://reviewboard.asterisk.org/r/1818/ Review: https://reviewboard.asterisk.org/r/1820/ ........ Merged revisions 359979 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 359980 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13Finalize ast_channel opaquificationTerry Wilson
Review: https://reviewboard.asterisk.org/r/1786/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-05Eliminate double close of file descriptor in manager.cJonathan Rose
The process_output function in manager.c attempted to call fclose and close immediately afterwards. Since fclose implies close, this resulted in a potential double free on file descriptors. This patch changes that behavior and also adds error checking to fclose and close depending on which was deemed necessary. Also error messages. Thanks to Rosen Iliev for pointing out the location of the problem. (closes issue ASTERISK-18453) Reported By: Jaco Kroon Review: https://reviewboard.asterisk.org/r/1793/ ........ Merged revisions 358214 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358215 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29Opaquify ast_channel structs and listsTerry Wilson
Review: https://reviewboard.asterisk.org/r/1773/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20ast_channel opaquification of pointers and integral typesTerry Wilson
Review: https://reviewboard.asterisk.org/r/1753/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14Re-commit the verbose branch.Tilghman Lesher
This change permits each verbose destination (consoles, logger) to have its own concept of what the verbosity level is. The big feature here is that the logger will now be able to capture a particular verbosity level without condemning each console to need to suffer that level of verbosity. Additionally, a stray 'core set verbose' will no longer change what will go to the log. Review: https://reviewboard.asterisk.org/r/1599/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13Opaquify char * and char[] in ast_channelTerry Wilson
Review: https://reviewboard.asterisk.org/r/1733/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-10Fix AMI Redirect ExtraChannel not redirecting to the same exten and context.Richard Mudgett
The astman_get_header() never returns NULL so the check by the code for NULL would never fail. (closes issue ASTERISK-16974) Reported by: Nuno Borges Patches: 0018325.patch (license #6116) patch uploaded by Nuno Borges (modified) ........ Merged revisions 354835 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 354836 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-02Fix TLS port binding behavior as well as reload behavior:Mark Michelson
* Removes references to tlsbindport from http.conf.sample and manager.conf.sample * Properly bind to port specified in tlsbindaddr, using the default port if specified. * On a reload, properly close socket if the service has been disabled. A note has been added to UPGRADE.txt to indicate how ports must be set for TLS. (closes issue ASTERISK-16959) reported by Olaf Holthausen (closes issue ASTERISK-19201) reported by Chris Mylonas (closes issue ASTERISK-19204) reported by Chris Mylonas Review: https://reviewboard.asterisk.org/r/1709 ........ Merged revisions 353770 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353820 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01Constify some more channel driver technology callback parameters.Richard Mudgett
Review: https://reviewboard.asterisk.org/r/1707/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-31Fix memory leak in error paths for action_originate().Richard Mudgett
* Fix memory leak of vars in error paths for action_originate(). * Moved struct fast_originate_helper tech and data members to stringfields. * Simplified ActionID header handling for fast_originate(). * Added doxygen note to ast_request() and ast_call() and the associated channel callbacks that the data/addr parameters should be treated as const char *. Review: https://reviewboard.asterisk.org/r/1690/ ........ Merged revisions 353454 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353463 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353466 65c4cc65-6c06-0410-ace0-fbb531ad65f3