Commit Graph

23209 Commits

Author SHA1 Message Date
Automerge script 8e7dd42f67 Merged revisions 376691 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376691 | rmudgett | 2012-11-27 18:13:10 -0600 (Tue, 27 Nov 2012) | 39 lines
  
  Fix extension matching with the '-' char.
  
  The '-' char is supposed to be ignored by the dialplan extension matching.
  Unfortunately, it's treatment is not handled consistently throughout the
  extension matching code.
  
  * Made the old exten matching code consistently ignore '-' chars.
  
  * Made the old exten matching code consistently handle case in the
  matching.
  
  * Made ignore empty character sets.
  
  * Fixed ast_extension_cmp() to return -1, 0, or 1 as documented.  The only
  user of it in pbx_lua.c was testing for -1.  It was originally returning
  the strcmp() value for less than which is not usually going to be -1.
  
  * Fix character set sorting if the sets have the same number of characters
  and start with the same character.  Character set [0-9] now sorts before
  [02-9a] as originally intended.
  
  * Updated some extension label and priority already in use warnings to
  also indicate if the extension is aliased.
  
  (closes issue ASTERISK-19205)
  Reported by: Philippe Lindheimer, Birger "WIMPy" Harzenetter
  Tested by: rmudgett
  
  Review: https://reviewboard.asterisk.org/r/2201/
  ........
  
  Merged revisions 376688 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376689 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376690 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-28 00:19:59 +00:00
Automerge script a825576277 Merged revisions 376660 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376660 | rmudgett | 2012-11-27 14:39:51 -0600 (Tue, 27 Nov 2012) | 27 lines
  
  Remove unnecessary channel module references.
  
  * Removed call to ast_module_user_hangup_all() in res_config_mysql.c since
  it is effectively a noop.  No channels can attach a reference to that
  module.
  
  * Removed call to ast_module_user_hangup_all() in app_celgenuserevent.c.
  The caller of unload_module() has already called it.
  
  * Removed redundant channel module references in pbx_dundi.c.  The
  registered dialplan function callback dispatchers for the read/read2/write
  callbacks already reference the module before calling.
  
  * pbx_dundi: Moved unregistering CLI commands, DUNDi switch, and dialplan
  functions to the first thing the unload_module() does.  This will reduce
  the chance of new channels using DUNDi services while the module is being
  torn down.
  ........
  
  Merged revisions 376657 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376658 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376659 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-27 21:19:40 +00:00
Automerge script 8c84eb128f Merged revisions 376630 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376630 | rmudgett | 2012-11-27 11:54:25 -0600 (Tue, 27 Nov 2012) | 13 lines
  
  Made AST_LIST_REMOVE() simpler and use better names.
  
  * Update doxygen of AST_LIST_REMOVE().
  ........
  
  Merged revisions 376627 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376628 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376629 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-27 18:20:18 +00:00
Automerge script 37ae4ad43f Merged revisions 376589 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376589 | mjordan | 2012-11-22 18:02:23 -0600 (Thu, 22 Nov 2012) | 29 lines
  
  Re-initialize logmsgs mutex upon logger initialization to prevent lock errors
  
  Similar to the patch that moved the fork earlier in the startup sequence to
  prevent mutex errors in the recursive mutex surrounding the read/write thread
  registration lock, this patch re-initializes the logmsgs mutex.  Part of the
  start up sequence before forking the process into the background includes
  reading asterisk.conf; this has to occur prior to the call to daemon in order
  to read startup parameters.  When reading in a conf file, log statements can
  be generated.  Since this can't be avoided, the mutex instead is
  re-initialized to ensure a reset of any thread tracking information.
  
  This patch also includes some additional debugging to catch errors when
  locking or unlocking the recursive mutex that surrounds locks when the
  DEBUG_THREADS build option is enabled.  DO_CRASH or THREAD_CRASH will
  cause an abort() if a mutex error is detected.
  
  (issue ASTERISK-19463)
  Reported by: mjordan
  Tesetd by: mjordan
  ........
  
  Merged revisions 376586 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376587 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376588 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-23 00:20:55 +00:00
Automerge script d16d0200d2 Merged revisions 376575 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r376575 | rmudgett | 2012-11-21 12:33:16 -0600 (Wed, 21 Nov 2012) | 20 lines
  
  Add red-black tree container type to astobj2.
  
  * Add red-black tree container type.
  
  * Add CLI command "astobj2 container dump <name>"
  
  * Added ao2_container_dump() so the container could be dumped by other
  modules for debugging purposes.
  
  * Changed ao2_container_stats() so it can be used by other modules like
  ao2_container_check() for debugging purposes.
  
  * Updated the unit tests to check red-black tree containers.
  
  (closes issue ASTERISK-19970)
  Reported by: rmudgett
  Tested by: rmudgett
  
  Review: https://reviewboard.asterisk.org/r/2110/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-21 19:20:22 +00:00
Automerge script b362853a32 Merged revisions 376562 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376562 | dlee | 2012-11-20 16:06:05 -0600 (Tue, 20 Nov 2012) | 8 lines
  
  Added missing newlines to websocket ast_logs.
  
  Without these newlines, log messages just continue tacking onto the same
  line, and do not flush immediately.
  ........
  
  Merged revisions 376561 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-20 22:19:11 +00:00
Mark Michelson 86f1378ea0 Remove extra ast_backtrace() call I had in while debugging.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-20 19:23:55 +00:00
Automerge script 898f9f853c Merged revisions 376551 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376551 | mmichelson | 2012-11-20 13:09:37 -0600 (Tue, 20 Nov 2012) | 20 lines
  
  Add "Require: timer" to 200 OK responses when appropriate.
  
  The method by which the Require header is added to 200 responses is
  inspired by the method that Olle Johansson uses in his darjeeling-prack
  branch.
  
  (closes issue ASTERISK-20570)
  Reported by Matt Jordan, at the behest of Olle Johansson
  
  Review: https://reviewboard.asterisk.org/r/2172
  ........
  
  Merged revisions 376521 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376522 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376550 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-20 19:19:31 +00:00
Automerge script ec170b1b9d Merged revisions 376541 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376541 | alecdavis | 2012-11-20 11:39:11 -0600 (Tue, 20 Nov 2012) | 19 lines
  
  Reduce CLI spam of "Extension Changed" device state messages.
  
  Asterisk 11 follows RFC3265 that states that after every subscribe or resubscribe a notify should be sent.
  Thus the console if filled continuously with the following after every subscribe;
    == Extension Changed 8512[phones] new state IDLE for Notify User cisco1
   
  In Asterisk 1.8 only changes would be sent. Thus only when a device state changed was anything emitted to the console.
  
  fix:
  Only print to console when device state isn't forced.
  
  (closes ASTERISK-20706)
  Reported by: alecdavis
  Tested by: alecdavis
  alecdavis (license 585)
  ........
  
  Merged revisions 376540 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-20 18:19:37 +00:00
Mark Michelson e2196d7981 Get rid of trailing whitespace.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-19 22:34:27 +00:00
Mark Michelson f4328e109d Reorganize code and change behavior of ast_taskprocessor_execute() when taskprocessor is shutting down.
Moved code around to be easier to follow.

ast_taskprocessor_execute() will now return 0 if the taskprocessor is being shut down.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-19 21:31:32 +00:00
Mark Michelson ff06346ea2 Add doxygen to taskprocessor tests.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-19 20:35:39 +00:00
Automerge script abdfdf1cae Merged revisions 376472 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376472 | wdoekes | 2012-11-19 14:03:56 -0600 (Mon, 19 Nov 2012) | 17 lines
  
  Fix most leftover non-opaque ast_str uses.
  
  Instead of calling str->str, one should use ast_str_buffer(str). Same
  goes for str->used as ast_str_strlen(str) and str->len as
  ast_str_size(str).
  
  Review: https://reviewboard.asterisk.org/r/2198
  ........
  
  Merged revisions 376469 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376470 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376471 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-19 20:20:36 +00:00
Automerge script 558c108b92 Merged revisions 376457 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r376457 | mjordan | 2012-11-18 20:14:54 -0600 (Sun, 18 Nov 2012) | 7 lines
  
  Fix uninitialized in this function error
  
  With some versions of gcc, n_buckets will be flagged as being uninitialized
  before use.  While its technically impossible (since the switch statement,
  even without a default, accounts for all possibilities), we'll initialize the
  variable to 0 anyway.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-19 02:19:08 +00:00
Automerge script 0f95c6b380 Merged revisions 376447 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376447 | mjordan | 2012-11-18 14:27:45 -0600 (Sun, 18 Nov 2012) | 55 lines
  
  Reorder startup sequence to prevent lockups when process is sent to background
  
  Although it is very rare and timing dependent, the potential exists for the
  call to 'daemon' to cause what appears to be a deadlock in Asterisk during
  startup.  This can occur when a recursive mutex is obtained prior to the
  daemon call executing.  Since daemon uses fork to send the process into the
  background, any threading primitives are unsafe to re-use after the call.
  Implementations of pthread recursive mutexes are highly likely to store the
  thread identifier of the thread that previously obtained the mutex.  If
  the mutex was locked prior to the fork, a subsequent unlock operation will
  potentially fail as the thread identifier is no longer valid.  Since the
  mutex is still locked, all subsequent attempts to grab the mutex by other
  threads will block.
  
  This behavior exhibited itself most often when DEBUG_THREADS was enabled, as
  this compile time option surrounds the mutexes in Asterisk with another
  recursive mutex that protects the storage of thread related information.  This
  made it much more likely that a recursive mutex would be obtained prior to
  daemon and unlocked after the call.
  
  This patch does the following:
  a) It backports a patch from Asterisk 11 that prevents the spawning of the
     localtime monitoring thread.  This thread is now spawned after Asterisk has
     fully booted.
  b) It re-orders the startup sequence to call daemon earlier during Asterisk
     startup.  This limits the potential of threading primitives being accessed
     by initialization calls before daemon is called.
  c) It removes calls to ast_verbose/ast_log/etc. prior to daemon being called.
     Developers should send error messages directly to stderr prior to daemon,
     as calls to ast_log may access recursive mutexes that store thread related
     information.
  d) It reorganizes when thread local storage is created for storing lock
     information during the creation of threads.  Prior to this patch, the
     read/write lock protecting the list of threads in ast_register_thread would
     utilize the lock in the thread local storage prior to it being initialized;
     this patch prevents that.
  
  On a very related note, this patch will *greatly* improve the stability of the
  Asterisk Test Suite.
  
  Review: https://reviewboard.asterisk.org/r/2197
  
  (closes issue ASTERISK-19463)
  Reported by: mjordan
  Tested by: mjordan
  ........
  
  Merged revisions 376428 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376431 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376441 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-18 21:19:45 +00:00
Automerge script dd85c232f0 Merged revisions 376416 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376416 | mjordan | 2012-11-18 08:31:32 -0600 (Sun, 18 Nov 2012) | 13 lines
  
  Add a test event that reports changes in ConfBridge state
  
  This patch adds a test event to ConfBridge that reports transitions between
  states in ConfBridge.  This is used by tests in the Asterisk Test Suite
  that verify state changes based on the entering/leaving of conference
  participants.
  ........
  
  Merged revisions 376414 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376415 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-18 15:20:26 +00:00
Mark Michelson 623d741ba1 Restructure taskprocessor load test to test integrity of task execution.
This throws a random number to each task and stores a copy locally. After
all tasks have executed, the data is checked to be sure tasks executed
in the correct order.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-17 22:27:39 +00:00
Mark Michelson da0e2169de Add a second default taskprocessor test that executes 20000 tasks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-17 21:55:42 +00:00
Mark Michelson f209bc6f9d Change the default taskprocessor test so it will never hang forever.
Changes the ast_cond_wait() to an ast_cond_timedwait() so that
if there is an issue, we'll never wait forever for the task to
finish execution.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-17 21:48:59 +00:00
Mark Michelson ec68a15619 Test that shutdown callback is called when expected.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-16 05:00:42 +00:00
Mark Michelson 2b36cbe2d5 Change the write-up on taskprocessors to reflect the new design.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-16 04:44:12 +00:00
Mark Michelson 12de4198b8 Add a shutdown callback to taskprocessor listeners.
This helps account for the fact that it is unknown just
how many references may exist for a given taskprocessor
listener, so simply unreffing it from the taskprocessor
shutdown function is not enough to convey the gravity
of the situation.

By putting in a shutdown callback, it now becomes clear
to the listener not to try to do any further operations
on the taskprocessor.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-16 04:33:53 +00:00
Automerge script e8898ec8ba Merged revisions 376341,376344-376345 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376341 | dlee | 2012-11-15 18:08:00 -0600 (Thu, 15 Nov 2012) | 34 lines
  
  Migrate hashtest/hashtest2 to be unit tests.
  
  Both hashtest and hashtest2 are manual testing apps that thrash hash
  tables (hashtab and ao2 containers, respectively), by spinning up
  several threads that randomly insert, delete, lookup and iterate over
  the hash table. If the app doesn't crash, the hash table probably passes
  the test. Those utils are not a part of the typical Asterisk build, so
  they do not usually get compiled. This all makes them less that useful.
  
  This patch removes those manual test programs and replaces them with
  Asterisk unit test modules (test_{hashtab,astobj2}_thrash.so). It also
  attempts to make the tests more deterministic.
  
  * Rather than spinning up some number of threads that operate on the
    hash table randomly, spin up four threads that concurrenly add,
    remove, lookup and iterate over the hash table.
  * Each thread checks the state of the hash table both during and after
    execution, and indicates a test failure if things are not as expected.
  * Each thread times out after 60 seconds to prevent deadlocking the unit
    test run.
  
  (closes issue ASTERISK-20505)
  Reported by: Matt Jordan
  Review: https://reviewboard.asterisk.org/r/2189/
  ........
  
  Merged revisions 376306 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376315 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376339 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r376344 | dlee | 2012-11-15 18:14:00 -0600 (Thu, 15 Nov 2012) | 1 line
  
  Somehow I put in svn-1.6 merge information. Oops.
................
  r376345 | dlee | 2012-11-15 18:15:30 -0600 (Thu, 15 Nov 2012) | 15 lines
  
  Fixed extconf.c breakage introduced in r376306.
  
  To quote wdoekes:
  > Note that I'm not confirming legitimacy of having that file in tree at
  > all. Is anyone using aelparse/conf2ael?
  ........
  
  Merged revisions 376340 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376342 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376343 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-16 00:19:48 +00:00
Automerge script 4b4be549cb Merged revisions 376312 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376312 | jrose | 2012-11-15 17:10:13 -0600 (Thu, 15 Nov 2012) | 23 lines
  
  app_meetme: Fix channels lingering when hung up under certain conditions
  
  Channels would get stuck and MeetMe would repeatedly display an Unable
  to write frame to channel error in the conf_run function if hung up
  during certain sound prompts such as during user count announcements.
  This patch fixes that by reintroducing a hangup check in the meetme's
  main loop (also in conf_run).
  
  (closes issue ASTERISK-20486)
  Reported by: Michael Cargile
  Review: https://reviewboard.asterisk.org/r/2187/
  Patches:
      meetme_hangup_patch_ASTERISK-20486_v3.diff uploaded by Jonathan Rose (license 6182)
  ........
  
  Merged revisions 376307 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376308 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376310 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-15 23:20:11 +00:00
Automerge script 748b374ac8 Merged revisions 376291 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376291 | beagles | 2012-11-15 08:35:01 -0600 (Thu, 15 Nov 2012) | 14 lines
  
  Patch to prevent stopping the active generator when it is not the silence
  generator.
  
  This patch introduces an internal helper function to safely check whether the
  current generator is the one that is expected before deactivating it. The
  current externally accessible ast_channel_stop_generator() function has been
  modified to be implemented in terms of the new function.
  
  (closes issue ASTERISK-19918)
  Reported by: Eduardo Abad
  ........
  
  Merged revisions 376217 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-15 15:20:01 +00:00
Automerge script 4db8931969 Merged revisions 376282 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376282 | newtonr | 2012-11-14 20:29:40 -0600 (Wed, 14 Nov 2012) | 16 lines
  
  (issue ASTERISK-20280)
  (closes issue ASTERISK-20280)
  Reported by: Tomo Takebe
  Tested by: Rusty Newton
  Patches:
      asterisk20280.patch uploaded by Rusty Newton (license 5829)
  ........
  
  Merged revisions 376262 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376263 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376264 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-15 03:19:12 +00:00
Automerge script c178c4d337 Merged revisions 376235 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376235 | rmudgett | 2012-11-14 13:55:39 -0600 (Wed, 14 Nov 2012) | 25 lines
  
  Fix call files when astspooldir is relative.
  
  Future dated call files are ignored when astspooldir is relative to the
  current directory.  The queue_file() assumed that the qdir needed to be
  prepended if the given filename did not start with a '/'.  If astspooldir
  is relative it is not going to start from the root directory obviously so
  it will not start with a '/'.  The filename used in queue_file()
  ultimately results in qdir prepended multiple times.
  
  * Made queue_file() not prepend qdir if the filename contains a '/'.
  
  (closes issue ASTERISK-20593)
  Reported by: James Le Cuirot
  Patches:
        0004-Fix-future-call-files-from-relative-directories.patch (license #6439) patch uploaded by James Le Cuirot
  ........
  
  Merged revisions 376232 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376233 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376234 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-14 20:20:21 +00:00
Automerge script 096540c2c0 Merged revisions 376219 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r376219 | jrose | 2012-11-13 13:42:13 -0600 (Tue, 13 Nov 2012) | 12 lines
  
  chan_sip: Add SubscribeContext field to SIPshowpeer AMI response
  
  The new field is will show up within the response if the requested peer has a
  subscribe context set.
  
  (closes issue ASTERISK-20626)
  Reported by: Jaco Kroon
  Patches:
      asterisk-sip-ami-SubscrContext.patch uploaded by jkroon (license 5671)
          -with modifications by jrose to conform to style guidelines
  Review: https://reviewboard.asterisk.org/r/2195/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-13 20:19:49 +00:00
Automerge script 69ae9ff20d Merged revisions 376148,376169 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376148 | elguero | 2012-11-12 14:18:47 -0600 (Mon, 12 Nov 2012) | 26 lines
  
  Fix Dynamic Hints Variable Substition - Underscore Problem
  
  When adding a dynamic hint, if an extension contains an underscore no variable
  subsitution is being performed.
  
  This patch changes from checking if the extension contains an underscore to
  checking if the extension begins with an underscore.
  
  (closes issue ASTERISK-20639)
  Reported by: Steven T. Wheeler
  Tested by: Steven T. Wheeler, Michael L. Young
  Patches:
    asterisk-20639-dynamic-hint-underscore.diff 
                                       uploaded by Michael L. Young (license 5026)
  
  Review: https://reviewboard.asterisk.org/r/2188/
  ........
  
  Merged revisions 376142 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376143 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376144 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r376169 | file | 2012-11-12 14:46:51 -0600 (Mon, 12 Nov 2012) | 20 lines
  
  Properly check if the "Context" and "Extension" headers are empty in a ShowDialPlan action.
  
  The code which handles the ShowDialPlan action wrongly assumed that a non-NULL return value
  from the function which retrieves headers from an action indicates that the header has a
  value. This is incorrect and the contents must be checked to see if they are blank.
  
  (closes issue ASTERISK-20628)
  Reported by: jkroon
  Patches:
       asterisk-showdialplan-incorrect-error.patch uploaded by jkroon
  ........
  
  Merged revisions 376166 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376167 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376168 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-12 21:20:14 +00:00
Mark Michelson 426e8d1454 Refine the taskprocessor listener test a bit more.
This makes it easier to follow and tests more thoroughly.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-12 00:36:16 +00:00
Automerge script 0874e3c825 Merged revisions 376131 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376131 | file | 2012-11-11 11:15:47 -0600 (Sun, 11 Nov 2012) | 16 lines
  
  Remove a fixed size limitation for producing SDP and change how ICE support is disabled by default.
  
  With ICE support enabled in chan_sip and a large number of interfaces on the system it was
  possible for the produced SDP to be truncated due to some fixed size buffers. These buffers
  have now been changed so they will dynamically grow as needed.
  
  ICE support is now also enabled by default in res_rtp_asterisk to provide a smoother experience
  for chan_motif users where it is required. To maintain the previous behavior in chan_sip it is
  no longer enabled by default there.
  
  (closes issue ASTERISK-20643)
  Reported by: coopvr
  ........
  
  Merged revisions 376130 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-11 17:20:20 +00:00
Mark Michelson 7d84963667 Add a test that ensures that taskprocessor listener callbacks
are properly called.

The new test is a bit raw in that it uses magic numbers, but that
can be improved upon easily.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-09 23:23:32 +00:00
Mark Michelson a4a48d9274 Add doxygen and constify some things.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-09 22:49:25 +00:00
Mark Michelson d5716ecae2 Genericize the allocation and destruction of taskprocessor listeners.
The goal of this is to take the responsibility away from individual
listeners to be sure to properly unref the taskprocessor.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-09 22:28:10 +00:00
Mark Michelson 6fc8d830f8 Add a basic taskprocessor test.
This just queues a task and ensures that the task
gets executed by the default taskprocessor listener.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-09 19:42:47 +00:00
Mark Michelson 902a2d8919 Get rid of taskprocessor fields no longer necessary.
This includes changing the taskprocessor to use its builtin
ao2_lock instead of having a separate mutex. It can do this
now since there is no longer an ast_cond_t associated with
the taskprocessor.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-08 23:35:10 +00:00
Mark Michelson 77725bf293 Move taskprocessors to use a listener model.
Taskprocessors are now divided into two units: the task queue
and their listeners.

When a task is added to the queue, the listener is notified and
can take whatever action is desired. This means that taskprocessors
are no longer confined to having their tasks executed within a 
single thread.

A default taskprocessor listener has been added that mirrors the
old taskprocessor behavior.

I've tested it by running Asterisk and placing calls. It appears
to work as expected. I'm going to do some cleaning up first and
then write some unit tests to be sure everything works as expected.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-08 23:27:16 +00:00
Automerge script 7c6c20bfc6 Merged revisions 376092 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376092 | mmichelson | 2012-11-08 16:10:29 -0600 (Thu, 08 Nov 2012) | 18 lines
  
  Fix a "set but not used" warning on newer gccs.
  
  Turns out the "helpful" setting of ms and res in this
  macro is completely useless after the timeout antipattern
  fix.
  
  If you're a new guy looking to write code, don't write
  a macro like this one.
  ........
  
  Merged revisions 376087 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376088 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376089 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-08 22:19:40 +00:00
Automerge script bf369f2018 Merged revisions 376061 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376061 | rmudgett | 2012-11-08 15:12:35 -0600 (Thu, 08 Nov 2012) | 22 lines
  
  chan_dahdi/SS7: Made reject incoming call for an in-alarm or blocked channel.
  
  If a SS7 call comes in requesting a CIC that is in-alarm, the call is
  accepted and connects if the extension exists in the dialplan.  The call
  does not have any audio.
  
  * Made release the call immediately with circuit congestion cause.
  
  (closes issue ASTERISK-20204)
  Reported by: Tuan Le
  Patches:
        jira_asterisk_20204_v1.8.patch (license #5621) patch uploaded by rmudgett
  ........
  
  Merged revisions 376058 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376059 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376060 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-08 21:19:33 +00:00
Automerge script f69513b85b Merged revisions 376049 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376049 | rmudgett | 2012-11-08 11:38:31 -0600 (Thu, 08 Nov 2012) | 41 lines
  
  Add MALLOC_DEBUG enhancements.
  
  * Makes malloc() behave like calloc().  It will return a memory block
  filled with 0x55.  A nonzero value.
  
  * Makes free() fill the released memory block and boundary fence's with
  0xdeaddead.  Any pointer use after free is going to have a pointer
  pointing to 0xdeaddead.  The 0xdeaddead pointer is usually an invalid
  memory address so a crash is expected.
  
  * Puts the freed memory block into a circular array so it is not reused
  immediately.
  
  * When the circular array rotates out a memory block to the heap it checks
  that the memory has not been altered from 0xdeaddead.
  
  * Made the astmm_log message wording better.
  
  * Made crash if the DO_CRASH menuselect option is enabled and something is
  found.
  
  * Fixed a potential alignment issue on 64 bit systems.
  struct ast_region.data[] should now be aligned correctly for all
  platforms.
  
  * Extracted region_check_fences() from __ast_free_region() and
  handle_memory_show().
  
  * Updated handle_memory_show() CLI usage help.
  
  Review: https://reviewboard.asterisk.org/r/2182/
  ........
  
  Merged revisions 376029 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376030 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376048 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376054 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-08 18:19:49 +00:00
Mark Michelson f28061145f Get that automerge rollin'
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07 21:28:16 +00:00
Mark Michelson 0e9f2aac74 Create a threadpool API for Asterisk.
A common theme for a lot of feature development has been that
a thread pool would be useful.

In this branch, I plan to implement a generic thread pool whose
policies can be controlled by listeners who react to activity in the pool.

This will more-or-less be a C implementation of the thread pool implemented
in Asterisk SCF.

The first victim^W entity to use the thread pool will be the PBX. It currently
allocates a new thread for each new call and tears it down when the call is
completed. Using a thread pool could be useful for systems that have a steady
amount of traffic on them.

This may, just *may*, also find use in the new chan_sip that is being developed.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07 21:23:20 +00:00
Mark Michelson f2bb9afe17 Multiple revisions 375993-375994
........
  r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines
  
  Fix misuses of timeouts throughout the code.
  
  Prior to this change, a common method for determining if a timeout
  was reached was to call a function such as ast_waitfor_n() and inspect
  the out parameter that told how many milliseconds were left, then use
  that as the input to ast_waitfor_n() on the next go-around.
  
  The problem with this is that in some cases, submillisecond timeouts
  can occur, resulting in the out parameter not decreasing any. When this
  happens thousands of times, the result is that the timeout takes much
  longer than intended to be reached. As an example, I had a situation where
  a 3 second timeout took multiple days to finally end since most wakeups
  from ast_waitfor_n() were under a millisecond.
  
  This patch seeks to fix this pattern throughout the code. Now we log the
  time when an operation began and find the difference in wall clock time
  between now and when the event started. This means that sub-millisecond timeouts
  now cannot play havoc when trying to determine if something has timed out.
  
  Part of this fix also includes changing the function ast_waitfor() so that it
  is possible for it to return less than zero when a negative timeout is given
  to it. This makes it actually possible to detect errors in ast_waitfor() when
  there is no timeout.
  
  (closes issue ASTERISK-20414)
  reported by David M. Lee
  
  Review: https://reviewboard.asterisk.org/r/2135/
........
  r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines
  
  Remove some debugging that accidentally made it in the last commit.
........

Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375995 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 376014 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07 19:15:26 +00:00
Richard Mudgett 6ad0126425 Fix stuck DTMF when bridge is broken.
When a bridge is broken by an AMI Redirect action or the ChannelRedirect
application, an in progress DTMF digit could be stuck sending forever.

* Made simulate a DTMF end event when a bridge is broken and a DTMF digit
was in progress.

(closes issue ASTERISK-20492)
Reported by: Jeremiah Gowdy
Patches:
      bridge_end_dtmf-v3.patch.txt (license #6358) patch uploaded by Jeremiah Gowdy
      Modified to jira_asterisk_20492_v1.8.patch
      jira_asterisk_20492_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: rmudgett

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

Merged revisions 375964 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375965 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375966 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-06 19:05:11 +00:00
Joshua Colp 82dc21e0e1 Fix a bug where our Motif ICE candidates were not quite proper, and make us more forgiving.
An issue was reported on the mailing list where calling would result in an "Incomplete
ICE-UDP candidate received on session" error message. This is the result of the ICE-UDP
candidate code not placing a "network" attribute within the candidates. This is now done.
To increase compatibility though I have removed the requirement for the "network" attribute
to exist within ICE-UDP candidates that are received since we don't actually require the
value.

Reported on the mailing list by Jean-Denis Girard.
........

Merged revisions 375925 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-06 12:15:31 +00:00
Matthew Jordan a0c363e227 Refactor ast_timer_ack to return an error and handle the error in timer users
Currently, if an acknowledgement of a timer fails Asterisk will not realize
that a serious error occurred and will continue attempting to use the timer's
file descriptor.  This can lead to situations where errors stream to the
CLI/log file.  This consumes significant resources, masks the actual problem
that occurred (whatever caused the timer to fail in the first place), and
can leave channels in odd states.

This patch propagates the errors in the timing resource modules up through
the timer core, and makes users of these timers handle acknowledgement
failures.  It also adds some defensive coding around the use of timers
to prevent using bad file descriptors in off nominal code paths.

Note that the patch created by the issue reporter was modified slightly for
this commit and backported to 1.8, as it was originally written for
Asterisk 10.

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

(issue ASTERISK-20032)
Reported by: Jeremiah Gowdy
patches:
  jgowdy-timerfd-6-22-2012.diff uploaded by Jeremiah Gowdy (license 6358)
........

Merged revisions 375893 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375894 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375895 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-05 23:10:14 +00:00
Richard Mudgett 5336a97f25 Add safety NULL pointer check in module user references.
Made __ast_module_user_remove() check for NULL pointers.
........

Merged revision 375860 from C.3
........

Merged revisions 375862 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375863 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375864 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-05 21:42:49 +00:00
Jonathan Rose ff09fa5ac5 chan_sip: Document a change to user-field encoding introduced with r303509
The change in question was added to improve compliance with RFC3261, but at
the time of commit, it wasn't adequately documented in the UPGRADE notes.

(closes issue ASTERISK-20561)
Reported by: Deniz
Review: https://reviewboard.asterisk.org/r/2177/
........

Merged revisions 375846 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375847 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-05 18:00:39 +00:00
Matthew Jordan b6bac916f0 Don't attempt to purge sessions when no sessions exist
Manager's tcp/tls objects have a periodic function that purge old manager
sessions periodically.  During shutdown, the underlying container holding
those sessions can be disposed of and set to NULL before the tcp/tls periodic
function is stopped.  If the periodic function fires, it will attempt to
iterate over a NULL container.

This patch checks for whether or not the sessions container exists before
attempting to purge sessions out of it.  If the sessions container is NULL,
we simply return.

Note that this error was also caught by the Asterisk Test Suite.
........

Merged revisions 375800 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375801 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375802 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-04 03:10:21 +00:00
Matthew Jordan 069f5f8b93 Only deref a reserved gateway session if we actually reserved one
Its perfectly acceptable to have a gateway session unreserved when we go to
first allocate one.  Unreffing the reserved gateway session - when its NULL -
will result in an assertion error.

This problem was caught by the Asterisk Test Suite (once we had enough of the
debugging flags enabled)
........

Merged revisions 375797 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375798 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-04 02:44:35 +00:00