summaryrefslogtreecommitdiff
path: root/apps/app_mixmonitor.c
AgeCommit message (Collapse)Author
2013-08-30Fix memory leaksKevin Harwell
(closes issue ASTERISK-22368) Reported by: Corey Farrell Patches: issueA22368_mixmonitor_free_filename.patch uploaded by wdoekes (license 5674) ........ Merged revisions 398004 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 398011 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398016 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-02MixMonitor: Minor code cleanup.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-02MixMonitor: Make start_mixmonitor_callback() options parameter NULL tolerant.Richard Mudgett
* Removed some unnecessary code in start_mixmonitor_callback(). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393496 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-02MixMonitor: Don't use ast_strdupa() in a loop.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-02MixMonitor: Update XML documentation and CLI "mixmonitor {start|stop|list}" ↵Richard Mudgett
help. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-02MixMonitor: Fix refleak in manager_stop_mixmonitor() if could not stop ↵Richard Mudgett
monitoring. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-02MixMonitor: Remove some unnecessary channel locking.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-02Fix MixMonitor b option.Richard Mudgett
The option had not been converted to use the replacement for ast_bridged_channel(). One touch mixmonitor now records files again. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-01bridge_features: Support One touch Monitor/MixMonitorJonathan Rose
In addition to porting those features, they now enjoy greater feature parity with one another. Specifically, AutoMixMon now has a start and stop message that can be specified with TOUCH_MIXMONITOR_MESSAGE_START and TOUCH_MIXMONITOR_MESSAGE_STOP. (closes issue ASTERISK-21553) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2620/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-14app_mixmonitor: Fix crashes caused by unloading app_mixmonitorJonathan Rose
Unloading app_mixmonitor while active mixmonitors were running would cause a segfault. This patch fixes that by making it impossible to unload app_mixmonitor while mixmonitors are active. Review: https://reviewboard.asterisk.org/r/2624/ ........ Merged revisions 391778 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391794 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-21Merge in the bridge_construction branch to make the system use the Bridging API.Richard Mudgett
Breaks many things until they can be reworked. A partial list: chan_agent chan_dahdi, chan_misdn, chan_iax2 native bridging app_queue COLP updates DTMF attended transfers Protocol attended transfers git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-22Fix StopMixMonitor Hanging Up When Unable To Stop MixMonitor On A ChannelMichael L. Young
A regression was accidentally introduced when allowing an optional ID to be used when calling StopMixMonitor. When we are unable to stop MixMonitor on a channel, -1 is being returned which triggers the hangup of the channel. This patch restores the prior behavior by returning 0 whether we were successful or not. It also allows the call from the manager to use the return code when the action fails. (closes issue ASTERISK-21294) Reported by: daroz Tested by: daroz Patches: asterisk-21294-stop_mixmonitor_hangingup.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2404/ ........ Merged revisions 383631 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-30mixmonitor: Add a test eventJonathan Rose
This test event is being used to fix the mixmonitor_audiohook_inherit test. ........ Merged revisions 375484 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375485 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 375486 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24func_audiohookinherit: Document some missed sources.Jonathan Rose
This patch also mentions that AUDIOHOOK_INHERIT can be used to transfer MixMonitor audiohooks. There is also wiki that addresses audiohooks and the use of AUDIOHOOK_INHERIT at the following link: https://wiki.asterisk.org/wiki/display/AST/Audiohooks (closes issue ASTERISK-18220) Reported by: Ishfaq Malik ........ Merged revisions 373467 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 373468 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 373470 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373479 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-18Ensure that all ast_datastore_info structures are 'const'.Kevin P. Fleming
While addressing a bug, I came across a instance of 'struct ast_datastore_info' that was not declared 'const'. Since the API already expects them to be 'const', this patch changes the declarations of all existing instances that were not already declared that way. ........ Merged revisions 370183 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370184 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-05app_mixmonitor: Fix a reference leak in manager_mixmonitor functionJonathan Rose
Manager_mixmonitor included an early return on failed executions of mixmonitor that would result in a leaked channel reference. (closes issue ASTERISK-19943) Reported by: Mark Murawski Patches: mixmonitor-trunk-368394.patch uploaded by Mark Murawski (license 5791) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04Remove some extra debugging I forgot to remove in the merge of Digium phone ↵Mark Michelson
support. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368455 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-03-29Introducing the log message unique call identifiers featureJonathan Rose
Log messages will now display a call number that they are tied to (ordered for calls based on when they started). This feature is made to be minimally invasive without requiring changes to many of the existing log messages. These IDs won't show up for verbose messages on CLI (but they will in log files) This is currently in phase II of production, see more about this feature on the wiki -- https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging Review: https://reviewboard.asterisk.org/r/1823/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29undoing 360785 due to merging mistakeJonathan Rose
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29Introducing the log message unique call identifiers featureJonathan Rose
Log messages will now display a call number that they are tied to (ordered for calls based on when they started). This feature is made to be minimally invasive without requiring changes to many of the existing log messages. These IDs won't show up for verbose messages on CLI (but they will in log files) This is currently in phase II of production, see more about this feature on the wiki -- https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging Review: https://reviewboard.asterisk.org/r/1823/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360785 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-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-01-23Adds the ability to stop specific mixmonitors by using unique IDs set at ↵Jonathan Rose
monitor launch. MixMonitor receives a new option i(channel_variable) which stores the unique id at said variable. StopMixMonitor now accepts ID as an optional argument, which if included will make StopMixMonitor specifically target the mixmonitor on that particular channel. CLI commands and AMI actions have been ammended to work with the IDs as well. In addition, monitors across a channel can now be listed be listed via CLI command "mixmonitor list <channel>" which will display all of the mixmonitors active on that channel along with the files they each have open. Created by Sergio González Martín. (closes issue ASTERISK-19096) Reported by: Sergio González Martín Review: https://reviewboard.asterisk.org/r/1643/ Review: https://reviewboard.asterisk.org/r/1682/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-20Prevent potential buffer overflow on AMI MixMonitor command.Mark Michelson
Don't be alarmed. This only affected trunk, and it would have required manager access to your system. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09Replace direct access to channel name with accessor functionsTerry Wilson
There are many benefits to making the ast_channel an opaque handle, from increasing maintainability to presenting ways to kill masquerades. This patch kicks things off by taking things a field at a time, renaming the field to '__do_not_use_${fieldname}' and then writing setters/getters and converting the existing code to using them. When all fields are done, we can move ast_channel to a C file from channel.h and lop off the '__do_not_use_'. This patch sets up main/channel_interal_api.c to be the only file that actually accesses the ast_channel's fields directly. The intent would be for any API functions in channel.c to use the accessor functions. No more monkeying around with channel internals. We should use our own APIs. The interesting changes in this patch are the addition of channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to use accessor functions when ast_channel is really opaque), and some re-working of the way channel iterators/callbacks are handled so as to avoid creating fake ast_channels on the stack to pass in matching data by directly accessing fields (since "name" is a stringfield and the fake channel doesn't init the stringfields, you can't use the ast_channel_name_set() function). I went with ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a setter. The majority of the grunt-work for this change was done by writing a semantic patch using Coccinelle ( http://coccinelle.lip6.fr/ ). Review: https://reviewboard.asterisk.org/r/1655/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-09Adds MixMonitor and StopMixMonitor AMI commands to the managerJonathan Rose
These commands work much like the dialplan applications that would otherwise invoke them. A nice benefit of these is that they can be invoked on a call remotely and at any time during a call. They work much like the Monitor and StopMonitor ami commands. (closes issue ASTERISK-17726) Reported by: Sergio González Martín Patches: mixmonitor_actions.diff uploaded by Sergio González Martín (license 5644) Review: https://reviewboard.asterisk.org/r/1193/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19Merged revisions 336717 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r336717 | jrose | 2011-09-19 15:16:23 -0500 (Mon, 19 Sep 2011) | 14 lines Merged revisions 336716 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r336716 | jrose | 2011-09-19 15:07:36 -0500 (Mon, 19 Sep 2011) | 7 lines Document applications that play audio and do not answer unanswered calls. This patch is part of an effort to document early media and its usage. If you are interested in contributing to this documentation effort, there are probably other applications worth documenting as well as an Asterisk wiki article at https://wiki.asterisk.org/wiki/display/AST/Early+Media+and+the+Progress+Application ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14Merged revisions 328247 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce <support_level> tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-13Merged revisions 328120 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/1.10 ........ r328120 | dvossel | 2011-07-13 17:09:34 -0500 (Wed, 13 Jul 2011) | 15 lines Preserve sample rate quality of wideband mixmonitor recordings. MixMonitor has the ability to record in any file format Asterisk supports, but the quality of wideband audio is not preserved. This is because regardless of the sample rate the call is being recorded in, the audio is always downsampled to 8khz and then upsampled to whatever wideband format it is being written as. This patch resolves this by requesting the audio from the audiohook in the signed linear format closest to the sample rate of the format we are writing. This fix is only possible for Asterisk 1.10 because audio hooks in 1.8 are not capable of wideband audio. Review: https://reviewboard.asterisk.org/r/1314/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-11Mix Monitor: Now with r and t options.Jonathan Rose
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@310373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-07Merged revisions 309858 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r309858 | jrose | 2011-03-07 16:07:25 -0600 (Mon, 07 Mar 2011) | 22 lines Merged revisions 309857 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r309857 | jrose | 2011-03-07 16:04:44 -0600 (Mon, 07 Mar 2011) | 15 lines Merged revisions 309856 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r309856 | jrose | 2011-03-07 16:02:12 -0600 (Mon, 07 Mar 2011) | 8 lines Bug fix for MixMonitor involving filenames with '.' not in the extension Closes issue #18391) Reported by: pabelanger Patches:       bugfix.patch uploaded by jrose (license 1225) Tested by: jrose ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-22Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd ↵David Vossel
audio ConfBridge, and other stuff -Functional changes 1. Dynamic global format list build by codecs defined in codecs.conf 2. SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf 3. Negotiation of SILK attributes in chan_sip. 4. SPEEX 32khz with translation 5. SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation using codec_resample.c 6. Various changes to RTP code required to properly handle the dynamic format list and formats with attributes. 7. ConfBridge now dynamically jumps to the best possible sample rate. This allows for conferences to take advantage of HD audio (Which sounds awesome) 8. Audiohooks are no longer limited to 8khz audio, and most effects have been updated to take advantage of this such as Volume, DENOISE, PITCH_SHIFT. 9. codec_resample now uses its own code rather than depending on libresample. -Organizational changes Global format list is moved from frame.c to format.c Various format specific functions moved from frame.c to format.c Review: https://reviewboard.asterisk.org/r/1104/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03Asterisk media architecture conversion - no more format bitfieldsDavid Vossel
This patch is the foundation of an entire new way of looking at media in Asterisk. The code present in this patch is everything required to complete phase1 of my Media Architecture proposal. For more information about this project visit the link below. https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal The primary function of this patch is to convert all the usages of format bitfields in Asterisk to use the new format and format_cap APIs. Functionally no change in behavior should be present in this patch. Thanks to twilson and russell for all the time they spent reviewing these changes. Review: https://reviewboard.asterisk.org/r/1083/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-21Added MixMonitorMute manager commandJulian Lyndon-Smith
Added a new manager command to mute/unmute MixMonitor audio on a channel. Added a new feature to audiohooks so that you can mute either read / write (or both) types of frames - this allows for MixMonitor to mute either side of the conversation without affecting the conversation itself. (closes issue #16740) Reported by: jmls Review: https://reviewboard.asterisk.org/r/487/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-16Merged revisions 257686 via svnmerge from Dwayne M. Hubbard
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r257686 | dhubbard | 2010-04-16 16:15:43 -0500 (Fri, 16 Apr 2010) | 21 lines Make the mixmonitor thread process audio frames faster Mantis issue 17078 reports MixMonitor recordings have shorter durations than the call duration. This was because the mixmonitor thread was not processing frames from the audiohook fast enough. The mixmonitor thread would slowly fall behind the most recent audio frame and when the channel hangs up, the mixmonitor thread would exit without processing the same number of frames as the channel; leaving the mixmonitor recording shorter than actual call duration. This revision fixes this issue by moving the ast_audiohook_trigger_wait() and the subsequent audiohook.status check into the block where the ast_audiohook_read_frame() function returns NULL. (closes issue #17078) Reported by: geoff2010 Patches: dw-M17078.patch uploaded by dhubbard (license 733) Tested by: dhubbard, geoff2010 Review: https://reviewboard.asterisk.org/r/611/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@257713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05Make CLI command 'mixmonitor start|stop <channel> work again.Michiel van Baak
(closes issue #16534) Reported by: jlaguilar Fix as suggested by jlaguilar in the bugreport git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-19Merged revisions 230508 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r230508 | dvossel | 2009-11-19 15:22:46 -0600 (Thu, 19 Nov 2009) | 10 lines fixes MixMonitor thread not exiting when StopMixMonitor is used (closes issue #16152) Reported by: AlexMS Patches: stopmixmonitor_1.4.diff uploaded by dvossel (license 671) Tested by: dvossel, AlexMS Review: https://reviewboard.asterisk.org/r/424/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-19Merged revisions 213103 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r213103 | dvossel | 2009-08-19 16:18:37 -0500 (Wed, 19 Aug 2009) | 8 lines Fixes memory leak caused by incorrectly freeing mixmonitor (closes issue #15699) Reported by: edantie Patches: mixmonitor.patch uploaded by edantie (license 862) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10AST-2009-005Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-17Merged revisions 201423 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r201423 | dvossel | 2009-06-17 14:28:12 -0500 (Wed, 17 Jun 2009) | 19 lines StopMixMonitor race condition (not giving up file immediately) StopMixMonitor only indicates to the MixMonitor thread to stop writing to the file. It does not guarantee that the recording's file handle is available to the dialplan immediately after execution. This results in a race condition. To resolve this, the filestream pointer is placed in a datastore on the channel. When StopMixMonitor is called, the datastore is retrieved from the channel and the filestream is closed immediately before returning to the dialplan. Documentation indicating the use of StopMixMonitor to free files has been updated as well. (closes issue #15259) Reported by: travisghansen Tested by: dvossel Review: https://reviewboard.asterisk.org/r/283/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16Merged revisions 200991 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r200991 | kpfleming | 2009-06-16 12:05:38 -0500 (Tue, 16 Jun 2009) | 11 lines Improve support for media paths that can generate multiple frames at once. There are various media paths in Asterisk (codec translators and UDPTL, primarily) that can generate more than one frame to be generated when the application calling them expects only a single frame. This patch addresses a number of those cases, at least the primary ones to solve the known problems. In addition it removes the broken TRACE_FRAMES support, fixes a number of bugs in various frame-related API functions, and cleans up various code paths affected by these changes. https://reviewboard.asterisk.org/r/175/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15Last batch of 'static' qualifiers for module-level global variables.Kevin P. Fleming
Fix up modules in the 'apps' directory, and also correct the bad example of enum definitions in include/asterisk/app.h, which many developers followed (thanks for reading the documentation!). In addition, add some basic usage examples of the 'pahole' and 'pglobal' tools to the coding guidelines. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28Update documentation in MixMonitor.Leif Madsen
Updated the MixMonitor documentation for the 'b' option so that it is more obvious that you must not optimize away the Local channel when using this option. (closes issue #14829) Reported by: licedey Tested by: mmichelson, licedey, lmadsen git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21Const-ify the world (or at least a good part of it)Kevin P. Fleming
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes: - CLI command handlers - CLI command handler arguments - AGI command handlers - AGI command handler arguments - Dialplan application handler arguments - Speech engine API function arguments In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing. Review: https://reviewboard.asterisk.org/r/251/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12add 'const' qualifiers in various places where they should have beenKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24Convert the ast_channel data structure over to the astobj2 framework.Russell Bryant
There is a lot that could be said about this, but the patch is a big improvement for performance, stability, code maintainability, and ease of future code development. The channel list is no longer an unsorted linked list. The main container for channels is an astobj2 hash table. All of the code related to searching for channels or iterating active channels has been rewritten. Let n be the number of active channels. Iterating the channel list has gone from O(n^2) to O(n). Searching for a channel by name went from O(n) to O(1). Searching for a channel by extension is still O(n), but uses a new method for doing so, which is more efficient. The ast_channel object is now a reference counted object. The benefits here are plentiful. Some benefits directly related to issues in the previous code include: 1) When threads other than the channel thread owning a channel wanted access to a channel, it had to hold the lock on it to ensure that it didn't go away. This is no longer a requirement. Holding a reference is sufficient. 2) There are places that now require less dealing with channel locks. 3) There are places where channel locks are held for much shorter periods of time. 4) There are places where dealing with more than one channel at a time becomes _MUCH_ easier. ChanSpy is a great example of this. Writing code in the future that deals with multiple channels will be much easier. Some additional information regarding channel locking and reference count handling can be found in channel.h, where a new section has been added that discusses some of the rules associated with it. Mark Michelson also assisted with the development of this patch. He did the conversion of ChanSpy and introduced a new API, ast_autochan, which makes it much easier to deal with holding on to a channel pointer for an extended period of time and having it get automatically updated if the channel gets masqueraded. Mark was also a huge help in the code review process. Thanks to David Vossel for his assistance with this branch, as well. David did the conversion of the DAHDIScan application by making it become a wrapper for ChanSpy internally. The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch. Review: http://reviewboard.digium.com/r/203/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05Merged revisions 173592 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r173592 | mmichelson | 2009-02-05 12:47:24 -0600 (Thu, 05 Feb 2009) | 3 lines Add some missing cleanup to app_mixmonitor ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05Merged revisions 173559 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r173559 | mmichelson | 2009-02-05 11:34:33 -0600 (Thu, 05 Feb 2009) | 25 lines Fix a problem where a channel pointer becomes invalid due to masquerading or hanging up. app_mixmonitor runs its own thread to monitor the channel's activity and write the mixed audio to a file. Since this thread runs independently of the channel, it is possible that the mixmonitor thread's channel pointer will point to freed memory when the channel either is masqueraded or hangs up (technically, both cases are hangups, but we need to handle the cases slightly differently). The solution for this is to employ a datastore, which has the nice benefit of allowing us to hook into channel masquerades and hangups and update our pointer as necessary. If this looks familiar, this same technique is employed in app_chanspy. app_chanspy is a bit more involved since it does a lot more operations on the channel that is being spied upon. app_mixmonitor does have an extra touch that app_chanspy doesn't have, though. Since there is a thread race between the channel's thread and the mixmonitor thread on a hangup, we em- ploy a condition-and-boolean combination to ensure that the channel thread finishes with our structure before the mixmonitor thread attempts to free it. No crashes! (closes issue #14374) Reported by: aragon Patches: 14374.patch uploaded by putnopvut (license 60) Tested by: aragon, putnopvut ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173589 65c4cc65-6c06-0410-ace0-fbb531ad65f3