dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

292 Commits

Author SHA1 Message Date
murf 6499c3c6d4 (closes issue #13557)
Reported by: nickpeirson
Patches:
      pbx.c.patch uploaded by nickpeirson (license 579)
      replace_bzero+bcopy.patch uploaded by nickpeirson (license 579)
Tested by: nickpeirson, murf

1. replaced all refs to bzero and bcopy to memset and memmove instead.
2. added a note to the CODING-GUIDELINES
3. add two macros to asterisk.h to prevent bzero, bcopy from creeping
   back into the source
4. removed bzero from configure, configure.ac, autoconfig.h.in




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@147807 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-09 14:17:33 +00:00
seanbright 84fde73d78 When echoing our copies, strip off ASTTOPDIR from the front of the source file.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@147456 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-08 12:07:19 +00:00
seanbright d75f767ab8 Make NOISY_BUILD work for the calls to cp in utils/Makefile
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@146597 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-06 00:36:37 +00:00
seanbright bc59e1cdde Quote arguments to cp so we can handle spaces in our paths.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@146555 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-06 00:21:49 +00:00
russell ed469812a1 Make this build on my mac.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@146514 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-05 22:11:30 +00:00
kpfleming 0a7b9056c6 remove incorrect comment
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@144951 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-27 16:17:43 +00:00
kpfleming 1c9fffa54c fix bugs caused by r144949 when MALLOC_DEBUG is defined
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@144950 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-27 16:10:33 +00:00
kpfleming db07a1f968 Merged revisions 144924-144925 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r144924 | kpfleming | 2008-09-27 10:00:48 -0500 (Sat, 27 Sep 2008) | 6 lines
  
  improve header inclusion process in a few small ways:
  
    - it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose
    - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled
    - simplify the usage of some of these headers in the AEL-related stuff in the utils directory
........
  r144925 | kpfleming | 2008-09-27 10:13:30 -0500 (Sat, 27 Sep 2008) | 2 lines
  
  fix some minor issues with rev 144924
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@144949 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-27 15:52:56 +00:00
murf fd606789e9 Matt suggests we remove utils/build-extensions-conf.lua, as per bug 12961, it is no longer necessary.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@144635 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-26 16:51:30 +00:00
mmichelson 91df49dd46 Merged revisions 140488 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r140488 | mmichelson | 2008-08-29 12:34:17 -0500 (Fri, 29 Aug 2008) | 22 lines

After working on the ao2_containers branch, I noticed
something a bit strange. In all cases where we provide
a callback function to ao2_container_alloc, the callback
function would only return 0 or CMP_MATCH. After inspecting
the ao2_callback() code carefully, I found that if you're
only looking for one specific item, then you should return
CMP_MATCH | CMP_STOP. Otherwise, astobj2 will continue
traversing the current bucket until the end searching for
more matches.

In cases like chan_iax2 where in 1.4, all the peers are
shoved into a single bucket, this makes for potentially
terrible performance since the entire bucket will be
traversed even if the peer is one of the first ones come
across in the bucket.

All the changes I have made were for cases where the 
callback function defined was passed to ao2_container_alloc
so that calls to ao2_find could find a unique instance
of whatever object was being stored in the container.


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@140489 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-29 17:47:17 +00:00
murf eb6f2fbf21 Oops. put a decl in a generated file. My bad, but fixed now.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@138845 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-19 16:31:24 +00:00
seanbright f21f6ae82a More merges from resolve-shadow warnings:
utils/
  codecs/
  and a change I missed from formats/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@136408 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-07 15:16:48 +00:00
tilghman 34ce9ca0f3 Fix trunk breakage
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@130230 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-11 19:40:55 +00:00
bbryant 8e222897e6 Janitor patch to change uses of sizeof to ARRAY_LEN
(closes issue #13054)
Reported by: pabelanger
Patches:
      ARRAY_LEN.patch2 uploaded by pabelanger (license 224)
Tested by: seanbright


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@130129 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-11 18:09:35 +00:00
mmichelson a406b42210 Remove an unneeded target from the Makefile
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@125799 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-27 14:14:09 +00:00
jpeeler 490730a6b3 Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@122234 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-12 17:27:55 +00:00
russell 869f8f9573 Add lock tracking for rwlocks. Previously, lock.h only had the ability to
hold tracking information for mutexes.  Now, the "core show locks" output
will output information about who is holding a rwlock when a thread is
waiting on it.

(closes issue #11279)
Reported by: ys
Patches:
      trunk_lock_utils.v8.diff uploaded by ys (license 281)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@120064 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-03 18:26:51 +00:00
seanbright fbdb5ab9e6 Avoid build warning when execinfo.h isn't available.
(closes issue #12751)
Reported by: ys
Patches:
      check_expr.diff uploaded by ys (license 281)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@118911 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-29 12:12:07 +00:00
russell b8c45c3168 Fix a linkage error related to the lock backtrace support
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@118695 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-28 15:56:41 +00:00
mmichelson c0ca2a427b A new feature thanks to the fine folks at Switchvox!
If a deadlock is detected, then the typical lock information will be
printed along with a backtrace of the stack for the offending threads.
Use of this requires compiling with DETECT_DEADLOCKS and having glibc
installed.

Furthermore, issuing the "core show locks" CLI command will print the
normal lock information as well as a backtraces for each lock. This
requires that DEBUG_THREADS is enabled and that glibc is installed.

All the backtrace features may be disabled by running the configure
script with --without-execinfo as an argument



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@118173 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-23 22:35:50 +00:00
mmichelson 549f37623b This change makes it so that logs will report the correct source of verbose messages.
Until this change, all verbose messages in Asterisk's log files reported logger.c
as the source of the message.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117693 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-21 22:34:27 +00:00
murf 6a90ea060c These changes were made via the comments atis_work made at 4:30am (Mountain Time zone- US)
in #asterisk-dev on 20 May 2008. He noted that a backslash was being inserted before commas
in app call arguments in the extensions.conf.aeldump file that you get from aelparse with the
-w arg. This was being generated from code left over from 1.4, where commas were substituted
with '|', and any remaining commas needed to be escaped.

Many thanks to atis for his comment; please let us know if these changes break anything!




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117335 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-21 01:00:28 +00:00
tilghman 6410c3d334 Add a set of text to the file astcanary uses to communicate back the main
Asterisk process, which explains the purpose for the file being there.  This
should assist people who find the file and wonder why it exists.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@116948 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-18 21:15:58 +00:00
mmichelson 7a0fd1b758 Get refcounter to build with LOW_MEMORY defined
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115473 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-06 20:15:02 +00:00
murf d3a9bac0e7 Introducing various astobj2 enhancements, chief being a refcount tracing feature, and various documentation updates in astobj2.h, and the addition of standalone utility, refcounter, that will filter the trace output for unbalanced, unfreed objects. This comes from the team/murf/bug11210 branch.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114175 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-16 17:45:28 +00:00
mmichelson e8da1cc73c Merged revisions 114051 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114051 | mmichelson | 2008-04-10 15:59:49 -0500 (Thu, 10 Apr 2008) | 3 lines

Fix 1.4 build when LOW_MEMORY is enabled.


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114052 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-10 22:02:32 +00:00
twilson 9e8ebe6a94 Go through and fix a bunch of places where character strings were being interpreted as format strings. Most of these changes are solely to make compiling with -Wsecurity and -Wformat=2 happy, and were not
actual problems, per se.  I also added format attributes to any printf wrapper functions I found that didn't have them.  -Wsecurity and -Wmissing-format-attribute added to --enable-dev-mode.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@109447 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-18 15:43:34 +00:00
murf 64b640a6f7 Merged revisions 109309 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r109309 | murf | 2008-03-18 00:37:15 -0600 (Tue, 18 Mar 2008) | 17 lines

(closes issue #11903)
Reported by: atis

Many thanks to atis for spotting this problem and reporting it.
The fix was to straighten out how items are placed on and removed
from the file stack. Regressions as well as the provided test case
helped to straighten out all code paths. valgrind was used to make
sure all memory allocated was freed.

Sorry for not solving this earlier. I got distracted.

Added the ntest23 regression test, which is mainly a copy of ntest22, 
but with a few juicy errors thrown in, to replicate the kind of 
error that atis spotted.



........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@109357 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-18 14:09:50 +00:00
kpfleming 00544b6a26 Merged revisions 107352 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r107352 | kpfleming | 2008-03-11 06:04:29 -0500 (Tue, 11 Mar 2008) | 11 lines

fix up various compiler warnings found with gcc-4.3:

- the output of flex includes a static function called 'input' that is not used, so for the moment we'll stop having the compiler tell us about unused variables in the flex source files (a better fix would be to improve our flex post-processing to remove the unused function)

- main/stdtime/localtime.c makes assumptions about signed integer overflow, and gcc-4.3's improved optimizer tries to take advantage of handling potential overflow conditions at compile time; for now, suppress these optimizations until we can fiure out if the code needs improvement

- main/udptl.c has some references to uninitialized variables; in one case there was no bug, but in the other it was certainly possibly for unexpected behavior to occur

- main/editline/readline.c had an unused variable


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@107373 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-11 11:36:51 +00:00
murf 2be361fbb9 (closes issue #6002)
Reported by: rizzo
Tested by: murf

Proposal of the changes to be made, and then an announcement of how they were accomplished:

http://lists.digium.com/pipermail/asterisk-dev/2008-February/032065.html

and:

http://lists.digium.com/pipermail/asterisk-dev/2008-March/032124.html

Here is a recap, file by file, of what I have done:

pbx/pbx_config.c
pbx/pbx_ael.c

All funcs that were passed a ptr to the context list, now will ALSO be passed a hashtab ptr to the same set.
Why? because (for the time being), the dialplan is stored in both, to facilitate a quick, low-cost move to
hash-tables to speed up dialplan processing. If it was deemed necessary to pass the context LIST, well, it
is just as necessary to have the TABLE available. This is because the list/table in question might not be
the global one, but temporary ones we would use to stage the dialplan on, and then swap into the global
position when things are ready.

We now have one external function for apps to use, "ast_context_find_or_create()" instead of the pre-existing
"find" and "create", as all existing usages used both in tandem anyway.

pbx_config, and pbx_ael, will stage the reloaded dialplan into local lists and tables, and 
then call merge_contexts_and_delete, which will merge (now) existing contexts and 
priorities from other registrars into this local set by copying them. Then, merge_contexts_and_delete will
lock down the contexts, swap the lists and tables, and unlock (real quick), and then 
destroy the old dialplan.



chan_sip.c
chan_iax.c
chan_skinny.c

All the channel drivers that would add regcontexts now use the ast_context_find_or_create now.

chan_sip also includes a small fix to get rid of warnings about removing priorities that never got entered.


apps/app_meetme.c
apps/app_dial.c
apps/app_queue.c

All the apps that added a context/exten/priority were also modified to use ast_context_find_or_create instead.


include/asterisk/pbx.h

ast_context_create() is removed. Find_or_create_ is the new method.
ast_context_find_or_create()  interface gets the hashtab added.
ast_merge_contexts_and_delete() gets the local hashtab arg added.
ast_wrlock_contexts_version() is added so you can detect if someone else got a writelock between your readlocking and writelocking.
ast_hashtab_compare_contexts was made public for use in pbx_config/pbx_ael
ast_hashtab_hash_contexts was in like fashion make public.


include/asterisk/pval.h

ast_compile_ael2() interface changed to include the local hashtab table ptr.


main/features.c

For the sake of the parking context, we use ast_context_find_or_create().



main/pbx.c

I changed all the "tree" names to "table" instead. That's because the original
implementation was based on binary trees. (had a free library). Then I moved
to hashtabs. Now, the names move forward too.

refcount field added to contexts, so you can keep track of how many modules
wanted this context to exist.

Some log messages that are warnings were inflated from LOG_NOTICE to LOG_WARNING.

Added some calls to ast_verb(3,...) for debug messages

Lots of little mods to ast_context_remove_extension2, which is now excersized in ways
it was not previously; one definite bug fixed.

find_or_create was upgraded to handle both local lists/tables as well as the globals.

context_merge() was added to do the per-context merging of the old/present contexts/extens/prios into the new/proposed local list/tables

ast_merge_contexts_and_delete() was heavily modified.

ast_add_extension2() was also upgraded to handle changes. 

the context_destroy() code was re-engineered to handle the new way of doing things,
by exten/prio instead of by context.



res/ael/pval.c
res/ael/ael.tab.c
res/ael/ael.tab.h
res/ael/ael.y
res/ael/ael_lex.c
res/ael/ael.flex
utils/ael_main.c
utils/extconf.c
utils/conf2ael.c
utils/Makefile

Had to change the interface to ast_compile_ael2(), to include the hashtab ptr.
This ended up involving several external apps.  The main gotcha was I had to 
include lock.h and hashtab.h in several places.


As a side note, I tested this stuff pretty thoroughly, I replicated the problems
originally reported by Luigi, and made triply sure that reloads worked, and everything
worked thru "stop gracefully". I found a and fixed a few bugs as I was merging into
trunk, that did not appear in my tests of bug6002.

How's this for verbose commit messages?




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@106757 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-07 18:57:57 +00:00
tilghman 84aa522629 Merged revisions 106552 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r106552 | tilghman | 2008-03-07 00:36:33 -0600 (Fri, 07 Mar 2008) | 6 lines

Safely use the strncat() function.
(closes issue #11958)
 Reported by: norman
 Patches: 
       20080209__bug11958.diff.txt uploaded by Corydon76 (license 14)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@106553 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-07 06:54:47 +00:00
russell 020573b8ac Merged revisions 105116 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r105116 | russell | 2008-02-28 16:23:05 -0600 (Thu, 28 Feb 2008) | 8 lines

Fix a bug in the lock tracking code that was discovered by mmichelson.  The issue
is that if the lock history array was full, then the functions to mark a lock as
acquired or not would adjust the stats for whatever lock is at the end of the array,
which may not be itself.  So, do a sanity check to make sure that we're updating
lock info for the proper lock.

(This explains the bizarre stats on lock #63 in BE-396, thanks Mark!)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105144 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-28 22:39:26 +00:00
tilghman 2c90b313b8 open(2) needs a mode argument when O_CREAT is specified.
(Closes issue #12083)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104534 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-27 15:34:28 +00:00
tilghman caa5ed8c50 Ignore some more unused generated events.
(closes issue #12042)
 Reported by: junky
 Patches: 
       astman_events.diff uploaded by junky (license 177)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104014 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-21 05:21:39 +00:00
tilghman d608611c67 Remove extraneous copy
(closes issue #12002)
 Reported by: junky
 Patches: 
       conf2ael.diff uploaded by junky (license 177)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103716 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-15 15:45:33 +00:00
tilghman 95575125cb Merged revisions 102323 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r102323 | tilghman | 2008-02-04 15:06:09 -0600 (Mon, 04 Feb 2008) | 7 lines

Cross-platform fix:  OS X now deprecates the use of the daemon(3) API.
(closes issue #11908)
 Reported by: oej
 Patches: 
       20080204__bug11908.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@102329 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-04 21:15:18 +00:00
murf 94140239f2 The fixes in this commit are mainly to allow compiling of trunk with --enable-dev-mode, mutex profiling, lock debugging, etc. Mainly, the version.c needs to be in the OBJS line; asterisk.h was chosen to have the prototypes for ast_get_version, ast_get_version_num; and the ASTERISK_FILE_VERSION macro needs to be used after including asterisk.h in a few files. I hope I did the right thing. If not, let me know.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@97656 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-10 00:50:39 +00:00
file d2509a4bb7 Make ast_atomic_fetchadd_int_slow magically appear in extconf.
(closes issue #11703)
Reported by: dmartin


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@97041 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-08 15:26:50 +00:00
rizzo 0a8518b7c8 modify http://svn.digium.com/view/asterisk?view=rev&rev=93603
so that paths and filename are writable by asterisk.c without
causing segfaults.

This involves defining the variables as const char *,
and having them point to as static, writable buffer
defined in asterisk.c

On passing, fix some errors in using these variables
in some files in utils/ , and in res/snmp/agent.c
which was redefining a variable without using paths.h

(not applicable to 1.4)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@94168 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-20 09:55:05 +00:00
tilghman 11a5516081 Add a canary process, for high priority mode (asterisk -p) to ensure that if
Asterisk goes into a busy loop, the machine will be recoverable.  We'd still
need to do a restart to put Asterisk back into high priority mode, but at
least a reboot won't be required. (Closes issue #11559)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93804 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-18 23:06:05 +00:00
rizzo 553ab5f770 make configuration variable const so they are not accidentally
modified.
This requires casting the strings in asterisk.c when writing to
them, so we do it through a macro to do it consistently.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93603 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-18 10:24:58 +00:00
rizzo 659205253c remove unnecessary (char *) casts for ast_config_AST_* variables.
There are some left in the .flex files, left to the maintainer...



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93582 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-18 09:46:18 +00:00
file 985bcbeb23 Add ast_atomic_fetchadd_int_slow to check_expr for platforms that need it.
(closes issue #11484)
Reported by: snuffy


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92206 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-10 16:48:18 +00:00
rizzo 9401a82c4d remove relative paths and use ASTTOPDIR instead.
Give a default value to ASTTOPDIR if unset so we can at least
do a 'make clean' without too much trouble.

The proper fix, however, is to partition the top level
Makefile in a 'setup' and a 'main' part, in a way that the
'setup' part can be included from subdirs' Makefiles and
allow targets to be built without going through the
top level Makefile.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92104 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-10 08:40:59 +00:00
rizzo 82d7685704 simplify this file
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92103 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-10 08:35:35 +00:00
rizzo 5d9a306f24 add hashtab.c to the list of files deleted
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92042 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-09 22:55:58 +00:00
rizzo b50ce18fe8 normalize subdirs' Makefile by using ASTTOPDIR and not .. to reference
the top level directory.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92022 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-09 21:29:37 +00:00
rizzo 0c67039eb1 normalize header order, and add a comment on the need
to clean up this file.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91930 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-08 03:27:16 +00:00
russell e40f5364c1 Fix the build of astman. Any file that includes any asterisk sub-headers
needs to first include asterisk.h.
(closes issue #11394)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91029 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-04 23:01:15 +00:00
kpfleming e95d92fac9 let's try this again... *all* compilation and linking in Asterisk should be done using the standard compilation rules, not manually created ones. changing hashtest.c to use these rules caused the compiler to notice a large number of coding guidelines violations, so those are fixed too.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@90150 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-29 13:38:11 +00:00
murf 753634f9ca closes issue #11341; made changes to make utils again right with the MTX_PROFILE world.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89595 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-26 17:46:41 +00:00
rizzo 971fcdc9ff enable support for stack backtrace for stuff built in utils/
(this was present in the main tree but forgotten here).



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89506 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21 21:30:24 +00:00
kpfleming 6d30ebbac7 move these forward declarations back to asterisk.h where they belong... even though asterisk.h includes compat.h, these declarations have nothing to do with the being platform-compatible and are directly related to being part of Asterisk
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89482 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21 16:07:11 +00:00
rizzo 0043b6cd58 more header removal/normalization
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89473 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21 00:23:49 +00:00
rizzo f89608896c move the declaration of struct ast_channel ast_frame and ast_module
to compat.h so it is always available - hopefully this will let
us reduce the number of inclusions of channel.h and frame.h



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89426 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-19 19:36:32 +00:00
rizzo 163cc146a7 more cygwin/mingw32 compatibility fixes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89373 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-17 10:54:52 +00:00
rizzo 1fe4d3a41f add a return NULL to a function that is expected to return a value
so compilers that don't understand that this code is NOTREACHED
will not complain (the fault is not much on the compiler but on the
declaration of pthread_exit on certain platforms)
s/certain platform/cygwin/ if you are really curious



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89368 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-17 09:54:54 +00:00
rizzo ba761e2427 more removal of duplicate #include lines
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89349 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-17 00:02:33 +00:00
rizzo 82c12f8105 remove redundant #include "asterisk/compat.h",
but make sure that asterisk/compiler.h is included everywhere



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89336 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16 21:08:28 +00:00
rizzo 883346d64a Start untangling header inclusion in a way that does not affect
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-16 20:04:58 +00:00
murf 8a1c2d1509 Don't forget the ASTERISK_VERSION for the sake of the mtx_prof stuff.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89201 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-12 23:33:55 +00:00
kpfleming 7d0d020dce (closes issue #11221)
Reported by: eliel
Patches:
      utils.Makefile.patch uploaded by eliel (modified by me) (license 64)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89190 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-12 20:16:13 +00:00
file 4b753c1924 Fix building on FreeBSD by including/not including some headers.
(closes issue #11218)
Reported by: ys
Patches:
      trunk89169.diff uploaded by ys (license 281)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89177 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-12 13:26:45 +00:00
murf aef44ae684 This is the perhaps the biggest, boldest, most daring change I've ever 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: http://svn.digium.com/svn/asterisk/trunk@89129 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-09 16:00:22 +00:00
kpfleming a45a413db3 improve linked-list macros in two ways:
- 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-08 05:28:47 +00:00
rizzo 6ba6ba6e24 Move AUDIO_LIBS outside the top level Makefile. This too is used only
in one place.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88770 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-05 21:36:11 +00:00
tilghman bad99f6a2a Add pbx_lua as a method of doing extensions
Reported by: mnicholson
Patch by: mnicholson
Closes issue #11140


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88250 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-02 15:36:34 +00:00
murf 47c8ea00b8 This commits the performance mods that give the priority processing engine 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-11-01 22:26:51 +00:00
russell d8a12a9c6b Remove another copied source file on "make clean".
(closes issue #11137)
Reported by: IgorG
Patches: 
      addonclean-87971-1.patch uploaded by IgorG (license 20)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88062 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-01 15:18:06 +00:00
kpfleming 9e40a36718 UGH... while trying to fix #10995, I found all kinds of cruft in this Makefile. It should all be gone now, and as a side effect hashtest2 now builds with --enable-dev-mode enabled without a host of errors
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87498 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-29 22:44:49 +00:00
kpfleming 5aafb5a5e4 clean up assembler and preprocessor files if they are here too
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87467 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-29 22:24:44 +00:00
murf 15b76d347e Merged revisions 87168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r87168 | murf | 2007-10-26 10:34:02 -0600 (Fri, 26 Oct 2007) | 1 line

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: http://svn.digium.com/svn/asterisk/trunk@87187 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-26 17:39:39 +00:00
murf 3af535a31c and then, I noticed the clicompat stuff.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86182 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17 20:06:28 +00:00
murf b45a66b50e more stub routines to allow linkage in stand-alone environment, with thread debugs turned on
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86181 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17 19:59:49 +00:00
murf 6b95b67666 more stub routines to allow linkage in stand-alone environment, with thread debugs turned on
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86180 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17 19:58:20 +00:00
tilghman 69a84d074b Remove redundant includes (patch by snuffy) (Closes issue #10922)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85140 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-09 16:04:41 +00:00
file 8cd1b4daba Fix up tree so that it compiles when MTX Profiling is enabled.
(closes issue #10898)
Reported by: snuffy
Patches:
      10898-mtx_prof.diff uploaded by qwell (license 4)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85025 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-08 16:12:21 +00:00
murf 6685951d10 OK. THis a DEBUG_THREADS situation.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84331 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01 23:33:07 +00:00
murf 60e7a00008 picky gcc versions... sigh.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84330 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01 23:26:50 +00:00
murf 2c8dd534a7 This mod will allow check_expr to compile in the presence of DEBUG_THREAD situations. At least, it does for me. And it's less expensive than several other approaches I tried.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84329 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01 23:20:20 +00:00
russell ea4c42d1e6 Add some files to the utils directory svn:ignore and Makefile clean target
(closes issue #10808, reported by mvanbaak)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83741 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-25 08:09:01 +00:00
tilghman 480f725cc1 Fix build of check_expr and hashtest2 when DEBUG_THREADLOCAL is defined
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83545 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-22 14:45:42 +00:00
russell 16927b7f7a Merged revisions 83432 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r83432 | russell | 2007-09-21 09:37:20 -0500 (Fri, 21 Sep 2007) | 4 lines

gcc 4.2 has a new set of warnings dealing with cosnt pointers.  This set of
changes gets all of Asterisk (minus chan_alsa for now) to compile with gcc 4.2.
(closes issue #10774, patch from qwell)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83433 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-21 14:40:10 +00:00
russell 6fa2c158cc Change the traversal to use ao2_callback() instead of an ao2_iterator. Using
ao2_callback() is a much more efficient way of performing an operation on every
item in the container.  This change makes hashtest2 run in about 25% of the
time it ran before on my system.

In general, I would say that it makes the most sense to use an ao2_iterator if
the operation being performed is going to take a long time and you don't want
to keep the container locked while you work with each object.  Otherwise,
the use of ao2_callback is preferred.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82282 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-12 15:53:40 +00:00
murf 4d7d64c096 This solves an unreported solaris compile problem (missing -lnsl -lsocket).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82268 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11 22:37:20 +00:00
murf a4f9e795c2 fixing up the pthread stuff for hashtest2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82256 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11 17:16:16 +00:00
file 13fbf56ca2 Include string compatibility file in hashtest2.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82235 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11 13:46:08 +00:00
file 86db19ffc0 Include compat.h to hopefully make it compatible with FreeBSD.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82234 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11 13:41:03 +00:00
file 3c5783a144 Fix building under FreeBSD. Make sure alloca.h exists before including it.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82233 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11 13:37:26 +00:00
murf 32f5cd5202 Committing my test for astobj2, hashtest2.c, along with makefile changes in utils.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82140 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-10 16:59:18 +00:00
murf 88e10708c5 This code was in team/murf/bug8684-trunk; it should fix bug 8684 in trunk. I didn't add it to 1.4 yet, because it's not entirely clear to me if this is a bug fix or an enhancement. A lot of files were affected by small changes like ast_variable_new getting an added arg, for the file name the var was defined in; ast_category_new gets added args of filename and lineno; ast_category and ast_variable structures now record file and lineno for each entry; a list of all #include and #execs in a config file (or any of its inclusions are now kept in the ast_config struct; at save time, each entry is put back into its proper file of origin, in order. #include and #exec directives are folded in properly. Headers indicating that the file was generated, are generated also for each included file. Some changes to main/manager.c to take care of file renaming, via the UpdateConfig command. Multiple inclusions of the same file are handled by exploding these into multiple include files, uniquely named. There's probably more, but I can't remember it right now.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81361 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-29 20:55:40 +00:00
murf ddcd4809bf fix up the MODULEINFO in conf2ael.c as well
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80748 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-24 15:42:25 +00:00
russell 181ac01389 Merged revisions 80722 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r80722 | russell | 2007-08-24 10:28:05 -0500 (Fri, 24 Aug 2007) | 3 lines

Tweak the formatting of this MODULEINFO block.  I think this would have caused
a "*" to get in the menuselect-tree file.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80725 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-24 15:29:16 +00:00
murf 02ba9efa48 Merged revisions 80717 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r80717 | murf | 2007-08-24 08:48:49 -0600 (Fri, 24 Aug 2007) | 1 line

This change addresses JerJer's complaint that aelparse builds and installs even if pbx_ael is unchecked in the menuselect stuff.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80718 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-24 14:55:34 +00:00
russell b80981fc9e Ensure that the object code for ast_atomic_fetchadd_int() gets included in the
check_expr binary when building with LOW_MEMORY defined.
(reported by Brian Capouch on the asterisk-dev list, patch by me)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80262 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22 16:27:39 +00:00
murf a295b03cb1 Stephn Davies reports that this will help make things work on 64-bit machines
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80075 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-20 17:37:36 +00:00
murf 0bd0ded5c0 pval.c should not be in svn, in the utils dir
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80037 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-20 15:27:35 +00:00
file f5d4c789d6 Bring pval.c in utils up to date with pval.c in res/ael.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80033 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-20 15:10:55 +00:00
file 5971b5afa1 (closes issue #10496)
Reported by: caio1982
Fix building on OSX.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79989 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-20 00:38:20 +00:00
tilghman 3ee21aac93 Add strcompat dependency for check_expr (needed for platforms that don't have strndup)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79980 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-19 14:17:30 +00:00