Commit Graph

866 Commits

Author SHA1 Message Date
Tilghman Lesher 79fdf2945e Merged revisions 310462 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r310462 | tilghman | 2011-03-12 14:27:54 -0600 (Sat, 12 Mar 2011) | 45 lines
  
  Merged revisions 310448 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r310448 | tilghman | 2011-03-12 14:24:54 -0600 (Sat, 12 Mar 2011) | 38 lines
    
    Recorded merge of revisions 310435 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r310435 | tilghman | 2011-03-12 14:22:07 -0600 (Sat, 12 Mar 2011) | 31 lines
      
      Add AELSub, which provides a stable entry point into AEL subroutines.
      
      This commit needs some explanation, given that we're adding a new application
      into an existing release branch.  This is generally a violation of our release
      policy, except in very limited circumstances, and I believe this is one of
      those circumstances.
      
      The problem that this solves is one of the sanity of using multiple dialplan
      languages to define a dialplan.  In the case of the reporter, he or she is
      using AEL is define subroutines, while using Realtime extensions to invoke
      those subroutines.  While you can do this, it's based upon the reality of AEL
      using actual dialplan extensions; however, there is no guarantee that the
      details of _how_ AEL is compiled into extensions will remain stable.  In fact,
      at the time of this commit, it has already changed twice, once in a
      fundamental way.
      
      Now normally, a new application would only be added to trunk.  However, this
      application is explicitly to create a stable user-level API between versions,
      and adding it to trunk only will not solve the user's problem of switching
      between 1.6.2 and 1.8, nor will it help anybody switching from 1.8 to 1.10.
      Therefore, it needs to go into existing release branches.  For the sake of
      consistency, and also because one of the changes was between 1.4 and 1.6.x,
      I am also electing to commit this to 1.4.
      
      (closes issue #18910)
       Reported by: alexandrekeller
       Patches: 
             20110304__issue18919__1.6.2.diff.txt uploaded by tilghman (license 14)
             20110304__issue18919__1.4.diff.txt uploaded by tilghman (license 14)
       Tested by: alexandrekeller
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@310500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-12 20:42:33 +00:00
Matthew Nicholson f6c2ebff45 Merged revisions 309585 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r309585 | mnicholson | 2011-03-04 13:38:25 -0600 (Fri, 04 Mar 2011) | 9 lines
  
  Merged revisions 309584 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r309584 | mnicholson | 2011-03-04 13:37:13 -0600 (Fri, 04 Mar 2011) | 2 lines
    
    Restore mysterious lua_pushvalue() call removed in r309494.  The mystery has been solved.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-04 19:38:59 +00:00
Matthew Nicholson 3ef45303e1 Merged revisions 309542 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r309542 | mnicholson | 2011-03-04 13:00:33 -0600 (Fri, 04 Mar 2011) | 11 lines
  
  Merged revisions 309541 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r309541 | mnicholson | 2011-03-04 12:59:20 -0600 (Fri, 04 Mar 2011) | 4 lines
    
    Check for errors from fseek() when loading config file, properly abort on errors from fread(), and supply a traceback for errors generated when loading the config file.
    
    Also, prepend a newline to traceback output so that the main error message is on it's own line.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-04 19:02:31 +00:00
Matthew Nicholson 8861d64ecc Merged revisions 309495 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r309495 | mnicholson | 2011-03-04 12:10:23 -0600 (Fri, 04 Mar 2011) | 9 lines
  
  Merged revisions 309494 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r309494 | mnicholson | 2011-03-04 11:55:57 -0600 (Fri, 04 Mar 2011) | 2 lines
    
    remove mysterious lua_pushvalue() that is never used
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309496 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-04 18:11:43 +00:00
Matthew Nicholson b20fecdbbb Add support for defining hints from pbx_lua
(closes issue #16024)
Reported by: mnicholson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-04 17:44:44 +00:00
Matthew Nicholson 438ef2625a Merged revisions 309448 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r309448 | mnicholson | 2011-03-04 09:59:25 -0600 (Fri, 04 Mar 2011) | 8 lines
  
  Export global symbols from pbx_lua to allow modules to be loaded.  Fixes a regression introduced in r278132.
  
  (closes issue #18671)
  Reported by: Igels
  Patches:
        pbx_lua_global_symbols1.diff uploaded by mnicholson (license 96)
  Tested by: Igels
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-04 16:00:05 +00:00
Paul Belanger 3556e4c2d4 Replace ast_log(LOG_DEBUG, ...) with ast_debug()
(closes issue #18556)
Reported by: kkm

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04 16:55:39 +00:00
David Vossel c26c190711 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 16:22:10 +00:00
Leif Madsen 0a72d67d3b Merged revisions 300082 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r300082 | lmadsen | 2011-01-03 07:14:25 -0600 (Mon, 03 Jan 2011) | 11 lines
  
  Increase side of mapping response field.
  
  I've increased the size of the response field in a DUNDi mapping because of
  some documentation I'm writing. Previously it was set to AST_MAX_EXTENSION which
  is only 80 characters, which is far too small when you're using some dialplan
  functions to craft a response. The example I'm using is:
  
  extensions =>
  RegisteredDevices,0,SIP,dundi:very_awesome_password/${IF($[${DB_EXISTS(phones/${NUMBER}/device)}]?${DB(phones/${NUMBER}/device)}:None)},nopartial
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-03 13:15:38 +00:00
Tilghman Lesher 8cca4ed8d8 Merged revisions 299449 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r299449 | tilghman | 2010-12-22 14:05:02 -0600 (Wed, 22 Dec 2010) | 15 lines
  
  Merged revisions 299448 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r299448 | tilghman | 2010-12-22 14:03:30 -0600 (Wed, 22 Dec 2010) | 8 lines
    
    Resolve warnings by disambiguating the "s" extension as used by chan_dahdi from the "s" extension as used by the AEL macros.
    
    (closes issue #18480)
     Reported by: nivek
     Patches: 
           20101215__issue18480__2.diff.txt uploaded by tilghman (license 14)
     Tested by: nivek
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-22 20:10:34 +00:00
Russell Bryant cc0b7e7df5 Some scheduler API cleanup and improvements.
Previously, I had added the ast_sched_thread stuff that was a generic scheduler
thread implementation.  However, if you used it, it required using different
functions for modifying scheduler contents.  This patch reworks how this is
done and just allows you to optionally start a thread on the original scheduler
context structure that has always been there.  This makes it trivial to switch
to the generic scheduler thread implementation without having to touch any of
the other code that adds or removes scheduler entries.

In passing, I made some naming tweaks to add ast_ prefixes where they were not
there before.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-20 17:15:54 +00:00
Tilghman Lesher 2cfb2dbbad Merged revisions 294605 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r294605 | tilghman | 2010-11-10 17:26:39 -0600 (Wed, 10 Nov 2010) | 2 lines
  
  Fixing the Mac OS X build (bamboo warning)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@294606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-10 23:27:33 +00:00
Tilghman Lesher a7e5429d70 Merged revisions 294569 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r294569 | tilghman | 2010-11-10 17:13:37 -0600 (Wed, 10 Nov 2010) | 8 lines
  
  Properly queue files with inotify(7).
  
  (closes issue #18089)
   Reported by: abelbeck
   Patches: 
         20101021__issue18089.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@294570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-10 23:14:45 +00:00
Jeff Peeler 14cef4634e Merged revisions 292083 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292083 | jpeeler | 2010-10-18 10:32:40 -0500 (Mon, 18 Oct 2010) | 4 lines
  
  Disable use of inotify for call file handling as it is not working properly.
  
  (related to #18089)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-18 15:33:35 +00:00
Tilghman Lesher bddb242d72 Merged revisions 290255 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r290255 | tilghman | 2010-10-04 18:23:11 -0500 (Mon, 04 Oct 2010) | 18 lines
  
  Merged revisions 290254 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r290254 | tilghman | 2010-10-04 18:14:59 -0500 (Mon, 04 Oct 2010) | 11 lines
    
    Change new pattern matcher to regard dashes the same as the old pattern matcher -- as visual candy to be ignored.
    
    Also change the AEL parser to not generate dashes within extensions, as those
    dashes would be ignored.  Update the AEL tests to match this behavior.
    
    (closes issue #17366)
     Reported by: murf
     Patches: 
           20100727__issue17366.diff.txt uploaded by tilghman (license 14)
     Tested by: tilghman
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@290256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-04 23:23:57 +00:00
Tilghman Lesher 93f9937ede Merged revisions 290066 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r290066 | tilghman | 2010-10-03 15:02:29 -0500 (Sun, 03 Oct 2010) | 8 lines
  
  Get notification only when file is closed, not when created.
  
  (closes issue #17924)
   Reported by: mkeuter
   Patches: 
         asterisk-1.8-bugid17924.patch uploaded by abelbeck (license 946)
   Tested by: abelbeck
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@290067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-03 20:04:57 +00:00
Tilghman Lesher 29249cfb25 Merged revisions 285386 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r285386 | tilghman | 2010-09-07 16:20:16 -0500 (Tue, 07 Sep 2010) | 13 lines
  
  Don't notify on attribute changes, and change how the queuing mechanism works.
  
  Fixes call spools in 1.8.
  
  (closes issue #17337)
   Reported by: loloski
   Patches: 
         20100827__issue17337.diff.txt uploaded by tilghman (license 14)
  
  (closes issue #17924)
   Reported by: mkeuter
   Tested by: mkeuter
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-07 21:21:00 +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
Tilghman Lesher 8190e96fad Merged revisions 284610 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r284610 | tilghman | 2010-09-02 00:20:59 -0500 (Thu, 02 Sep 2010) | 10 lines
  
  When optional_api is non-optional, force dependent modules to be loaded.
  
  (closes issue #17707)
   Reported by: ira
   Patches: 
         20100819__issue17707__asterisk1.8.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman
   
  Review: https://reviewboard.asterisk.org/r/876/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02 05:27:53 +00:00
Russell Bryant 61aa412c61 Merged revisions 283951 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r283951 | russell | 2010-08-27 16:33:55 -0500 (Fri, 27 Aug 2010) | 2 lines
  
  Print exten@context:priority in verbose messages from pbx_realtime.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@283958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-27 21:50:15 +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
Terry Wilson d6e1c724e5 Remove built-in AES code and use optional_api instead
Review: https://reviewboard.asterisk.org/r/793/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-21 19:11:32 +00:00
Tilghman Lesher b4e18d5660 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 19:35:02 +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
Matthew Nicholson 01507f4ab7 Merged revisions 271761 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r271761 | mnicholson | 2010-06-22 09:49:36 -0500 (Tue, 22 Jun 2010) | 9 lines
  
  Allow users to specify a port for dundi peers.
  
  (closes issue #17056)
  Reported by: klaus3000
  Patches:
        dundi-peerport-patch-trunk.txt uploaded by klaus3000 (license 65)
  Tested by: klaus3000
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@271762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-22 14:54:58 +00:00
Jeff Peeler 54f2dfc91c Merged revisions 271399 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r271399 | jpeeler | 2010-06-18 14:28:24 -0500 (Fri, 18 Jun 2010) | 11 lines
  
  Fix crash when parsing some heavily nested statements in AEL on reload.
  
  Due to the recursion used when compiling AEL in gen_prios, all the stack space 
  was being consumed when parsing some AEL that contained nesting 13 levels deep.
  Changing a few large buffers to be heap allocated fixed the crash, although I
  did not test how many more levels can now be safely used.
  
  (closes issue #16053)
  Reported by: diLLec
  Tested by: jpeeler
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@271483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-18 21:32:09 +00:00
Jeff Peeler a370bc1522 fix compile error
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-27 20:08:49 +00:00
Tilghman Lesher 05a1ec8abc Cache query results for one second.
Queries from the PBX core come in 3's.  Caching avoids the additional
performance penalty from those two additional queries hitting the database.

(closes issue #16521)
 Reported by: tilghman
 Patches: 
       20091229__issue16521.diff.txt uploaded by tilghman (license 14)
 Tested by: Hubguru, tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-27 19:25:16 +00:00
Tilghman Lesher a7498ae02e Use configure to determine the prefixes and include directories properly.
This ensures cross-platform compatibility, even among Linux distributions,
which don't always put headers in the same place.

(closes issue #17391)
 Reported by: loloski


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@265747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-26 00:29:40 +00:00
Russell Bryant 7c4a95f2ea Fix build on linux.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-13 15:33:49 +00:00
Tilghman Lesher 8d6ee962c7 Add kqueue(2) implementation to Asterisk in various places.
This will save a considerable amount of CPU on the BSDs, including Mac OS X,
as it eliminates several places in the code that we previously used a busy
loop.  Additionally, this adds a res_timing interface, using kqueue timers.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-13 05:37:31 +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
Russell Bryant be672528e6 Merged revisions 255322 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r255322 | russell | 2010-03-30 11:06:06 -0500 (Tue, 30 Mar 2010) | 2 lines
  
  Don't make Asterisk not start if pbx_dundi fails to initialize.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@255323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-30 16:07:49 +00:00
Tilghman Lesher 11f57c6806 inotify support for pbx_spool
This should give a good speed boost, in that one particular thread isn't waking
up once a second to read directory contents.

Reviewboard: https://reviewboard.asterisk.org/r/137/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@255117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-27 06:09:26 +00:00
Kevin P. Fleming ae6008ef3a Change per-file debug and verbose levels to be per-module, the way
users expect them to work.

'core set debug' and 'core set verbose' can optionally change the
level for a specific filename; however, this is actually for a
specific source file name, not the module that source file is included
in. With examples like chan_sip, chan_iax2, chan_misdn and others
consisting of multiple source files, this will not lead to the
behavior that users expect. If they want to set the debug level for
chan_sip, they want it set for all of chan_sip, and not to have to
also set it for reqresp_parser and other files that comprise the
chan_sip module.

This patch changes this functionality to be module-name based instead
of file-name based.

To make this work, some Makefile modifications were required to ensure
that the AST_MODULE definition is present in each object file produced
for each module as well.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23 14:22:27 +00:00
Russell Bryant b6e5e180b9 Resolve a compiler warning on FreeBSD.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-20 11:39:39 +00:00
Russell Bryant 925aad8944 Remove pbx_gtkconsole and related gtk1 checks.
Review: https://reviewboard.asterisk.org/r/541/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-05 19:32:19 +00:00
Leif Madsen b310356d93 Convert some DUNDI functions to XML documentation.
(closes issue #16798)
Reported by: snuffy
Patches: 
      xml_dundi.diff uploaded by snuffy (license 35)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02 19:21:19 +00:00
Russell Bryant 77578f5e35 Add a todo for pbx_gtkconsole for updating to gtk2.
This module needs to be converted to gtk2, or we will eventually have to just
remove it from the tree.  gtk1 isn't even packaged anymore in the distro I'm
using.  I suspect nobody uses this and that nobody would notice if we removed
it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-08 04:43:55 +00:00
Tilghman Lesher bc9f02a60d Merged revisions 242520 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242520 | tilghman | 2010-01-24 00:33:01 -0600 (Sun, 24 Jan 2010) | 8 lines
  
  Only rebuild bison and flex source files on demand, if bison and flex are detected by the configure script.
  
  Changed after discussion on the -dev list about possible unnecessary build
  failures, due to checkouts/untars causing these special source files to
  possibly be newer than their resulting C files.  This should additionally
  ensure that nobody need learn about extra Makefile arguments to ensure the
  proper files get rebuilt when changes are made to these special source files.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-24 06:40:31 +00:00
Jeff Peeler 568c057c4c Extend max call limit duration from 24.8 days to 292+ million years.
If the limit was set past MAX_INT upon answering, the call was immediately
hung up due to overflow from the return of ast_tvdiff_ms (in ast_check_hangup).
The time calculation functions ast_tvdiff_sec and ast_tvdiff_ms have been
changed to return an int64_t to prevent overflow. Also the reporter suggested
adding a message indicating the reason for the call hanging up. Given that the
new limit is so much higher, the message (which would only really be useful in
the overflow scenario) has been made a debug message only.

(closes issue #16006)
Reported by: viraptor


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 22:31:25 +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
Matthew Nicholson a723865e5c Load pbx_lua with global symbols to allow linking with other lua libraries.
Found by Maxim Litnitskiy.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231189 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-25 15:42:48 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +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 01fd08d5b9 If lua is detected with the lua5.1 prefix (or not), adjust the include path accordingly.
Based upon feedback to a release announcement on the -users list.  See
http://lists.digium.com/pipermail/asterisk-users/2009-August/236954.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@214819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-30 06:43:04 +00:00
Tilghman Lesher 9c653c4431 DUNDILOOKUP function in 1.6 should use comma delimiters.
(closes issue #15322)
 Reported by: chappell
 Patches: 
       dundilookup-0015322.patch uploaded by chappell (license 8)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-25 06:51:12 +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 Brooks d81d6d3415 Fixing typos. Replaces "recieved" with "received" and "initilize" with "initialize"
(closes issue #15571)
Reported by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27 16:33:50 +00:00
Russell Bryant 742f0b90dd Remove trailing whitespace.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-24 21:12:43 +00:00
Kevin P. Fleming 96e4e31eeb Merged revisions 207647 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r207647 | kpfleming | 2009-07-21 08:04:44 -0500 (Tue, 21 Jul 2009) | 12 lines
  
  Ensure that user-provided CFLAGS and LDFLAGS are honored.
  
  This commit changes the build system so that user-provided flags (in ASTCFLAGS
  and ASTLDFLAGS) are supplied to the compiler/linker *after* all flags provided
  by the build system itself, so that the user can effectively override the
  build system's flags if desired. In addition, ASTCFLAGS and ASTLDFLAGS can now
  be provided *either* in the environment before running 'make', or as variable
  assignments on the 'make' command line. As a result, the use of COPTS and LDOPTS
  is no longer necessary, so they are no longer documented, but are still supported
  so as not to break existing build systems that supply them when building Asterisk.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 13:28:04 +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 82fb56886e More 'static' qualifiers on module global variables.
The 'pglobal' tool is quite handy indeed :-)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 17:34:30 +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
Kevin P. Fleming a3af213506 Remove rarely-used event_log/LOG_EVENT support
In discussions today at the Europe Asterisk Developer Meet-Up, we determined that
the event_log was used in only 9 places in the entire tree, and really was not needed
at all. The users have been converted to use LOG_NOTICE, or the messages have been
removed since other messages were already in place that provided the same information.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02 19:02:22 +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
Russell Bryant b564b2105f Change g_eid to ast_eid_default.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 14:00:18 +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
Mark Michelson 7824d71998 Convert pbx_spool to use string fields instead of statically-sized buffers.
In tests run after making this conversion, I noticed an approximate 85% 
reduction in memory usage for call file processing.

Review: http://reviewboard.digium.com/r/168/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@179745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 17:03:47 +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
Sean Bright 5183cbccfc Change intializer types. Found while working on asterisk-cpp. I have a new
favorite error message from g++:

    pbx_dundi.c:4580: sorry, unimplemented: non-trivial designated
                      initializers not supported

I like it when compilers are apologetic.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-17 02:52:30 +00:00
Joshua Colp 654ea55a65 Numerous documentation updates.
(closes issue #13970)
Reported by: pkempgen
Patches:
      __20081217_cli_usage_fixes.patch.txt uploaded by blitzrage (license 10)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 21:21:44 +00:00
Steve Murphy 1a37ee4025 A possibly "horrible fix" for a "horribly broken"
situation.

As stuff shifts around in the asterisk code, the
miscellaneous inclusions from the standalone stuff
gets broken. There's no easy fix for this situation.

I made sure that everything in utils builds without
problem ***AND*** that aelparse runs the regressions
correctly with the following make menuselect options
both on and off:

DONT_OPTIMIZE
DEBUG_THREADS
DEBUG_CHANNEL_LOCKS
MALLOC_DEBUG
MTX_PROFILE
DEBUG_SCHEDULER
DEBUG_THREADLOCALS
DETECT_DEADLOCKS
CHANNEL_TRACE

I think from now on, I'm going to #undef
all these features in the various utils native
files; I guess I could do the same for the
copied-in files, surrounded by STANDALONE ifdef.

A standalone isn't going to care about threads,
mutexes, etc.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-17 05:04:56 +00:00
Steve Murphy eaafc96872 fixed the regressions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-17 02:32:58 +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
Tilghman Lesher e62193f887 Allow disabling pattern match searches within the Realtime dialplan switch.
(closes issue #13698)
 Reported by: fhackenberger
 Patches: 
       20081211__bug13698.diff.txt uploaded by Corydon76 (license 14)
 Tested by: fhackenberger


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 21:17:07 +00:00
Russell Bryant 1238488319 When a reload is issued, always process the configuration for dundi.conf.
The reason is that a reload can be used to refresh DNS lookups for defined peers.
Even if the config file hasn't changed, we want to process it for that purpose.

(closes issue #13776)
Reported by: kombjuder


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 16:17:55 +00:00
Russell Bryant 92e1619bab Merged revisions 163511 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r163511 | russell | 2008-12-12 08:40:31 -0600 (Fri, 12 Dec 2008) | 5 lines

Specify uint32_t for variables storing a CRC32 so that it is actually 32 bits
on 64-bit machines, as well.

(inspired by issue #13879)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-12 14:44:06 +00:00
Matthew Nicholson c6244cca48 Merged revisions 163316 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r163316 | mnicholson | 2008-12-11 16:44:31 -0600 (Thu, 11 Dec 2008) | 9 lines
  
  Clean up the dundi cache every 5 minutes.
  
  (closes issue #13819)
  Reported by: adomjan
  Patches:
        pbx_dundi.c-clearcache.patch uploaded by adomjan (license 487)
        dundi_clearecache3.diff uploaded by mnicholson (license 96)
  Tested by: adomjan
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 22:49:59 +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
Tilghman Lesher b1824992a9 Merged revisions 160558 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r160558 | tilghman | 2008-12-03 11:34:34 -0600 (Wed, 03 Dec 2008) | 7 lines
  
  If an entry is added to the directory during a scan when another entry expires,
  then that new entry will not be processed promptly, but must wait for either a
  future entry to start or a current entry's retry to occur.  If no other entries
  exist in the directory (other than the new entries) when a bunch expire, then
  the new entries must wait until another new entry is added to be processed.
  This was a rather weird race condition, really.  Fixes AST-147.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 17:38:59 +00:00
Tilghman Lesher efa00e7038 Merged revisions 160551 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r160551 | tilghman | 2008-12-03 10:58:34 -0600 (Wed, 03 Dec 2008) | 4 lines
  
  Don't start scanning the directory until all modules are loaded, because some
  required modules (channels, apps, functions) may not yet be in memory yet.
  Fixes AST-149.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 17:01:03 +00:00
Tilghman Lesher 1b0d3db863 Don't actually do anything with a negative priority, because we ignore it in
the result, anyway.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159189 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 18:01:02 +00:00
Kevin P. Fleming 8d5deb312b Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
  
  the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
  
  with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
  
  while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
Terry Wilson d66a8cd264 Fix checking for CONFIG_STATUS_FILEINVALID so that modules don't crash upon trying to parse an invalid config
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19 19:25:14 +00:00
Michiel van Baak 86f900b201 This commit does two things:
- Add CLI aliases module to asterisk.
- Remove all deprecated CLI commands from the code

Initial work done by file.
Junk-Y and lmadsen did a lot of work and testing to
get the list of deprecated commands into the configuration file.

Deprecated CLI commands are now handled by this new module,
see cli_aliases.conf for more info about that.

ok russellb@ via reviewboard

(closes issue #13735)
Reported by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 06:46:04 +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 d5837ba8c2 Add additional memory debugging to several core APIs, and fix several memory
leaks found with these changes.
(Closes issue #13505, closes issue #13543)
Reported by: mav3rick, triccyx
 Patches: 
       20081001__bug13505.diff.txt uploaded by Corydon76 (license 14)
 Tested by: mav3rick, triccyx


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 22:38:06 +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
Kevin P. Fleming 629861a705 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: https://origsvn.digium.com/svn/asterisk/trunk@144949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-27 15:52:56 +00:00
Steve Murphy 1c2b1eb928 (closes issue #13564)
Reported by: mnicholson
Patches:
      pbx_lua9.diff uploaded by mnicholson (license 96)

Many thanks to Matt for his upgrade to the lua dialplan
option! 

the Description from the bug:

This patch adds a stack trace to errors encountered while executing lua extensions. The patch also handles out of memory errors reported by lua.




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@144681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-26 18:02:06 +00:00
Steve Murphy a36696f2e7 (closes issue #13559)
Reported by: mnicholson
Patches:
      pbx_lua8.diff uploaded by mnicholson (license 96)




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@144563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-25 21:54:11 +00:00
Steve Murphy 38028fa641 I added a little verbage to hashtab for the hashtab_destroy func.
It was pretty sparsely documented.

This update fleshes out the pbx_lua module, to 
add the switch statements to the extensions in the
extensions.lua file, as well as removing them when
the module is unloaded.

Many thanks to Matt Nicholson for his fine
contribution!




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@144523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-25 21:18:12 +00:00
Steve Murphy f8ddaae70b (closes issue #13558)
Reported by: mnicholson

Considering that the example extensions.lua used nothing but ["12345"] notation,
and that the resulting error message: 

[Sep 24 17:01:16] ERROR[12393]: pbx_lua.c:1204 exec: Error executing lua extension: attempt to call a nil value

is not very informative as to the nature of the problem, I think this bug
fix is a big win!





git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@144482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-25 17:51:11 +00:00
Steve Murphy ec25f4be4d Merged revisions 141094 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r141094 | murf | 2008-09-04 17:15:07 -0600 (Thu, 04 Sep 2008) | 70 lines

(closes issue #13357)
Reported by: pj
Tested by: murf

(closes issue #13416)
Reported by: yarns
Tested by: murf

If you find this message overly verbose, relax, it's probably
not meant for you. This message is meant for probably only
two people in the whole world: me, or the poor schnook that
has to maintain this code because I'm either dead or unavailable
at the moment.

This fix solves two reports, both having to do with embedding
a function call in a ${} construct. It was tricky because the
funccall syntax has parenthesis () in it. And up till now,
the 'word' token in the flex stuff didn't allow that, because
it would tend to steal the LP and RP tokens. To be truthful,
the "word" token was the trickiest, most unstable thing in
the whole lexer. I was lucky it made this long without complaints.
I had to choose every character in the pattern with extreme
care, and I knew that someday I'd have to revisit it. Well,
the day has come.

So, my brilliant idea (and I'm being modest), was to use the 
surrounding ${} construct to make a state machine and capture 
everything in it, no matter what it contains. But, I have to now
treat the word token like I did with comments, in that I turn
the whole thing into a state-machine sort of spec, with new
contexts "curlystate", "wordstate", and "brackstate".

Wait a minute, "brackstate"? Yes, well, it didn't take very many
regression tests to point out if I do this for ${} constructs,
I also have to do it with the $[] constructs, too.

I had to create a separate pcbstack2 and pcbstack3 because
these constructs can occur inside macro argument lists, and
when we have two state machines operating on the same structures
we'd get problems otherwise. I guess I could have stopped at
pcbstack2 and had the brackstate stuff share it, but it doesn't
hurt to be safe. So, the pcbpush and pcbpop routines also now
have versions for "2" and "3".

I had to add the {KEYWORD} construct to the initial pattern for
"word", because previously word would match stuff like "default7",
because it was a longer match than the keyword "default". But,
not any more, because the word pattern only matches only one or
two characters now, and it will always lose. So, I made it the
winner again by making an optional match on any of the keywords
before it's normal pattern.

I added another regression test to make sure we don't
lose this in future edits, and had to fix just one regression,
where it no longer reports a 'cascaded' error, which I guess
is a plus.

I've given some thought as to whether to apply these fixes to
1.4 and the 1.6.x releases, vs trunk; I decided to put it in
1.4 because one of the bug reports was against 1.4; and it
is unexpected that AEL cannot handle this situation. It actually
reduced the amount of useless "cascade" error messages that
appeared in the regressions (by one line, ehhem). There is
a possible side-effect in that it does now do more careful
checking of what's in those ${} constructs, as far as matching
parens, and brackets are concerned. Some users may find a an
insidious problem and correct it this way. This should be 
exceedingly rare, I hope.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@141115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-04 23:31:41 +00:00
Steve Murphy a40f1cc1c5 Merged revisions 136726 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r136726 | murf | 2008-08-07 18:15:34 -0600 (Thu, 07 Aug 2008) | 32 lines


(closes issue #13236)
Reported by: korihor

Wow, this one was a challenge!

I regrouped and ran a new strategy for
setting the ~~MACRO~~ value; I set it once
per extension, up near the top. It is only
set if there is a switch in the extension.

So, I had to put in a chunk of code to detect
a switch in the pval tree.

I moved the code to insert the set of ~~exten~~
up to the beginning of the gen_prios routine, 
instead of down in the switch code.

I learned that I have to push the detection
of the switches down into the code, so everywhere
I create a new exten in gen_prios, I make sure
to pass onto it the values of the mother_exten
first, and the exten next.

I had to add a couple fields to the exten
struct to accomplish this, in the ael_structs.h
file. The checked field makes it so we don't
repeat the switch search if it's been done.

I also updated the regressions.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-08 00:48:35 +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 7df8b8b848 make datastore creation and destruction a generic API since it is not really channel related, and add the ability to add/find/remove datastores to manager sessions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05 16:56:11 +00:00
Russell Bryant 8c29e699fe Merged revisions 134595 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r134595 | russell | 2008-07-30 15:37:17 -0500 (Wed, 30 Jul 2008) | 6 lines

Reduce stack consumption by 12.5% of the max stack size to fix a crash when
compiled with LOW_MEMORY.

(closes issue #13154)
Reported by: edantie

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 20:38:35 +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
Brett Bryant 5b7933fe5e 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: https://origsvn.digium.com/svn/asterisk/trunk@130129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 18:09:35 +00:00
Tilghman Lesher 4ff527903e Code wasn't ready to be merged - see -dev list discussion
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-09 03:39:59 +00:00
Brett Bryant d185405755 Janitor project to convert sizeof to ARRAY_LEN macro.
(closes issue #13002)
Reported by: caio1982
Patches:
      janitor_arraylen5.diff uploaded by caio1982 (license 22)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 16:40:28 +00:00
Olle Johansson 6f400edeab Changing name of global api call to ast_*
My mistake, pointed out by Russell.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@128378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-06 08:28:58 +00:00
Olle Johansson 45e79490ba Implement flags for AGI in the channel structure so taht "show channels" and
AMI commands can display that a channel is under control of an AGI.

Work inspired by work at customer site, but paid for by Edvina AB


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@128240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-05 20:54:30 +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
Kevin P. Fleming 71b3fd1ef7 various minor fixes created while i worked on getting *every* Asterisk module to build on laptop in dev mode:
remove weird pre-setting of LUA paths; they are not necessary; also use the proper path for including the files in pbx_lua.c

add searching for OpenAIS libraries in /usr/lib/openais if a path is not specified; not sure if this is really the optimal solution, but it works

make the compiler shut up about some ignored function results in pbx_gtkconsole; this module is badly coded anyway



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-29 16:19:29 +00:00
Michiel van Baak 8e8359465b Older versions of GNU gcc do not allow 'NULL' as sentinel.
They want (char *)NULL as sentinel.
An example is OpenBSD (confirmed on 4.3) that ships with gcc 3.3.4

This commit introduces a contstant SENTINEL which is declared as:
#define SENTINEL ((char *)NULL)

All places I could test compile on my openbsd system are converted.
Update CODING-GUIDELINES to tell about this constant.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 20:48:33 +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
Tilghman Lesher c86e26e66b Merged revisions 123710 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r123710 | tilghman | 2008-06-18 15:22:42 -0500 (Wed, 18 Jun 2008) | 7 lines

Set the variables top-down, so that if a script sets a variable more than once,
the last one will take precedence.
(closes issue #12673)
 Reported by: phber
 Patches: 
       20080519__bug12673.diff.txt uploaded by Corydon76 (license 14)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123715 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-18 20:23:58 +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
Russell Bryant f4a8062e93 Merge another change from team/russell/events ...
DUNDi uses a concept called the Entity ID for unique server identifiers.  I have
pulled out the handling of EIDs and made it something available to all of Asterisk.
There is now a global Entity ID that can be used for other purposes as well, such
as code providing distributed device state, which is why I did this.  The global
Entity ID is set automatically, just like it was done in DUNDi, but it can also be
set in asterisk.conf.  DUNDi will now use this global EID unless one is specified
in dundi.conf.

The current EID for the system can be seen in the "core show settings" CLI command.
It is also available in the dialplan via the ENTITYID variable.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-10 12:48:50 +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 5b5a84676a Merged revisions 120226 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r120226 | tilghman | 2008-06-03 17:41:04 -0500 (Tue, 03 Jun 2008) | 8 lines

Due to incorrect use of the AST_LIST_INSERT_HEAD() macro the loopback switch
cannot perform any translation on the extension number before searching for it
in the target context.
(closes issue #12473)
 Reported by: chappell
 Patches: 
       pbx_loopback.c.diff uploaded by chappell (license 8)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 22:42:03 +00:00
Tilghman Lesher 76506b7baa Move compatibility options into asterisk.conf, default them to on for upgrades,
and off for new installations.  This includes the translation from pipes to commas
for pbx_realtime and the EXEC command for AGI, as well as the change to the Set
application not to support multiple variables at once.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 22:05:16 +00:00
Steve Murphy f40f170eea Merged revisions 119966 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r119966 | murf | 2008-06-03 09:26:56 -0600 (Tue, 03 Jun 2008) | 8 lines

Updated the regressions on AEL. Hadn't updated
this for the changes I made to preserve ${EXTEN}
in switches, which affected several tests because
it adds extra priorities, and at least one needed to be updated
because of the removal of the empty extension warning
message.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 15:49:34 +00:00
Tilghman Lesher 1c51fec08c In compat14 mode, don't translate pipes inside expressions, as they aren't
argument delimiters, but rather 'or' symbols.
(Closes issue #12723)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 13:13:17 +00:00
Tilghman Lesher 9276a4370c Add a compatibility option for upgrading realtime extensions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 21:42:50 +00:00
Russell Bryant 457dbc1b4f Merged revisions 117507 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r117507 | russell | 2008-05-21 13:19:34 -0500 (Wed, 21 May 2008) | 7 lines

1) Don't print the verbose marker in front of every message from ast_verbose()
   being sent to remote consoles.

2) Fix pbx_gtkconsole to filter out the verbose marker.

(related to issue #12702)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:20:11 +00:00
Olle Johansson 29b1d73567 Add support for codec settings in originate via call file and manager.
This is to enable video and text in originated calls. Development sponsored
by Omnitor AB, Sweden. (http://www.omnitor.se)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 12:32:57 +00:00
Olle Johansson cc6d4100ad Doxygen formatting change only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 08:16:25 +00:00
Russell Bryant 9eb8e7d665 Lock the channel around datastore access
(closes issue #12527)
Reported by: mnicholson
Patches:
      pbx_lua4.diff uploaded by mnicholson (license 96)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 22:04:46 +00:00
Steve Murphy c0b8f57b9d (closes issue #12467)
Reported by: atis
Tested by: murf

This upgrade adds the ~~ (concatenation) string operator to expr2.
While not needed in normal runtime pbx operation, it is needed when
raw exprs are being syntax checked. This plays into future syntax-
unification plans. By permission of atis, this addition in trunk 
and the reason of why things are as they are will suffice to close
this bug.

I also added a short note about the previous addition of "sip show sched"
to the CLI in CHANGES, which I discovered I forgot in a previous commit.




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-21 21:13:02 +00:00
Steve Murphy 2427603eaf Merged revisions 111341 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r111341 | murf | 2008-03-26 21:21:05 -0600 (Wed, 26 Mar 2008) | 15 lines


(closes issue #12302)
Reported by: pj
Tested by: murf

These changes will set a channel variable ~~EXTEN~~ just before generating code
for a switch, with the value of ${EXTEN}. The exten is marked as having a switch, 
and ever after that, till the end of the exten, we substitute any ${EXTEN} 
with ${~~EXTEN~~} instead in application arguments; (and the ${EXTEN: also). 
The reason for this, is that because switches are coded using 
separate extensions to provide pattern matching, and
jumping to/from these switch extensions messes up the ${EXTEN} value, 
which blows the minds of users.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-27 04:47:12 +00:00
Steve Murphy 4e29ae8806 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: https://origsvn.digium.com/svn/asterisk/trunk@109357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 14:09:50 +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
Russell Bryant 1ec8cb41a8 Merge changes from team/mvanbaak/cli-command-audit
(closes issue #8925)

About a year ago, as Leif Madsen and Jim van Meggelen were going over the CLI
commands in Asterisk 1.4 for the next version of their book, they documented
a lot of inconsistencies.  This set of changes addresses all of these issues
and has been reviewed by Leif.

While this does introduce even more changes to the CLI command structure, it
makes everything consistent, which is the most important thing.

Thanks to all that helped with this one!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-08 21:26:32 +00:00
Tilghman Lesher ac699196f5 Merged revisions 100465 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r100465 | tilghman | 2008-01-27 15:59:53 -0600 (Sun, 27 Jan 2008) | 11 lines

When deleting a task from the scheduler, ignoring the return value could
possibly cause memory to be accessed after it is freed, which causes all
sorts of random memory corruption.  Instead, if a deletion fails, wait a
bit and try again (noting that another thread could change our taskid
value).
(closes issue #11386)
 Reported by: flujan
 Patches: 
       20080124__bug11386.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, flujan, stuarth`

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-27 22:35:29 +00:00
Russell Bryant cc4a630cd7 Merged revisions 98390 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98390 | russell | 2008-01-11 16:46:21 -0600 (Fri, 11 Jan 2008) | 9 lines

Fix up setting the EID on BSD based systems.

(closes issue #11646)
Reported by: caio1982
Patches:
      dundi_osx_eid6.diff.txt uploaded by caio1982 (license 22)
      dundi_osx_eid6-1.4.diff uploaded by caio1982 (license 22)
Tested by: caio1982, mvanbaak

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 22:52:41 +00:00
Russell Bryant 234b856d17 Merged revisions 97753 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r97753 | russell | 2008-01-10 10:19:47 -0600 (Thu, 10 Jan 2008) | 2 lines

Remove other remnants of pbx_kdeconsole

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 16:22:10 +00:00
Russell Bryant c53f95e29f Merged revisions 97734 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r97734 | russell | 2008-01-10 10:10:09 -0600 (Thu, 10 Jan 2008) | 4 lines

Remove pbx_kdeconsole from the tree.  It hasn't worked in ages, and nobody has
complained.
(closes issue #11706, reported by caio1982)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 16:15:43 +00:00
Tilghman Lesher 857e3412f4 Several manager changes:
1) Add the Dialplan class, for NewExten and VarSet events, which should cut
down on the volume of traffic in the Call class.
2) Permit some commands to be run from multiple classes, such as allowing
DBGet to be run from either the System or the Reporting class.
3) Heavily document each class in the sample config, as there were several
that made no sense to be in the write= line, and two that made no sense to be
in the read= line (since they controlled no permissions there).

(Closes issue #10386)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 00:12:35 +00:00
Russell Bryant 372dd125dc Merged revisions 97645 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r97645 | russell | 2008-01-09 17:01:48 -0600 (Wed, 09 Jan 2008) | 2 lines

Strip terminal sequences from the verbose messages

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 23:02:19 +00:00
Russell Bryant ddc0fbfc98 Merged revisions 97640 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r97640 | russell | 2008-01-09 16:26:33 -0600 (Wed, 09 Jan 2008) | 3 lines

Make pbx_gtkconsole build ... but doesn't actually load on my system still
(related to issue #11706)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 22:27:50 +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
Kevin P. Fleming 100ef27af9 Merged revisions 93180 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines

In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html,
rizzo brought up some issues related to the way that the metadata required
for menuselect and the rest of the build system is extracted from the source
files. Since I had a few hours to kill on an airplane today, I decided to
improve this situation... so now the system caches the extracted metadata
and uses it to build the menuselect 'tree' as much as it can. The result
of this is that when a single source file is changed, only the metadata for
that file needs to be extracted again, and the rest is used from the cache
files. I also reduced the number of forked processes required to do the
metadata extraction; it was actually possible to do most of what we needed
in the Makefiles themselves without using any shell scripts at all! On my
laptop, these changes resulted in an 80% decrease in the time required
for the 'menuselect.makeopts' automatic check to occur after editing a single
source file.

While doing this work I also cleaned up a few minor things in the Makefiles,
adding a check for 'awk' to the configure script and changed all remaining
places we use 'grep' or 'awk' to use the ones found by the configure script,
and changed the 'prep_tarball' script to build the menuselect metadata so
that tarballs of Asterisk will include it and won't require the user to
wait while it is extracted after unpacking.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
Olle Johansson 940f8f6276 Convert from LOG_DEBUG etc to ast_debug. Thanks, dimas!
(closes issue #11572)
Reported by: dimas
Patches: 
      dundilog-trunk.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-16 13:38:25 +00:00
Olle Johansson 17afebc1a6 HUGE improvements to QoS/CoS handling by IgorG
- Refer to the proper documentation
- Implement separate signalling/media QoS/CoS in many channels using RTP
- Improve warnings and verbose messages
- Deprecate some old settings

Minor modifications by me, a big effort from IgorG.
Thanks!


Reported by: IgorG
Patches: 
      qoscleanup-89394-4-trunk.patch uploaded by IgorG (license 20)
Tested by: IgorG
(closes issue #11145)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-16 10:51:53 +00:00
Russell Bryant 04ab19aef5 make something static
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 19:31:25 +00:00
Luigi Rizzo 5490889153 Put into Makefile.moddir_rules the common instructions used to
generate loadable and embedded module lists.

Individual Makefiles now are a lot simpler, possibly as simple as this:

    -include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
    MODULE_PREFIX=cdr_
    all: _all
    include $(ASTTOPDIR)/Makefile.moddir_rules

and also more flexible because in a single directory we can combine
various types of modules (app_, cdr_, func_, ... ) by simply
listing them in the MODULE_PREFIX variable.

The individual Makefiles can also create list of modules to be
excluded by listing them in the variablel MODULE_EXCLUDE (see an
example in channels/Makefile).

With this change it becomes trivial to integrate a directory with
locally created/modified sources into the main build.




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-10 03:50:38 +00:00
Luigi Rizzo d652be0930 normalize subdirs' Makefile by using ASTTOPDIR and not .. to reference
the top level directory.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-09 21:29:37 +00:00
Jason Parker fc607d5be4 Update documentation for pbx_lua.
Closes issue #11492, patch by mnicholson.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 21:28:49 +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
Steve Murphy ab92fc1f35 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 18:50:44 +00:00
Mark Michelson 180c3fb60e Change all instances of "CALLERID(number)" to "CALLERID(num)" for
consistency's sake

(closes issue #11381, reported and patched by jon)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 23:15:53 +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
Tilghman Lesher cbfc6dcbea Make trunk build again
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 23:29:33 +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 6938f4b2b0 Fix building of modules under cygwin.
After this commit we can actually load modules under windows,
and we can start debugging more interesting problems related
to the load order and functionality of modules.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 16:12:10 +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
Steve Murphy 1a5cdeb138 a quick fix to pbx_dundi.c to make it so it will compile. Hope I did the right thing. And some additions to removal of extens to take care of hashtab pointers in all cases.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-17 17:46:36 +00:00
Luigi Rizzo a0f06d0dd5 start using asterisk/network.h for network related headers.
Also remove some unnecessary includes.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-17 14:11:53 +00:00
Russell Bryant 49d1248c55 fix the build of pbx_lua
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-17 06:34:10 +00:00
Luigi Rizzo 5490960453 remove a bunch of duplicate includes
Reproduce with

grep -r #include . | grep -v .svn | grep -v Binary | sort | uniq -c | sort -nr 



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 23:54:45 +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
Luigi Rizzo 7f8ecd2cd3 make the 'name' and 'value' fields in ast_variable const char *
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-14 13:18:40 +00:00
Jason Parker cfbc4f5fb8 Doxygen fixes.
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-12 23:44:20 +00:00
Steve Murphy 98429d37b2 Based on a note in asterisk-dev by Brian Capouch, I determined I too 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-12 18:44:36 +00:00
Steve Murphy a897556f7f 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: https://origsvn.digium.com/svn/asterisk/trunk@89129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-09 16:00:22 +00:00
Jason Parker 267e829cbd Add check_hangup() method to pbx_lua, which can be used to check whether it is time to hangup a channel.
Closes issue #11202, patch by mnicholson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 23:38:30 +00:00
Kevin P. Fleming edc78d6023 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: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 05:28:47 +00:00
Russell Bryant c93520b88b propagate the DECLINE return value back to the loader
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02 21:39:36 +00:00
Russell Bryant 9a47852673 Don't kill asterisk if extensions.lua is not present.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02 21:36:37 +00:00
Tilghman Lesher ca55e2f671 Oops, some dev-mode changes for ISO C90
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02 17:34:33 +00:00
Tilghman Lesher e8c781b215 Add pbx_lua as a method of doing extensions
Reported by: mnicholson
Patch by: mnicholson
Closes issue #11140


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02 15:36:34 +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
Russell Bryant 1c7eb1d82b Change some uses of free() to ast_free(). (No functional differences.)
(closes issue #11138)
Reported by: eliel
Patches: 
      pbx_dundi.c.patch uploaded by eliel (license 64)
	  chan_sip.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 15:56:25 +00:00
Steve Murphy c9f3efc381 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: https://origsvn.digium.com/svn/asterisk/trunk@87187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-26 17:39:39 +00:00
Steve Murphy b7ef49c931 closes issue #11005, where #include uses the current dir instead of the config dir (/etc/asterisk) for relative path includes for AEL
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-24 13:21:29 +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
Joshua Colp 9409a33900 Merged revisions 86661 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r86661 | file | 2007-10-22 11:05:26 -0300 (Mon, 22 Oct 2007) | 6 lines

Fix tab completion for dundi show peer.
(closes issue #11041)
Reported by: jsmith
Patches:
      asterisk-dundicomplete.diff.txt uploaded by jamesgolovich (license 176)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 14:07:14 +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
Jason Parker ed690fc348 Switch dundi to new tos config format.
Remove old unused defines for old style.

Closes issue 10860, patch by IgorG.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 23:20:40 +00:00
Russell Bryant be54dc15e5 Simplify buffer handling in dundi-parser.c. This also makes the code a bit
safer by removing various assumptions about sizes. (No vulnerabilities, though)

(closes issue #10977)
Reported by: dimas
Patches: 
      dundiparser.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 15:55:23 +00:00
Russell Bryant 3f2e8db598 Merged revisions 85556 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r85556 | russell | 2007-10-15 10:40:45 -0500 (Mon, 15 Oct 2007) | 9 lines

Ensure the buffer passed to ast_canmatch_extension() is properly initialized so
that it is null terminated.

(issue #10977)
Reported by: dimas
Patches: 
      pbxdundi.patch uploaded by dimas (license 88)
	    - small mods by me

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 15:47:46 +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 e5853d8409 Merged revisions 85515 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r85515 | russell | 2007-10-12 10:40:35 -0500 (Fri, 12 Oct 2007) | 7 lines

Fix the potential use of an uninitialized buffer in a log message.

(closes issue #10958)
Reported by: dimas
Patches: 
      realtime.patch uploaded by dimas (license 88)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-12 15:41:27 +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
Steve Murphy 3ffa04bbd3 Merged revisions 84511 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r84511 | murf | 2007-10-03 08:23:00 -0600 (Wed, 03 Oct 2007) | 1 line

closes issue #10834 ; where a null input to a switch statement results in a hangup; since switch is implemented with extensions, and the default case is implemented with a '.', and the '.' matches 1 or more remaining characters, the case where 0 characters exist isn't matched, and the extension isn't matched, and the goto fails, and a hangup occurs. Now, when a default case is generated, it also generates a single fixed extension that will match a null input. That extension just does a goto to the default extension for that switch. I played with an alternate solution, where I just tack an extra char onto all the patterns and the goto, but not the default case's pattern. Then even a null input will still have at least one char in it. But it made me nervous, having that extra char in , even if that's a pretty secret and low-level issue.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03 14:39:05 +00:00
Steve Murphy b3168a76c9 Merged revisions 84239 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r84239 | murf | 2007-10-01 14:27:52 -0600 (Mon, 01 Oct 2007) | 1 line

closes issue #10777 -- by returning a null for the parse tree when there's really nothing there, and making sure we don't try to do checking on a null tree.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 23:03:50 +00:00
Russell Bryant d78463be1e Corydon posted this janitor project to the bug tracker and mvanbaak provided
a patch for it.  It replaces a bunch of simple calls to snprintf with ast_copy_string

(closes issue #10843)
Reported by: Corydon76
Patches: 
      2007092900_10843.diff uploaded by mvanbaak (license 7)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 15:23:19 +00:00
Steve Murphy c782398ca4 the last commit for AEL affected a small number of tests. Added a regression test for glob'd includes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-29 22:40:58 +00:00
Russell Bryant 41d513f443 Merged revisions 83976 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r83976 | russell | 2007-09-26 19:01:29 -0500 (Wed, 26 Sep 2007) | 1 line

remove a todo item that has been completed
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-27 00:02:18 +00:00
Steve Murphy f2b38cf2f3 Merged revisions 83558 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r83558 | murf | 2007-09-22 10:41:43 -0600 (Sat, 22 Sep 2007) | 1 line

This closes issue #10788 -- the 3rd arg in the for statement is now wrapped in Set() only if there's an '=' in that string. Otherwise, if it begins with '&', then a Macro call is generated; otherwise it is made into an app call. A bit more accomodating, keeps the new guys happy, and the guys with ael-1 code should be happy, too
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-22 17:39:37 +00:00
Russell Bryant 9f64905d4e 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: https://origsvn.digium.com/svn/asterisk/trunk@83433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21 14:40:10 +00:00
Joshua Colp 6489076887 Fix memory leaks in pbx_dundi, cdr_pgsql, and the configuration file parser.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 16:10:57 +00:00
Russell Bryant 3d7cf301d8 Merged revisions 82802 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82802 | russell | 2007-09-18 11:31:01 -0500 (Tue, 18 Sep 2007) | 4 lines

When copying the contents from the wildcard peer, do a deep copy instead of
shallow copy so that it doesn't crash when beging destroyed.
(closes issue #10546, patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 16:34:05 +00:00
Russell Bryant 9388173f85 Make the MALLOC_DEBUG output for free() useful again. After changing calls to
free to be ast_free, astmm said all calls to free were coming from utils.h


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 18:57:56 +00:00
Jason Parker 584a510d20 Merged revisions 82358 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82358 | qwell | 2007-09-13 18:11:27 -0500 (Thu, 13 Sep 2007) | 4 lines

Fix a small typo.

retrytime > waittime

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 23:12:16 +00:00
Russell Bryant c0f72f5311 Merged revisions 82250 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82250 | russell | 2007-09-11 11:03:42 -0500 (Tue, 11 Sep 2007) | 4 lines

The sample dundi.conf claims support for a wildcard peer entry - [*], but the
code did not support it.  This patch makes it work.
(closes issue #10546, patch by dds, with some changes by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 16:05:03 +00:00
Joshua Colp 078595f5c5 Merged revisions 82243 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82243 | file | 2007-09-11 11:56:39 -0300 (Tue, 11 Sep 2007) | 6 lines

(closes issue #10577)
Reported by: jamesgolovich
Patches:
      asterisk-dundifree.diff.txt uploaded by jamesgolovich (license 176)
Don't leak memory when unloading DUNDi.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 14:58:11 +00:00
Steve Murphy b5cd67adc3 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: https://origsvn.digium.com/svn/asterisk/trunk@81361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-29 20:55:40 +00:00
Russell Bryant 2f4a2811b6 Add proper channel locking around the uses of datastore_add and _find. There
are still more places in the tree that I have not yet changed if someone wants
to go through and find the places they are used without the channel locked.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-28 18:41:18 +00:00
Russell Bryant 44795584b2 This should have been trunk only, I guess. oh well ... it's harmless.
Merged revisions 81065 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81065 | russell | 2007-08-27 11:38:33 -0500 (Mon, 27 Aug 2007) | 1 line

explicity define a variable as a boolean
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 17:44:24 +00:00
Russell Bryant adcd4d4ab4 Merged revisions 81074 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81074 | russell | 2007-08-27 12:27:48 -0500 (Mon, 27 Aug 2007) | 3 lines

Add a \todo to note that this module leaks most of the memory it allocates on
unload and should be fixed (when I'm not in the middle of something else ...).

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 17:28:14 +00:00
Russell Bryant 8d4761f8d3 localize a variable and remove a duplicate error message
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-25 17:49:51 +00:00
Steve Murphy 83e28341b5 an unreported crash I debugged, looked like it was backing up way too far after hitting the syntax error. An inspection of the code revealed that error tokens in lists were not rearranged when the rules were rearranged as part of a code neatening-up process. By moving the error tokens to where they should be, I also reduced the number of shift/reduce conflicts to 3 instead of 8. This introduces subtle differences in error messages, so the regressions had to be updated.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 23:37:33 +00:00
Jason Parker fafa7d93e4 Correct the argument separator for a Dial statement in pbx_dundi.
Closes issue #10483, patch by lunn


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17 15:27:19 +00:00
Tilghman Lesher 56b9568164 Don't reload a configuration file if nothing has changed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 21:09:46 +00:00