Skip to content
Snippets Groups Projects
  1. Nov 19, 2018
    • George Joseph's avatar
      backtrace: Refactor ast_bt_get_symbols so it doesn't crash · ece5f801
      George Joseph authored
      We've been seeing crashes in libbfd when we attempt to generate
      a stack trace from multiple threads.  It turns out that libbfd
      is NOT thread-safe.  It can cache the bfd structure and give it to
      multiple threads without protecting itself.  To get around this,
      we've added a global mutex around the bfd functions and also have
      refactored the use of those functions to be more efficient and
      to provide more information about inlined functions.
      
      Also added a few more tests to test_pbx.c.  One just calls
      ast_assert() and the other calls ast_log_backtrace().  Neither are
      run by default.
      
      WARNING:  This change necessitated changing the return value of
      ast_bt_get_symbols() from an array of strings to a VECTOR of
      strings.  However, the use of this function outside Asterisk is not
      likely.
      
      ASTERISK-28140
      
      Change-Id: I79d02862ddaa2423a0809caa4b3b85c128131621
      ece5f801
  2. Jul 18, 2018
  3. Mar 17, 2018
    • Corey Farrell's avatar
      core: Stop using AST_INLINE_API for allocator functions. · 4d1c9d87
      Corey Farrell authored
      This replaces AST_INLINE_API allocators in utils.h with real functions
      implemented in astmm.c.  Associated macro's are also moved from utils.h
      to astmm.h.
      
      Remove menuselect conflicts between MALLOC_DEBUG and DEBUG_CHAOS as they
      can now be combined.
      
      This has multiple benefits:
      * Simplifies asterisk/utils.h by removing inline functions and use of
        the logger.
      * Removal of these inline functions decreases size of Asterisk and
        module binaries by 1% or more.
      * Puts memory management functions together with and without
        MALLOC_DEBUG enabled, simplifying management of the code.
      * Enables DEBUG_CHAOS for ASTMM_REDIRECT and bundled pjproject.
      
      Change-Id: If9df4377f74bdbb627461b27a473123e05525887
      4d1c9d87
  4. Dec 22, 2017
  5. Oct 24, 2017
  6. Jan 04, 2017
    • Jonathan R. Rose's avatar
      core/pbx: dialplan show - display filename/line# · d96e3502
      Jonathan R. Rose authored
      Adds the ability for extensions to be registered to include filename and
      line number so that dialplan show output can show the filename and line
      number of a config file responsible for generating a given extension.
      
      This only affects config modules that are written to use the new extension
      registering functions. In this patch, that only includes pbx_config, so
      extensions registered in extensions.conf and any included extension will
      be shown in this manner. Extensions registered in this manner will show
      the filename and line number *instead* of the registrar.
      
      ASTERISK-26658 #close
      Reported by: Jonathan R. Rose
      
      Change-Id: Ieccc6abccdff34ed5c7da3511fd24972b8f2dd30
      d96e3502
  7. Oct 27, 2016
    • Corey Farrell's avatar
      Remove ASTERISK_REGISTER_FILE. · a6e5bae3
      Corey Farrell authored
      ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
      all traces of it.
      
      Previously exported symbols removed:
      * __ast_register_file
      * __ast_unregister_file
      * ast_complete_source_filename
      
      This also removes the mtx_prof static variable that was declared when
      MTX_PROFILE was enabled.  This variable was only used in lock.c so it
      is now initialized in that file only.
      
      ASTERISK-26480 #close
      
      Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
      a6e5bae3
  8. Sep 29, 2016
  9. Jul 21, 2016
    • Corey Farrell's avatar
      pbx: Create pbx_sw.c for management of 'struct ast_sw'. · a36a174c
      Corey Farrell authored
      This changes context switches from a linked list to a vector, makes
      'struct ast_sw' opaque to pbx.c.
      
      Although ast_walk_context_switches is maintained the procedure is no
      longer efficient except for the first call (inc==NULL).  This
      functionality is replaced by two new functions implemented by vector
      macros.
      * ast_context_switches_count (AST_VECTOR_SIZE)
      * ast_context_switches_get (AST_VECTOR_GET)
      
      As with ast_walk_context_switches callers of these functions are
      expected to have locked contexts.  Only a few places in Asterisk walked
      the switches, they have been converted to use the new functions.
      
      Change-Id: I08deb016df22eee8288eb03de62593e45a1f0998
      a36a174c
  10. Jul 18, 2016
    • Corey Farrell's avatar
      pbx: Create pbx_ignorepat.c for management of 'struct ast_ignorepat'. · e2e8713b
      Corey Farrell authored
      This changes context ignore patterns from a linked list to a vector,
      makes 'struct ast_ignorepat' opaque to pbx.c.
      
      Although ast_walk_context_ignorepats is maintained the procedure is no
      longer efficient except for the first call (inc==NULL).  This
      functionality is replaced by two new functions implemented by vector
      macros.
      * ast_context_ignorepats_count (AST_VECTOR_SIZE)
      * ast_context_ignorepats_get (AST_VECTOR_GET)
      
      As with ast_walk_context_ignorepats callers of these functions are
      expected to have locked contexts.  Only a few places in Asterisk walked
      the ignorepats, they have been converted to use the new functions.
      
      Change-Id: I78f2157d275ef1b7d624b4ff7d770d38e5d7f20a
      e2e8713b
  11. Jul 15, 2016
    • Corey Farrell's avatar
      pbx: Create pbx_include.c for management of 'struct ast_include'. · be36bd7c
      Corey Farrell authored
      This changes context includes from a linked list to a vector, makes
      'struct ast_include' opaque to pbx.c.
      
      Although ast_walk_context_includes is maintained the procedure is no
      longer efficient except for the first call (inc==NULL).  This
      functionality is replaced by two new functions implemented by vector
      macros.
      * ast_context_includes_count (AST_VECTOR_SIZE)
      * ast_context_includes_get (AST_VECTOR_GET)
      
      As with ast_walk_context_includes callers of these functions are
      expected to have locked contexts.  Only a few places in Asterisk walked
      the includes, they have been converted to use the new functions.
      
      const have been applied where possible to parameters for ast_include
      functions.
      
      Change-Id: Ib5c882e27cf96fb2aec67a39c18b4c71c9c83b60
      be36bd7c
  12. May 05, 2015
    • Corey Farrell's avatar
      CLI: Enable automatic references to modules. · df6c1d75
      Corey Farrell authored
      * Pass module to ast_cli_register and ast_cli_register_multiple.
      * Add a module reference before executing any CLI callback, remove
        the reference when complete.
      
      ASTERISK-25049 #close
      Reported by: Corey Farrell
      
      Change-Id: I7aafc7c9f2b912918f28fe51d51e9e8a755750e3
      df6c1d75
  13. Apr 13, 2015
    • Matt Jordan's avatar
      git migration: Refactor the ASTERISK_FILE_VERSION macro · 4a582616
      Matt Jordan authored
      Git does not support the ability to replace a token with a version
      string during check-in. While it does have support for replacing a
      token on clone, this is somewhat sub-optimal: the token is replaced
      with the object hash, which is not particularly easy for human
      consumption. What's more, in practice, the source file version was often
      not terribly useful. Generally, when triaging bugs, the overall version
      of Asterisk is far more useful than an individual SVN version of a file. As a
      result, this patch removes Asterisk's support for showing source file
      versions.
      
      Specifically, it does the following:
      
      * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
        remove passing the version in with the macro. Other facilities
        than 'core show file version' make use of the file names, such as
        setting a debug level only on a specific file. As such, the act of
        registering source files with the Asterisk core still has use. The
        macro rename now reflects the new macro purpose.
      
      * main/asterisk:
        - Refactor the file_version structure to reflect that it no longer
          tracks a version field.
        - Remove the "core show file version" CLI command. Without the file
          version, it is no longer useful.
        - Remove the ast_file_version_find function. The file version is no
          longer tracked.
        - Rename ast_register_file_version/ast_unregister_file_version to
          ast_register_file/ast_unregister_file, respectively.
      
      * main/manager: Remove value from the Version key of the ModuleCheck
        Action. The actual key itself has not been removed, as doing so would
        absolutely constitute a backwards incompatible change. However, since
        the file version is no longer tracked, there is no need to attempt to
        include it in the Version key.
      
      * UPGRADE: Add notes for:
        - Modification to the ModuleCheck AMI Action
        - Removal of the "core show file version" CLI command
      
      Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
      4a582616
  14. Mar 28, 2015
  15. Jul 04, 2014
    • Matthew Jordan's avatar
      Remove many deprecated modules · 97834718
      Matthew Jordan authored
      Billing records are fair,
      To get paid is quite bright,
      You should really use ODBC;
      Good-bye cdr_sqlite.
      
      Microsoft did once push H.323,
      Hell, we all remember NetMeeting.
      But try to compile chan_h323 now
      And you will take quite a beating.
      
      The XMPP and SIP war was fierce,
      And in the distant fray
      Was birthed res_jabber/chan_jingle;
      But neither to stay.
      
      For everyone did care and chase what Google professed.
      "Free Internet Calling" was what devotees cried,
      But Google did change the specs so often
      That the developers were happy the day chan_gtalk died.
      
      And then there was that odd application
      Dedicated to the Polish tongue.
      app_saycountpl was subsumed by Say;
      One could say its bell was rung.
      
      To read and parse a file from the dialplan
      You could (I guess) use an application.
      app_readfile did fill that purpose, but I think
      A function is perhaps better in its creation.
      
      Barging is rude, I'm not sure why we do it.
      Inwardly, the caller will probably sigh.
      But if you really must do it,
      Don't use app_dahdibarge, use ChanSpy.
      
      We all despise the sound of tinny robots
      It makes our queues so cold.
      To control such an abomination
      It's better to not use Wait/SetMusicOnHold.
      
      It's often nice to know properties of a channel
      It makes our calls right
      We have a nice function called CHANNEL
      And so SIPCHANINFO is sent off into the night.
      
      And now things get odd;
      Apparently one could delimit with a colon
      Properties from the SIPPEER function!
      Commas are in; all others are done.
      
      Finally, a word on pipes and commas.
      We're sorry. We can't say it enough.
      But those compatibility options in asterisk.conf;
      To maintain them forever was just too tough.
      
      This patch removes:
      
      * cdr_sqlite
      * chan_gtalk
      * chan_jingle
      * chan_h323
      * res_jabber
      * app_saycountpl
      * app_readfile
      * app_dahdibarge
      
      It removes the following applications/functions:
      
      * WaitMusicOnHold
      * SetMusicOnHold
      * SIPCHANINFO
      
      It removes the colon delimiter from the SIPPEER function.
      
      Finally, it also removes all compatibility options that were configurable from
      asterisk.conf, as these all applied to compatibility with Asterisk 1.4 systems.
      
      Review: https://reviewboard.asterisk.org/r/3698/
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      97834718
  16. Mar 25, 2014
  17. Mar 24, 2014
  18. Feb 22, 2014
  19. Sep 10, 2013
  20. Jun 13, 2013
  21. Mar 13, 2012
    • Tilghman Lesher's avatar
      Enable macros in 1.8 to find the next highest "h" extension in a context, like in 1.4. · 9af5c769
      Tilghman Lesher authored
      This change restores functionality that was present in 1.4, when AEL macros
      were implemented with the Macro dialplan application.  Macros are fraught with
      functionality issues, because they consume a large portion of the underlying
      application stack.  This limits the ability of AEL users to call many layers
      of subroutines, an issue which Gosub does not have (originally tested to
      100,000 levels deep).  Therefore, starting in 1.6.0, AEL macros were
      implemented with Gosub.
      
      However, there were some implicit behaviors of Macro, which were not replicated
      at the same time as with the transition to Gosub, one of which is documented in
      the related issue.  In particular, the "h" extension is designed to execute not
      in the Macro context, but in the topmost calling context.  Due to legacy issues
      with a misapplied bugfix many years ago, when a macro exited in 1.4, it looks
      in all calling contexts, bubbling up from the deepest level until it finds an
      "h" extension.
      
      Since AEL hides the complexity of the underlying dialplan logic from the AEL
      programmer, it's reasonable to assume that this behavior should not change in
      the transition from Asterisk 1.4 LTS to Asterisk 1.8 LTS, lest we break
      working AEL configurations in the transition to Asterisk 1.8 LTS.  This fix
      is the result, which implements a search for the "h" extension in all calling
      Gosub contexts.
      
      Fixes ASTERISK-19336
      
      Patch: 20120308__ael_bugfix_for_trunk__2.diff (License #5003) by Tilghman Lesher
      	(with slight modifications for 1.8)
      
      Tested by: Johan Wilfer
      
      Review: https://reviewboard.asterisk.org/r/1776/
      ........
      
      Merged revisions 358810 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 358811 from http://svn.asterisk.org/svn/asterisk/branches/10
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      9af5c769
  22. Jul 14, 2011
  23. Dec 18, 2010
  24. Jun 18, 2009
  25. May 21, 2009
    • Kevin P. Fleming's avatar
      Const-ify the world (or at least a good part of it) · e6b2e9a7
      Kevin P. Fleming authored
      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
      e6b2e9a7
  26. Dec 17, 2008
    • Steve Murphy's avatar
      A possibly "horrible fix" for a "horribly broken" · 1a37ee40
      Steve Murphy authored
      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
      1a37ee40
  27. Nov 29, 2008
    • Kevin P. Fleming's avatar
      incorporates r159808 from branches/1.4: · 887e28d7
      Kevin P. Fleming authored
      ------------------------------------------------------------------------
      r159808 | kpfleming | 2008-11-29 10:58:29 -0600 (Sat, 29 Nov 2008) | 7 lines
      
      update dev-mode compiler flags to match the ones used by default on Ubuntu Intrepid, so all developers will see the same warnings and errors
      
      since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them
      
      format attributes in a consistent way
      
      
      ------------------------------------------------------------------------
      
      in addition:
      
      move some format attributes from main/utils.c to the header files they belong in, and fix up references to the relevant functions based on new compiler warnings
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      887e28d7
  28. Aug 19, 2008
  29. Jun 03, 2008
  30. May 23, 2008
    • Mark Michelson's avatar
      A new feature thanks to the fine folks at Switchvox! · 975a848b
      Mark Michelson authored
      If a deadlock is detected, then the typical lock information will be
      printed along with a backtrace of the stack for the offending threads.
      Use of this requires compiling with DETECT_DEADLOCKS and having glibc
      installed.
      
      Furthermore, issuing the "core show locks" CLI command will print the
      normal lock information as well as a backtraces for each lock. This
      requires that DEBUG_THREADS is enabled and that glibc is installed.
      
      All the backtrace features may be disabled by running the configure
      script with --without-execinfo as an argument
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      975a848b
  31. Apr 10, 2008
  32. Mar 18, 2008
    • Steve Murphy's avatar
      Merged revisions 109309 via svnmerge from · 4e29ae88
      Steve Murphy authored
      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
      4e29ae88
  33. Mar 07, 2008
    • Steve Murphy's avatar
      (closes issue #6002) · 377e51c4
      Steve Murphy authored
      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
      377e51c4
  34. Feb 15, 2008
  35. Dec 20, 2007
  36. Dec 18, 2007
  37. Nov 26, 2007
  38. Nov 21, 2007
  39. Oct 26, 2007
    • Steve Murphy's avatar
      Merged revisions 87168 via svnmerge from · c9f3efc3
      Steve Murphy authored
      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
      c9f3efc3
  40. Oct 08, 2007
Loading