Commit Graph

4000 Commits

Author SHA1 Message Date
Kinsey Moore d182115fcb Resolve a ref leak in threadpool.c
Ownership of the listener reference is not transferred because the
listener is reffed when placed into the taskprocessor. Ensure that the
listener is dereffed properly.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-06 15:21:42 +00:00
Richard Mudgett 736f4e9420 Fixup some bridge and format capabilities comments and whitespace.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-04 21:15:36 +00:00
Jason Parker 22d58fbea8 Fix comparison of presence state in event subsystem.
Several new IEs were not given types (or names), causing the comparison
function to improperly succeed.  This adds those.

(closes issue AST-1128)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-04 21:14:30 +00:00
Joshua Colp a4f45a2c95 Add support for registering a sorcery handler which supports multiple fields using a regex.
Review: https://reviewboard.asterisk.org/r/2332/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382340 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-01 18:01:56 +00:00
Richard Mudgett 855bb334c8 threadpool: Make ast_threadpool_push() return -1 if shutting_down
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-28 21:31:14 +00:00
Richard Mudgett e2832f18bc threadpool: Whitespace and comment corrections.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-28 21:29:57 +00:00
Tzafrir Cohen 4951ab9ed1 Remove unneeded linux-gnueabi*
As of r380522 the configure scripts converts the value of linux-gnueabi*
of OSARCH to "linux-gnu". So no point in testing for those values.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-26 19:29:14 +00:00
Matthew Jordan 182098ba96 Don't display the AMI ALL class authorization for users if they don't have it
When converting AMI class authorizations to a string representation, the
method always appends the ALL class authorization. This is especially
important for events, as they should always communicate that class
authorization - even if the event itself does not specify ALL as a class
authorization for itself. (Events have always assumed that the ALL class
authorization is implied when they are raised)

Unfortunately, this did mean that specifying a user with restricted class
authorizations would show up in the 'manager show user' CLI command as
having the ALL class authorization.

Rather then modifying the existing string manipulation function, this patch
adds a function that will only return a string if the field being compared
explicitly matches class authorization field it is being compared against.
This prevents ALL from being returned unless it is actually specified for
the user.

(closes issue ASTERISK-20397)
Reported by: Johan Wilfer
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-24 16:27:47 +00:00
Kevin Harwell 5e9994ed9c Write the correct callid to the data1 field in queue_log for transfer events.
The incorrect callid was being written to the "data1" field in queue_log table
for transfer events.  The callid of the queue was being written instead of the
transfer target's callid.  This now gets the correct "transfer to" number and
places that in the "data1" field of the queue_log table when a transfer event
is triggered.

(closes issue ASTERISK-19960)
Reported by: vladimir shmagin
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-19 19:47:42 +00:00
Michael L. Young d1f8e338b0 Add The Status Of A Module To The Output Of "CLI> module show"
When a module's configuration is not loadable, we still load the module but it
is not in a running state.  When trying to troubleshoot, let's say, why
chan_motif is ignoring inbound XMPP traffic, there is no way to indicate that a
loaded module is not currently running.

(closes issue ASTERISK-21108)
Reported by: Rusty Newton
Tested by: Michael L. Young
Patches:
  asterisk-21108_add_status-v2.diff Michael L. Young (license 5026)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-19 17:17:10 +00:00
Joshua Colp cce1c9547f Add support for retrieving multiple objects from sorcery using a regex on their id.
Review: https://reviewboard.asterisk.org/r/2329/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381614 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-16 16:24:21 +00:00
Matthew Jordan c209e85ad3 Fix crash in PresenceState AMI action when specifying an invalid provider
This patch fixes a crash in Asterisk that could be caused by using the
PresenceState AMI action while providing an invalid provider. This patch
also adds some additional warnings when a user attempts to provide the
PresenceState action with invalid data, and removes some NOTICE statements
that were still lurking in the code from testing.

(closes issue AST-1084)
Reported by: John Bigelow
Tested by: John Bigelow
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15 23:29:28 +00:00
Matthew Jordan e123ee2d77 Disable strict XML documentation config checking; fix crash caused by sorcery
This patch does two things:
 1. It disables (temporarily) strict XML documentation checking for module
    configurations. We should re-enable it before making any release from
    trunk.
 2. Pass the module flag AST_MODULE through sorcery. This means several of the
    API calls are now macros and will do this automatically for you. The config
    framework needs the module that objects are registering to so it can
    properly construct the documentation. (This was already a required field,
    but sorcery was getting by without it)




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15 18:44:24 +00:00
Kevin Harwell 71bce17720 Stopped spamming of debug messages during attended transfer.
While autoservice is running and servicing a channel the callid is being stored
and removed in the thread's local storage for each iteration of the thread loop.
If debug was set to a sufficient level the log file would be spammed with callid
thread local storage debug messages.

Added a new function that checks to see if the callid to be stored is different
than what is already contained (if anything).  If it is different then
store/replace and log, otherwise just leave as is.  Also made it so all logging
of debug messages pertaining to the callid thread storage outputs only when
TEST_FRAMEWORK is defined.

(issue ASTERISK-21014)
(closes issue ASTERISK-21014)
Report by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2324/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15 17:38:22 +00:00
Matthew Jordan d04ab3c645 Add CLI configuration documentation
This patch allows a module to define its configuration in XML in source, such
that it can be parsed by the XML documentation engine. Documentation is
generated in a two-pass approach:

1. The documentation is first generated from the XML pulled from the source
2. The documentation is then enhanced by the registration of configuration
   options that use the configuration framework

This patch include configuration documentation for the following modules:
 * chan_motif
 * res_xmpp
 * app_confbridge
 * app_skel
 * udptl

Two new CLI commands have been added:
 * config show help - show configuration help by module, category, and item
 * xmldoc dump - dump the in-memory representation of the XML documentation to
   a new XML file.

Review: https://reviewboard.asterisk.org/r/2278
Review: https://reviewboard.asterisk.org/r/2058

patches:
  on review 2058 uploaded by twilson



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15 13:38:12 +00:00
Richard Mudgett d3811a2352 End stuck DTMF if AST_SOFTHANGUP_ASYNCGOTO because it isn't a real hangup.
It doesn't hurt to check AST_SOFTHANGUP_UNBRIDGE either, but it should not
be set outside of a bridge.

(issue ASTERISK-20492)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14 19:52:14 +00:00
Kinsey Moore 2e1e0735fe Revamp of terminal color codes
The core module related to coloring terminal output was old and needed
some love.  The main thing here was an attempt to get rid of the
obscene number of stack-local buffers that were allocated for no other
reason than to colorize some output.  Instead, this uses a simple trick
to allocate several buffers within threadlocal storage, then
automatically rotates between them, so that you can make multiple calls
to the colorization routine within one function and not need to
allocate multiple buffers.

Review: https://reviewboard.asterisk.org/r/2241/
Patches:
    bug.patch uploaded by Tilghman Lesher


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14 18:47:56 +00:00
David M. Lee 222e8a3afb Add a serializer interface to the threadpool
This patch adds the ability to create a serializer from a thread pool. A
serializer is a ast_taskprocessor with the same contract as a default
taskprocessor (tasks execute serially) except instead of executing out
of a dedicated thread, execution occurs in a thread from a
ast_threadpool. Think of it as a lightweight thread.

While it guarantees that each task will complete before executing the
next, there is no guarantee as to which thread from the pool individual
tasks will execute. This normally only matters if your code relys on
thread specific information, such as thread locals.

This patch also fixes a bug in how the 'was_empty' parameter is computed
for the push callback, and gets rid of the unused 'shutting_down' field.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-12 21:45:59 +00:00
Mark Michelson e9ff351f06 Do not allow native RTP bridging if packetization of media streams differs.
The RTP engine will no longer allow for local and remote native RTP bridges
if packetization of streams differs. Allowing native bridging in this scenario
has been known to cause FAX failures.

(closes ASTERISK-20650)
Reported by: Maciej Krajewski
Patches:
	ASTERISK-20659.patch uploaded by Mark Michelson (License #5049)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-12 20:57:31 +00:00
Richard Mudgett 3d91f97cf9 features: Don't cache a struct ast_app pointer.
Caching a struct ast_app pointer is not a good idea because someone could
unload the application.  After the applicaiton unload the cached ast_app
pointer is no longer valid.  Only pbx.c can cache the pointer because it
knows when the application is unloaded and removes the pointer.

* Fixed one-touch Monitor and MixMonitor to not cache the ast_app pointer
and not use the silly monitor_ok/mixmonitor_ok/stopmixmonitor_ok flags.

* Extracted bridge_check_monitor() from ast_bridge_call() and use propper
locking.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-11 18:00:05 +00:00
Joshua Colp 27882b8599 Add additional functionality to the Sorcery API.
This commit adds native implementation support for copying and diffing objects,
as well as the ability to load or reload on a per-object type level.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-10 14:58:37 +00:00
Richard Mudgett 0e442112ad pbx: Fix regression caused by taking advantage of the function name sort.
Taking advantage of the sorted order of the registered functions container
requires that they are actually inserted in the expected sort order.

* Insert the registered functions into the container in case sensitive
position.  As a result, only the complete_functions() routine needs to
search the entire container because it does a case insensitive search for
convenience.

Caught by the unit tests.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-09 20:58:53 +00:00
Richard Mudgett 1e65035d17 pbx: Make function and application containers take advantage of being sorted.
* Fixed "core show function" tab completion and token count checking.

* Refactored function and application container handling code to reduce
redundancy.

* Made __ast_pbx_run() return using the defines the caller should expect.
Doesn't change the returned values.  Just made use the defines.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-09 03:51:32 +00:00
Richard Mudgett 5b236ee647 Make ast_do_masquerade() a void function.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-09 01:31:55 +00:00
Jonathan Rose 1a70d513f1 Call Parking: Set PARKINGLOT and PARKINGSLOT variables on all parked calls
These two variables were previously not being set when comebacktoorigin=yes
and the example configs seemed to imply that they should be. Since there
is no harm in this and since calls that are sent back to origin are capable
of continuing in the dialplan, this seemed like a no-brainer. Also it
supports some bridging tests I've been working on.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-08 17:36:23 +00:00
Richard Mudgett 657aa491f0 Separate option_types[] from the struct definition.
Updated the option_types[] doxygen comment.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-05 18:13:09 +00:00
Richard Mudgett 32ac38ea37 Improve func FRAME_TRACE DTMF digit format.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-31 18:15:49 +00:00
Richard Mudgett b7ecff2e4b Eliminate a use of a C++ keyword as a variable. new to new_frame
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-31 18:14:05 +00:00
Joshua Colp ffaf79b1eb Fix an issue where building with DEBUG_FD_LEAKS enabled would not work due to sorcery using calls called "open" and "close".
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-29 20:19:28 +00:00
Jonathan Rose 80021f220c call_parking: Make sure fallbacks are used when lacking a flat channel exten
A regression was introduced which removed automatic fallback behavior from
the PBX. This behavior was used by call parking (or at least documented as
how the feature works) in order to select an extension when the flat channel
extension wasn't available from the comebackcontext. Parking now handles
the fallbacks internally in order to keep behavior matching with how it is
documented.

(closes issue ASTERISK-20716)
Reported by: Chris Gentle
Review: https://reviewboard.asterisk.org/r/2296/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-29 17:06:17 +00:00
Russell Bryant 5d41d31621 Change cleanup ordering in filestream destructor.
This patch came about due to a problem observed where wav files had an
empty header.  The header is supposed to be updated in wav_close().  It
turns out that this was broken when the cache_record_files option from
asterisk.conf was enabled.  The cleanup code was moving the file to its
final destination *before* running the close() method of the file
destructor, so the header didn't get updated.

Another problem here is that the move was being done before actually
closing the FILE *.

Finally, the last bug fixed here is that I noticed that wav_close()
checks for stream->filename to be non-NULL.  In the previous cleanup
order, it's checking a pointer to freed memory.  This doesn't actually
cause anything to break, but it's treading on dangerous waters.  Now the
free() of stream->filename is happening after the format module's
close() method gets called, so it's safer.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-28 01:58:41 +00:00
Russell Bryant dfdf3d9909 Add queue_log_realtime_use_gmt option to logger.conf
Add an option that lets you specify that the timestamps going into the realtime
queue log should be in GMT instead of local time.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-28 01:50:54 +00:00
Joshua Colp 44ce06682b Fix a bug where the apply function was not getting called.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-27 17:13:22 +00:00
Richard Mudgett 97dcd1d935 Misc bridge code improvements
* Made multiplexed_bridge_destroy() check if anything to destroy and
cleared bridge_pvt pointer after destruction.

* Made multiplexed_add_or_remove() handling of the chans array simpler.

* Extracted bridge_channel_poke().

* Simplified bridge_array_remove() handling of the bridge->array[].  The
array does not have a NULL sentinel pointer.

* Made ast_bridge_new() not create a temporary bridge just to see if it
can be done.  Only need to check if there is an appropriate bridge tech
available.

* Made ast_bridge_new() clean up on allocation failures.

* Made destroy_bridge() free resources in the opposite order of creation.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-25 20:00:21 +00:00
Richard Mudgett 7bb540dc80 More trivial bridge code cleanup.
* Breaking long lines
* Word wrapping comment blocks.
* Removing redundant initializers.
* Debug message wording.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-25 19:29:04 +00:00
Joshua Colp 3fa4278a31 Merge the sorcery data access layer API.
Sorcery is a unifying data access layer which provides a pluggable mechanism to allow
object creation, retrieval, updating, and deletion using different backends (or wizards).

This is a fancy way of saying "one interface to rule them all" where them is configuration,
realtime, and anything else that comes along.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-25 14:01:04 +00:00
Richard Mudgett 22ae23eed3 Attempt to be more helpful when using a bad ao2 object pointer.
Put the external obj pointer in the message instead of the internal version.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-23 00:30:00 +00:00
Matthew Jordan 7d9871b394 Add ControlPlayback manager action
This patch adds the capability for asynchronous manipulation of audio being
played back to a channel though a new AMI action "ControlPlayback". The
ControlPlayback action supports a number of operations, the availability of
which depend on the application being used to send audio to the channel.
When the audio playback was initiated using the ControlPlayback application
or CONTROL STREAM FILE AGI command, the audio can be paused, stopped,
restarted, reversed, or skipped forward. When initiated by other mechanisms
(such as the Playback application), the audio can be stopped, reversed, or
skipped forward.

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

(closes issue ASTERISK-20882)
Reported by: mjordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-22 15:16:20 +00:00
Matthew Jordan a3e7a77a82 Update init.d scripts to handle stderr; readd splash screen for remote consoles
When r376428 was commited to re-order start up sequences to be more tolerant of
forking with thread primitives, a few items were changed that caused changes
in behavior on some distros. This includes:
 * Not displaying the splash screen on a remote console.
 * Displaying an error message on stderr when a remote console cannot connect
   to a running instance of Asterisk.

In the first case, the splash screen was re-added (thanks to Michael L. Young).
In the second case, the various init.d scripts were modified to pipe stderr
to /dev/null, as the error message is useful - if you execute a remote
console or a remote console command execution and it fail, it should tell
you. Note that the error message was always present, it just failed to be
printed prior to r376428.

Much thanks to the folks who quickly reported this problem, provided solutions,
and promptly tested the various init.d scripts on a variety of distros.

(closes issue ASTERISK-20945)
Reported by: Warren Selby
Tested by: Michael L. Young, Jamuel Starkey, kaldemar, Danny Nicholas, mjordan
patches:
  asterisk-20945-remote-intro-msg.diff uploaded by elguero (license 5026)
  ASTERISK-20945-1.8-mjordan.diff uploaded by mjordan (license 6283)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-21 20:41:12 +00:00
Richard Mudgett c23a04c7f0 Better protect bridge_channel state from other threads.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-21 20:35:12 +00:00
Richard Mudgett 7a69e6c5ac Extract common bridging code into bridge_stop() and bridge_force_out_all().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-21 20:24:23 +00:00
Richard Mudgett c6e6b7f2f1 Made some bridging API calls void. Some bridging comments updated.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-21 20:15:57 +00:00
Richard Mudgett b5962bd5f6 Trivial bridge code cleanup.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-21 18:45:17 +00:00
Walter Doekes e6a3674150 Add builtin roundf() for systems lacking it.
(closes issue ASTERISK-16854)
Review: https://reviewboard.asterisk.org/r/2276
Reported-by: Ovidiu Sas
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379549 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-19 20:54:07 +00:00
Matthew Jordan 01763fd41b Fix astcanary startup problem due to wrong pid value from before daemon call
When Asterisk forks itself into the background via a call to daemon, it must
re-set the pid value of the new process. Otherwise, astcanary gets the pid
value of the process before the fork, which prevents it from running. Asterisk
eventually starts lowering its priority, as it can no longer communicate
with the proverbial canary in the coal mine.

This patch ensures that the correct process identifier is used by astcanary.

Note that this is getting committed to 10 as a regression fix.

(closes issue ASTERISK-20947)
Reported by: Jakob Hirsch
Tested by: mjordan
patches:
  asterisk-10.12.0.astcanary_ppid.diff uploaded by Jakob Hirsch (license 6113)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379518 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-19 00:19:19 +00:00
David M. Lee bc97a4ded1 Up the minimum OS X version to 10.6.
* This allows us to remove some special-case build logic.
 * 10.5 is down to less that 8% of the OS X market share. 10.4 is down to 
   under 2%.
 * Apple is no longer releasing security updates for 10.5 and earlier.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-18 22:42:38 +00:00
David M. Lee 7bd50bc0c4 Specify the -rpath linker flag when prefix != /usr.
This allows Asterisk to start without having to specify the
LD_LIBRARY_PATH. This can be disabled by passing --disable-rpath to
configure.

(closes issue ASTERISK-20407)
Reported by: David M. Lee
Review: https://reviewboard.asterisk.org/r/2132/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-18 21:35:09 +00:00
Mark Michelson 84c50fde1f Address David's latest feedback on reviewboard:
* Add a max_size option for threadpools. Also added a test for this option.
* Fixed comments to be more accurate and have fewer typos.
* Updated copyright dates on new files.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-17 16:04:10 +00:00
Automerge script 29620f5a6e Merged revisions 379312 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r379312 | mmichelson | 2013-01-16 16:51:32 -0600 (Wed, 16 Jan 2013) | 11 lines
  
  Further fix misinformation in the description of manager MailboxStatus command.
  
  The description still claimed that it returned the number of messages rather than
  whether there were messages waiting.
  ........
  
  Merged revisions 379310 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 379311 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379321 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-16 23:20:22 +00:00
Automerge script 108f5cc599 Merged revisions 379229,379231,379233 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r379229 | mjordan | 2013-01-16 11:46:15 -0600 (Wed, 16 Jan 2013) | 10 lines
  
  Let documentation reference links specify which module they're linking to
  
  Again, since res_jabber/res_xmpp have duplicate APIs, their documentation ref
  links have to specify which reference they're referring to. The various
  documentation parsers can interpret the module attribute however they want
  in order to construct the appropriate links.
  ........
  
  Merged revisions 379228 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r379231 | rmudgett | 2013-01-16 11:49:52 -0600 (Wed, 16 Jan 2013) | 10 lines
  
  chan_misdn: Fix compile error.
  
  (issue ASTERISK-15456)
  ........
  
  Merged revisions 379226 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 379230 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r379233 | rmudgett | 2013-01-16 12:09:28 -0600 (Wed, 16 Jan 2013) | 8 lines
  
  Reduce call-id logging resource usage.
  
  Since there is no need for the call-id logging ao2 object to have a lock,
  don't create it with one.
  ........
  
  Merged revisions 379232 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-16 18:20:38 +00:00
Automerge script 0dc9cc48a0 Merged revisions 379128 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r379128 | rmudgett | 2013-01-15 16:23:49 -0600 (Tue, 15 Jan 2013) | 1 line
  
  Fix ast_bridge_features_register() not registering builtin features. I broke. Ooops.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-15 23:20:18 +00:00
Mark Michelson a73d6e5b86 Add doxygen to accessors and increase refcount of taskprocessor before returning.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-15 21:15:04 +00:00
Mark Michelson 967e380ba8 Make the threadpool listener opaque.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-15 21:09:55 +00:00
Mark Michelson 663479a558 Make ast_taskprocessor_listener opaque.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-15 20:48:45 +00:00
Mark Michelson 03e89247de Address further review feedback from David Lee.
* Clarify some documentation
* Change copyright date of taskprocessor files
* Address potential issue of creating taskprocessor with listener if
  taskprocessor with that name exists already



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-15 20:15:00 +00:00
Mark Michelson c6bc51ef28 Make the initial size of the threadpool part of the options passed in.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-15 19:44:25 +00:00
Mark Michelson edc2e4dac0 Remove threadpool listener alloc and destroy callbacks.
This replaces the destroy callback with a shutdown callback
instead.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-15 19:36:33 +00:00
Mark Michelson 65c7d6e2c3 Remove alloc and destroy callbacks from the taskprocessor.
Now user data is allocated by the creator of the taskprocessor
listener and that user data is passed into ast_taskprocessor_listener_alloc().
Similarly, freeing of the user data is left up to the user himself. He can
free the data when the taskprocessor shuts down, or he can choose to hold
onto it if it makes sense to do so.

This, unsurprisingly, makes threadpool allocation a LOT cleaner now.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-15 18:40:36 +00:00
Automerge script 0d3dfad94f Merged revisions 379021,379023 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r379021 | dlee | 2013-01-14 09:29:22 -0600 (Mon, 14 Jan 2013) | 15 lines
  
  Fix XML encoding of 'identity display' in NOTIFY messages, continued.
  
  When r378933 was merged into 1.8, it should have also escaped
  remote_display, since it will have the same XML encoding problem when
  the caller/callee roles are reversed.
  
  (closes issue ABE-2902)
  Reported by: Guenther Kelleter
  ........
  
  Merged revisions 379001 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 379020 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r379023 | dlee | 2013-01-14 09:58:01 -0600 (Mon, 14 Jan 2013) | 20 lines
  
  Masquerades are an insane implementation detail within Asterisk. It generates
  a number of useless and confusing events, and manipulates channels in a way
  that semantically doesn't make sense. I've given a fairly thorough review of
  masquerade code and its usage on the wiki at
  https://wiki.asterisk.org/wiki/x/IwBRAQ.
  
  While ultimately it makes the most sense to abandon masquerades altogether,
  it will take some time to completely irradicate. Even then, there may always
  be code that's not worth rewriting to get rid of the masquerade.
  
  This patch does two things to make masquerades slightly less insane:
   * When swapping the names of the original and clone channel, only emit a
     single rename event of original -> original<ZOMBIE>. The original code
     issued three rename events to accomplish the same end.
   * In addition to swapping the names of the channels, also swap their
     uniqueid's. This allows the 'Uniqueid' field to be used as a stable
     identifier for a channel from and external interface, such as AMI.
  
  Review: https://reviewboard.asterisk.org/r/2266/
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-14 16:20:46 +00:00
Automerge script f7f7850f7a Merged revisions 378935 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378935 | dlee | 2013-01-12 00:43:37 -0600 (Sat, 12 Jan 2013) | 41 lines
  
  Fix XML encoding of 'identity display' in NOTIFY messages.
  
  XML encoding in chan_sip is accomplished by naively building the XML
  directly from strings. While this usually works, it fails to take into
  account escaping the reserved characters in XML.
  
  This patch adds an 'ast_xml_escape' function, which works similarly to
  'ast_uri_encode'. This is used to properly escape the local_display
  attribute in XML formatted NOTIFY messages.
  
  Several things to note:
   * The Right Thing(TM) to do would probably be to replace the
     ast_build_string stuff with building an ast_xml_doc. That's a much
     bigger change, and out of scope for the original ticket, so I
     refrained myself.
   * It is with great sadness that I wrote my own ast_xml_escape
     function. There's one in libxml2, but it's knee-deep in
     libxml2-ness, and not easily used to one-off escape a
     string.
   * I only escaped the string we know is causing problems
     (local_display). At least some of the other strings are
     URI-encoded, which should be XML safe. Rather than figuring out
     what's safe and escaping what's not, it would be much cleaner to
     simply build an ast_xml_doc for the messages and let the XML
     library do the XML escaping. Like I said, that's out of scope.
  
  (closes issue ABE-2902)
  Reported by: Guenther Kelleter
  Tested by: Guenther Kelleter
  Review: http://reviewboard.digium.internal/r/365/
  
  ........
  
  Merged revision 378919 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
  ........
  
  Merged revisions 378933 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378934 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-12 07:21:01 +00:00
Automerge script 2c1720b4f7 Merged revisions 378915,378918 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378915 | dlee | 2013-01-11 16:31:42 -0600 (Fri, 11 Jan 2013) | 21 lines
  
  Add JSON API for Asterisk.
  
  This provides a JSON API by pulling in and wrapping the Jansson JSON
  library[1]. The Asterisk API basically mirrors the Jansson
  functionality, with a few minor tweaks.
  
   * Some names have been asteriskified to protect the innocent.
   * Jansson provides both reference-stealing and reference-borrowing
     versions of several API's. The Asterisk API is exclusively
     reference-stealing for operations that put elements into arrays and
     objects.
   * No support for doubles, since we usually don't need that.
   * Coming along for the ride is the ast_test_validate macro, which made
     the unit tests much easier to write.
  
   [1]: http://www.digip.org/jansson/
  
  (issue ASTERISK-20887)
  (closes issue ASTERISK-20888)
  Review: https://reviewboard.asterisk.org/r/2264/
................
  r378918 | file | 2013-01-11 17:05:38 -0600 (Fri, 11 Jan 2013) | 11 lines
  
  Retain XMPP filters across reconnections so external modules continue to function as expected.
  
  Previously if an XMPP client reconnected any filters added by an external module were lost.
  This issue exhibited itself with chan_motif not receiving and reacting to Jingle signaling.
  
  (closes issue ASTERISK-20916)
  Reported by: kuj
  ........
  
  Merged revisions 378917 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-11 23:20:57 +00:00
Automerge script 919f772f78 Merged revisions 378889 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r378889 | rmudgett | 2013-01-09 20:40:50 -0600 (Wed, 09 Jan 2013) | 8 lines
  
  * Simplify native bridge code in ast_channel_bridge().
  
  * Fix an unbalanced manager_bridge_event(unlink) call if
  AST_SOFTHANGUP_UNBRIDGE is set in ast_channel_bridge().
  
  * Make ast_channel_bridge() use common cleanup code when leaving the
  bridge.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-10 03:20:47 +00:00
Automerge script f7e1073af5 Merged revisions 378874 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r378874 | rmudgett | 2013-01-09 19:43:27 -0600 (Wed, 09 Jan 2013) | 4 lines
  
  * Removed some noop code and restructured an else-if ladder in ast_generic_bridge().
  
  * Trivial changes in ast_channel_bridge().
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-10 02:20:50 +00:00
Automerge script 41eba63840 Merged revisions 378854,378858-378859 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r378854 | rmudgett | 2013-01-09 17:22:00 -0600 (Wed, 09 Jan 2013) | 1 line
  
  Fix logger.c function definition.
........
  r378858 | rmudgett | 2013-01-09 17:23:41 -0600 (Wed, 09 Jan 2013) | 6 lines
  
  Trivial misc bridge code changes.
  
  * softmix_bridge_thread() was redundantly initializing an 8K buffer.
  
  * Promoted a debug message to a warning in multiplexed_add_or_remove().
........
  r378859 | rmudgett | 2013-01-09 17:51:45 -0600 (Wed, 09 Jan 2013) | 6 lines
  
  * Simple optimization of bridge_playfile().
  
  * Squeezed some redundancy out of update_bridge_vars().
  
  * Wrapped long line in __ast_change_name_nolink().
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-10 00:20:46 +00:00
Automerge script e844969fba Merged revisions 378840 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r378840 | rmudgett | 2013-01-09 16:56:08 -0600 (Wed, 09 Jan 2013) | 2 lines
  
  Trivial misc bridge code changes.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-09 23:20:35 +00:00
Automerge script 7a06fdad89 Merged revisions 378823 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r378823 | rmudgett | 2013-01-09 16:15:41 -0600 (Wed, 09 Jan 2013) | 2 lines
  
  Tweaked __ast_test_suite_assert_notify() and __ast_test_suite_event_notify() to be void functions.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-09 22:20:40 +00:00
Automerge script 613b972cc5 Merged revisions 378783,378789-378790 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378783 | dlee | 2013-01-09 14:30:33 -0600 (Wed, 09 Jan 2013) | 14 lines
  
  Fix end condition in ast_rtp_lookup_mime_multiple2.
  
  The erroneous end condition would never include the AST_RTP_CISCO_DTMF flag
  in the debug output.
  
  (closes issue ASTERISK-20772)
  Reported by: Xavier Hienne
  ........
  
  Merged revisions 378776 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378780 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r378789 | rmudgett | 2013-01-09 14:56:23 -0600 (Wed, 09 Jan 2013) | 4 lines
  
  * Found some more places to use ast_channel_lock_both().
  
  * Minor optimization in ast_rtp_instance_early_bridge().
................
  r378790 | rmudgett | 2013-01-09 15:14:39 -0600 (Wed, 09 Jan 2013) | 4 lines
  
  * Whitespace changes.
  
  * Made ast_test_init() match its prototype.
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-09 21:21:11 +00:00
Mark Michelson 99701cd1d1 Remove tasks from the taskprocessor and free them when taskprocessor is destroyed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-07 23:11:41 +00:00
Mark Michelson a08847c270 Add some doxygen and remove an unnecessary unlock.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-07 22:56:37 +00:00
Mark Michelson bdd8da406b Address review board feedback from Matt and Richard
* Remove extraneous whitespace
* Bump up debug levels of messages and add identifying info to messages.
* Account for potential failures of ao2_link()
* Add additional test and some more test data
* Add some comments in places where they could be useful
* Make threadpool listeners and their callbacks optional



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-07 22:16:06 +00:00
Automerge script f824b845ce Merged revisions 378458,378460 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378458 | rmudgett | 2013-01-03 12:47:29 -0600 (Thu, 03 Jan 2013) | 18 lines
  
  chan_agent: Misc code cleanup.
  
  * Fix off-nominal path resource cleanup in agent_request().
  
  * Create agent_pvt_destroy() to eliminate inlined versions in many places.
  
  * Pull invariant code out of loop in add_agent().
  
  * Remove redundant module user references in login_exec().
  
  * Remove unused struct agent_pvt logincallerid[] member.
  ........
  
  Merged revisions 378456 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378457 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r378460 | kmoore | 2013-01-03 12:51:43 -0600 (Thu, 03 Jan 2013) | 13 lines
  
  Add missing test event
  
  This test event was missing from channel.c causing the dial_LS_options
  test to fail intermittently because of a race condition where most code
  paths emitted the test event but this one did not. The dial_LS_options
  test should stop bouncing now.
  ........
  
  Merged revisions 378455 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378459 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-03 19:19:40 +00:00
Automerge script b375abae50 Merged revisions 378374,378377,378384 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378374 | rmudgett | 2013-01-02 15:23:16 -0600 (Wed, 02 Jan 2013) | 33 lines
  
  Fix AMI redirect action with two channels failing to redirect both channels.
  
  The AMI redirect action can fail to redirect two channels that are bridged
  together.  There is a race between the AMI thread redirecting the two
  channels and the bridge thread noticing that a channel is hungup from the
  redirects.
  
  * Made the bridge wait for both channels to be redirected before exiting.
  
  * Made the AMI redirect check that all required headers are present before
  proceeding with the redirection.
  
  * Made the AMI redirect require that any supplied ExtraChannel exist
  before proceeding.  Previously the code fell back to a single channel
  redirect operation.
  
  (closes issue ASTERISK-18975)
  Reported by: Ben Klang
  
  (closes issue ASTERISK-19948)
  Reported by: Brent Dalgleish
  Patches:
        jira_asterisk_19948_v11.patch (license #5621) patch uploaded by rmudgett
  Tested by: rmudgett, Thomas Sevestre, Deepak Lohani, Kayode
  
  Review: https://reviewboard.asterisk.org/r/2243/
  ........
  
  Merged revisions 378356 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378358 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r378377 | mjordan | 2013-01-02 16:10:32 -0600 (Wed, 02 Jan 2013) | 24 lines
  
  Prevent crashes from occurring when reading from data sources with large values
  
  When reading configuration data from an Asterisk .conf file or when pulling
  data from an Asterisk RealTime backend, Asterisk was copying the data on the
  stack for manipulation. Unfortunately, it is possible to read configuration
  data or realtime data from some data source that provides a large blob of
  characters. This could potentially cause a crash via a stack overflow.
  
  This patch prevents large sets of data from being read from an ARA backend or
  from an Asterisk conf file.
  
  (issue ASTERISK-20658)
  Reported by: wdoekes
  Tested by: wdoekes, mmichelson
  patches:
   * issueA20658_dont_process_overlong_config_lines.patch uploaded by wdoekes (license 5674)
   * issueA20658_func_realtime_limit.patch uploaded by wdoekes (license 5674)
  ........
  
  Merged revisions 378375 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378376 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r378384 | mjordan | 2013-01-02 16:19:32 -0600 (Wed, 02 Jan 2013) | 11 lines
  
  Clean up app_mysql's application entry points to properly parse arguments
  
  When parsing arguments, application entry points should not attempt to
  directly modify the parameters to the function. This patch properly duplicates
  the passed in parameters before attempting to parse them.
  
  (issue ASTERISK-20658)
  Reported by: wdoekes
  patches:
    issueA20658_sanitize_app_mysql.patch uploaded by wdoekes (license 5674)
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 22:19:49 +00:00
Automerge script 675914bb17 Merged revisions 378322 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378322 | mjordan | 2013-01-02 12:11:59 -0600 (Wed, 02 Jan 2013) | 33 lines
  
  Prevent exhaustion of system resources through exploitation of event cache
  
  Asterisk maintains an internal cache for devices in the event subsystem. The
  device state cache holds the state of each device known to Asterisk, such that
  consumers of device state information can query for the last known state for
  a particular device, even if it is not part of an active call. The concept of
  a device in Asterisk can include entities that do not have a physical
  representation. One way that this occurred was when anonymous calls are allowed
  in Asterisk. A device was automatically created and stored in the cache for
  each anonymous call that occurred; this was possible in the SIP and IAX2
  channel drivers and through channel drivers that utilized the
  res_jabber/res_xmpp resource modules (Gtalk, Jingle, and Motif). These devices
  are never removed from the system, allowing anonymous calls to potentially
  exhaust a system's resources.
  
  This patch changes the event cache subsystem and device state management to
  no longer cache devices that are not associated with a physical entity.
  
  (issue ASTERISK-20175)
  Reported by: Russell Bryant, Leif Madsen, Joshua Colp
  Tested by: kmoore
  patches:
    event-cachability-3.diff uploaded by jcolp (license 5000)
  ........
  
  Merged revisions 378303 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378320 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378321 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 18:20:03 +00:00
Automerge script 5966364588 Merged revisions 378288 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378288 | mjordan | 2013-01-02 09:39:42 -0600 (Wed, 02 Jan 2013) | 36 lines
  
  Resolve crashes due to large stack allocations when using TCP
  
  Asterisk had several places where messages received over various network
  transports may be copied in a single stack allocation. In the case of TCP,
  since multiple packets in a stream may be concatenated together, this can
  lead to large allocations that overflow the stack.
  
  This patch modifies those portions of Asterisk using TCP to either
  favor heap allocations or use an upper bound to ensure that the stack will not
  overflow:
   * For SIP, the allocation now has an upper limit
   * For HTTP, the allocation is now a heap allocation instead of a stack
     allocation
   * For XMPP (in res_jabber), the allocation has been eliminated since it was
     unnecesary.
  
  Note that the HTTP portion of this issue was independently found by Brandon
  Edwards of Exodus Intelligence.
  
  (issue ASTERISK-20658)
  Reported by: wdoekes, Brandon Edwards
  Tested by: mmichelson, wdoekes
  patches:
    ASTERISK-20658_res_jabber.c.patch uploaded by mmichelson (license 5049)
    issueA20658_http_postvars_use_malloc2.patch uploaded by wdoekes (license 5674)
    issueA20658_limit_sip_packet_size3.patch uploaded by wdoekes (license 5674)
  ........
  
  Merged revisions 378269 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378286 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378287 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 16:20:01 +00:00
Automerge script 550581db83 Merged revisions 378166 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378166 | rmudgett | 2012-12-20 15:51:03 -0600 (Thu, 20 Dec 2012) | 8 lines
  
  Give the causes[] a struct name.
  ........
  
  Merged revisions 378164 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378165 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-20 22:18:25 +00:00
Automerge script e0fa5cf52d Merged revisions 378122 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378122 | kmoore | 2012-12-18 11:48:36 -0600 (Tue, 18 Dec 2012) | 17 lines
  
  Add test events for time limit-related hangups
  
  This patch adds hangup-related test events in order to support testing
  of time-limited bridges. This aids in testing the S() and L() bridge
  options.
  
  (issue SWP-4713)
  ........
  
  Merged revisions 378119 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378120 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378121 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-18 18:18:44 +00:00
Automerge script 84e6a9847a Merged revisions 378091,378095 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378091 | rmudgett | 2012-12-17 17:02:54 -0600 (Mon, 17 Dec 2012) | 22 lines
  
  Make chan_local module references tied to local_pvt lifetime.
  
  The chan_local module references were manually tied to the existence of
  the ;1 and ;2 channel links.
  
  * Made chan_local module references tied to the existence of the local_pvt
  structure as well as automatically take care of the module references.
  
  * Tweaked the wording of the local_fixup() failure warning message to make
  sense.
  
  Review: https://reviewboard.asterisk.org/r/2181/
  ........
  
  Merged revisions 378088 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378089 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378090 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r378095 | rmudgett | 2012-12-17 17:10:42 -0600 (Mon, 17 Dec 2012) | 11 lines
  
  Fix potential double free when unloading a module.
  ........
  
  Merged revisions 378092 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378093 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378094 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-17 23:18:40 +00:00
Automerge script be4cc7b20b Merged revisions 378072,378074 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378072 | rmudgett | 2012-12-17 14:34:25 -0600 (Mon, 17 Dec 2012) | 9 lines
  
  chan_local: Misc lock and ref tweaks.
  
  * awesome_locking() does not need to thrash the pvt lock as much.
  
  * local_setoption() does not need to check for NULL pvt on cleanup since
  it will never be NULL.
  
  * Made ref the pvt before locking for consistency.
................
  r378074 | qwell | 2012-12-17 14:59:51 -0600 (Mon, 17 Dec 2012) | 10 lines
  
  Make libasteriskssl.so symlink use a relative path.
  
  This was causing issues when using DESTDIR, since the path to which the link
  pointed is not likely to exist (and not useful to exist) on the target system.
  
  (issue ASTNOW-284)
  ........
  
  Merged revisions 378073 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-17 21:18:01 +00:00
Automerge script d4aeeecffa Merged revisions 378063-378064 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r378063 | jrose | 2012-12-14 16:34:18 -0600 (Fri, 14 Dec 2012) | 8 lines
  
  Features: BRIDGE_FEATURES variable automixmonitor support and use proper party
  
  BRIDGE_FEATURES did not previously support the automixmonitor feature. Now it
  does. In addition, the BRIDGE_FEATURES variable would not apply features to
  the proper party based on whether the feature option letter was in caps or
  in lowercase (both ways would apply it to the caller). Now uppercase applies
  to the caller while lowercase applies to the callee (like with the dial option)
........
  r378064 | rmudgett | 2012-12-14 16:45:03 -0600 (Fri, 14 Dec 2012) | 4 lines
  
  chan_agent: Remove some duplicated code.
  
  No need to check for an agent twice.  Santa does that.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-14 23:17:59 +00:00
Mark Michelson ece4c95798 Resolve conflict and reset automerge.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-13 16:39:40 +00:00
Automerge script 57d2e81d78 Merged revisions 377915 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r377915 | elguero | 2012-12-11 22:43:18 -0600 (Tue, 11 Dec 2012) | 17 lines
  
  Convert Dynamic Features Buffer To Use ast_str
  
  Currently, the buffer for the dynamic features list is set to a fixed size of
  128.  If the list is bigger than that, it results in the dynamic feature(s) not
  being recognized.
  
  This patch changes the buffer from a fixed size to a dynamic one.
  
  (closes issue ASTERISK-20680)
  Reported by: Clod Patry
  Tested by: Michael L. Young
  Patches: 
      asterisk-20680-dynamic-features-v2.diff 
                                       uploaded by Michael L. Young (license 5026)
  
  Review: https://reviewboard.asterisk.org/r/2221/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-12 05:17:36 +00:00
Automerge script 686cdd0e79 Merged revisions 377906 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r377906 | mmichelson | 2012-12-11 16:42:11 -0600 (Tue, 11 Dec 2012) | 3 lines
  
  Add test events necessary for bridging tests to be able to properly run.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 23:17:37 +00:00
Mark Michelson 817a78075a Reset automerge property.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 22:25:21 +00:00
Mark Michelson f5e9cf5975 Add automerge property back after conflict.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 21:52:09 +00:00
Automerge script 090b9e09f7 Merged revisions 377809 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377809 | rmudgett | 2012-12-11 14:05:32 -0600 (Tue, 11 Dec 2012) | 23 lines
  
  Cleanup pbx on exit.
  
  * Cleanup CLI commands on exit.
  
  * Unreference hints and statecbs containers on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        pbx-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell
        pbx-cleanup-10.patch (license #5909) patch uploaded by Corey Farrell
        pbx-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377806 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377807 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377808 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 20:20:16 +00:00
Mark Michelson 7995bc63c7 Some general cleanup, plus we now send state changes when threads activate.
This is now ready for review board, imo!



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 16:53:16 +00:00
Mark Michelson 2abda64003 Add threadpool option version check into threadpool creation routine.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 16:36:08 +00:00
Mark Michelson 8760e32ae3 Add auto-increment option and accompanying test.
This allows for the threadpool to automatically grow if tasks
are pushed to it and no idle threads are currently available.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 16:34:00 +00:00
Mark Michelson 29fc122783 Some documentation fixes and function call name fixes.
The documentation for taskprocessors was incorrect with
regards to when a listener's alloc callback was called.

I also made the names of queued function calls in the
threadpool more uniform.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 04:23:31 +00:00
Automerge script 605dcfad97 Merged revisions 377774 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377774 | rmudgett | 2012-12-10 20:44:53 -0600 (Mon, 10 Dec 2012) | 19 lines
  
  Cleanup logger on exit.
  
  * Cleanup CLI commands, destroy verbosers and logchannels lists on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        logger-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377771 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377772 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377773 from http://svn.asterisk.org/svn/asterisk/branches/11
................


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

................
  r377743 | rmudgett | 2012-12-10 20:13:37 -0600 (Mon, 10 Dec 2012) | 25 lines
  
  Cleanup indications on exit.
  
  * Made ast_unregister_indication_country() unlink the found tone zone
  before selecting a new default_tone_zone to make it impossible to select
  the tone zone being unregistered again.
  
  * Ringcadence is no longer parsed twice in store_config_tone_zone().
  
  * Cleanup CLI commands and destroy default_tone_zone on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        indications-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377740 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377741 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377742 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 02:19:39 +00:00
Automerge script 56a9f5b6cb Merged revisions 377707,377711 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377707 | rmudgett | 2012-12-10 18:37:01 -0600 (Mon, 10 Dec 2012) | 20 lines
  
  Cleanup dnsmgr on exit.
  
  * Cleanup dnsmgr thread and CLI commands on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        dnsmgr-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell
        dnsmgr-cleanup-10-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377704 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377705 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377706 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377711 | rmudgett | 2012-12-10 19:04:50 -0600 (Mon, 10 Dec 2012) | 19 lines
  
  Cleanup event on exit.
  
  * Cleanup CLI commands on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        event_shutdown-10-only.patch (license #5909) patch uploaded by Corey Farrell
        event_shutdown-1_8-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
  ........
  
  Merged revisions 377708 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377709 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377710 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 01:19:39 +00:00
Mark Michelson 1310e659bd Solve the issue about the "CHANGE THIS" and "XXX CHANGE THIS XXX" taskprocessor names.
Unfortunately, this required a taskprocessor listener change that makes listener allocation
utterly silly. I'm going to change the scheme so that allocation of taskprocessor listeners
is done internally within taskprocessor code. This will make it parallel with threadpool
code, which is a good thing.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 20:14:23 +00:00
Mark Michelson 64deed062a Add threadpool options and accompanying test.
The only test added so far is an idle thread timeout
option. This will greatly aid threadpool users who wish
to maintain a threadpool by allowing for idle threads to
die out as necessary.

Test passes.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 06:13:09 +00:00
Mark Michelson 5dd22df050 Improve shutdown procedure.
This helps tests to pass more often than before.
They are far less likely to queue extra processes
into the control taskprocessor since they are prevented
once the threadpool begins to shut down.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 05:25:38 +00:00
Mark Michelson 03d617040a Add safeguards to ensure we don't improperly access a destroyed taskprocessor.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 04:08:29 +00:00
Automerge script 955307ef9f Merged revisions 377506,377512 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377506 | tilghman | 2012-12-09 19:29:32 -0600 (Sun, 09 Dec 2012) | 11 lines
  
  Remove some dead code and additionally handle a case that wasn't handled.
  ........
  
  Merged revisions 377487 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377504 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377505 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377512 | tilghman | 2012-12-09 19:41:50 -0600 (Sun, 09 Dec 2012) | 22 lines
  
  Improve documentation by making all of the colors used readable,
  no matter what the background color is.
  
  Dark blue on a black background is unreadable, as is yellow on a
  light background.  This patch turns on the bright attribute for
  colors when on a dark background and turns *off* the bright
  attribute when the -W command line option is used (indicating a
  _light_ background).  This ensures that text is readable in both
  cases.
  
  Patch by: tilghman
  Review: https://reviewboard.asterisk.org/r/2224
  ........
  
  Merged revisions 377509 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377510 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377511 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 02:20:30 +00:00
Mark Michelson 7be7baba30 Remove unnecessary debugging and add some useful debugging.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-09 19:10:14 +00:00
Mark Michelson 293b18ecce Create longer thread destruction test.
This one involves shrinking the threadpool in such
a way that both idle and active threads are affected.

This test made me re-realize why the zombie state exists,
so I re-added it. We don't want to clog up the control
taskprocessor by waiting on active threads to complete
what they are doing. Instead, we mark them as zombies so
that when they are done, they can clean themselves up
properly.

Without the zombie state available, the new test actually
will deadlock.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-09 18:56:25 +00:00
Automerge script c75b8c5283 Merged revisions 377402 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377402 | rmudgett | 2012-12-07 17:45:15 -0600 (Fri, 07 Dec 2012) | 11 lines
  
  MALLOC_DEBUG: Only wait if we want atexit allocation dumps.
  ........
  
  Merged revisions 377398 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377399 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377401 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-08 00:19:39 +00:00
Mark Michelson b8f35bb197 Remove unsafe write of listener member.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-07 21:53:18 +00:00
Mark Michelson 3a25935f7d Fix infinite looping and crash problem.
MALLOC_DEBUG is complaining about corrupted memory on taskprocessor
listeners, but I'm not seeing it, nor is valgrind. Not sure what's up
there.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-07 19:05:30 +00:00
Mark Michelson 4590bfd93d Add new threadpool test and fix some taskprocessor bugs.
The new thread creation test fails because Asterisk locks up
while trying to lock a taskprocessor.

While trying to debug that, I found a race condition during taskprocessor
creation where a default taskprocessor listener could try to operate on
a partially started taskprocessor. This was fixed by adding a new callback
to taskprocessor listeners.

Then while testing that change, I found some bugs in the taskprocessor
tests where I was not properly unlocking when done with a lock. Scoped
locks have spoiled me a bit.

I still have not figured out why the threadpool thread creation test
is locking up.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-07 00:30:35 +00:00
Mark Michelson 9445402925 It helps if we actually assign the listener to the pool.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-06 20:45:42 +00:00
Mark Michelson c32634e0dd Add initial simple threadpool test.
This one simply pushes a task into the threadpool and ensures
that the listener gets the callbacks expected.

It currently crashes, so I need to figure out what's wrong.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-06 20:25:17 +00:00
Automerge script 95b571b390 Merged revisions 377324,377329-377330 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377324 | mjordan | 2012-12-06 08:26:13 -0600 (Thu, 06 Dec 2012) | 13 lines
  
  Fix memory leak in 'manager show event' when command entered incorrectly
  
  When the CLI command 'manager show event' was run incorrectly and its usage
  instructions returned, a reference to the event container was leaked. This
  would prevent the container from being reclaimed when Asterisk exits. We now
  properly decrement the count on the ao2 object using the nifty RAII_VAR macro.
  
  Thanks to Russell for helping me stumble on this, and Terry for writing that
  ridiculously helpful macro.
  ........
  
  Merged revisions 377319 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377329 | russell | 2012-12-06 09:06:47 -0600 (Thu, 06 Dec 2012) | 7 lines
  
  Add CLI tab completion to 'acl show'.
  
  The 'acl show' CLI command allows you to show the details about a specific
  named ACL in acl.conf.  This patch adds tab completion to the command.
  
  Review: https://reviewboard.asterisk.org/r/2230/
................
  r377330 | russell | 2012-12-06 09:13:37 -0600 (Thu, 06 Dec 2012) | 6 lines
  
  Minor code cleanup in named_acl.c.
  
  This patch makes a few little cleanups to named_acl.c.  A couple non-public
  functions were made static and an opening brace for a function was moved to
  its own line, per the coding guidelines.
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-06 15:19:58 +00:00
Automerge script 521f9e8dfe Merged revisions 377245-377246 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377245 | rmudgett | 2012-12-04 20:20:57 -0600 (Tue, 04 Dec 2012) | 8 lines
  
  Fix registering core show codecs/codec CLI commands twice.
  ........
  
  Merged revisions 377241 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377244 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377246 | rmudgett | 2012-12-04 20:23:10 -0600 (Tue, 04 Dec 2012) | 1 line
  
  Remove init_framer(). It no longer does anything.
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-05 03:19:08 +00:00
Mark Michelson cc63d2c380 Add better listener support.
Add some parameters to listener callbacks.
Add alloc and destroy callbacks for listeners.
Add public function for allocating a listener.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-04 23:45:39 +00:00
Mark Michelson 2158005bdb Remove zombie state from threadpool altogether.
After giving it some consideration, there's no real
use for zombie threads. Listeners can't really use the
current number of zombie threads as a way of gauging activity,
zombifying threads is just an extra step before they die that
really serves no purpose, and since there's no way to re-animate
zombies, the operation does not need to be around.

I also fixed up some miscellaneous compilation errors that
were lingering from some past revisions.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-04 22:11:31 +00:00
Mark Michelson c16371fab6 Simplify threadpool refcounting a bit.
Since threadpool shutdown is very strictly controlled,
there is no need to be so precise with reference counts
in queued operations. Since the threadpool shuts down its
own control taskprocessor before doing anything else destructive,
it can be guaranteed that all queued tasks will have a valid
pointer to the pool. This meant that some destructor functions
for helper structs could be removed entirely.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-04 21:21:15 +00:00
Mark Michelson a37fb2e8c8 Add some doxygen and rearrange code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-04 21:11:34 +00:00
Automerge script f40b6ad46d Merged revisions 377168 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377168 | rmudgett | 2012-12-03 17:00:08 -0600 (Mon, 03 Dec 2012) | 21 lines
  
  Cleanup ast_run_atexits() atexits list.
  
  * Convert atexits list to a mutex instead of a rd/wr lock.  The lock is
  only write locked.
  
  * Move CLI verbose Asterisk ending message to where AMI message is output
  in really_quit() to avoid further surprises about using stuff already
  shutdown.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  ........
  
  Merged revisions 377165 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377166 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377167 from http://svn.asterisk.org/svn/asterisk/branches/11
................


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

................
  r377138 | rmudgett | 2012-12-03 14:46:11 -0600 (Mon, 03 Dec 2012) | 23 lines
  
  Cleanup core main on exit.
  
  * Cleanup time zones on exit.
  
  * Make exit clean/unclean report consistent for AMI and CLI in
  really_quit().
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        core-cleanup-1_8-10.patch (license #5909) patch uploaded by Corey Farrell
        core-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377135 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377136 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377137 from http://svn.asterisk.org/svn/asterisk/branches/11
................


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

................
  r377107 | rmudgett | 2012-12-03 13:33:06 -0600 (Mon, 03 Dec 2012) | 16 lines
  
  Cleanup config cache on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        config-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
  ........
  
  Merged revisions 377104 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377105 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377106 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 20:19:34 +00:00
Automerge script 1ba058bb7d Merged revisions 377072,377077 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377072 | rmudgett | 2012-12-03 12:45:18 -0600 (Mon, 03 Dec 2012) | 21 lines
  
  Cleanup CDR resources on exit.
  
  * Simplify do_reload() return handling since it never returned anything
  other than 0.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        cdr-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell
        cdr-cleanup-10-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377069 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377070 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377071 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377077 | rmudgett | 2012-12-03 13:17:24 -0600 (Mon, 03 Dec 2012) | 18 lines
  
  Cleanup CLI resources on exit and CLI command registration errors.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        cli-leaks-1_8-10.patch (license #5909) patch uploaded by Corey Farrell
        cli-leaks-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377073 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377074 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377075 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 19:19:39 +00:00
Mark Michelson 66fe664c00 Fix a few miscellaneous things
* Renamed some taskprocessor listener callbacks
* Fixed what would become a refcounting issue for pools
* Removed some XXX comments from allocation failure points



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 17:24:11 +00:00
Automerge script f6f7774b19 Merged revisions 377035,377040 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377035 | oej | 2012-12-03 10:45:49 -0600 (Mon, 03 Dec 2012) | 2 lines
  
  Formatting fixes
................
  r377040 | rmudgett | 2012-12-03 11:10:40 -0600 (Mon, 03 Dec 2012) | 16 lines
  
  Fix CCSS CLI commands and logger level not unregistered.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        ccss-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
  ........
  
  Merged revisions 377037 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377038 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377039 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 17:19:46 +00:00
Mark Michelson e7ce12839d This now compiles.
That's a milestone, of sorts. Things really need
arranging/documenting, and there's no function to
be able to push tasks to a threadpool.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 16:59:26 +00:00
Mark Michelson e044fa5fde Some more progress.
Still does not compile.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-30 00:19:50 +00:00
Mark Michelson ddde765c59 Commit some progress towards threadpools.
Does this compile? Not even close.
But I figure I don't want to lose this all in the case
of some catastrophe.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-29 18:54:51 +00:00
Automerge script 93ec26e40a Merged revisions 376820-376821 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r376820 | pkiefer | 2012-11-29 10:44:42 -0600 (Thu, 29 Nov 2012) | 14 lines
  
  Fix chan_sip websocket payload handling
  
  Websocket by default doesn't return an ast_str for the payload received. When 
  converting it to an ast_str on chan_sip the last character was being omitted, 
  because ast_str functions expects that the given length includes the trailing 
  0x00. payload_len only has the actual string length without counting the 
  trailing zero.
  
  For most cases this passed unnoticed as most of SIP messages ends with \r\n.
  
  (closes issue ASTERISK-20745)
  Reported by: I?\195?\177aki Baz Castillo
  Review: https://reviewboard.asterisk.org/r/2219/
........
  r376821 | dlee | 2012-11-29 11:16:50 -0600 (Thu, 29 Nov 2012) | 5 lines
  
  Fixed ast_random's comment about locking.
  
  The original comment was separated from the code at some point, and didn't
  reflect the use of libc's other than glibc for Linux.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-29 17:19:50 +00:00
Automerge script 9b9da2938b Merged revisions 376791 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376791 | rmudgett | 2012-11-28 18:48:12 -0600 (Wed, 28 Nov 2012) | 32 lines
  
  Add MALLOC_DEBUG atexit unreleased malloc memory summary.
  
  * Adds the following CLI commands to control MALLOC_DEBUG reporting of
  unreleased malloc memory when Asterisk is shut down.
  memory atexit list on
  memory atexit list off
  memory atexit summary byline
  memory atexit summary byfunc
  memory atexit summary byfile
  memory atexit summary off
  
  * Made check all remaining allocated region blocks atexit for fence
  violations.
  
  * Increased the allocated region hash table size by about three times.  It
  still isn't large enough considering the number of malloced blocks
  Asterisk uses.
  
  * Made CLI "memory show allocations anomalies" use
  regions_check_all_fences().
  
  Review: https://reviewboard.asterisk.org/r/2196/
  ........
  
  Merged revisions 376788 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376789 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376790 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-29 01:20:42 +00:00
Automerge script 1e1f6c7867 Merged revisions 376761 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376761 | rmudgett | 2012-11-28 18:07:55 -0600 (Wed, 28 Nov 2012) | 25 lines
  
  Enhance MALLOC_DEBUG CLI commands.
  
  * Fixed CLI "memory show allocations" misspelling of anomalies option.
  The command will still accept the original misspelling.
  
  * Miscellaneous tweaks to CLI "memory show allocations" command output
  format.
  
  * Made CLI "memory show summary" summarize by line number instead of by
  function if a filename is given.
  
  * Made CLI "memory show summary" sort its output by filename or
  function-name/line-number depending upon request.
  
  * Miscellaneous tweaks to CLI "memory show summary" command output format.
  ........
  
  Merged revisions 376758 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376759 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376760 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-29 00:21:13 +00:00
Automerge script b6ace287f0 Merged revisions 376728 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r376728 | jrose | 2012-11-28 10:47:44 -0600 (Wed, 28 Nov 2012) | 22 lines
  
  manager: Make challenge work with allowmultiplelogin=no
  
  Prior to this patch, challenge would yield a multiple logins error if used
  without providing the username (which isn't really supposed to be an argument
  to challenge) if allowmultiplelogin was set to no because allowmultiplelogin
  finds a user with a zero length login name. This check is simply disabled for
  the challenge action when the username is empty by this patch.
  
  (closes issue ASTERISK-20677)
  Reported by: Vladimir
  Patches:
      challenge_action_nomultiplelogin.diff uploaded by Jonathan Rose (license 6182)
  ........
  
  Merged revisions 376725 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 376726 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 376727 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-28 17:20:23 +00:00
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 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
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
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
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 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
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 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 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 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 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 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 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 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
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
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 4bd66cb96b Properly clean up manager resources on exit
This patch does two things:
1) It properly unregisters the manager CLI commands
2) It cleans up AMI users on exit.  Prior to this patch, the AMI users
   were not being disposed of properly, resulting in a memory leak.

(closes issue ASTERISK-20646)
Reported by: Corey Farrell
patches:
  manager_shutdown.patch uploaded by Corey Farrell (license 5909)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-04 02:38:19 +00:00
Matthew Jordan a243f4f153 Properly finalize prepared SQLite3 statements to prevent memory leak
The AstDB uses prepared SQLite3 statements to retrieve data from the SQLite3
database.  These statements should be finalized during Asterisk shutdown so
that the SQLite3 database can be properly closed.  Failure to finalize the
statements results in a memory leak and a failure when closing the database.

This patch fixes those issues by ensuring that all prepared statements are
properly finalized at shutdown.

(closes issue ASTERISK-20647)
Reported by: Corey Farrell
patches:
  astdb-sqlite3_close.patch uploaded by Corey Farrell (license 5909)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-04 01:19:43 +00:00
Matthew Jordan ff469e9d5d Fix memory leaks in XML documentation
This patch fixes two memory leaks:
1) When building XML documentation items, the 'name' attribute was extracted
   from XML elements but not properly freed after being copied into the item
   being built.
2) When unloading XML documentation, the doctree container objects were not
   properly freed.

This patch corrects these memory leaks.  Note that this patch was modified
slightly for this commmit, as the case where the 'name' attribute doesn't
exist also wasn't handled in the item construction.  This patch also checks
for that attribute not existing.

(closes issue ASTERISK-20648)
Reported by: Corey Farrell
Tested by: mjordan
patches:
  xmldoc-memory_leak.patch uploaded by Corey Farrell (license 5909)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-04 00:48:24 +00:00
Matthew Jordan 19282f682e Prevent multiple CDR batches from conflicting when scheduling the CDR write
The Asterisk Test Suite caught an error condition where a scheduled CDR batch
write can be deleted twice if two channels attempt to post their CDRs at the
same time.  The batch CDR mutex is locked while the CDRs are appended to the
current batch list; however, it is unlocked prior to actually scheduling the
CDR write.  As such, two threads can attempt to remove the currently scheduled
batch write at the same time, resulting in an assertion error.

This patch extends the time that the mutex is locked to encompass actually
scheduling the write.  This prevents two threads from unscheduling the
currently scheduled write at the same time.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-04 00:02:06 +00:00
Richard Mudgett f85db0e34d Things don't need to be that const.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-02 21:01:33 +00:00
Mark Michelson da85f8489f Make evaluation of channel variables consistently case-sensitive.
Due to inconsistencies in how variable names were evaluated, the
decision was made to make all evaluations case-sensitive. See the
UPGRADE.txt file or https://wiki.asterisk.org/wiki/display/AST/Case+Sensitivity
for more details.

(closes issue ASTERISK-20163)
reported by Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29 21:27:09 +00:00
Richard Mudgett 8d65c777c8 Fix the Park 'r' option when a channel parks itself.
When a channel uses the Park appliation to park itself with the 'r'
option, the channel hears music-on-hold instead of the requested ringing.

* Added a missing check for the 'r' option when a channel parks itself.

(closes issue ASTERISK-19382)
Reported by: James Stocks
Patches by: dsessions

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29 19:31:36 +00:00
Jonathan Rose 3d540ef218 core: Fix a memory leak in app.c from an early return
ast_app_group_match_get_count allocates memory with the regcomp
function and we previously forgot to free it when bailing out
due to a regex compilation failure against category.

(closes issue AST-1018)
Reported by: Guenther Kelleter
Patches:
	regcomp_memleak.diff uploaded by Guenther Kelleter (license 6372)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-22 20:19:51 +00:00
Andrew Latham 6c20cf2d8a Doxygen Updates - Title update
Update and extend the configuration_file group and enable linking. Commit other cleanups from multi-version Doxygen testing.  Update title that was left behind many years ago.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-18 14:17:40 +00:00
Jonathan Rose 68c63d7965 manager: remove curses dependent stuff from r375103
Upon further examination, this code was causing compliation problems on
CentOS at the least (possibly on any machine without curses) and also
the local value of COLS is used even with a remote console, so it is
less than ideal.

(issue ASTERISK-20396)
Reported by: Johan Wilfer


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-17 20:34:40 +00:00
Kinsey Moore 372e29620c Ensure Asterisk fails TCP/TLS SIP calls when certificate checking fails
When placing a call to a TCP/TLS SIP endpoint whose certificate is not
signed by a configured CA certificate, Asterisk would issue a warning
and continue to process the call as if there was not an issue with the
certificate.  Asterisk now properly fails the call if the certificate
fails verification or if the certificate does not exist when
certificate checking is enabled (the default behavior).

(closes issue ASTERISK-20559)
Reported by: kmoore

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-17 19:01:27 +00:00
Walter Doekes 6d57ecd48c Change a few warnings to debug and the inverse.
Remove the "RTP Read too short" warning for RTP keepalives. Remove the
the warning about the application delimiter switch from pipe to comma.
(You should've done this by now.) Make cdr_odbc report more when an
insert fails. Make chan_sip warn less when the peer wants SRTP (and we
don't) or sends a zero port to disable a media type.

Review: https://reviewboard.asterisk.org/r/2167
(closes issue ASTERISK-20538)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-17 14:24:52 +00:00
Jonathan Rose b2f9542f61 manager: Change display of 'manager show commands' and 'manager show command'
manager show commands now shows the full name of the command being displayed
regardless of size. The privilege column has also been removed from this
display. It will also now use the full length of the terminal if curses is
available. Manager show command will now always display the privilege of
the manager command within the CLI.

(closes ASTERISK-20396)
Reported by: Johan Wilfer
Review: https://reviewboard.asterisk.org/r/2143/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-16 20:45:49 +00:00
Mark Michelson e9ab568f88 Fix some potential misuses of ast_str in the code.
Passing an ast_str pointer by value that then calls
ast_str_set(), ast_str_set_va(), ast_str_append(), or
ast_str_append_va() can result in the pointer originally
passed by value being invalidated if the ast_str had
to be reallocated.

This fixes places in the code that do this. Only the
example in ccss.c could result in pointer invalidation
though since the other cases use a stack-allocated ast_str
and cannot be reallocated.

I've also updated the doxygen in strings.h to include
notes about potential misuse of the functions mentioned
previously.

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-15 21:25:29 +00:00
Andrew Latham b106b77041 Title update
Update title that was left behind many years ago. Used revision 6596 as my guide for what it should be.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14 21:56:13 +00:00
Andrew Latham e51432027a Doxygen Clean ups
Add app_skel.c as an example in app.c and fix some formating for the "Dial Privacy scripts" so it actually shows up in the Doxygen output.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-13 16:38:48 +00:00
Mark Michelson c7b23cbb0a Do not use a FILE handle when doing SIP TCP reads.
This is used to solve an issue where a poll on a file
descriptor does not necessarily correspond to the readiness
of a FILE handle to be read.

This change makes it so that for TCP connections, we do a
recv() on the file descriptor instead.

Because TCP does not guarantee that an entire message or even
just one single message will arrive during a read, a loop has
been introduced to ensure that we only attempt to handle a
single message at a time. The tcptls_session_instance structure
has also had an overflow buffer added to it so that if more
than one TCP message arrives in one go, there is a place to
throw the excess.

Huge thanks goes out to Walter Doekes for doing extensive review
on this change and finding edge cases where code could fail.

(closes issue ASTERISK-20212)
reported by Phil Ciccone

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-12 16:31:01 +00:00
Andrew Latham 7226606f77 Continue to group config files
(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 22:39:02 +00:00
Mark Michelson 825607e09b Don't make chan_sip export global symbols.
During testing, it was discovered that having chan_sip
export global symbols was problematic.

The biggest problem was that load order was affected.
Trying to use realtime could be problematic since in
all likelihood the necessary realtime driver(s) would
not be loaded before chan_sip.

In addition, it was found that it was impossible to
use the Digium Phone Module for Asterisk since it
must be loaded before chan_sip since it must hook
into chan_sip's configuration parsing.

The solution is to use a virtual table in the same
manner that other modules in Asterisk do, like
app_voicemail.

(closes issue ASTERISK-20545)
Reported by: kmoore

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 15:49:02 +00:00
Matthew Jordan 5ac43a08ad Fix incorrect billing duration reported when batch mode is enabled
Similar to r369351, the billing duration can be skewed when batch mode is
enabled.  This happened much more rarely than the duration, as it only
occured when the call was answered (thereby indicating an actual answer
time) and immediately hung up on (indicating a billsec of 0).  Since
a billing time of '0' can either mean that the call immediately ended
or that the CDR was improperly answered, we have to use additional information
to know whether or not we can trust the CDR billsec value.  Prior to this
patch, we looked to see if we had a valid answer time.  If we did, and
billsec was zero, we used the current time to calculate what billsec value
we could from the CDR being written.  If batch mode is enabled, this will
incorrectly report a billsec value being much greater than the actual
duration of the call.

Instead of relying on the presence of an answer time to know whether or not
we can re-calculate the billsec for the CDR, we now also use the presence
of the CDR's end time to know if we need to re-calculate or whether we can
trust the billsec value that we have.  This prevents erroneous jumps in the
billsec value, while still making sure that in the worst case, some billing
time will be calculated.

(closes issue AST-1016)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 15:44:38 +00:00
Kinsey Moore 357b733b66 Fix segfault regression from r370681
Due to usage of ast_hook_send_action, AMI action handling code should
be able to handle a NULL mansession->session.  This would cause a crash
on NULL dereference if action_originate was called from
ast_hook_send_action.

(closes issue ASTERISK-20544)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-10 13:40:40 +00:00
Richard Mudgett 9a0ff62452 Fix execution of 'i' extension due to uninitialized variable.
The fix for ASTERISK-18243 added code that could potentially use
dst_exten[] uninitialized.  As a result the 'i' exten may not be executed
when it should.

(closes issue ASTERISK-20455)
Reported by: Richard Miller
Patches:
      pbx-1.8.16.0.diff (license #5685) patch uploaded by Richard Miller
      Made some cosmetic modifications.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-09 22:24:10 +00:00
Matthew Jordan 6b5677a41d Trivial patch to make 'best_score' defined for all architectures.
Fixes trivial build error on Solaris:

  acl.c: In function `get_local_address':
  acl.c:196: error: `best_score' undeclared (first use in this function)
  acl.c:196: error: (Each undeclared identifier is reported only once
  acl.c:196: error: for each function it appears in.)
  make[2]: *** [acl.o] Error 1

(issue ASTERISK-20366)
Reported by: Ben Klang
Tested by: Ben Klang
patches:
  0002-main-acl.c-Trivial.-best_score-should-be-defined-for.patch by Shaun Ruffell (license 5417)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-07 17:33:38 +00:00
Matthew Jordan 15b35972ff Update documentation for MessageSend application/command's From field for XMPP
When using the channel technology agnostic application/AMI command MessageSend,
the "From" field is technically optional for the SIP channel driver.  However,
if being sent by the XMPP resource module (either res_xmpp or res_jabber), the
"From" field is necessary, and must correspond to a defined account.  This
patch updates the documentation for this application/AMI command to reflect
this.

(closes issue ASTERISK-20405)
Reported by: Leif Madsen
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-06 01:47:00 +00:00
David M. Lee 5f9f6f3867 Multiple revisions 374570,374581
........
  r374570 | dlee | 2012-10-05 15:14:41 -0500 (Fri, 05 Oct 2012) | 22 lines
  
  Improve AMI long line error handling
  
  In AMI's parser, when it receives a long line (> 1024 characters), it discards
  that line, but continues to process the message normally.
  
  Typically, this is not a problem because a) who has lines that long and b)
  usually a discarded line results in an invalid message. But if that line is
  specifying an optional field, then the message will be processed, you get a
  'Response: Success', but things don't work the way you expected them to.
  
  This patch changes the behavior when a line-too-long parse error occurs.
  
  * Changes the log message to avoid way-too-long (and truncated anyways) log
    messages
  * Adds a 'parsing' status flag to Response: Success
  * Sets parsing = MESSAGE_LINE_TOO_LONG if, well, a line is too long
  * Responds with an appropriate error if parsing != MESSAGE_OKAY
  
  (closes issue AST-961)
  Reported by: John Bigelow
  Review: https://reviewboard.asterisk.org/r/2142/
........
  r374581 | dlee | 2012-10-05 15:20:28 -0500 (Fri, 05 Oct 2012) | 1 line
  
  I've committed too much. Reverting part of r374570.
........

Merged revisions 374570,374581 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-05 20:33:56 +00:00
Alec L Davis 90f8c90b10 dsp.c User Configurable DTMF_HITS_TO_BEGIN and DTMF_MISSES_TO_END
Instead of a recompile, allow values to be adjusted in dsp.conf

For binary distributions allows easy adjustment for wobbly GSM calls, and other reasons.

Defaults to DTMF_HITS_TO_BEGIN=2 and DTMF_MISSES_TO_END=3

(closes issue ASTERISK-17493)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 20:21:36 +00:00
Alec L Davis 36405ae659 dsp.c fix incorrect DTMF Digit_Duration.
it's always short by 'hits_to_begin*DTMF_GSIZE', or 25.5ms if hitstobegin=2

(issue ASTERISK-16003)
Tested by: alecdavis
alecdavis (license 585)

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 20:08:22 +00:00
David M. Lee c5acf22cec Fix DBDelTree error codes for AMI, CLI and AGI
The AMI DBDelTree command will return Success/Key tree deleted successfully even
if the given key does not exist. The CLI command 'database deltree' had a
similar problem, but was saved because it actually responded with '0 database
entries removed'. AGI had a slightly different error, where it would return
success if the database was unavailable.

This came from confusion about the ast_db_deltree retval, which is -1 in the
event of a database error, or number of entries deleted (including 0 for
deleting nothing).

* Changed some poorly named res variables to num_deleted
* Specified specific errors when calling ast_db_deltree (database unavailable
  vs. entry not found vs. success)
* Fixed similar bug in AGI database deltree, where 'Database unavailable'
  results in successful result

(closes issue AST-967)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2138/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 15:48:24 +00:00
Joshua Colp d78f7f92b2 Add support for applying direct media ACLs between differing channel technologies.
Review: https://reviewboard.asterisk.org/r/2122/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 13:49:45 +00:00
Alec L Davis 4af961a03a dsp.c User configuration of DTMF_NORMAL_TWIST and DTMF_REVERSE_TWIST values
Asterisk's DTMF Specifications are based on AT&T specs, which may not be compatible in other countries.

Various countries have different specifications for the maximum power level differences
between the DTMF low group and high group of frequencies.

Power level difference between frequencies for different Administrations/RPOAs
 NTT        = Max. 5 dB
 AT&T       = 4dB(reverse) to 8dB(normal)
 Danish     = Max. 6 dB
 Australian = Max. 10 dB
 Brazilian  = Max. 9 dB
 ETSI       = Max. 6 dB from ETSI ES 201 235-3 V1.3.1 (2006-03)

Now allow 4 variables to be individually configured in dsp.conf, with reasonable min/max of 2dB to 20dB.
Default is AT&T specifications

Add's the following variables to dsp.conf
;dtmf_normal_twist=6.31 
;dtmf_reverse_twist=2.51 
;relax_dtmf_normal_twist=6.31 
;relax_dtmf_reverse_twist=3.98 


(closes issue ASTERISK-20442)
Reported by: tbsky
Tested by: tbsky,alecdavis

alecdavis (license 585)

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 04:50:16 +00:00
Matthew Jordan 9367893cff Destroy the generic_monitors container after the core_instances in ccss
For each item in core_instances disposed of in the shutdown of ccss, any
generic monitor instances referenced by the objects will be removed from
generic_monitors during their destruction.  Hilarity ensues if
generic_monitors no longer exists.

Thanks to the Asterisk Test Suite's generic_ccss test for complaining loudly
when it ran into this.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-03 17:27:53 +00:00
Richard Mudgett 9b25076e83 Missed an astobj2.c debug tag.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 23:23:30 +00:00
Richard Mudgett 427abb240a * Add ref debug tags to astobj2.c ref usage.
* Make container nodes not show up in the ref debug log.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 22:39:47 +00:00
Matthew Jordan bfe35ee0b0 Ensure Shutdown AMI event is still fired during Asterisk shutdown
Richard pointed out that having the manager dispose of itself gracefully
during shutdown meant that the Shutdown event will no longer get fired.
This patch moves the AMI event just prior to running the atexit callbacks.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 21:26:27 +00:00
Matthew Jordan ed3acdeb21 Fix findings from check-in on r374177
Richard pointed out two problems with the check-in from r374177:
* The ast_msg_shutdown function declaration doesn't match the prototype
  in main/message.c.
* The ref/alloc function usage in astobj2 (in trunk) can use the ao2_t_*
  variants of the functions to allow the REF_DEBUG flag to enable/disable
  their debug counterparts.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 17:16:20 +00:00
Matthew Jordan a094707d51 Fix a variety of ref counting issues
This patch resolves a number of ref leaks that occur primarily on Asterisk
shutdown.  It adds a variety of shutdown routines to core portions of
Asterisk such that they can reclaim resources allocate duringd initialization.

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 01:47:16 +00:00
Andrew Latham 4e228fce03 Doxygen Cleanup
Start adding configuration file linking and pages.  Add module loading doxygen block.

Breaking up commits to keep it easy to track

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 23:39:45 +00:00
Sean Bright b9eeff1521 app_queue: Support persisting and loading of long member lists.
Greenlight in #asterisk brought up that he was receiving an error message "Could
not create persistent member string, out of space" when running app_queue in
Asterisk 10.  dump_queue_members() made an assumption that 8K would be enough to
store the generated string, but with queues that have large member lists this is
not always the case.  This patch removes the limitation and uses ast_str instead
of a fixed sized buffer.

The complicating factor comes from the fact that ast_db_get requires a buffer
and buffer size argument, which doesn't let us pull back more than what we pass
in, so I introduced a new ast_db_get_allocated() which returns an ast_strdup()'d
copy of the value from astdb.

As an aside, I did some testing on the maximum size of data that we can store in
the BDB library we distribute and was able to store a 10MB string and retrieve
it with no problems, so I feel this is a safe patch.

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 20:36:25 +00:00
Sean Bright b3c739a842 Use ast_copy_string instead of strncpy to guarantee a NUL terminated string.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 17:28:41 +00:00
Richard Mudgett 154ee24ae8 Change core show help output format.
The CLI "core show help" output leaves something to be desired.
1) The command is truncated to a maximum of 30 characters.
2) The output columns are mirrored from the 31st column.

Current output format:
                   logger mute Toggle logging output to a console
                 logger reload Reopens the log files
                 logger rotate Rotates and reopens the log files
logger set level {DEBUG|NOTICE Enables/Disables a specific logging level for this console
          logger show channels List configured log channels


New format:
logger mute                    -- Toggle logging output to a console
logger reload                  -- Reopens the log files
logger rotate                  -- Rotates and reopens the log files
logger set level {DEBUG|NOTICE|WARNING|ERROR|VERBOSE|DTMF} {on|off} -- Enables/Disables a specific logging level for this console
logger show channels           -- List configured log channels

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 17:05:37 +00:00
Richard Mudgett b5138fccf4 Add pause one second W dial modifier.
* The following dialplan applications now recognize 'W' to pause sending
DTMF for one second in addition to the previously existing 'w' that paused
sending DTMF for half a second.  Dial, ExternalIVR, and SendDTMF.

* The chan_dahdi analog port dialing and deferred DTMF dialing for PRI now
distinguishes between 'w' and 'W'.  The 'w' pauses dialing for half a
second.  The 'W' pauses dialing for one second.

* Created dahdi_dial_str() in chan_dahdi that eliminated a lot of
duplicated dialing code and diagnostic messages for the channel driver.

(closes issue ASTERISK-20039)
Reported by: Jeremiah Gowdy
Patches:
      jgowdy-wait-6-22-2012.diff (license #5621) patch uploaded by Jeremiah Gowdy
      Expanded patch to add support in chan_dahdi.
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 18:27:02 +00:00
Brent Eagles 89d427ca24 Reset hangup flags on channels created through messages and cleanup globals
in res_xmpp on unload.

This patch fixes an issue where hangup flags were not being reset on a
channel, affecting subsequent use of that channel. The patch also adds some
additional cleanup to res_xmpp to fix an issue with reloading the module.

(closes ASTERISK-20360)
Reported by: Noah Engelberth 
Tested by: beagles
Review: https://reviewboard.asterisk.org/r/2134/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 13:04:11 +00:00
Richard Mudgett a8771e3953 Cleanup ast_dtmf_stream()
* Made ast_dtmf_stream() wait after starting the silence generator rather
than before.

* Made ast_dtmf_stream() put the peer in autoservice for the whole time
things are being done to the chan.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-27 22:33:15 +00:00
Joshua Colp 9e9f3b7609 loader: Ensure dependent modules are properly initialized.
If an Asterisk module specifies a dependency in ast_module_info.nonoptreq, it
is possible for Asterisk to skip calling the modules's .load function.
Asterisk was loading and linking the module via load_dynamic_module() but was
not adding the module to the resource_heap. Therefore the module was not
initialized based on it's priority along with the other modules in the heap.

Now use load_resource() instead of load_dynamic_module() for non-optional
requirement. This will add the module to the resource_heap so the module can
be properly initialized in the correct order.

This is required if there are any module global data structures initialized in
the .load() callback for the module on platforms which do not support weak
references.

(issue ASTERISK-20439)
Reported by: sruffell
Patches:
     0001-loader-Ensure-dependent-modules-are-properly-initial.patch uploaded by sruffell (license 5417)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-27 16:53:19 +00:00
Mark Michelson 4284ade5a6 Fix saying of date in Dutch.
The Dutch say the date before the month.

(closes issue ASTERISK-20353)
Reported by: Teun Ouwehand
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 23:10:22 +00:00
Mark Michelson fdfb3ae5fa Allow for redirecting reasons to be set to arbitrary strings.
This allows for the REDIRECTING dialplan function to be
used to set the reason to any string.

The SIP channel driver has been modified to set the redirecting
reason string to the value received in a Diversion header. In
addition, SIP 480 response reason text will set the redirecting
reason as well.

(closes issue AST-942)
reported by Malcolm Davenport

(closes issue AST-943)
reported by Malcolm Davenport

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 19:29:14 +00:00
Andrew Latham fd98835f1f Doxygen Updates Janitor Work
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
* Add cleanup to Makefile for the Doxygen configuration update
* Start updating Doxygen configuration for cleaner output
* Enable inclusion of configuration files into documentation
* remove mantisworkflow...
* update documentation README
* Add markup to Tilghman's email and talk with him about updating his email, he knows...
* no code changes on this commit other than the mentioned Makefile change

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22 20:43:30 +00:00
Andrew Latham 6f61cb50c5 Doxygen Updates - janitor work
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style.  Some missing txt file links are removed but their content or essense will be included in some later updates.  A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen.

Further updates coming.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 17:14:59 +00:00
Alec L Davis 368b4c6166 dsp.c: remove more whitespace mentioned in review2107
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 09:11:39 +00:00
Alec L Davis d3a23be26e dsp.c ast_dsp_call_progress use local short variable in loop, plus other cleanup
janitor cleanup. No functional change.

1). ast_dsp_call_progress: use 'short samp' instead of s[x] inside loop.
    apply same casting as other _init, dsp->energy = (int32_t) samp * (int32_t) samp

2). ast_dtmf_detect_init: move repeated setting of s->energy to outside of loop.
    do goertzel_init loop first before setting s->lasthit and s->current_hit, consistant with ast_dsp_digitreset()

3). ast_mf_detect_init:
    do goertzel_init loop first before setting s->hits[] and s->current_hit, consistant with ast_dsp_digitreset()

4). Don't chain init different variables, as the type may change

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 06:51:25 +00:00
Joshua Colp e8380afc8a Add support for DTLS-SRTP to res_rtp_asterisk and chan_sip.
As mentioned on the review for this, WebRTC has moved towards choosing
DTLS-SRTP as the mechanism for key exchange for SRTP. This commit adds
support for this but makes it available for normal SIP clients as well.

Testing has been done to ensure that this introduces no regressions with
existing behavior and also that it functions as expected.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 18:27:28 +00:00
Richard Mudgett da5944fc56 Named call pickup groups. Fixes, missing functionality, and improvements.
* ASTERISK-20383
Missing named call pickup group features:

CHANNEL(callgroup) - Need CHANNEL(namedcallgroup)
CHANNEL(pickupgroup) - Need CHANNEL(namedpickupgroup)
Pickup() - Needs to also select from named pickup groups.

* ASTERISK-20384
Using the pickupexten, the pickup channel selection could fail even though
there was a call it could have picked up.  In a call pickup race when
there are multiple calls to pickup and two extensions try to pickup a
call, it is conceivable that the loser will not pick up any call even
though it could have picked up the next oldest matching call.

Regression because of the named call pickup group feature.

* See ASTERISK-20386 for the implementation improvements.  These are the
changes in channel.c and channel.h.

* Fixed some locking issues in CHANNEL().

(closes issue ASTERISK-20383)
Reported by: rmudgett
(closes issue ASTERISK-20384)
Reported by: rmudgett
(closes issue ASTERISK-20386)
Reported by: rmudgett
Tested by: rmudgett

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 17:22:41 +00:00
Alec L Davis ed442248e5 dsp.c: remove whitespace mentioned in review2107
Related https://reviewboard.asterisk.org/r/2107/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 10:41:30 +00:00
Sean Bright 9d4f8abdc6 Make the casing of CALL_ID in debug messages consistent to satisfy my OCD.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-18 20:19:49 +00:00