Commit Graph

71 Commits

Author SHA1 Message Date
Steve Murphy
164d8a5e61 In response to 10578, I just ran 1.4 thru valgrind; some of the config 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@89088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07 21:40:28 +00:00
Steve Murphy
6addd141d9 Included some verbage in the check_includes func, to inform the user that 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@87775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31 03:51:52 +00:00
Steve Murphy
4c7393a6a4 closes issue #11086 where a user complains that references to following 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@87168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-26 16:34:02 +00:00
Steve Murphy
563c9e74a2 closes issue #10870 ; where a CUT() function call in a switch expr doesn't 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@84544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03 18:20:07 +00:00
Steve Murphy
ed75fa38e9 closes issue #10834 ; where a null input to a switch statement results in a 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@84511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03 14:23:00 +00:00
Steve Murphy
8bf81e2bac Anything to keep gcc 4.2 happy...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 21:18:40 +00:00
Steve Murphy
b7f66e48e8 closes issue #10777 -- by returning a null for the parse tree when there's really nothing there, and making sure we don't try to do checking on a null tree.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 20:27:52 +00:00
Steve Murphy
4cd59ff447 This closes issue #10788 -- The exact same fixes are made here for the first 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@83589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-22 19:39:16 +00:00
Steve Murphy
eef551c063 This closes issue #10788 -- the 3rd arg in the for statement is now wrapped 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@83558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-22 16:41:43 +00:00
Steve Murphy
7d83255ef8 memset really, really needs to be used here.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 22:40:06 +00:00
Steve Murphy
9020699e0a This patch fixes bug 10411. I added a new regression test, some regression test cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 17:49:54 +00:00
Steve Murphy
dc63d79143 this fixes bug 9883, wherein macros were not allowing the includes construct. fixed and tested, looks OK. Now includes can serve as an adjunct to catch.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 21:30:18 +00:00
Steve Murphy
b698ff265b Added code to automatically add a default case to switches that don't have 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@67420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 18:17:28 +00:00
Steve Murphy
48b277a047 continue in for-loop should go to the incrementer, not the test. As per 9435, thanks to marcelbarbulescu
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-02 17:31:32 +00:00
Steve Murphy
bd5967ea0c via 9373 (duplicate context in AEL crashes asterisk), kpfleming pointed on asterisk-dev, that DECLINE in this case the proper thing to do. This change now has it doing the proper thing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 18:16:32 +00:00
Steve Murphy
1f08db56c5 fix for 9373 (duplicate context in AEL crashes asterisk). I turned a 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@59228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 21:41:32 +00:00
Steve Murphy
6e869d135c The fix for the AEL <<security hole>> (bug 9316) is here...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-20 17:43:02 +00:00
Steve Murphy
9fab305234 I almost had comma escapes right, but 9184 points out the problem-- the 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@57426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-02 05:21:36 +00:00
Steve Murphy
96622ddd26 I was surprised that I had not yet downgraded missing goto targets and macro 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@57049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 17:15:27 +00:00
Steve Murphy
99ce040a80 This fixes 8836, according to dnatural
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-22 19:28:51 +00:00
Steve Murphy
eae46d9a28 A fix for 8661, where the CUT func needed to have comma args converted to vertical bars. I hope this change does little harm.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-30 00:40:37 +00:00
Joshua Colp
c71a6b9004 Clean up last commit to better conform to standards.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 17:38:44 +00:00
Steve Murphy
dc8dca7807 AEL need not complain about parkedcalls not being found... just confuses users
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 17:13:20 +00:00
Kevin P. Fleming
ce4b0afb73 apparently developers are still not aware that they should be use ast_copy_string instead of strncpy... fix up many more users, and fix some bugs in the process
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 14:32:08 +00:00
Steve Murphy
dc04209898 Bug 8128 fixed in this release via these changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 20:52:17 +00:00
Steve Murphy
25b33fd0c8 This mod fixes a problem pointed out by dgarstang. Many thanks to Doug\!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-05 18:21:39 +00:00
Steve Murphy
c37666252d These changes fix the problems reported in bug 8090
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 19:57:08 +00:00
Steve Murphy
73b0ed54b9 This commits a change to return MODULE_LOAD_FAILURE on error, and SUCCESS (instead of 0) when all goes well for bug 8004
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 21:36:10 +00:00
Steve Murphy
3836bbd557 If the extensions.ael file not found, or unreadable, we return AST_MODULE_LOAD_DECLINE,
as per bug # 8004.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 21:08:36 +00:00
Matthew Fredrickson
33ddb53663 Various updates from PCadach's chan_h323-live branch
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-19 21:07:49 +00:00
Kevin P. Fleming
fcb999c01c merge qwell's CLI verbification work
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-18 19:54:18 +00:00
Steve Murphy
51132bbdbf Changes to fix all problems reported in 7804 are included here.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41150 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-25 20:43:51 +00:00
Joshua Colp
7734efb97b Make a warning about an unused function & variable go away on the stand alone AEL build.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-22 02:24:46 +00:00
Kevin P. Fleming
0a27d8bfe5 merge new_loader_completion branch, including (at least):
- 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-21 02:11:39 +00:00
Russell Bryant
92bd7f19f7 Merge team/russell/ast_verbose_threadstorage
- 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: https://origsvn.digium.com/svn/asterisk/trunk@39272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-08 06:32:04 +00:00
Steve Murphy
14c12fed9b The contents of branch teams/murf/bug_7598 are being folded in here.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-07 12:59:47 +00:00
Steve Murphy
f67f6b2261 This branch will resolve the bug 7635.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-01 19:03:32 +00:00
Steve Murphy
db0b142b06 committing a fix for colons in goto arguments and suppressing operator messages in globals assignments.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-19 02:55:24 +00:00
Russell Bryant
73ae55698f merge changes from team/murf/AEL-trunk-fixesonly
- fix callerid matching for extensions
 - fix nested switch statements
 - fix compilation with bison 2.1a or higher
(issue #7309)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@34665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-18 21:36:24 +00:00
Kevin P. Fleming
472c1ca282 simplify autoconfig include mechanism (make tholo happy he can use lint again :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-07 18:54:56 +00:00
Tilghman Lesher
9be0f34a3e Bug 7062 - Rename ael2 CLI commands to ael
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@24075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-01 22:07:18 +00:00
Luigi Rizzo
f4b05f86cc make destroy_pval able to handle a NULL value
(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: https://origsvn.digium.com/svn/asterisk/trunk@23613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-30 12:30:08 +00:00
Luigi Rizzo
aaf99191c8 include/asterisk/ael_structs.h:
- 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: https://origsvn.digium.com/svn/asterisk/trunk@22654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-26 22:41:16 +00:00
Luigi Rizzo
d85048d692 fix variable declaration in the middle of a block
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@22413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-25 17:06:37 +00:00
Kevin P. Fleming
5f58cc8770 Merge Steve Murphy's (murf) complete re-implementation of AEL, which is now no longer considered experimental :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@22273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-24 17:41:27 +00:00
Luigi Rizzo
e43bc6634d This rather large commit changes the way modules are loaded.
As partly documented in loader.c and include/asterisk/module.h,
modules are now expected to return all of their methods and flags
into a structure 'mod_data', and are normally loaded with RTLD_NOW
| RTLD_LOCAL, so symbols are resolved immediately and conflicts
should be less likely.  Only in a small number of cases (res_*,
typically) modules are loaded RTLD_GLOBAL, so they can export
symbols.
 
The core of the change is only the two files loader.c and
include/asterisk/module.h, all the rest is simply adaptation of the
existing modules to the new API, a rather mechanical (but believe
me, time and finger-consuming!) process whose detail you can figure
out by svn diff'ing any single module.

Expect some minor compilation issue after this change, please
report it on mantis http://bugs.digium.com/view.php?id=6968
so we collect all the feedback in one place.

I am just sorry that this change missed SVN version number 20000!



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-14 14:08:19 +00:00
Kevin P. Fleming
f10f427d49 since the module API is changing, it's a good time to const-ify the description() and key() return values
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@18552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-08 22:01:19 +00:00
Russell Bryant
7298d3feb3 Merged revisions 15658 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r15658 | russell | 2006-03-28 13:09:05 -0500 (Tue, 28 Mar 2006) | 2 lines

fix the order in which for loops are expanded (issue #6810)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@15659 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-03-28 18:13:53 +00:00
Tilghman Lesher
84d98f6b84 Merged revisions 7577 via svnmerge from
/branches/1.2


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-12-21 19:24:56 +00:00
Kevin P. Fleming
2c65582b66 remove extraneous svn:executable properties
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-29 18:24:39 +00:00