summaryrefslogtreecommitdiff
path: root/main/manager.c
AgeCommit message (Collapse)Author
2014-12-12loader: Move definition of ast_module_reload from _private.h to module.hGeorge Joseph
No functionality change. Just move the definition of ast_module_reload from _private.h to module.h so it can be public. Also removed the include of _private.h from manager.c since ast_module_load was the only reason for including it. Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4251/ ........ Merged revisions 429542 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-04main/test: Fix race condition between AMI topic and Test Suite topicMatthew Jordan
This patch fixes a race condition between the raising of test AMI events (which drive many tests in the Asterisk Test Suite) and other AMI events. Prior to this patch, the Stasis messages published to the test topic were not forwarded to the AMI topic. Instead, the code in manager had a dedicated handler for test messages that was independent of the topics forwarded to the AMI topic. This results in no synchronization between the test messages and the rest of the Stasis messages published out over AMI. In some test with very tight timing constraints, this can result in out of order messages and spurious test failures. Properly forwarding the Test Suite topic to the AMI topic ensures that the messages are synchronized properly. This patch does that, and moves the message handling to the Stasis definition of the Test Suite message in test.c as well. Review: https://reviewboard.asterisk.org/r/4221/ ........ Merged revisions 428945 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428946 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-21manager: Fix could not extend string messages.Richard Mudgett
When shutting down Asterisk that has an active AMI connection, you get several "failed to extend from %d to %d" messages because use of the EVENT_FLAG_SHUTDOWN attempts to add all AMI permission strings to the event. * Created MAX_AUTH_PERM_STRING to use when creating stack based struct ast_str variables used with the authority_to_str() and user_authority_to_str() functions instead of a variety of magic numbers that could be too small. * Added a special check for EVENT_FLAG_SHUTDOWN to authority_to_str() so it will not attempt to add all permission level strings. Review: https://reviewboard.asterisk.org/r/4200/ ........ Merged revisions 428570 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 428571 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428572 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-19ast_str: Fix improper member access to struct ast_str members.Richard Mudgett
Accessing members of struct ast_str outside of the string manipulation API routines is invalid since struct ast_str is supposed to be treated as opaque. Review: https://reviewboard.asterisk.org/r/4194/ ........ Merged revisions 428244 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 428245 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428246 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-09manager: Fix HTTP connection reference leaks.Corey Farrell
Fix reference leak that happens if (session && !blastaway). ASTERISK-24505 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4153/ ........ Merged revisions 427641 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 427642 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 427643 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-28manager: Unsubscribe from acl_change_sub at shutdown.Corey Farrell
ASTERISK-24453 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4110/ ........ Merged revisions 426524 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 426525 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-28main/manager: Fix typo in AMI event documentation of "OriginateResponse"Matthew Jordan
The parameter name is "Response", not "Resonse". ASTERISK-24430 #close Reported by: Dafi Ni ........ Merged revisions 426366 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 426367 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 426368 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-24Documentation: Improve documentation for ExtensionStatus AMI eventsJonathan Rose
Review: https://reviewboard.asterisk.org/r/4085/ ........ Merged revisions 426120 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-13manager/config: Support templates and non-unique category names via AMIGeorge Joseph
This patch provides the capability to manipulate templates and categories with non-unique names via AMI. Summary of changes: GetConfig and GetConfigJSON: Added "Filter" parameter: A comma separated list of name_regex=value_regex expressions which will cause only categories whose variables match all expressions to be considered. The special variable name TEMPLATES can be used to control whether templates are included. Passing 'include' as the value will include templates along with normal categories. Passing 'restrict' as the value will restrict the operation to ONLY templates. Not specifying a TEMPLATES expression results in the current default behavior which is to not include templates. UpdateConfig: NewCat now includes options for allowing duplicate category names, indicating if the category should be created as a template, and specifying templates the category should inherit from. The rest of the actions now accept a filter string as defined above. If there are non-unique category names, you can now update specific ones based on variable values. To facilitate the new capabilities in manager, corresponding changes had to be made to config, most notably the addition of filter criteria to many of the APIs. In some cases it was easy to change the references to use the new prototype but others would have required touching too many files for this patch so a wrapper with the original prototype was created. Macros couldn't be used in this case because it would break binary compatibility with modules such as res_digium_phone that are linked to real symbols. Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4033/ ........ Merged revisions 425383 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 425384 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-05Release AMI connections on shutdown.Corey Farrell
ASTERISK-24378 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4037/ ........ Merged revisions 424578 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 424579 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 424580 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-03Manager: Add missing fields and documentation for CoreShowChannelsKinsey Moore
This corrects some issues introduced in the responses to the CoreShowChannels AMI command as well as adding documentation for the responses. The command in Asterisk 12 was missing the following fields: Duration, Application, ApplicationData, and BridgedChannel and BridgedUniqueID (replaced with BridgeId). ASTERISK-24262 #close Reported by: Mitch Claborn Review: https://reviewboard.asterisk.org/r/4040/ ........ Merged revisions 424423 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 424424 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18config: bug: Fix SEGV in ast_category_insert when matching category isn't foundGeorge Joseph
If you call ast_category_insert with a match category that doesn't exist, the list traverse runs out of 'next' categories and you get a SEGV. This patch adds check for the end-of-list condition and changes the signature to return an int for success/failure indication instead of a void. The only consumer of this function is manager and it was also changed to use the return value. Tested by: George Joseph Review: https://reviewboard.asterisk.org/r/3993/ ........ Merged revisions 423276 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 423277 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 423278 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 423279 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-04Manager: Require read permission for SYSTEM in order to send FullyBootedJonathan Rose
Review: https://reviewboard.asterisk.org/r/3969/ ........ Merged revisions 422584 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 422625 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 422626 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 422631 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-30manager: Make WaitEvent action respect eventfiltersGeorge Joseph
A WaitEvent issued via an http session isn't respecting eventfilters defined for the user. I just added a match_filter to the predicate that controls astman_append. Tested by: George Joseph Review: https://reviewboard.asterisk.org/r/3958/ ........ Merged revisions 422439 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 422440 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 422441 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 422442 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-20AMI: Add AllVariables parameter to StatusKinsey Moore
This adds the AllVariables parameter to the Status AMI action such that if defined and set to "true", all channel variables will be reported in the subsequent Status event(s). This parameter does not negate the functionality of the "Variables" parameter so that global variables and dialplan functions can be requested. Review: https://reviewboard.asterisk.org/r/3915/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-19AMI Docs: Fix Status channel parameter optionalityKinsey Moore
........ Merged revisions 421442 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 421443 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 421444 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 421445 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-13AMI: Improve documentation for Status actionKinsey Moore
........ Merged revisions 420919 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-06Stasis: Allow message types to be blockedKinsey Moore
This introduces stasis.conf and a mechanism to prevent certain message types from being published. Internally, this works by preventing the chosen message types from being created which ensures that those message types can never be published. This patch also adjusts message publishers such that message payloads are not created if the related message type is not available. ASTERISK-23943 #close Review: https://reviewboard.asterisk.org/r/3823/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-04Manager - Improve documentation for manager commands Getvar and Setvar.Rusty Newton
The documentation for these commands did not make it clear that they could accept expressions and functions. Modified to make this clear, but tried not to be overly explicit. ASTERISK-21178 #close Reported by: Rusty Newton Tested by: Rusty Newton Review: https://reviewboard.asterisk.org/r/3854 ........ Merged revisions 419942 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 419943 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 419944 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-30manager: Add state list commandsKinsey Moore
This patch adds three new AMI commands: * ExtensionStateList (pbx.c) - list all known extension state hints and their current statuses. Events emitted by the list action are equivalent to the ExtensionStatus events. * PresenceStateList (res_manager_presencestate) - list all known presence state values. Events emitted are generated by the stasis message type, and hence are PresenceStateChange events. * DeviceStateList (res_manager_devicestate) - list all known device state values. Events emitted are generated by the stasis message type, and hence are DeviceStateChange events. Patch-by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3799/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-29Do not omit the first header of a UserEvent AMI action from the ↵Mark Michelson
corresponding emitted UserEvent. ASTERISK-24124 #close Reported by Matt Jordan AFS-131 #close Reported by Matt Jordan Patches: userevent.patch uploaded by Matt Jordan (License #6283) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-24AMI: Allow for command response documentationKinsey Moore
Allow for responses to AMI actions/commands to be documented properly in XML and displayed via the CLI. Response events are documented exactly as standard AMI events are documented. Review: https://reviewboard.asterisk.org/r/3812/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-23res_fax: unregister manager actions on unloadCorey Farrell
* Unregister manager actions FAXSessions, FAXSession and FAXStats at unload. * Update ast_manager_register2 use ao2_t_alloc tagged with the action name. ASTERISK-24058 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3831/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-20media formats: re-architect handling of media for performance improvementsMatthew Jordan
In the old times media formats were represented using a bit field. This was fast but had a few limitations. 1. Asterisk was limited in how many formats it could handle. 2. Formats, being a bit field, could not include any attribute information. A format was strictly its type, e.g., "this is ulaw". This was changed in Asterisk 10 (see https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal for notes on that work) which led to the creation of the ast_format structure. This structure allowed Asterisk to handle attributes and bundle information with a format. Additionally, ast_format_cap was created to act as a container for multiple formats that, together, formed the capability of some entity. Another mechanism was added to allow logic to be registered which performed format attribute negotiation. Everywhere throughout the codebase Asterisk was changed to use this strategy. Unfortunately, in software, there is no free lunch. These new capabilities came at a cost. Performance analysis and profiling showed that we spend an inordinate amount of time comparing, copying, and generally manipulating formats and their related structures. Basic prototyping has shown that a reasonably large performance improvement could be made in this area. This patch is the result of that project, which overhauled the media format architecture and its usage in Asterisk to improve performance. Generally, the new philosophy for handling formats is as follows: * The ast_format structure is reference counted. This removed a large amount of the memory allocations and copying that was done in prior versions. * In order to prevent race conditions while keeping things performant, the ast_format structure is immutable by convention and lock-free. Violate this tenet at your peril! * Because formats are reference counted, codecs are also reference counted. The Asterisk core generally provides built-in codecs and caches the ast_format structures created to represent them. Generally, to prevent inordinate amounts of module reference bumping, codecs and formats can be added at run-time but cannot be removed. * All compatibility with the bit field representation of codecs/formats has been moved to a compatibility API. The primary user of this representation is chan_iax2, which must continue to maintain its bit-field usage of formats for interoperability concerns. * When a format is negotiated with attributes, or when a format cannot be represented by one of the cached formats, a new format object is created or cloned from an existing format. That format may have the same codec underlying it, but is a different format than a version of the format with different attributes or without attributes. * While formats are reference counted objects, the reference count maintained on the format should be manipulated with care. Formats are generally cached and will persist for the lifetime of Asterisk and do not explicitly need to have their lifetime modified. An exception to this is when the user of a format does not know where the format came from *and* the user may outlive the provider of the format. This occurs, for example, when a format is read from a channel: the channel may have a format with attributes (hence, non-cached) and the user of the format may last longer than the channel (if the reference to the channel is released prior to the format's reference). For more information on this work, see the API design notes: https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite Finally, this work was the culmination of a large number of developer's efforts. Extra thanks goes to Corey Farrell, who took on a large amount of the work in the Asterisk core, chan_sip, and was an invaluable resource in peer reviews throughout this project. There were a substantial number of patches contributed during this work; the following issues/patch names simply reflect some of the work (and will cause the release scripts to give attribution to the individuals who work on them). Reviews: https://reviewboard.asterisk.org/r/3814 https://reviewboard.asterisk.org/r/3808 https://reviewboard.asterisk.org/r/3805 https://reviewboard.asterisk.org/r/3803 https://reviewboard.asterisk.org/r/3801 https://reviewboard.asterisk.org/r/3798 https://reviewboard.asterisk.org/r/3800 https://reviewboard.asterisk.org/r/3794 https://reviewboard.asterisk.org/r/3793 https://reviewboard.asterisk.org/r/3792 https://reviewboard.asterisk.org/r/3791 https://reviewboard.asterisk.org/r/3790 https://reviewboard.asterisk.org/r/3789 https://reviewboard.asterisk.org/r/3788 https://reviewboard.asterisk.org/r/3787 https://reviewboard.asterisk.org/r/3786 https://reviewboard.asterisk.org/r/3784 https://reviewboard.asterisk.org/r/3783 https://reviewboard.asterisk.org/r/3778 https://reviewboard.asterisk.org/r/3774 https://reviewboard.asterisk.org/r/3775 https://reviewboard.asterisk.org/r/3772 https://reviewboard.asterisk.org/r/3761 https://reviewboard.asterisk.org/r/3754 https://reviewboard.asterisk.org/r/3753 https://reviewboard.asterisk.org/r/3751 https://reviewboard.asterisk.org/r/3750 https://reviewboard.asterisk.org/r/3748 https://reviewboard.asterisk.org/r/3747 https://reviewboard.asterisk.org/r/3746 https://reviewboard.asterisk.org/r/3742 https://reviewboard.asterisk.org/r/3740 https://reviewboard.asterisk.org/r/3739 https://reviewboard.asterisk.org/r/3738 https://reviewboard.asterisk.org/r/3737 https://reviewboard.asterisk.org/r/3736 https://reviewboard.asterisk.org/r/3734 https://reviewboard.asterisk.org/r/3722 https://reviewboard.asterisk.org/r/3713 https://reviewboard.asterisk.org/r/3703 https://reviewboard.asterisk.org/r/3689 https://reviewboard.asterisk.org/r/3687 https://reviewboard.asterisk.org/r/3674 https://reviewboard.asterisk.org/r/3671 https://reviewboard.asterisk.org/r/3667 https://reviewboard.asterisk.org/r/3665 https://reviewboard.asterisk.org/r/3625 https://reviewboard.asterisk.org/r/3602 https://reviewboard.asterisk.org/r/3519 https://reviewboard.asterisk.org/r/3518 https://reviewboard.asterisk.org/r/3516 https://reviewboard.asterisk.org/r/3515 https://reviewboard.asterisk.org/r/3512 https://reviewboard.asterisk.org/r/3506 https://reviewboard.asterisk.org/r/3413 https://reviewboard.asterisk.org/r/3410 https://reviewboard.asterisk.org/r/3387 https://reviewboard.asterisk.org/r/3388 https://reviewboard.asterisk.org/r/3389 https://reviewboard.asterisk.org/r/3390 https://reviewboard.asterisk.org/r/3321 https://reviewboard.asterisk.org/r/3320 https://reviewboard.asterisk.org/r/3319 https://reviewboard.asterisk.org/r/3318 https://reviewboard.asterisk.org/r/3266 https://reviewboard.asterisk.org/r/3265 https://reviewboard.asterisk.org/r/3234 https://reviewboard.asterisk.org/r/3178 ASTERISK-23114 #close Reported by: mjordan media_formats_translation_core.diff uploaded by kharwell (License 6464) rb3506.diff uploaded by mjordan (License 6283) media_format_app_file.diff uploaded by kharwell (License 6464) misc-2.diff uploaded by file (License 5000) chan_mild-3.diff uploaded by file (License 5000) chan_obscure.diff uploaded by file (License 5000) jingle.diff uploaded by file (License 5000) funcs.diff uploaded by file (License 5000) formats.diff uploaded by file (License 5000) core.diff uploaded by file (License 5000) bridges.diff uploaded by file (License 5000) mf-codecs-2.diff uploaded by file (License 5000) mf-app_fax.diff uploaded by file (License 5000) mf-apps-3.diff uploaded by file (License 5000) media-formats-3.diff uploaded by file (License 5000) ASTERISK-23715 rb3713.patch uploaded by coreyfarrell (License 5909) rb3689.patch uploaded by mjordan (License 6283) ASTERISK-23957 rb3722.patch uploaded by mjordan (License 6283) mf-attributes-3.diff uploaded by file (License 5000) ASTERISK-23958 Tested by: jrose rb3822.patch uploaded by coreyfarrell (License 5909) rb3800.patch uploaded by jrose (License 6182) chan_sip.diff uploaded by mjordan (License 6283) rb3747.patch uploaded by jrose (License 6182) ASTERISK-23959 #close Tested by: sgriepentrog, mjordan, coreyfarrell sip_cleanup.diff uploaded by opticron (License 6273) chan_sip_caps.diff uploaded by mjordan (License 6283) rb3751.patch uploaded by coreyfarrell (License 5909) chan_sip-3.diff uploaded by file (License 5000) ASTERISK-23960 #close Tested by: opticron direct_media.diff uploaded by opticron (License 6273) pjsip-direct-media.diff uploaded by file (License 5000) format_cap_remove.diff uploaded by opticron (License 6273) media_format_fixes.diff uploaded by opticron (License 6273) chan_pjsip-2.diff uploaded by file (License 5000) ASTERISK-23966 #close Tested by: rmudgett rb3803.patch uploaded by rmudgetti (License 5621) chan_dahdi.diff uploaded by file (License 5000) ASTERISK-24064 #close Tested by: coreyfarrell, mjordan, opticron, file, rmudgett, sgriepentrog, jrose rb3814.patch uploaded by rmudgett (License 5621) moh_cleanup.diff uploaded by opticron (License 6273) bridge_leak.diff uploaded by opticron (License 6273) translate.diff uploaded by file (License 5000) rb3795.patch uploaded by rmudgett (License 5621) tls_fix.diff uploaded by mjordan (License 6283) fax-mf-fix-2.diff uploaded by file (License 5000) rtp_transfer_stuff uploaded by mjordan (License 6283) rb3787.patch uploaded by rmudgett (License 5621) media-formats-explicit-translate-format-3.diff uploaded by file (License 5000) format_cache_case_fix.diff uploaded by opticron (License 6273) rb3774.patch uploaded by rmudgett (License 5621) rb3775.patch uploaded by rmudgett (License 5621) rtp_engine_fix.diff uploaded by opticron (License 6273) rtp_crash_fix.diff uploaded by opticron (License 6273) rb3753.patch uploaded by mjordan (License 6283) rb3750.patch uploaded by mjordan (License 6283) rb3748.patch uploaded by rmudgett (License 5621) media_format_fixes.diff uploaded by opticron (License 6273) rb3740.patch uploaded by mjordan (License 6283) rb3739.patch uploaded by mjordan (License 6283) rb3734.patch uploaded by mjordan (License 6283) rb3689.patch uploaded by mjordan (License 6283) rb3674.patch uploaded by coreyfarrell (License 5909) rb3671.patch uploaded by coreyfarrell (License 5909) rb3667.patch uploaded by coreyfarrell (License 5909) rb3665.patch uploaded by mjordan (License 6283) rb3625.patch uploaded by coreyfarrell (License 5909) rb3602.patch uploaded by coreyfarrell (License 5909) format_compatibility-2.diff uploaded by file (License 5000) core.diff uploaded by file (License 5000) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-15manager: Return ActionID on nominal responses to PresenceState actionMatthew Jordan
When the PresenceState action is executed, the nominal path fails to include the ActionID in the successful response. This patch adds a call to astman_start_ack, which guarantees that an ActionID (if provided) will be sent back to the AMI client. Unlike the Asterisk 11 and 12 patches, this patch also deprecates the duplicate Message key in the response to the action, replacing it with the key 'PresenceMessage'. Review: https://reviewboard.asterisk.org/r/3776/ ASTERISK-23985 #close ........ Merged revisions 418713 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 418714 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-13Fix minor reference leaks in app_skel and TEST_FRAMEWORKCorey Farrell
* Cleanup games object in app_skel. * Cleanup stasis subscription to TEST_FRAMEWORK in manager.c (12+). Review: https://reviewboard.asterisk.org/r/3757/ ........ Merged revisions 418465 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 418466 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-03res_ari: Fix some off-nominal paths just dropping the HTTP connection.Richard Mudgett
* Removed some incorrect newlines on ast_http_error() messages in manager.c. * Removed an incorrect newline in res_ari_channels.c. Addendum to ASTERISK-23552 ........ Merged revisions 417932 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-03HTTP: Add persistent connection support.Richard Mudgett
Persistent HTTP connection support is needed due to the increased usage of the Asterisk core HTTP transport and the frequency at which REST API calls are going to be issued. * Add http.conf session_keep_alive option to enable persistent connections. * Parse and discard optional chunked body extension information and trailing request headers. * Increased the maximum application/json and application/x-www-form-urlencoded body size allowed to 4k. The previous 1k was kind of small. * Removed a couple inlined versions of ast_http_manid_from_vars() by calling the function. manager.c:generic_http_callback() and res_http_post.c:http_post_callback() * Add missing va_end() in ast_ari_response_error(). * Eliminated unnecessary RAII_VAR() use in http.c:auth_create(). ASTERISK-23552 #close Reported by: Scott Griepentrog Review: https://reviewboard.asterisk.org/r/3691/ ........ Merged revisions 417880 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20Logger: Add manager command 'LoggerRotate' to rotate loggerJonathan Rose
Part of a series of AMI command equivalents to existing CLI commands Review: https://reviewboard.asterisk.org/r/3651/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-13stasis: Reduce creation of channel snapshots to improve performanceMatthew Jordan
During some performance testing of Asterisk with AGI, ARI, and lots of Local channels, we noticed that there's quite a hit in performance during channel creation and releasing to the dialplan (ARI continue). After investigating the performance spike that occurs during channel creation, we discovered that we create a lot of channel snapshots that are technically unnecessary. This includes creating snapshots during: * AGI execution * Returning objects for ARI commands * During some Local channel operations * During some dialling operations * During variable setting * During some bridging operations And more. This patch does the following: - It removes a number of fields from channel snapshots. These fields were rarely used, were expensive to have on the snapshot, and hurt performance. This included formats, translation paths, Log Call ID, callgroup, pickup group, and all channel variables. As a result, AMI Status, "core show channel", "core show channelvar", and "pjsip show channel" were modified to either hit the live channel or not show certain pieces of data. While this is unfortunate, the performance gain from this patch is worth the loss in behaviour. - It adds a mechanism to publish a cached snapshot + blob. A large number of publications were changed to use this, including: - During Dial begin - During Variable assignment (if no AMI variables are emitted - if AMI variables are set, we have to make snapshots when a variable is changed) - During channel pickup - When a channel is put on hold/unhold - When a DTMF digit is begun/ended - When creating a bridge snapshot - When an AOC event is raised - During Local channel optimization/Local bridging - When endpoint snapshots are generated - All AGI events - All ARI responses that return a channel - Events in the AgentPool, MeetMe, and some in Queue - Additionally, some extraneous channel snapshots were being made that were unnecessary. These were removed. - The result of ast_hashtab_hash_string is now cached in stasis_cache. This reduces a large number of calls to ast_hashtab_hash_string, which reduced the amount of time spent in this function in gprof by around 50%. #ASTERISK-23811 #close Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3568/ ........ Merged revisions 416211 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-13AST-2014-007: Fix of fix to allow AMI and SIP TCP to send messages.Richard Mudgett
ASTERISK-23673 #close Reported by: Richard Mudgett Review: https://reviewboard.asterisk.org/r/3617/ ........ Merged revisions 416066 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416067 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416070 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12AST-2014-007: Fix DOS by consuming the number of allowed HTTP connections.Richard Mudgett
Simply establishing a TCP connection and never sending anything to the configured HTTP port in http.conf will tie up a HTTP connection. Since there is a maximum number of open HTTP sessions allowed at a time you can block legitimate connections. A similar problem exists if a HTTP request is started but never finished. * Added http.conf session_inactivity timer option to close HTTP connections that aren't doing anything. Defaults to 30000 ms. * Removed the undocumented manager.conf block-sockets option. It interferes with TCP/TLS inactivity timeouts. * AMI and SIP TLS connections now have better authentication timeout protection. Though I didn't remove the bizzare TLS timeout polling code from chan_sip. * chan_sip can now handle SSL certificate renegotiations in the middle of a session. It couldn't do that before because the socket was non-blocking and the SSL calls were not restarted as documented by the OpenSSL documentation. * Fixed an off nominal leak of the ssl struct in handle_tcptls_connection() if the FILE stream failed to open and the SSL certificate negotiations failed. The patch creates a custom FILE stream handler to give the created FILE streams inactivity timeout and timeout after a specific moment in time capability. This approach eliminates the need for code using the FILE stream to be redesigned to deal with the timeouts. This patch indirectly fixes most of ASTERISK-18345 by fixing the usage of the SSL_read/SSL_write operations. ASTERISK-23673 #close Reported by: Richard Mudgett ........ Merged revisions 415841 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415854 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415896 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-06chan_sip: Fix order of variables specified in SIPNotify actionJonathan Rose
Prior to this patch, sequential variables would be ordered in reverse from the order specified in the manager action. Review: https://reviewboard.asterisk.org/r/3588/ ........ Merged revisions 415359 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415390 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415410 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09Allow Asterisk to compile under GCC 4.10Kinsey Moore
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-08app_queue: Extend documentation for various Manager actions and events.Joshua Colp
........ Merged revisions 413485 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413486 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413487 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-21HTTP: Add TCP_NODELAY to accepted connectionsKinsey Moore
This adds the TCP_NODELAY option to accepted connections on the HTTP server built into Asterisk. This option disables the Nagle algorithm which controls queueing of outbound data and in some cases can cause delays on receipt of response by the client due to how the Nagle algorithm interacts with TCP delayed ACK. This option is already set on all non-HTTP AMI connections and this change would cover standard HTTP requests, manager HTTP connections, and ARI HTTP requests and websockets in Asterisk 12+ along with any future use of the HTTP server. Review: https://reviewboard.asterisk.org/r/3466/ ........ Merged revisions 412745 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412748 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 412749 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-18ARI: Add debug logging for events and responsesKinsey Moore
This adds DEBUG level logging for ARI websocket events and HTTP responses similar to what is available for AMI. Logging for ARI HTTP requests is already adequate for debugging purposes. ........ Merged revisions 412565 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-28http: response body often missing after specific requestScott Griepentrog
This patch works around a problem with the HTTP body being dropped from the response to a specific client and under specific circumstances: a) Client request comes from node.js user agent "Shred" via use of swagger-client library. b) Asterisk and Client are *not* on the same host or TCP/IP stack In testing this problem, it has been determined that the write of the HTTP body is lost, even if the data is written using low level write function. The only solution found is to instruct the TCP stack with the shutdown function to flush the last write and finish the transmission. See review for more details. ASTERISK-23548 #close (closes issue ASTERISK-23548) Reported by: Sam Galarneau Review: https://reviewboard.asterisk.org/r/3402/ ........ Merged revisions 411462 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411463 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 411465 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-20assigned-uniqueids: Miscellaneous cleanup and fixes.Richard Mudgett
* Fix memory leak in ast_unreal_new_channels(). Made it generate the ;2 uniqueid on a stack variable instead of mallocing it. * Made send error response to ARI and AMI requests instead of just logging excessive uniqueid length and allowing truncation. action_originate() and ari_channels_handle_originate_with_id(). * Fixed minor truncating uniqueid hole when generating the ;2 uniqueid string length. Created public and internal lengths of uniqueid. The internal length can handle a max public uniqueid plus an appended ;2. * free() and ast_free() are NULL tolerant so they don't need a NULL test before calling. * Made use better struct initialization format instead of the position dependent initialization format. Also anything not explicitly initialized in the struct is initialized to zero by the compiler. * Made ast_channel_internal_set_fake_ids() use the safer ast_copy_string() instead of strncpy(). Review: https://reviewboard.asterisk.org/r/3371/ ........ Merged revisions 410949 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14manager: fix memory leak in manager_add_filter functionJonathan Rose
(closes issue ASTERISK-23420) Reported by: Etienne Lessard Patches: manager_eventfilter_leak uploaded by Etienne Lessard (license 6394) ........ Merged revisions 410609 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 410623 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-10unqiueid: correct max uniqueid length testScott Griepentrog
This patch adds null string test prior to checking for a max uniqueid value that was added in r410157. ........ Merged revisions 410368 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07uniqueid: channel linkedid, ami, ari object creation with id'sScott Griepentrog
Much needed was a way to assign id to objects on creation, and much change was necessary to accomplish it. Channel uniqueids and linkedids are split into separate string and creation time components without breaking linkedid propgation. This allowed the uniqueid to be specified by the user interface - and those values are now carried through to channel creation, adding the assignedids value to every function in the chain including the channel drivers. For local channels, the second channel can be specified or left to default to a ;2 suffix of first. In ARI, bridge, playback, and snoop objects can also be created with a specified uniqueid. Along the way, the args order to allocating channels was fixed in chan_mgcp and chan_gtalk, and linkedid is no longer lost as masquerade occurs. (closes issue ASTERISK-23120) Review: https://reviewboard.asterisk.org/r/3191/ ........ Merged revisions 410157 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21manager: Fix AMI Status action of a single channel.Richard Mudgett
Fixed use of uninitialized ao2 container iterator in an off-nominal condition. Either a memory allocation error or the requested channel is an internal channel not exposed to the outside. ........ Merged revisions 408715 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-30Make a NOTICE about an invalid channel name more useful.Sean Bright
........ Merged revisions 406918 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 406919 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-27manager: ExtensionStatus event status human readableKevin Harwell
When an 'ExtensionStatus' event was raised it included the status as a numerical value, but did not include a text description of the status. Added a 'StatusText' field to the event which is a string representation of the extension status. Also added this to the 'Extension State' command response. (closes issue ASTERISK-23154) Reported by: Jonathan Rose git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-27manager: The eventfilter= option now takes an extended regex.Walter Doekes
In pre-trunk versions (...12) it accepts a basic regex, which is confusing because all other regexes in asterisk are of the extended kind. Review: https://reviewboard.asterisk.org/r/3147/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-24manager: Register atexit shutdown routine only once.Richard Mudgett
* Made register atexit shutdown routine only once in __init_manager(). * Fixed some initial load failure conditions in __init_manager(). * Made reset options to defaults on reload when the reload will actually happen. * Removed unnecessary container traversals of the white/black filters during manager_free_user(). * ast_free() does not need a NULL check before calling. ........ Merged revisions 406359 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406400 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 406401 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-24manager: Protect data structures during shutdown.Richard Mudgett
Occasionally, the manager module would get an "INTERNAL_OBJ: bad magic number" error on a "core restart gracefully" command if an AMI connection is established. * Added ao2_global_obj protection to the sessions global container. * Fixed the order of unreferencing a session object in session_destroy(). * Removed unnecessary container traversals of the white/black filters during session_destructor(). (closes issue AST-1242) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/3144/ ........ Merged revisions 406341 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 406342 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406343 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-21manager: Clarify eventfilter documentation. Textual changes only.Walter Doekes
Review: https://reviewboard.asterisk.org/r/3133/ ........ Merged revisions 406079 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406080 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 406081 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-16manager: Originate doesn't abort on failed format_cap allocationKevin Harwell
action_originate responds to the remote system with an error when cap==NULL, but doesn't return (abort the originate). Patched to return. (closes issue ASTERISK-23034) Reported by: Corey Farrell Patches: ASTERISK-23034.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 405745 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 405746 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405747 65c4cc65-6c06-0410-ace0-fbb531ad65f3