aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
AgeCommit message (Collapse)AuthorFilesLines
2009-08-10Changes to make 1.4.26 into 1.4.26.1v1.4.26.1tilghman1-12/+12
git-svn-id: http://svn.digium.com/svn/asterisk/tags/1.4.26.1@211596 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18Fix cases where the internal poll() was not being used when it needed to be.russell1-2/+2
We have seen a number of problems caused by poll() not working properly on Mac OSX. If you search around, you'll find a number of references to using select() instead of poll() to work around these issues. In Asterisk, we've had poll.c which implements poll() using select() internally. However, we were still getting reports of problems. vadim investigated a bit and realized that at least on his system, even though we were compiling in poll.o, the system poll() was still being used. So, the primary purpose of this patch is to ensure that we're using the internal poll() when we want it to be used. The changes are: 1) Remove logic for when internal poll should be used from the Makefile. Instead, put it in the configure script. The logic in the configure script is the same as it was in the Makefile. Ideally, we would have a functionality test for the problem, but that's not actually possible, since we would have to be able to run an application on the _target_ system to test poll() behavior. 2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT is not defined. 3) Change uses of poll() throughout the source tree to ast_poll(). I feel that it is good practice to give the API call a new name when we are changing its behavior and not using the system version directly in all cases. So, normally, ast_poll() is just redefined to poll(). On systems where AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll(). 4) Change poll() in main/poll.c to be ast_internal_poll(). It's worth noting that any code that still uses poll() directly will work fine (if they worked fine before). So, for example, out of tree modules that are using poll() will not stop working or anything. However, for modules to work properly on Mac OSX, ast_poll() needs to be used. (closes issue #13404) Reported by: agalbraith Tested by: russell, vadim http://reviewboard.digium.com/r/198/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182810 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-29Lose the CAP_NET_ADMIN at every fork, instead of at startup. Otherwise, iftilghman1-0/+17
Asterisk runs as a non-root user and the administrator does a 'restart now', Asterisk loses the ability to set QOS on packets. (closes issue #14004) Reported by: nemo Patches: 20090105__bug14004.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@172438 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-25Err, yeah.tilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@171122 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-25Add thread to kill zombies, when child processes don't die immediately ontilghman1-2/+71
SIGHUP. (closes issue #13968) Reported by: eldadran Patches: 20090114__bug13968.diff.txt uploaded by Corydon76 (license 14) Tested by: eldadran git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@171120 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-12(closes issue #13881)jpeeler1-0/+5
Reported by: hoowa Update the app CDR field for AGI commands that are not executing an application via "exec". git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168516 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-08Don't truncate database results at 255 chars.tilghman1-3/+22
(closes issue #14069) Reported by: evandro Patches: 20081214__bug14069.diff.txt uploaded by Corydon76 (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167840 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-11Don't wait forever, if there's a specified recording timeout.tilghman1-1/+1
(closes issue #13885) Reported by: bamby Patches: res_agi.c.patch uploaded by bamby (license 430) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@163088 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-29update dev-mode compiler flags to match the ones used by default on Ubuntu ↵kpfleming1-2/+2
Intrepid, so all developers will see the same warnings and errors since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them format attributes in a consistent way git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@159808 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-01fix a bunch of potential problems found by gcc 4.3.x, primarily bare strings ↵kpfleming1-2/+3
being passed to printf()-like functions and ignored results from read()/write() and friends git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153337 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-03(closes issue #13425)jpeeler1-1/+5
Reported by: mdu113 Tested by: mdu113 Similar to r143204, masquerade the channel in the case of Park being called from AGI. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@146129 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-06Reverting behavior change (AGI should not exit non-zero on SUCCESS)tilghman1-1/+1
(closes issue #13434) Reported by: francesco_r git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@141503 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-04(closes issue #11979)jpeeler1-1/+1
Fixes multiple parking problems: Crash when executing a park on an extension dialed by AGI due to not returning the proper return code. Crash when using a builtin feature that was a subset of a enabled dynamic feature. Crash due to always hanging up the peer despite the fact that the peer was supposed to be parked. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@141028 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-30launch_netscript sometimes returns -1, which fails to set AGISTATUS. Maptilghman1-1/+1
failure to -1, so that AGISTATUS is always set. (closes issue #13199) Reported by: smw1218 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@134480 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-14Avoid zombies when the channel exits before the AGI.tilghman1-1/+5
(closes issue #12648) Reported by: gkloepfer Patches: 20080514__bug12648.diff.txt uploaded by Corydon76 (license 14) Tested by: gkloepfer git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@116466 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-17Add special case for when the agi cannot be executed, to comply with the ↵tilghman1-1/+10
documentation that we return failure in that case. (closes issue #12462) Reported by: fmueller Patches: 20080416__bug12462.diff.txt uploaded by Corydon76 (license 14) Tested by: fmueller git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114195 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-11If the channel is hungup during RECORD FILE send a result code of -1 to be ↵file1-1/+1
uniform with everything else. (closes issue #11743) Reported by: davevg Patches: res_agi.diff uploaded by davevg (license 209) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98317 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-14Change help documentation to match actual behavior (FAILURE vs FAILED).tilghman1-1/+1
Reported by: angeloxx-sir Patch by: tilghman (Closes issue #11548) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@92933 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01Add another sanity check in the AGI read loop. We really don't care aboutrussell1-0/+2
EAGAIN unless we didn't read an entire line. If there is a newline at the end if the read buffer, break, because we got the whole thing. (reported and patched by bmd) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84236 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-18Add a new patch to handle interrupting the fgets() call when using FastAGI.russell1-4/+25
This version of the patch maintains the original behavior of the code when not using FastAGI. (closes issue #10553) Reported by: juggie Patches: res_agi_fgets-4.patch uploaded by juggie (license 24) res_agi_fgets_1.4svn.patch uploaded by juggie (license 24) Slight mods by me Tested by: juggie, festr git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82929 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-12Fix a check of the wrong pointer, as pointed out by an XXX comment left in russell1-1/+1
the code. The problem was harmless, however. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82296 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-12revert patch from issue #10553, as someone not using fastagi reported that thisrussell1-16/+1
broke their system. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82278 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11(closes issue #10553)russell1-7/+25
Reported by: juggie Patches: res_agi_fgets-2.patch uploaded by juggie (license 24) Tested by: juggie When using fastagi, fgets() can return before a full line is read. Add explicit handling for the case where it gets interrupted. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82245 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-23Revert res_agi fix that didn't quite work until we get it right ...russell1-8/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@80469 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22Juggie in #asterisk-dev was reporting problems where fgets would returnrussell1-1/+9
without reading the whole line when using fastagi. When this happens, errno was set to EINTR or EAGAIN. This patch accounts for the possibility and lets fgets continue in that case. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@80360 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-30(closes issue #10279)russell1-4/+6
Reported by: seanbright Patches: res_agi.carefulwrite.1.4.07252007.patch uploaded by seanbright (license 71) res_agi.carefulwrite.trunk.07252007.patch uploaded by seanbright (license 71) Allow the "agi_network: yes" line to be printed out in the AGI debug output. Also, allow partial writes to be handled when writing out this line just like it is for all of the others. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@77788 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-30Merged revisions 77782 via svnmerge from tilghman1-1/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r77782 | tilghman | 2007-07-30 13:40:54 -0500 (Mon, 30 Jul 2007) | 2 lines Revert change in revision 71656, even though it fixed a bug, because many people were depending upon the (broken) behavior. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@77783 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-17(issue #10210)russell1-0/+2
Reported by: juggie Patches: 10210-1.4-grr.patch uploaded by juggie (license #24) Tested by: juggie, blitzrage Log a warning if someone uses DeadAGI on a live channel. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75437 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-17Remove a duplicated newline character in AGI debug output.russell1-1/+1
(closes issue #10207, patch by seanbright) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75401 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-25Merged revisions 71656 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r71656 | tilghman | 2007-06-25 13:12:37 -0500 (Mon, 25 Jun 2007) | 2 lines Issue 10035 - handle_exec returns a result inconsistent with all of the other AGI commands ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@71657 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-22Merged revisions 71065 via svnmerge from qwell1-15/+5
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r71065 | qwell | 2007-06-22 09:52:18 -0500 (Fri, 22 Jun 2007) | 4 lines Fix a few silly usages of ast_playstream() - it only ever returns 0... Issue 10035 ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@71068 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-06Make the new "agi debug off" CLI command work. (issue #9890 reported by eliel)file1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67597 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-20res_agi needs to export two symbols (ast_agi_register and ↵file1-1/+4
ast_agi_unregister) for usage by others. (issue #9755 reported by mnicholson) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@65250 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-16Merged revisions 54771 via svnmerge from oej1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r54771 | oej | 2007-02-16 12:38:03 +0100 (Fri, 16 Feb 2007) | 2 lines Issue #9069 - If we open with TH we should not close with /TD. (seanbright) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@54772 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-11Merged revisions 48374 via svnmerge from tilghman1-6/+18
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r48374 | tilghman | 2006-12-10 18:33:59 -0600 (Sun, 10 Dec 2006) | 5 lines When doing a fork() and exec(), two problems existed (Issue 8086): 1) Ignored signals stayed ignored after the exec(). 2) Signals could possibly fire between the fork() and exec(), causing Asterisk signal handlers within the child to execute, which caused nasty race conditions. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48375 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-02More changes making the CLI more consistent with "category verb arguments" ↵tilghman1-1/+1
(continuation of issue 8236) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47053 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-02Reverse change of "show" to "list" and make several other commands more ↵tilghman1-3/+3
consistent with "category verb arguments" git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47051 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-31Merged revisions 46557 via svnmerge from russell1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r46557 | russell | 2006-10-31 01:13:09 -0500 (Tue, 31 Oct 2006) | 3 lines fix some copy/paste bugs in the checking of arguments for the "control stream file" AGI command (issue #8255, mnicholson) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@46558 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-27We should always be using _exit() after a fork() or vfork() instead of exit().russell1-2/+2
This is because exit() does some extra cleanup which in some implementations of vfork(), for example, can actually modify the state of the parent process, causing very weird bugs or crashes. (issue #7971, Nick Gavrikov) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@46363 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-24Fix FastAGI when there is no pid (bug #7628, #8147)markster1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@46142 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-20move more API into the ast_ namespacekpfleming1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43310 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-18merge qwell's CLI verbification workkpfleming1-23/+47
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43212 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-06Merged revisions 42148 via svnmerge from file1-1/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r42148 | file | 2006-09-06 16:02:59 -0400 (Wed, 06 Sep 2006) | 2 lines Don't close the second file descriptor if it's the same as the first one, as it will have already been closed elsewhere and could cause massive panic. (issue #7699 reported by bn999) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@42149 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-31Merge in VLDTMF support with Zaptel/Core done by the ever great Darumkilla ↵file1-0/+2
Russell Bryant and the RTP portion done by myself, Muffinlicious Joshua Colp. This has gone through so many discussions/revisions it's not funny but we finally have it! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41507 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-23Merged revisions 40901 via svnmerge from tilghman1-4/+5
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r40901 | tilghman | 2006-08-23 11:05:26 -0500 (Wed, 23 Aug 2006) | 2 lines Revert last change - breaks retrieval of builtin variables ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40904 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-20/+7
- 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: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-15Merged revisions 39935 via svnmerge from russell1-5/+4
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r39935 | russell | 2006-08-15 18:49:41 -0400 (Tue, 15 Aug 2006) | 3 lines use pbx_builtin_getvar_helper() so that GET VARIABLE can retrieve global variables (issue #7609) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39936 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-08Merge team/russell/ast_verbose_threadstoragerussell1-1/+1
- instead of defining a free() wrapper in a bunch of files, define it as ast_free() in utils.h and remove the copies from all the files. - centralize and abstract the code used for doing thread storage. The code lives in threadstorage.h, with one function being implemented in utils.c. This new API includes generic thread storage as well as special functions for handling thread local dynamic length string buffers. - update ast_inet_ntoa() to use the new threadstorage API - update ast_state2str() to use the new threadstorage API - update ast_cli() to use the new threadstorage API - Modify manager_event() to use thread storage. Instead of using a buffer of 4096 characters as the workspace for building the manager event, use a thread local dynamic string. Now there is no length limitation on the length of the body of a manager event. - Significantly simplify the handling of ast_verbose() ... - Instead of using a static char buffer and a lock to make sure only one thread can be using ast_verbose() at a time, use a thread local dynamic string as the workspace for preparing the verbose message. Instead of locking around the entire function, the only locking done now is when the message has been built and is being deliviered to the list of registered verbose message handlers. - This function was doing a strdup() on every message passed to it and keeping a queue of the last 200 messages in memory. This has been completely removed. The only place this was used was that if there were any messages in the verbose queue when a verbose handler was registered, all of the messages in the queue would be fed to it. So, I just made sure that the console verbose handler and the network verbose handler (for remote asterisk consoles) were registered before any verbose messages. pbx_gtkconsole and pbx_kdeconsole will now lose a few verbose messages at startup, but I didn't feel the performance hit of this message queue was worth saving the initial verbose output for these very rarely used modules. - I have removed the last three arguments to the verbose handlers, leaving only the string itself because they aren't needed anymore. For example, ast_verbose had some logic for telling the verbose handler to add a newline if the buffer was completely full. Now that the buffer can grow as needed, this doesn't matter anymore. - remove unused function, ast_verbose_dmesg() which was to dispatch the message queue - Convert the list of verbose handlers to use the linked list macros. - add missing newline characters to a few ast_verbose() calls - convert the list of log channels to use the linked list macros in logger.c - fix close_logger() to close all of the files it opened for logging - update ast_log() to use a thread local dynamic string for its workspace for preparing log messages instead of a buffer of size BUFSIZ (8kB on my system) allocated on the stack. The dynamic string in this case is limited to only growing to a maximum size of BUFSIZ. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39272 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-20add a verbose message to the AGI command, STREAM FILE, similar to therussell1-1/+9
verbose messages when using Playback, Background, or the GET DATA command (issue #7297, softins) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38021 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-19merge Russell's 'hold_handling' branch, finally implementing music-on-hold ↵kpfleming1-1/+1
handling the way it was decided at AstriDevCon Europe 2006 (and the way people really want it to be) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37988 f38db490-d61c-443f-a65b-d21fe96a405b