aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
AgeCommit message (Collapse)AuthorFilesLines
2007-11-22remove a number of #include <fcntl.h> which are eitherrizzo1-1/+0
useless or done elsewhere git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89516 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21remove a bunch of useless #include "options.h"rizzo1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89511 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-20move asterisk/paths.h outside asterisk.h and into those filesrizzo1-0/+1
who really need it. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89466 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-19include "logger.h" and errno.h from asterisk.h - usage shows that theyrizzo1-2/+0
were included almost everywhere. Remove some of the instances. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89424 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-17start using asterisk/network.h for network related headers.rizzo1-5/+1
Also remove some unnecessary includes. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89380 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16remove a bunch of duplicate includesrizzo1-1/+0
Reproduce with grep -r #include . | grep -v .svn | grep -v Binary | sort | uniq -c | sort -nr git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89348 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16Start untangling header inclusion in a way that does not affectrizzo1-6/+0
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: http://svn.digium.com/svn/asterisk/trunk@89333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08improve linked-list macros in two ways:kpfleming1-2/+2
- the *_CURRENT macros no longer need the list head pointer argument - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89106 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-07Print out the channel name as a prefix to the "agi debug" output. This makesrussell1-89/+94
AGI debugging on busy systems much easier. (closes issue #10730) Reported by: junky Patches: agi_debug_chan.diff uploaded by junky (license 177) 20070923_10730.diff uploaded by mvanbaak (license 7) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89074 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-01This commits the performance mods that give the priority processing engine ↵murf1-1/+1
in the pbx, a 25-30% speed boost. The two updates used, are, first, to merge the ast_exists_extension() and the ast_spawn_extension() where they are called sequentially in a loop in the code, into a slightly upgraded version of ast_spawn_extension(), with a few extra args; and, second, I modified the substitute_variables_helper_full, so it zeroes out the byte after the evaluated string instead of demanding you pre-zero the buffer; I also went thru the code and removed the code that zeroed this buffer before every call to the substitute_variables_helper_full. The first fix provides about a 9% speedup, and the second the rest. These figures come from the 'PIPS' benchmark I describe in blogs, conf. reports, etc. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88166 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-22Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former ↵qwell1-3/+3
didn't make much sense git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86820 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-19Convert NEW_CLI to AST_CLI.qwell1-3/+3
Closes issue #11039, as suggested by seanbright. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86536 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01Merged revisions 84236 via svnmerge from russell1-0/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84236 | russell | 2007-10-01 14:56:28 -0500 (Mon, 01 Oct 2007) | 5 lines Add another sanity check in the AGI read loop. We really don't care about 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/trunk@84237 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-18Merged revisions 82929 via svnmerge from russell1-4/+25
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82929 | russell | 2007-09-18 17:42:27 -0500 (Tue, 18 Sep 2007) | 11 lines Add a new patch to handle interrupting the fgets() call when using FastAGI. 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/trunk@82931 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-18(issue #10724)qwell1-87/+86
Reported by: eliel Patches: res_features.c.patch uploaded by eliel (license 64) res_agi.c.patch uploaded by seanbright (license 71) res_musiconhold.c.patch uploaded by seanbright (license 71) pbx.c.patch uploaded by moy (license 222) logger.c.patch uploaded by moy (license 222) frame.c.patch uploaded by moy (license 222) manager.c.patch uploaded by moy (license 222) http.c.patch uploaded by moy (license 222) dnsmgr.c.patch uploaded by moy (license 222) res_realtime.c.patch uploaded by eliel (license 64) res_odbc.c.patch uploaded by seanbright (license 71) res_jabber.c.patch uploaded by eliel (license 64) chan_local.c.patch uploaded by eliel (license 64) chan_agent.c.patch uploaded by eliel (license 64) chan_alsa.c.patch uploaded by eliel (license 64) chan_features.c.patch uploaded by eliel (license 64) chan_sip.c.patch uploaded by eliel (license 64) RollUp.1.patch (includes all of the above patches) uploaded by seanbright (license 71) Convert many CLI commands to the NEW_CLI format. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82930 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-12Merged revisions 82296 via svnmerge from russell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82296 | russell | 2007-09-12 16:56:32 -0500 (Wed, 12 Sep 2007) | 3 lines Fix a check of the wrong pointer, as pointed out by an XXX comment left in the code. The problem was harmless, however. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82297 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-12Merged revisions 82278 via svnmerge from russell1-16/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82278 | russell | 2007-09-12 10:11:11 -0500 (Wed, 12 Sep 2007) | 3 lines revert patch from issue #10553, as someone not using fastagi reported that this broke their system. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82279 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11Remove an unused variable. I have no idea why this was marked with the unusedrussell1-1/+0
attribute instead of just removing it. :) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82247 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11Merged revisions 82245 via svnmerge from russell1-7/+25
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82245 | russell | 2007-09-11 10:26:51 -0500 (Tue, 11 Sep 2007) | 9 lines (closes issue #10553) 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/trunk@82246 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-10(closes issue #10684)file1-5/+7
Reported by: junky Patches: debug.diff uploaded by junky (license 177) Fix issue with debug always showing up. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82076 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-23Merged revisions 80469 via svnmerge from russell1-8/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80469 | russell | 2007-08-23 10:49:28 -0500 (Thu, 23 Aug 2007) | 2 lines Revert res_agi fix that didn't quite work until we get it right ... ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80470 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22Merged revisions 80360 via svnmerge from russell1-1/+9
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80360 | russell | 2007-08-22 14:53:30 -0500 (Wed, 22 Aug 2007) | 5 lines Juggie in #asterisk-dev was reporting problems where fgets would return 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/trunk@80361 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-01Twould help if we actually defined ->mod before comparing against it ↵tilghman1-19/+20
(reported and fixed by Juggie via IRC). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77851 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-31Mostly cleanup of documentation to substitute the pipe with the comma, but a ↵tilghman1-1/+1
few other formatting cleanups, too. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77808 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-30Fix the return value of ast_agi_fdprintf() to include the result from ↵russell1-3/+1
ast_carefulwrite() git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77792 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-30Improve ast_agi_fdprintf() by using the ast_str() API.russell1-6/+12
* Use a thread local ast_str for building the string that will be written out to the console for debug, and to the FD for the AGI itself, instead of allocating a buffer on the heap every time the function is called. * Use the information contained within the ast_str to determine how many bytes need to be written instead of calling strlen(). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77791 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-30Merged revisions 77788 via svnmerge from russell1-4/+6
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r77788 | russell | 2007-07-30 14:13:31 -0500 (Mon, 30 Jul 2007) | 10 lines (closes issue #10279) 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/trunk@77789 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-30Cleanup of res_agi, ensuring thread safety (closes issue #10288)tilghman1-111/+134
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77787 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-30Merged revisions 77783 via svnmerge from tilghman1-1/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r77783 | tilghman | 2007-07-30 13:43:55 -0500 (Mon, 30 Jul 2007) | 10 lines Merged revisions 77782 via svnmerge from 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/trunk@77784 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-26Do a massive conversion for using the ast_verb() macrorussell1-10/+5
(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: http://svn.digium.com/svn/asterisk/trunk@77299 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-23You need to put static in front of a static RWLIST declaration to make it ↵file1-2/+1
really static... and don't call AST_RWLIST_HEAD_DESTROY on a statically declared list. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@76711 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-23Enhance AGI with several fixes:tilghman1-170/+194
- Makes the structures handling external AGI commands a bit more thread-safe - Makes AGI transparently work with both live and hungup channels - DeadAGI is hence no longer necessary and is deprecated - CLI bug fixes - Commands will refuse to run if the channel is dead and the command is nonsensical for dead channels. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@76707 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-23Missed one conversion to comma delimiter (thanks, Juggie) and add ↵tilghman1-7/+10
documentation on the change to the Local channel name. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@76704 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-19(closes issue #10210, reported and patched by juggie)russell1-4/+13
This merges the trunk only part of the patches from this issue. In 1.4, res_agi will issue a warning if you try to use DeadAGI on a channel that is not hung up. Now, in trunk, it just plain won't let you do it. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75930 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-17Merged revisions 75401 via svnmerge from russell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r75401 | russell | 2007-07-17 14:45:07 -0500 (Tue, 17 Jul 2007) | 3 lines Remove a duplicated newline character in AGI debug output. (closes issue #10207, patch by seanbright) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75402 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-16It is no longer required for each module that deals with a channel to call ↵file1-1/+0
ast_module_user_hangup_all in it's unload function. The loader will automatically perform this action for it. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75183 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-11Code cleanup of res_agifile1-111/+81
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@74713 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-02After some discussion on the asterisk-dev list, we determined that this approachrussell1-72/+0
for extracting application, function, manager, and agi documentation is the wrong one to take. The most severe problem is that the output depends on which modules are loaded as well as compile time options, which both determine which parts are available. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@72986 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-02Fix up the AGI doc dump CLI command and update the AGI commands tex file to notrussell1-0/+3
include a bunch of empty entries. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@72939 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-02Add a CLI command to export the AGI command docsrussell1-0/+69
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@72931 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-02Add a note that the AGI commands array is not handled in a thread-safe wayrussell1-0/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@72930 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-25Merged revisions 71657 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r71657 | tilghman | 2007-06-25 13:14:59 -0500 (Mon, 25 Jun 2007) | 10 lines Merged revisions 71656 via svnmerge from 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/trunk@71658 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-25Minor header inclusion tweak for new usage of stat()file1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@71521 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-22Use stat to determine whether the file exists or not. (issue #10038 reported ↵file1-2/+3
by Mike Anikienko) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@71158 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-22Merged revisions 71068 via svnmerge from qwell1-15/+5
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r71068 | qwell | 2007-06-22 10:00:30 -0500 (Fri, 22 Jun 2007) | 12 lines Merged revisions 71065 via svnmerge from 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/trunk@71069 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-21Expand AGISTATUS variable to include NOTFOUND which is set when the AGI file ↵file1-2/+13
could not be found. (issue #9285 reported by srdjan) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@70731 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-14Add a massive set of changes for converting to use the ast_debug() macro.russell1-8/+4
(issue #9957, patches from mvanbaak, caio1982, critch, and dimas) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69327 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-08Add an option for ControlPlayback to be able to start at an offset fromrussell1-1/+1
the beginning of the file. Also, add a channel variable that indicates the location in the file where the Playback was stopped. (closes issue #7655, patch from sharkey) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@68502 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-06Issue 9869 - replace malloc and memset with ast_calloc, and other coding ↵tilghman1-2/+2
guidelines changes git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67864 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-06Merged revisions 67597 via svnmerge from file1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r67597 | file | 2007-06-06 08:34:06 -0400 (Wed, 06 Jun 2007) | 2 lines Make the new "agi debug off" CLI command work. (issue #9890 reported by eliel) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67598 f38db490-d61c-443f-a65b-d21fe96a405b