summaryrefslogtreecommitdiff
path: root/apps/app_mixmonitor.c
AgeCommit message (Collapse)Author
2017-11-06Fix ast_(v)asprintf() malloc failure usage conditions.Richard Mudgett
When (v)asprintf() fails, the state of the allocated buffer is undefined. The library had better not leave an allocated buffer as a result or no one will know to free it. The most likely way it can return failure is for an allocation failure. If the printf conversion fails then you actually have a threading problem which is much worse because another thread modified the parameter values. * Made __ast_asprintf()/__ast_vasprintf() set the returned buffer to NULL on failure. That is much more useful than either an uninitialized pointer or a pointer that has already been freed. Many uses won't have to check for failure to ensure that the buffer won't be double freed or prevent an attempt to free an uninitialized pointer. * stasis.c: Fixed memory leak in multi_object_blob_to_ami() allocated by ast_asprintf(). * ari/resource_bridges.c:ari_bridges_play_helper(): Remove assignment to the wrong thing which is now not needed even if assigning to the right thing. Change-Id: Ib5252fb8850ecf0f78ed0ee2ca0796bda7e91c23
2017-11-02Add missing menuselect dependencies.Corey Farrell
This adds menuselect dependencies for modules that use symbols of other modules. ASTERISK-27390 Change-Id: Ia2d2849f5b87a72af7324a82edc3f283eafb5385
2017-08-30AST-2017-006: Fix app_minivm application MinivmNotify command injectionCorey Farrell
An admin can configure app_minivm with an externnotify program to be run when a voicemail is received. The app_minivm application MinivmNotify uses ast_safe_system() for this purpose which is vulnerable to command injection since the Caller-ID name and number values given to externnotify can come from an external untrusted source. * Add ast_safe_execvp() function. This gives modules the ability to run external commands with greater safety compared to ast_safe_system(). Specifically when some parameters are filled by untrusted sources the new function does not allow malicious input to break argument encoding. This may be of particular concern where CALLERID(name) or CALLERID(num) may be used as a parameter to a script run by ast_safe_system() which could potentially allow arbitrary command execution. * Changed app_minivm.c:run_externnotify() to use the new ast_safe_execvp() instead of ast_safe_system() to avoid command injection. * Document code injection potential from untrusted data sources for other shell commands that are under user control. ASTERISK-27103 Change-Id: I7552472247a84cde24e1358aaf64af160107aef1
2017-03-15autochan/mixmonitor/chanspy: Fix unsafe channel locking and references.Richard Mudgett
Dereferencing struct ast_autochan.chan without first calling ast_autochan_channel_lock() is unsafe because the pointer could change at any time due to a masquerade. Unfortunately, ast_autochan_channel_lock() itself uses struct ast_autochan.chan unsafely and can result in a deadlock if the original channel happens to get destroyed after a masquerade in addition to the pointer getting changed. The problem is more likely to happen with v11 and earlier because masquerades are used to optimize out local channels on those versions. However, it could still happen on newer versions if the channel is executing a dialplan application when the channel is transferred or redirected. In this situation a masquerade still must be used. * Added a lock to struct ast_autochan to safely be able to use ast_autochan.chan while trying to get the channel lock in ast_autochan_channel_lock(). The locking order is the channel lock then the autochan lock. Locking in the other direction requires deadlock avoidance. * Fix unsafe ast_autochan.chan usages in app_mixmonitor.c. * Fix unsafe ast_autochan.chan usages in app_chanspy.c. * app_chanspy.c: Removed unused autochan parameter from next_channel(). ASTERISK-26867 Change-Id: Id29dd22bc0f369b44e23ca423d2f3657187cc592
2016-03-11app_chanspy: Fix occasional deadlock with ChanSpy and Local channels.Walter Doekes
Channel masquerading had a conflict with autochannel locking. When locking autochannel->channel, the channel is fetched from the autochannel and then locked. During the fetch, the autochannel -- which has no locks itself -- can be modified by someone who owns the channel lock. That means that the value of autochan->channel cannot be trusted until you hold the lock. In practice, this caused problems with Local channels getting masqueraded away while the ChanSpy attempted to get info from that channel. The old channel which was about to get removed got locked, but the new (replaced) channel got unlocked (no-op). Because the replaced channel was now locked (and would never get unlocked), it couldn't get removed from the channel list in a timely manner, and would now cause deadlocks when iterating over the channel list. This change checks the autochannel after locking the channel for changes to the autochannel. If the channel had been changed, the lock is reobtained on the new channel. In theory it seems possible that after this fix, the lock attempt on the old (wrong) channel can be on an already destroyed lock, maybe causing a crash. But that hasn't been observed in the wild and is harder induce than the current deadlock. Thanks go to Filip Frank for suggesting a fix similar to this and especially to IRC user hexanol for pointing out why this deadlock was possible and testing this fix. And to Richard for catching my rookie while loop mistake ;) ASTERISK-25321 #close Change-Id: I293ae0014e531cd0e675c3f02d1d118a98683def
2015-02-15apps/app_mixmonitor: Move Test Event for MIXMONITOR_END to after it finishesMatthew Jordan
The Test Event for MIXMONITOR_END - which signals that a MixMonitor has completed - technically fired before the filestream was closed. If a test used this to trigger a condition to verify that the file was written, it could result in a race condition where the file size would not be what the test expected. Luckily, no tests were using this (although they should have been). Since the test event needed to be moved after the point where the MixMonitor autochan has been destroyed, the test event no longer emits the channel name. Luckily, nothing needs it. ........ Merged revisions 431788 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-03audiohooks: Reevaluate the bridge technology when an audiohook is added or ↵Richard Mudgett
removed. Adding a mixmonitor to a channel causes the bridge to change technologies from native to simple_bridge so the call can be recorded. However, when the mixmonitor is stopped the bridge does not switch back to the native technology. * Added unbridge requests to reevaluate the bridge when a channel audiohook is removed. * Moved the unbridge request into ast_audiohook_attach() ensure that the bridge reevaluates whenever an audiohook is attached. This simplified the mixmonitor and chan_spy start code as well. * Added defensive code to stop_mixmonitor_full() in case additional arguments are ever added to the StopMixMonitor application. * Made ast_framehook_detach() not do an unbridge request if the framehook does not exist. * Made ast_framehook_list_fixup() do an unbridge request if there are any framehooks. Also simplified the loop. ASTERISK-24195 #close Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/4046/ ........ Merged revisions 424506 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@424507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-22Fix a locking inversion in MixMonitor.Mark Michelson
We need to unlock the audiohook before trying to lock the channel, since the correct locking order is channel then audiohook. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@421882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-13Bridges: Fix feature interruption/unintended kick caused by external actionsJonathan Rose
If a manager or CLI user attached a mixmonitor to a call running a dynamic bridge feature while in a bridge, the feature would be interrupted and the channel would be forcibly kicked out of the bridge (usually ending the call during a simple 1 to 1 call). This would also occur during any similar action that could set the unbridge soft hangup flag, so the fix for this was to remove unbridge from the soft hangup flags and make it a separate thing all together. ASTERISK-24027 #close Reported by: mjordan Review: https://reviewboard.asterisk.org/r/3900/ ........ Merged revisions 420934 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@420940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-22apps/app_mixmonitor: Add Options To Play Beep At Start Or StopMichael L. Young
We have a new periodic beep feature but sometimes a user needs some sort of feedback, without the need to have a periodic beep during the recording, to let them know that MixMonitor started recording or ended the recording. The use case where this patch is being used is when using Dynamic Features to start and end MixMonitor. This patch adds an option to play a beep when MixMonitor starts and an option to play a beep when MixMonitor ends. ASTERISK-24051 #close Reported by: Michael L. Young patches: mixmonitor-play-beep-start-stop.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/3820/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419238 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-06-12MixMontior: Add class authorization requirements to MixMonitor AMI commandsJonathan Rose
MixMonitor AMI commands StartMixMonitor and StopMixMonitor lacked class authorization. StopMixMonitor now requires that the manager user either have the call or system class authorization. StartMixMonitor is a slightly larger issue since it can execute shell commands if the right arguments are passed into it, and we consider this a permission escalation. A security release will be issued for problem this shortly. ASTERISK-23609 #close Reported by: Corey Farrell ........ Merged revisions 415825 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415832 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-28Logger/CLI/etc.: Fix some aesthetic issues; reduce chatty verbose messagesMatthew Jordan
This patch addresses some aesthetic issues in Asterisk. These are all just minor tweaks to improve the look of the CLI when used in a variety of settings. Specifically: * A number of chatty verbose messages were removed or demoted to DEBUG messages. Verbose messages with a verbosity level of 5 or higher were - if kept as verbose messages - demoted to level 4. Several messages that were emitted at verbose level 3 were demoted to 4, as announcement of dialplan applications being executed occur at level 3 (and so the effects of those applications should generally be less). * Some verbose messages that only appear when their respective 'debug' options are enabled were bumped up to always be displayed. * Prefix/timestamping of verbose messages were moved to the verboser handlers. This was done to prevent duplication of prefixes when the timestamp option (-T) is used with the CLI. * Verbose magic is removed from messages before being emitted to non-verboser handlers. This prevents the magic in multi-line verbose messages (such as SIP debug traces or the output of DumpChan) from being written to files. * _Slightly_ better support for the "light background" option (-W) was added. This includes using ast_term_quit in the output of XML documentation help, as well as changing the "Asterisk Ready" prompt to bright green on the default background (which stands a better chance of being displayed properly than bright white). Review: https://reviewboard.asterisk.org/r/3547/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-15(mix)monitor: Add options to enable a periodic beepRussell Bryant
Add an option to enable a periodic beep to be played into a call if it is being recorded. If enabled, it uses the PERIODIC_HOOK() function internally to play the 'beep' prompt into the call at a specified interval. This option is provided for both Monitor() and MixMonitor(). Review: https://reviewboard.asterisk.org/r/3424/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-09Add a Command header to the AMI Mixmonitor action.Mark Michelson
This fixes a parsing error that occurred during the processing of the AMI action. The error did not result in MixMonitor itself misbehaving, but it could result in the AMI response not giving correct information back. The new header allows for one to specify a post-process command to run when recording finishes. Previously, in order to do this, the post-process command would have to be placed at the end of the Options: header. Patches: mixmonitor_command_2.patch by jhardin (License #6512) ........ Merged revisions 412048 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-17Several components: fixing Typos in comments and code, "avaliable" instead ↵Rusty Newton
of "available" (issue ASTERISK-23021) (closes issue ASTERISK-23021) Reported by: Jeremy Lainé Tested by: Rusty Newton Patches: available.patch uploaded by Jeremy Lainé (license 6561) ........ Merged revisions 404046 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-09Create function for retrieving Mixmonitor instance data.Mark Michelson
For the time, this is only useful for retrieving the filename. The purpose of this function is to better facilitate multiple mixmonitors per channel. Setting a MIXMONITOR_FILENAME channel variable is not conducive to such behavior, so allowing finer grained access to individual mixmonitor properties improves the situation. The MIXMONITOR_FILENAME channel variable is still set, though, so there is no worry about backwards compatibility. Review: https://reviewboard.asterisk.org/r/3023 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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