aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/pbx_ael.c
AgeCommit message (Collapse)AuthorFilesLines
2008-08-08(closes issue #13236)murf1-16/+335
Reported by: korihor Wow, this one was a challenge! I regrouped and ran a new strategy for setting the ~~MACRO~~ value; I set it once per extension, up near the top. It is only set if there is a switch in the extension. So, I had to put in a chunk of code to detect a switch in the pval tree. I moved the code to insert the set of ~~exten~~ up to the beginning of the gen_prios routine, instead of down in the switch code. I learned that I have to push the detection of the switches down into the code, so everywhere I create a new exten in gen_prios, I make sure to pass onto it the values of the mother_exten first, and the exten next. I had to add a couple fields to the exten struct to accomplish this, in the ael_structs.h file. The checked field makes it so we don't repeat the switch search if it's been done. I also updated the regressions. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@136726 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-30(closes issue #13197)murf1-2/+7
Reported by: pj (closes issue #13051) Reported by: pj This patch substitutes commas in the expr supplied to the if () statement, as in if ( expr ) ... This solves both the bugs above, and makes the source symmetric with switch statements, which were earlier reported to need this sort of treatment. I tested this using the examples, both for the compiler and at run time. Looks good. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@134652 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-16(closes issue #13090)murf1-6/+19
Reported by: murf The problem was that, esoteric as it is, because the hangerupper context immediately preceded the std-priv-extent macro, that the checking code accidentally would fall from traversing hangerupper into the std-priv-exten macro, where it would hit the hangerupper in the 'includes', and proceed into an infinite recursion. A small fix to traverse into the statements of the context instead of the context solves this issue. I also added some commented out printfs for debug, which were pretty handy in the face of a dorky gdb. This was a problem around since the package was first written; but evidently pretty rare in turning up in the field. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@131242 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-12in 1.4 the functions still have | as argument seperator.mvanbaak1-1/+1
This commit fixes the use of RAND in the ael random function. (closes issue #13061) Reported by: danpwi git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@130373 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-03as per http://lists.digium.com/pipermail/asterisk-users/2008-June/212934.html,murf1-6/+0
which is a message from Philipp Kempgen, requesting that the WARNING that an extension is empty be reduced to a NOTICE or less, as empty extensions are syntactically possible, and no big deal. With which I agree, and have removed that WARNING message entirely. I think it is not necessary to see this message. It didn't state that a NoOp() was inserted automatically on your behalf, and really, as users, who cares? Why freak out dialplan writers with unnecessary warnings? The details of the machinations a compiler goes thru to produce working assembly code is of little interest to most programmers-- we will follow the unix principal of doing our work silently. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@119929 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-27(closes issue #12302)murf1-53/+96
Reported by: pj Tested by: murf These changes will set a channel variable ~~EXTEN~~ just before generating code for a switch, with the value of ${EXTEN}. The exten is marked as having a switch, and ever after that, till the end of the exten, we substitute any ${EXTEN} with ${~~EXTEN~~} instead in application arguments; (and the ${EXTEN: also). The reason for this, is that because switches are coded using separate extensions to provide pattern matching, and jumping to/from these switch extensions messes up the ${EXTEN} value, which blows the minds of users. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@111341 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-07In response to 10578, I just ran 1.4 thru valgrind; some of the config ↵murf1-2/+5
leakage I've already fixed, but it doesn't hurt to double check. I found and fixed leaks in res_jabber, cdr_tds, pbx_ael. Nothing major, tho. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89088 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-31Included some verbage in the check_includes func, to inform the user that ↵murf1-2/+3
included contexts that have no match in the AEL, might be OK, as AEL cannot check in the extensions.conf or the in-memory contexts, as they may not be there at the time of the check. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@87775 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-26closes issue #11086 where a user complains that references to following ↵murf1-3/+3
contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config, git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@87168 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-03closes issue #10870 ; where a CUT() function call in a switch expr doesn't ↵murf1-8/+29
execute correctly, because the commas in the function args are not converted to vertbars before the func is called. I modified just the switch code to convert the commas to vertbars if there, but if more of these sort of probs are found, I may have to resort to something a little more fundamental. We'll see, I guess. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84544 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-03closes issue #10834 ; where a null input to a switch statement results in a ↵murf1-4/+23
hangup; since switch is implemented with extensions, and the default case is implemented with a '.', and the '.' matches 1 or more remaining characters, the case where 0 characters exist isn't matched, and the extension isn't matched, and the goto fails, and a hangup occurs. Now, when a default case is generated, it also generates a single fixed extension that will match a null input. That extension just does a goto to the default extension for that switch. I played with an alternate solution, where I just tack an extra char onto all the patterns and the goto, but not the default case's pattern. Then even a null input will still have at least one char in it. But it made me nervous, having that extra char in , even if that's a pretty secret and low-level issue. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84511 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01Anything to keep gcc 4.2 happy...murf1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84273 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01closes issue #10777 -- by returning a null for the parse tree when there's ↵murf1-3/+5
really nothing there, and making sure we don't try to do checking on a null tree. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84239 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-22This closes issue #10788 -- The exact same fixes are made here for the first ↵murf1-3/+38
arg in the for(arg1; arg2; arg3) {} statement, as were done for the 3rd arg. It can now be an assignment that will embedded in a Set() app, or a macro call, or an app call. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@83589 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-22This closes issue #10788 -- the 3rd arg in the for statement is now wrapped ↵murf1-5/+40
in Set() only if there's an '=' in that string. Otherwise, if it begins with '&', then a Macro call is generated; otherwise it is made into an app call. A bit more accomodating, keeps the new guys happy, and the guys with ael-1 code should be happy, too git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@83558 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-13memset really, really needs to be used here.murf1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@79363 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-13This patch fixes bug 10411. I added a new regression test, some regression ↵murf1-9/+23
test cleanups git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@79255 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-05this fixes bug 9883, wherein macros were not allowing the includes ↵murf1-1/+23
construct. fixed and tested, looks OK. Now includes can serve as an adjunct to catch. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67526 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-05Added code to automatically add a default case to switches that don't have ↵murf1-0/+27
one. In some cases, rather than fall thru, it results in a goto with -1 result, which terminates the extension; a sort of dialplan seqfault, sort of. This was required to fix bug reported in 9881 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67420 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-02continue in for-loop should go to the incrementer, not the test. As per ↵murf1-1/+1
9435, thanks to marcelbarbulescu git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59688 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-27via 9373 (duplicate context in AEL crashes asterisk), kpfleming pointed on ↵murf1-1/+1
asterisk-dev, that DECLINE in this case the proper thing to do. This change now has it doing the proper thing. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59261 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-26fix for 9373 (duplicate context in AEL crashes asterisk). I turned a ↵murf1-3/+3
duplicate context from a WARNING to an ERROR. Now you get a module load failure, and asterisk just exits. That's better than a crash, right\? git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59228 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-20The fix for the AEL <<security hole>> (bug 9316) is here...murf1-11/+16
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59069 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-02I almost had comma escapes right, but 9184 points out the problem-- the ↵murf1-0/+8
escape is removed by pbx_config, and pbx_ael should also, before sending it down into the pbx engine. Also, you have to insert it back in, if you are generating extensions.conf code from the AEL. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@57426 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-28I was surprised that I had not yet downgraded missing goto targets and macro ↵murf1-10/+38
call defs to a warning, in case they are in extensions.conf; I rectified this problem. Also, A goto in a macro to a target in a catch block was not being found; I fixed this too; the cause was that I needed to treat catch statements like an extension in the find_match code. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@57049 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-22This fixes 8836, according to dnaturalmurf1-2/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51409 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-30A fix for 8661, where the CUT func needed to have comma args converted to ↵murf1-1/+16
vertical bars. I hope this change does little harm. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49061 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-13Clean up last commit to better conform to standards.file1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47558 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-13AEL need not complain about parkedcalls not being found... just confuses usersmurf1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47553 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-25apparently developers are still not aware that they should be use ↵kpfleming1-15/+18
ast_copy_string instead of strncpy... fix up many more users, and fix some bugs in the process git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@46200 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-13Bug 8128 fixed in this release via these changesmurf1-6/+32
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@45103 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-05This mod fixes a problem pointed out by dgarstang. Many thanks to Doug\!murf1-2/+29
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@44488 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-04These changes fix the problems reported in bug 8090murf1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@44380 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-22This commits a change to return MODULE_LOAD_FAILURE on error, and SUCCESS ↵murf1-1/+3
(instead of 0) when all goes well for bug 8004 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43508 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-22If the extensions.ael file not found, or unreadable, we return ↵murf1-0/+6
AST_MODULE_LOAD_DECLINE, as per bug # 8004. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43505 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-19Various updates from PCadach's chan_h323-live branchmattf1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43294 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-18merge qwell's CLI verbification workkpfleming1-9/+26
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43212 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-25Changes to fix all problems reported in 7804 are included here.murf1-9/+64
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41150 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-22Make a warning about an unused function & variable go away on the stand ↵file1-1/+6
alone AEL build. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40819 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-23/+14
- 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-08Merge team/russell/ast_verbose_threadstoragerussell1-12/+2
- 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-08-07The contents of branch teams/murf/bug_7598 are being folded in here.murf1-62/+339
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39151 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-01This branch will resolve the bug 7635.murf1-0/+25
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38652 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-19committing a fix for colons in goto arguments and suppressing operator ↵murf1-36/+38
messages in globals assignments. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37925 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-18merge changes from team/murf/AEL-trunk-fixesonlyrussell1-17/+30
- fix callerid matching for extensions - fix nested switch statements - fix compilation with bison 2.1a or higher (issue #7309) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@34665 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-01Bug 7062 - Rename ael2 CLI commands to aeltilghman1-9/+9
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@24075 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-30make destroy_pval able to handle a NULL valuerizzo1-0/+5
(the warning should be removed); define a 'elements_block' rule to simplify some other rules removing duplicated code - runtests seems happy with this. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23613 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-26include/asterisk/ael_structs.h:rizzo1-13/+23
- protect against multiple includes of ael_structs.h - remove prototypes for unused or undeclared functions pbx/ael/ael.y - staticize functions as appropriate - constify arguments - remove useless extern pbx/ael/ael.flex - ifdef out unused functions pbx/pbx_ael.c - constify some variables and arguments - ifdef out unused functions - staticize functions as appropriate update generated files accordingly git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22654 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-25fix variable declaration in the middle of a blockrizzo1-2/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22413 f38db490-d61c-443f-a65b-d21fe96a405b