summaryrefslogtreecommitdiff
path: root/main
AgeCommit message (Collapse)Author
2007-11-16remove duplicate headers.Luigi Rizzo
Properly check for netdb.h (there is actually tens of places to fix) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
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: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Fixing a problem pointed out by QwellMark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Added some locks that should have been around astman_send_error,Mark Michelson
at least according to the comments. (closes issue #11258, reported and patched by eliel) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16This corrects a hashtab removal, given a bad argumentSteve Murphy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16This fixes a problem with pattern ranges; and corrects a situation in ↵Steve Murphy
res_features, where an extension would be created with the name Zap/51, as an example. THe / is bad because it would tend to mean that the 51 is to be cid matched. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Merged revisions 89325 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89325 | kpfleming | 2007-11-16 10:47:46 -0600 (Fri, 16 Nov 2007) | 4 lines To help combat problems where people build external modules (asterisk-addons or others) and then change the build options of the Asterisk build in a way that makes the incompatible without warning, this commit introduces an MD5 signature of the important build-time options and includes that signature into modules when they are built. When the loader loads one of these modules and notices the problem, it will emit a warning to console and refuse to initialize the module, as doing so could cause the system to be unstable or even crash. If you upgrade to this version of Asterisk, you must rebuild *all* of your modules that came from other sources before trying to run this version. If you are using Digium's G.729 binary codec module, you will need v33 or newer. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16add a small new function to retrieve variables from a configLuigi Rizzo
once we have a pointer to the category. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15If we're going to be passing a negative value for the size of a stringfield,Tilghman Lesher
in order to indicate something, then using an UNSIGNED parameter is bad, mmmmmkay? git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15Get rid of a previously missed ast_log call for debug, no longer nec.Steve Murphy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15Perhaps I went overboard on initializing things. I can remove unnecc. stuff ↵Steve Murphy
later. A few bug fixes. Killing small bugs on the way to killing bigger ones. Removed locking on hashtabs; there's plenty of locks already being taken. A small bug in the root_tree hashtab compare func. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15access channel locks through ast_channel_lock/unlock/trylock and notLuigi Rizzo
through ast_mutex primitives. To detect all occurrences, I have renamed the lock field in struct ast_channel so it is clear that it shouldn't be used directly. There are some uses in res/res_features.c (see details of the diff) that are error prone as they try and lock two channels without caring about the order (or without explaining why it is safe). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15Merged revisions 89288 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89288 | mmichelson | 2007-11-15 08:57:28 -0600 (Thu, 15 Nov 2007) | 3 lines Undoing previous commit since I realize it was wrong ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15Merged revisions 89286 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89286 | mmichelson | 2007-11-15 08:54:10 -0600 (Thu, 15 Nov 2007) | 4 lines Adding a missing mutex unlock. (closes issue 11256, reported and patched by ys) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15Had trouble playing with parking; spent a long time trying to reason out ↵Steve Murphy
MATCHMORE mode. made these updates and xfers on zaptel lines seem to work ok now git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15Merged revisions 89275 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89275 | tilghman | 2007-11-14 17:23:58 -0600 (Wed, 14 Nov 2007) | 5 lines When a recording ends with '#', we are improperly trimming an extra 200ms from the recording. Reported by: sim Patch by: tilghman Closes issue #11247 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14TypoTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14Add callerid to the Hangup manager event.Tilghman Lesher
Reported by: outtolunc Patch by: outtolunc Closes issue #11248 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14Rescaled the weights of the patterns to give something more independent of ↵Steve Murphy
pattern length; and make . less likely to win. Question: which should win for 14102241145-- _1xxxxxxx. or _XXXXXXXXXXX -- right now, the pure X pattern will win. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14A further problem highlighted by 11233 has been resolved; a certain ↵Steve Murphy
combination of patterns in a certain order, led to a malformed trie, due to a ptr not being initialized in the loop. Also, some tree printing prettifications. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14One more typo in config.c; and missed conversions due to the constifying of ↵Tilghman Lesher
ast_variable_new parameters git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14TypoTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14make the 'name' and 'value' fields in ast_variable const char *Luigi Rizzo
This prevents modifying the strings in the stored variables, and catched a few instances where this was actually done. Given the differences between trunk and 1.4 (and the fact that this is effectively an API change) it is better to fix 1.4 independently. These are chan_sip.c::sip_register() chan_skinny.c:: near line 2847 config.c:: near line 1774 logger.c::make_components() res_adsi.c:: near line 1049 I may have missed some instances for modules that do not build here. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14Fix up various coding guidelines issues ...Russell Bryant
- handle memory allocation failures - add an ast_ prefix to a publicly exported function - put curly braces in the right places - add a bunch of spaces where they should be be used git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14Merged revisions 89260 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89260 | file | 2007-11-13 21:15:12 -0400 (Tue, 13 Nov 2007) | 4 lines Return the proper value when the srv_callback function executes properly. (closes issue #11240) Reported by: jtodd ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14use simpler technique for removing known entries from listsKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14- Simplify removing an item from a listRussell Bryant
- move a verbose message to after the item is added to the list - make use of the ARRAY_LEN macro in one spot git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13This hopefully will fix the re-opened 11233. Hadn't covered the case of a ↵Steve Murphy
context with no patterns. (blush) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13closes issue #11233 -- where some fine points in the algorithm to build the ↵Steve Murphy
tree needed to be corrected. Many thanks for the test case, jtodd git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13Merged revisions 89239 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89239 | tilghman | 2007-11-13 07:51:53 -0600 (Tue, 13 Nov 2007) | 4 lines Debugging is running into the 16-lock limit. Increase to avoid. (This define is only effective when debugging is turned on, so there's no effect for most installations.) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12Doxygen fixes.Jason Parker
Also fix a common typo I kept seeing (arguement) in various files. Closes issue #11222, patch by snuffy (with arguement > argument by me). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12Thanks to snuff-work, who brought up that these fixes might need to be made.Steve Murphy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12Merged revisions 89194 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89194 | qwell | 2007-11-12 14:46:52 -0600 (Mon, 12 Nov 2007) | 1 line Fix a typo pointed out by De_Mon on #asterisk-dev ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12Based on a note in asterisk-dev by Brian Capouch, I determined I too ↵Steve Murphy
agressive in not initializing arrays passed to pbx_substitute_variables_xxxx; I reviewed the code (again) and hopefully found every possible spot where substitute_variables is called conditionally, and made sure the char array involved was set to a null string. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12Merged revisions 89184 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89184 | tilghman | 2007-11-12 11:29:17 -0600 (Mon, 12 Nov 2007) | 5 lines Fix two cases of memory corruption caused by background threads. Reported by: atis Patch by: tilghman Fixes issue #10923 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-09This is the perhaps the biggest, boldest, most daring change I've ever ↵Steve Murphy
committed to trunk. Forgive me in advance any disruption this may cause, and please, report any problems via the bugtracker. The upside is that this can speed up large dialplans by 20 times (or more). Context, extension, and priority matching are all fairly constant-time searches. I introduce here my hashtables (hashtabs), and a regression for them. I would have used the ast_obj2 tables, but mine are resizeable, and don't need the object destruction capability. The hashtab stuff is well tested and stable. I introduce a data structure, a trie, for extension pattern matching, in which knowledge of all patterns is accumulated, and all matches can be found via a single traversal of the tree. This is per-context. The trie is formed on the first lookup attempt, and stored in the context for future lookups. Destruction routines are in place for hashtabs and the pattern match trie. You can see the contents of the pattern match trie by using the 'dialplan show' cli command when 'core set debug' has been done to put it in debug mode. The pattern tree traversal only traverses those parts of the tree that are interesting. It uses a scoreboard sort of approach to find the best match. The speed of the traversal is more a function of the length of the pattern than the number of patterns in the tree. The tree also contains the CID matching patterns. See the source code comments for details on how everything works. I believe the approach general enough that any issues that might come up involving fine points in the pattern matching algorithm, can be solved by just tweaking things. We shall see. The current pattern matcher is fairly involved, and replicating every nuance of it is difficult. If you find and report problems, I will try to resolve than as quickly as I can. The trie and hashtabs are added to the existing context and exten structs, and none of the old machinery has been removed for the sake of the multitude of functions that use them. In the future, we can (maybe) weed out the linked lists and save some space. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08Merged revisions 89125 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 (closes issue #11203) ........ r89125 | qwell | 2007-11-08 17:52:35 -0600 (Thu, 08 Nov 2007) | 4 lines Properly say the seconds here.. Issue 11203, fix described by vma. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08AST_LIST_REMOVE_CURRENT takes only one argument.Mark Michelson
Thanks to snuffy for pointing this out on IRC git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08use %d and cast to int instead of %zd for size_t object,Luigi Rizzo
this helps portability. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08Merged revisions 89105 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89105 | kpfleming | 2007-11-08 00:26:47 -0500 (Thu, 08 Nov 2007) | 2 lines fix a glaring bug in the new SRV record handling that would cause incorrect weight sorting ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08improve linked-list macros in two ways:Kevin P. Fleming
- 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: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07remove a debugging message which i forgot in.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07Fix another CLI command so it doesn't run the real code when called for ↵Russell Bryant
initialization. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Fix up some PBX logic that became broken. The code would exit prematurely ↵Joshua Colp
when it should have been collecting more digits. (closes issue #11175) Reported by: pj git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Commit some cleanups to the format type code.Tilghman Lesher
- Remove the AST_FORMAT_MAX_* types, as these are consuming 3 out of our available 32 bits. - Add a native slin16 type, so that 16kHz codecs can translate without losing resolution. (This doesn't affect anything immediately, until another codec has wb support.) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Merged revisions 89036 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89036 | murf | 2007-11-06 10:52:50 -0700 (Tue, 06 Nov 2007) | 1 line closes issue #8786 - where the [catname](!) and [catname](othercat1,othercat2,...) notation gets dropped across a ConfigUpdate (or any other thing that would cause a config file to be written). While I was at it, I also cleaned up some of the destroy routines to free up comments, which was not being done. Made sure the new struct I introduced is also cleaned up properly at destruction time. My code handles multiple template inclusions. Many thanks to ssokol for his patch, which, while not literally used in the final merge, served as a foundation for the fix. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Remove native bridging check for DTMF based transfers. Thanks to the last ↵Joshua Colp
batch of RTP changes it is no longer required for the media stream to go through Asterisk if DTMF is going over signalling. It will simply reinvite back as needed. (closes issue #11172) Reported by: ibc git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Fix the memory show allocations CLI command so that it doesn't spew out allRussell Bryant
of the current memory allocations when you start Asterisk, when the command's handler gets called for initialization. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Hoping to avoid a crash in OSX for a problem blitzrage foundSteve Murphy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Formatting. Illegaly using some spare spaces from Russell's space-bucket.Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89050 65c4cc65-6c06-0410-ace0-fbb531ad65f3