Commit Graph

165 Commits

Author SHA1 Message Date
Richard Mudgett 6209a4b1f9 Merged revisions 324849 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r324849 | rmudgett | 2011-06-24 15:46:01 -0500 (Fri, 24 Jun 2011) | 15 lines
  
  Syntax errors in dialplan do not display the file name.
  
  When issuing the CLI command "dialplan reload" syntax errors and warnings
  are displayed on the console.  The offending line number is displayed on
  the console, but the file name is not displayed.  Errors caught in
  main/config.c do display the file name.
  
  (closes issue ASTERISK-17985)
  Reported by: ulogic
  Patches:
        pbx_config.patch uploaded by ulogic (License #5685) modified format
  Tested by: rmudgett
  
  JIRA SWP-3554
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@324850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-24 20:50:52 +00:00
Russell Bryant 37aa52fd78 Merged revisions 316265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines
  
  Fix a bunch of compiler warnings generated by gcc 4.6.0.
  
  Most of these are -Wunused-but-set-variable, but there were a few others
  mixed in here, as well.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 20:45:32 +00:00
Paul Belanger 92358b078c Merged revisions 315394 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r315394 | pabelanger | 2011-04-25 22:18:50 -0400 (Mon, 25 Apr 2011) | 14 lines
  
  Merged revisions 315393 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r315393 | pabelanger | 2011-04-25 22:17:43 -0400 (Mon, 25 Apr 2011) | 7 lines
    
    Add back CLI command 'dialplan save'
    
    (closes issue #19140)
    Reported by: lmadsen
    Patches:
          __20110419_dialplan_save.patch.txt uploaded by lmadsen (license 10)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@315395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-26 02:21:38 +00:00
Jonathan Rose 3c02c09162 In handle_cli_dialplan_add_extension, const char pointer *into_context is used instead of a->argv[5] to improve readability.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-04 17:37:47 +00:00
Jonathan Rose 7fa7d9c36b Makes 'dialplan add extension' create the specified context if it does not already exist.
If the user invokes 'dialplan add extension' into a non-existing context, the context will be created
and a message informing the user of the context being created will be issued in cli.

(closes issue #17431)
Reported by: leearcher
Patches:
      context_auto_create.diff uploaded by kobaz (license 834)
Tested by: leearcher, kobaz, jrose


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-04 17:32:05 +00:00
Tilghman Lesher 90bf5c0549 Merged revisions 285367 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r285367 | tilghman | 2010-09-07 15:56:07 -0500 (Tue, 07 Sep 2010) | 23 lines
  
  Merged revisions 285366 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r285366 | tilghman | 2010-09-07 15:31:41 -0500 (Tue, 07 Sep 2010) | 16 lines
    
    Merged revisions 285365 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r285365 | tilghman | 2010-09-07 15:30:22 -0500 (Tue, 07 Sep 2010) | 9 lines
      
      Catch invalid extensions at the parser, instead of making the core deal with them.
      
      (closes issue #17794)
       Reported by: PavelL
       Patches: 
             20100820__issue17794__1.6.2.diff.txt uploaded by tilghman (license 14)
             20100820__issue17794__1.4.diff.txt uploaded by tilghman (license 14)
       Tested by: PavelL
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-07 20:56:53 +00:00
Jason Parker 377c3bf88e Merged revisions 282131 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r282131 | qwell | 2010-08-12 17:51:44 -0500 (Thu, 12 Aug 2010) | 16 lines
  
  Merged revisions 282130 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r282130 | qwell | 2010-08-12 17:50:54 -0500 (Thu, 12 Aug 2010) | 9 lines
    
    Merged revisions 282129 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r282129 | qwell | 2010-08-12 17:49:28 -0500 (Thu, 12 Aug 2010) | 1 line
      
      Register CLI commands before parsing config, in case there is a config error.
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@282132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-12 22:52:33 +00:00
David Vossel 3f00e3ff03 fixes issue with 'dialplan remove extension blah' segfaulting with tab completion
(closes issue #17440)
Reported by: kobaz


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-22 22:11:50 +00:00
Paul Belanger 663a368a87 Improve logging by displaying line number
(closes issue #16303)
Reported by: dant
Patches:
      issue16303.patch.v2 uploaded by pabelanger (license 224)
Tested by: dant, lmadsen, pabelanger


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-11 19:40:37 +00:00
Matthias Nick 89b02b583a Parse global variables or expressions in hint extensions
Parse global variables or expressions in hint extensions. Like: exten => 400,hint,DAHDI/i2/${GLOBAL(var)}

(closes issue #16166)
Reported by: rmudgett
Tested by: mnick, rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-04 17:15:47 +00:00
Russell Bryant b0778107c7 Resolve a warning from gcc 4.4.1.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 22:08:46 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Kevin P. Fleming ed2a3cedd1 Merged revisions 209759 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r209759 | kpfleming | 2009-07-31 19:52:00 -0500 (Fri, 31 Jul 2009) | 7 lines
  
  Minor changes inspired by testing with latest GCC.
  
  The latest GCC (what will become 4.5.x) has a few new warnings, that in these
  cases found some either downright buggy code, or at least seriously poorly
  designed code that could be improved.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-01 01:03:07 +00:00
David Vossel dcfe69ec64 fixes some memory leaks and redundant conditions
(closes issue #15269)
Reported by: contactmayankjain
Patches:
      patch.txt uploaded by contactmayankjain (license 740)
      memory_leak_stuff.trunk.diff uploaded by dvossel (license 671)
Tested by: contactmayankjain, dvossel




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-18 16:37:42 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

Review: https://reviewboard.asterisk.org/r/251/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
David Brooks 0ea83eab48 Removing crufty code that is no longer necessary. Code cleanup.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 18:32:58 +00:00
Jeff Peeler 58cf8b69da Fix malloc debug macros to work properly with h323.
The main problem here was that cstdlib was undefining free thereby causing the
proper debug macros to not be used. ast_h323.cxx has been changed to call
ast_free instead to avoid the issue. 

A few other issues were addressed:
- There were a few instances of functions improperly passing ast_free instead
of ast_free_ptr.
- Some clean up was done to avoid the debug macros intentionally being redefined.
(copied below from Kevin's commit, appreciate the help)
- disable astmm.h from doing anything when STANDALONE is defined, which is used
by the tools in the utils/ directory that use parts of Asterisk header files in
hackish ways; also ensure that utils/extconf.c and utils/conf2ael.c are
compiled with STANDALONE defined.

(closes issue #13593)
Reported by: pj



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 04:06:44 +00:00
Tilghman Lesher f90021fdd0 Ensure that commas placed in the middle of extension character classes do not
interfere with correct parsing of the extension.  Also, if an unterminated
character class DOES make its way into the pbx core (through some other
method), ensure that it does not crash Asterisk.
(closes issue #14362)
 Reported by: Nick_Lewis
 Patches: 
       20090129__bug14362.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-04 00:43:52 +00:00
Tilghman Lesher 53ddd52fc4 Merged revisions 170158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r170158 | tilghman | 2009-01-22 11:18:07 -0600 (Thu, 22 Jan 2009) | 6 lines
  
  Allow global variables after substitution to be as long as other variables.
  (closes issue #14263)
   Reported by: markd
   Patches: 
         20090120__bug14263.diff.txt uploaded by Corydon76 (license 14)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@170165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 17:19:28 +00:00
Joshua Colp 601176cb6e Be more detailed about why the include did not get included.
(closes issue #14071)
Reported by: kshumard
Patches:
      pbx_config.patch.improvederroroutput.txt uploaded by kshumard (license 92)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 16:50:11 +00:00
Eliel C. Sardanons 1e8e12efcf Janitor, use ARRAY_LEN() when possible.
(closes issue #13990)
Reported by: eliel
Patches:
      array_len.diff uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 10:31:25 +00:00
Kevin P. Fleming 210df649a2 correct logic error noticed by rmudgett (thanks!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07 03:09:16 +00:00
Kevin P. Fleming 9153827d56 coding style/guidelines cleanup, plus use new side-effect safe S_OR
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-06 21:12:03 +00:00
Kevin P. Fleming bd4eb070f3 bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 branch, and add the ones needed for all the new code here too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 18:52:13 +00:00
BJ Weschke 9aefadd7c1 Do NOT attempt to do anything with the ast_config struct when it's been returned as INVALID by the config file interpreter.
(closes issue #13741)
 


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-20 05:07:25 +00:00
Tilghman Lesher 038b588ee8 Reset continuation items at the beginning of each context (suggested by
kpfleming).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@148329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-10 18:59:58 +00:00
Tilghman Lesher 5c32f80a61 Add keyword "same", which allows you to create multiple steps in a dialplan,
without needing to respecify an extension pattern multiple times.
(closes issue #13632)
 Reported by: blitzrage
 Patches: 
       20081006__bug13632.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage, Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@148325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-10 18:31:38 +00:00
Sean Bright b7a4db0ced Start moving in changes from my resolve-shadow-warnings branch. Going to do
this in pieces so the diffs are a little bit smaller and more reviewable.

pbx/ and formats/ first.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 00:44:55 +00:00
Kevin P. Fleming 6291cd19bf remove remaining Zaptel references in various places
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-28 16:42:00 +00:00
Tilghman Lesher 12e5c68622 Merged revisions 127973 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r127973 | tilghman | 2008-07-03 22:30:30 -0500 (Thu, 03 Jul 2008) | 8 lines

Fix the 'dialplan remove extension' logic, so that it a) works with cidmatch,
and b) completes contexts correctly when the extension is ambiguous.
(closes issue #12980)
 Reported by: licedey
 Patches: 
       20080703__bug12980.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@128027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-04 16:06:34 +00:00
Tilghman Lesher 122486b263 Allow alternative extensions to be specified for a user.
(closes issue #12830)
 Reported by: jcollie
 Patches: 
       astertisk-trunk-121496-alternate-extensions.patch uploaded by jcollie (license 412)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 19:22:59 +00:00
Jeff Peeler ef3b214728 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: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 17:27:55 +00:00
Joshua Colp 270bad99c8 We like tabs.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 15:38:00 +00:00
Joshua Colp db9d25d32e Merged revisions 120282 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r120282 | file | 2008-06-04 10:31:09 -0300 (Wed, 04 Jun 2008) | 6 lines

Fix a log message and add a message for when the dialplan is done reloading.
(closes issue #12716)
Reported by: chappell
Patches:
      dialplan_reload_2.diff uploaded by chappell (license 8)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 13:33:59 +00:00
Tilghman Lesher bdad3c9889 (closes issue #6019)
Reported by: ssokol
 Patches: 
       20080304__bug6019.diff.txt uploaded by Corydon76 (license 14)
 Tested by: putnopvut


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 21:48:20 +00:00
Steve Murphy 377e51c4d4 (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: https://origsvn.digium.com/svn/asterisk/trunk@106757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 18:57:57 +00:00
Jason Parker eea428cf76 Use defined return values in load_module in more places.
(closes issue #11096)
Patches:
      pbx_config.c.patch uploaded by moy (license 222)
      pbx_dundi.c.patch uploaded by moy (license 222)
      pbx_gtkconsole.c.patch uploaded by moy (license 222)
      pbx_loopback.c.patch uploaded by moy (license 222)
      pbx_realtime.c.patch uploaded by moy (license 222)
      pbx_spool.c.patch uploaded by moy (license 222)
      app_adsiprog.c.patch uploaded by moy (license 222)
      app_alarmreceiver.c.patch uploaded by moy (license 222)
      app_amd.c.patch uploaded by moy (license 222)
      app_authenticate.c.patch uploaded by moy (license 222)
      app_cdr.c.patch uploaded by moy (license 222)
      app_zapateller.c.patch uploaded by moy (license 222)
      app_zapbarge.c.patch uploaded by moy (license 222)
      app_zapras.c.patch uploaded by moy (license 222)
      app_zapscan.c.patch uploaded by moy (license 222)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@94806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-26 20:02:27 +00:00
Steve Murphy 1f792f1745 closes issue #11294; missed the conditional unlock of the contexts when the hash table is used instead; also, used the ast_free_ptr as advised.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 22:14:55 +00:00
Joshua Colp 9910b7d9a7 Merged revisions 89592 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89592 | file | 2007-11-26 13:36:45 -0400 (Mon, 26 Nov 2007) | 6 lines

Use ast_free to free memory, or else we shall implode if MALLOC_DEBUG is enabled.
(closes issue #11347)
Reported by: ys
Patches:
      pbx.pbx_config.c.diff uploaded by ys (license 281)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 17:38:57 +00:00
Steve Murphy a63f6be669 closes issue #11363; where the pattern _20x. buried in an included context, didn't match 2012; There were a small set of problems to fix: 1. I needed NOT to score patterns unless you are at the end of the data string. 2. Capital N,X,Z and small n,x,z are OK in patterns. I canonicalize the patterns in the trie to caps. 3. When a pattern ends with dot or exclamation, CANMATCH/MATCHMORE should always report this pattern, no matter the length. With this commit, I also supplied the wish of Luigi, where the user can select which pattern matching algorithm to use, the old (legacy) pattern matcher, or the new, trie based matcher. The OLD matcher is the default. A new [general] section variable, extenpatternmatchnew, is added to the extensions.conf, and the example config has it set to false. If true, the new matcher is used. In all other respects, the context/exten structs are the same; the tries and hashtabs are formed, but in the new mode the tries are not used. A new CLI command 'dialplan set extenpatternmatch true/false' is provided to allow switching at run time. I beg users that are forced to return to the old matcher to please report the reason in the bug tracker. Measured the speed benefit of the new matcher against an impossibly large context with 10,000 extensions: the new matcher is 374 times faster.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-24 21:00:26 +00:00
Luigi Rizzo 51391e6b09 shuffle a little bit the content of header files to reduce dependencies.
In this commit:
- move the ast_register/unregister_app functions to module.h
  to avoid the need to include pbx.h for the simpler apps;
- move the ast_group structure to channel.h to remove the
  dependency of app.h on linkedlists.h

Note, this is a long process that I am doing in small steps.

The main difficulty is that now for each subsystem we
have a single header (e.g. channel.h) included by the subsystem
provider (usually one file, e.g. channel.c) and by its clients
(dozens of them, e.g. we have some 70+ apps and 30+ functions).

This requires the clients to include all the extra headers
required by the provider (eg. lock.h, linkedlists.h, definitions
of substructures...) even though many of the clients would be
just happy with opaque struct declarations and function prototypes.

The long term plan is to eventually rectify this structure
so that the compilation can become faster, and also APIs
are more stable.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-22 03:50:04 +00:00
Luigi Rizzo 7e8835e0d7 remove another set of redundant #include "asterisk/options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:24:55 +00:00
Luigi Rizzo a23c055c3d move asterisk/paths.h outside asterisk.h and into those files
who really need it.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 23:16:15 +00:00
Luigi Rizzo ffd86fc964 more errno.h removal
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 21:12:08 +00:00
Luigi Rizzo fdb7f7ba3d 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: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Steve Murphy 63f2f04cf4 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: https://origsvn.digium.com/svn/asterisk/trunk@88166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 22:26:51 +00:00
Jason Parker ebe4050128 Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former didn't make much sense
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 20:05:18 +00:00
Jason Parker b0f3e6097e Convert NEW_CLI to AST_CLI.
Closes issue #11039, as suggested by seanbright.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19 18:29:40 +00:00
Russell Bryant ac46e63a41 Merged revisions 85540 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r85540 | russell | 2007-10-14 10:24:52 -0500 (Sun, 14 Oct 2007) | 7 lines

Don't create the context for users in users.conf until we know at least one user exists.

(closes issue #10971)
Reported by: dimas
Patches: 
      pbxconfig.patch uploaded by dimas (license 88)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-14 15:34:54 +00:00
Russell Bryant e97a723cf1 Merge a ton of NEW_CLI conversions. Thanks to everyone that helped out! :)
(closes issue #10724)
Reported by: eliel
Patches: 
      chan_skinny.c.patch uploaded by eliel (license 64)
      chan_oss.c.patch uploaded by eliel (license 64)
      chan_mgcp.c.patch2 uploaded by eliel (license 64)
      pbx_config.c.patch uploaded by seanbright (license 71)
      iax2-provision.c.patch uploaded by eliel (license 64)
      chan_gtalk.c.patch uploaded by eliel (license 64)
      pbx_ael.c.patch uploaded by seanbright (license 71)
      file.c.patch uploaded by seanbright (license 71)
      image.c.patch uploaded by seanbright (license 71)
      cli.c.patch uploaded by moy (license 222)
      astobj2.c.patch uploaded by moy (license 222)
      asterisk.c.patch uploaded by moy (license 222)
      res_limit.c.patch uploaded by seanbright (license 71)
      res_convert.c.patch uploaded by seanbright (license 71)
      res_crypto.c.patch uploaded by seanbright (license 71)
      app_osplookup.c.patch uploaded by seanbright (license 71)
      app_rpt.c.patch uploaded by seanbright (license 71)
      app_mixmonitor.c.patch uploaded by seanbright (license 71)
      channel.c.patch uploaded by seanbright (license 71)
      translate.c.patch uploaded by seanbright (license 71)
      udptl.c.patch uploaded by seanbright (license 71)
      threadstorage.c.patch uploaded by seanbright (license 71)
      db.c.patch uploaded by seanbright (license 71)
      cdr.c.patch uploaded by moy (license 222)
      pbd_dundi.c.patch uploaded by moy (license 222)
      app_osplookup-rev83558.patch uploaded by moy (license 222)
      res_clioriginate.c.patch uploaded by moy (license 222)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85460 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-11 19:03:06 +00:00