aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
AgeCommit message (Collapse)AuthorFilesLines
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
2006-07-12Merged revisions 37419 via svnmerge from kpfleming1-5/+0
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r37419 | kpfleming | 2006-07-12 08:54:10 -0500 (Wed, 12 Jul 2006) | 2 lines remove some more bad examples of using printf ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37433 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-12Merged revisions 33693 via svnmerge from russell1-1/+0
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r33693 | russell | 2006-06-12 16:40:11 -0400 (Mon, 12 Jun 2006) | 2 lines fix a place where a frame would be free'd twice ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33694 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-12Merged revisions 33615 via svnmerge from tilghman1-3/+3
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r33615 | tilghman | 2006-06-12 10:27:18 -0500 (Mon, 12 Jun 2006) | 4 lines Move set priority up, because at this point in the code, stdout is no longer the console. If we're unable to set priority, the error goes to Asterisk as if it were an AGI command (issue 7335). ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33616 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07simplify autoconfig include mechanism (make tholo happy he can use lint ↵kpfleming1-4/+4
again :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32846 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-31Merged revisions 31194 via svnmerge from russell1-2/+7
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r31194 | russell | 2006-05-31 19:50:00 -0400 (Wed, 31 May 2006) | 3 lines if the connection to a FastAGI server fails because of a timeout, log a more informative log message ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31195 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-26Add the video stream for AGI function STREAM FILE (issue #5392 reported by ↵file1-34/+56
areski -- minor mods by me) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30547 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-25allow setting a channel variable to disable sending SIGHUP to the AGI processrussell1-2/+8
(issue #6491, original patch by juggie, channel variable patch by corydon, committed patch modified to change variable name and update documentation) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30337 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-25Add the ability to retrieve the exit code of the forked AGI process. If thererussell1-2/+11
is an error executing the AGI script, or the AGI script itself returns a non-zero value, the AGISTATUS variable will now be set to FAILURE instead of SUCCESS. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30328 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-25- add support for setting an AGISTATUS variable that indicates successfulrussell1-27/+48
execution, failure, or if the channel requested hangup. - only return -1 from the application if the application requested hangup. If there was just a failure in execution of the AGI, just set the status variable appropriately and move on in the dialplan. (issue #7121, original patch by Alessandro Polverini, updated patch by srt, committed patch is heavily modified to allow still returning -1 on hangup) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30272 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-24Merged revisions 29973 via svnmerge from kpfleming1-0/+6
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r29973 | kpfleming | 2006-05-24 11:59:20 -0500 (Wed, 24 May 2006) | 2 lines support video recording via AGI 'RECORD FILE' command (issue #7068) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@29988 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-18revert bogus changekpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@28395 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-18Add missing argument to ast_carefulwriteoej1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@28393 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-10remove almost all of the checks of the result from ast_strdupa() or alloca().russell1-2/+0
As it turns out, all of these checks were useless, because alloca will never return NULL. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26451 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-05move ast_carefulwrite from manager.c to utils.c so that cli.c andrussell1-1/+0
res_agi.c no longer depend on manager.h (issue #6397, casper) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25026 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-29a bunch of conversion to ast_channel_*lock (issue #7058)russell1-3/+3
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23355 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-21more NULL "" equivalence in cid fields.rizzo1-4/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@21835 f38db490-d61c-443f-a65b-d21fe96a405b