summaryrefslogtreecommitdiff
path: root/apps/app_chanspy.c
AgeCommit message (Collapse)Author
2008-04-17Merged revisions 114226 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114226 | mmichelson | 2008-04-17 16:03:29 -0500 (Thu, 17 Apr 2008) | 9 lines Declaration of the peer channel in this scope was making it so the peer variable defined in the outer scope was never set properly, therefore making iterating through the channel list always restart from the beginning. This bug would have affected anyone who called chanspy without specifying a first argument. (closes issue #12461) Reported by: stever28 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17Merged revisions 114191 via svnmerge from Sean Bright
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114191 | seanbright | 2008-04-17 06:51:20 -0400 (Thu, 17 Apr 2008) | 1 line Make sure we have enough room for the recording's filename. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16Add the ability to disable channel technology name playback when speaking ↵Sean Bright
the current channel name git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-15I'm not sure why, but "this" bothers me. Ba dum dum.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19Merged revisions 110083 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r110083 | mmichelson | 2008-03-19 15:33:03 -0500 (Wed, 19 Mar 2008) | 4 lines Add a missing unlock in the case that memory allocation fails in app_chanspy. Thanks to Russell for confirming that this was an issue. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18Merged revisions 109763 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r109763 | russell | 2008-03-18 17:34:42 -0500 (Tue, 18 Mar 2008) | 3 lines Fix one place where the chanspy datastore isn't removed from a channel. (issue #12243, reported by atis, patch by me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-17Merged revisions 109012 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r109012 | mmichelson | 2008-03-17 09:18:26 -0500 (Mon, 17 Mar 2008) | 6 lines Make sure that we release the lock on the spyee channel if the spyee or spy has hung up (closes issue #12232) Reported by: atis ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-13Merged revisions 108583 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r108583 | russell | 2008-03-13 16:38:16 -0500 (Thu, 13 Mar 2008) | 11 lines Fix another issue that was causing crashes in chanspy. This introduces a new datastore callback, called chan_fixup(). The concept is exactly like the fixup callback that is used in the channel technology interface. This callback gets called when the owning channel changes due to a masquerade. Before this was introduced, if a masquerade happened on a channel being spyed on, the channel pointer in the datastore became invalid. (closes issue #12187) (reported by, and lots of testing from atis) (props to file for the help with ideas) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12Merged revisions 108135 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r108135 | russell | 2008-03-12 14:57:42 -0500 (Wed, 12 Mar 2008) | 40 lines (closes issue #12187, reported by atis, fixed by me after some brainstorming on the issue with mmichelson) - Update copyright info on app_chanspy. - Fix a race condition that caused app_chanspy to crash. The issue was that the chanspy datastore magic that was used to ensure that spyee channels did not disappear out from under the code did not completely solve the problem. It was actually possible for chanspy to acquire a channel reference out of its datastore to a channel that was in the middle of being destroyed. That was because datastore destruction in ast_channel_free() was done near the end. So, this left the code in app_chanspy accessing a channel that was partially, or completely invalid because it was in the process of being free'd by another thread. The following sort of shows the code path where the race occurred: ============================================================================= Thread 1 (PBX thread for spyee chan) || Thread 2 (chanspy) --------------------------------------||------------------------------------- ast_channel_free() || - remove channel from channel list || - lock/unlock the channel to ensure || that no references retrieved from || the channel list exist. || --------------------------------------||------------------------------------- || channel_spy() - destroy some channel data || - Lock chanspy datastore || - Retrieve reference to channel || - lock channel || - Unlock chanspy datastore --------------------------------------||------------------------------------- - destroy channel datastores || - call chanspy datastore d'tor || which NULL's out the ds' || - Operate on the channel ... reference to the channel || || - free the channel || || || - unlock the channel --------------------------------------||------------------------------------- ============================================================================= ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07Merged revisions 106552 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r106552 | tilghman | 2008-03-07 00:36:33 -0600 (Fri, 07 Mar 2008) | 6 lines Safely use the strncat() function. (closes issue #11958) Reported by: norman Patches: 20080209__bug11958.diff.txt uploaded by Corydon76 (license 14) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27Merged revisions 104787 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104787 | file | 2008-02-27 16:56:23 -0400 (Wed, 27 Feb 2008) | 2 lines Don't loop around infinitely trying to spy on our own channel, and don't forget to free/detach the datastore upon hangup of the spy. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27Merged revisions 104625 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104625 | russell | 2008-02-27 11:33:04 -0600 (Wed, 27 Feb 2008) | 4 lines Fix a problem in ChanSpy where it could get stuck in an infinite loop without being able to detect that the calling channel hung up. (closes issue #12076, reported by junky, patched by me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27Merged revisions 104334 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104334 | russell | 2008-02-26 19:15:02 -0600 (Tue, 26 Feb 2008) | 3 lines Avoid some recursion in the cleanup code for the chanspy datastore (closes issue #12076, reported by junky, patched by me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25Merged revisions 104106 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104106 | russell | 2008-02-25 17:42:42 -0600 (Mon, 25 Feb 2008) | 10 lines This patch fixes some pretty significant problems with how app_chanspy handles pointers to channels that are being spied upon. It was very likely that a crash would occur if the channel being spied upon hung up. This was because the current ast_channel handling _requires_ that the object is locked or else it could disappear at any time (except in the owning channel thread). So, this patch uses some channel datastore magic on the spied upon channel to be able to detect if and when the channel goes away. (closes issue #11877) (patch written by me, but thanks to kpfleming for the idea, and to file for review) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-09whitespace fixes only.Michiel van Baak
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-07This is a combination new feature/bug fix for app_chanspy.Mark Michelson
New feature: Add the 'e' option, which takes as an argument a list of interfaces separated by colons. This way, you will only be able to spy on this limited list of interfaces. Bug fix: change some pointer checks to ast_strlen_zero so that spying would work properly even if no channel was specified as the first argument to chanspy. (closes issue #10072) Reported by: xmarksthespot Patches: bugfix+newfeature10072patchtotrunkrev102726.diff uploaded by xmarksthespot (license 16) Tested by: xmarksthespot, mvanbaak git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23Merged revisions 99923 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r99923 | russell | 2008-01-23 11:46:55 -0600 (Wed, 23 Jan 2008) | 8 lines ChanSpy issues a beep when it starts at the beginning of a list of channels to potentially spy on. However, if there were no matching channels, it would beep at you over and over, which is pretty annoying. Now, it will only beep once in the case that there are no channels to spy on, but it will still beep again once it reaches the beginning of the channel list again. (closes issue #11738, patched by me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14Convert ast_verbose to ast_verb.Tilghman Lesher
Reported by: snuffy Patch by: snuffy (Closes issue #11547) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21remove another set of redundant #include "asterisk/options.h"Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20move asterisk/paths.h outside asterisk.h and into those filesLuigi Rizzo
who really need it. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19include "logger.h" and errno.h from asterisk.h - usage shows that theyLuigi Rizzo
were included almost everywhere. Remove some of the instances. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06"show application <foo>" changes for clarity.Mark Michelson
(closes issue #11171, reported and patched by blitzrage) Many thanks! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31Add volume adjustment to spy audiohook in app_chanspy.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08Merge audiohooks branch into trunk. This is a new API for developers to ↵Joshua Colp
listen and manipulate the audio going through a channel. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31Mostly cleanup of documentation to substitute the pipe with the comma, but a ↵Tilghman Lesher
few other formatting cleanups, too. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26Do a massive conversion for using the ast_verb() macroRussell Bryant
(closes issue #10277, patches by mvanbaak) Basically, this changes ... if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3, "Something\n"); to ... ast_verb(3, "Something\n"); git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23Merge the dialplan_aesthetics branch. Most of this patch simply converts ↵Tilghman Lesher
applications using old methods of parsing arguments to using the standard macros. However, the big change is that the really old way of specifying application and arguments separated by a comma will no longer work (e.g. NoOp,foo|bar). Instead, the way that has been recommended since long before 1.0 will become the only method available (e.g. NoOp(foo,bar). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16Applications no longer need to call ast_module_user_add and ↵Joshua Colp
ast_module_user_remove. This is now taken care of in the pbx_exec function outside of the application. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16It is no longer required for each module that deals with a channel to call ↵Joshua Colp
ast_module_user_hangup_all in it's unload function. The loader will automatically perform this action for it. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13Merged revisions 75078 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r75078 | mmichelson | 2007-07-13 15:15:30 -0500 (Fri, 13 Jul 2007) | 13 lines Merged revisions 75066 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r75066 | mmichelson | 2007-07-13 15:10:39 -0500 (Fri, 13 Jul 2007) | 5 lines Fixed an issue where chanspy flags were uninitialized if no options were passed. What triggered this investigation was an IRC chat where some people's quiet flags were set while others' weren't even though none of them had specified the q option. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05Merged revisions 73355 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r73355 | file | 2007-07-05 11:21:44 -0300 (Thu, 05 Jul 2007) | 10 lines Merged revisions 73349 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r73349 | file | 2007-07-05 11:19:14 -0300 (Thu, 05 Jul 2007) | 2 lines Tweak spy locking. (issue #9951 reported by welles) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14Add a massive set of changes for converting to use the ast_debug() macro.Russell Bryant
(issue #9957, patches from mvanbaak, caio1982, critch, and dimas) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16Add 'o' option to Chanspy which causes it to only listen to audio coming ↵Joshua Colp
from the channel, and the 'X' option which allows the user to exit to a valid single digit extension. (issue #8137 reported by mnicholson) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-21a quick fix to app_sms.c to get rid of cursed compiler warnings so I can ↵Steve Murphy
compile under --enable-dev-mode git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10Merged revisions 47437 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r47437 | file | 2006-11-10 11:53:16 -0500 (Fri, 10 Nov 2006) | 2 lines Only split up extension and context if a value exists. (issue #8332 reported by loloski) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13Merged revisions 45066 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r45066 | file | 2006-10-13 13:05:02 -0400 (Fri, 13 Oct 2006) | 10 lines Merged revisions 45060 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r45060 | file | 2006-10-13 13:01:22 -0400 (Fri, 13 Oct 2006) | 2 lines Turn on volume adjustment if it needs to be on (issue #8136 reported by mnicholson) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-26Merged revisions 43695 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r43695 | file | 2006-09-26 16:09:41 -0400 (Tue, 26 Sep 2006) | 2 lines Slight overhaul of the whisper support. 1. We need to duplicate the frame from ast_translate 2. We need to ensure we always have signed linear coming in for signed linear combining. 3. We need to ensure we are always feeding signed linear out. 4. Properly store and restore write format when beeping on the channel we are whispering on. 5. Properly discontinue the stream on the channel for the beep. (issue #8019 reported by timkelly1980) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-05Minor tweak - we need to lock the channel when we are removing the spy from it.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-03Use tabs instead of spaces (I <3 tabs -- this is for you Qwell)Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-03Make the difference clear about what the responsibilities of the core and a ↵Joshua Colp
spy are when it comes to spying on a channel. The core is responsible for adding a spy to a channel, feeding frames into the spy, removing the spy from the channel, and notifying the spy that is has been detached. The spy is responsible for reading frames in, and cleaning itself up. Each side will not try to do the other's job. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-03 We don't spy on Zap/psuedo channels. Not at all. Never. (#7871 - sxpert ↵BJ Weschke
reporting) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21merge new_loader_completion branch, including (at least):Kevin P. Fleming
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-05suppress a compiler warning about the usage of a potentially uninitializedRussell Bryant
variable git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28play a beep tone into the spied-on channel if we are about to whisper to themKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28add ExtenSpy variant of ChanSpyKevin P. Fleming
implement whisper mode for ExtenSpy/ChanSpy git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27more simplification, and correct a bug i introduced in the last commitKevin P. Fleming
fix prototype for a channel walking function to use a const input pointer use existing channel walk by name prefix instead of reproducing that code in this app git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38389 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27remove local channel finding wrappersKevin P. Fleming
move guts of dialplan application into separate function, so it can be shared bythe new application i'm about to add :-) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27restore infinite timeout for ast_waitfor() callKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27various cleanups:Kevin P. Fleming
use API call for finding channel by name prefix code formatting to match guidelines (lost about half the of the indenting) remove useless automatic variable initializations don't set the spying channel's read format to SLINEAR when we don't do anything with the voice frames we read from it anyway use proper option argument checking for volume argument git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38368 65c4cc65-6c06-0410-ace0-fbb531ad65f3