Commit Graph

4277 Commits

Author SHA1 Message Date
Michael L. Young 474c5df62f Fix Segfault In features-config.c When Application Has No Arguments
Some applications do not require arguments.  Therefore, when parsing application
maps in features.conf, it is possible that app_data will be set to NULL.

* This patch sets app_data to "" if it is NULL.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@399294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-18 00:12:21 +00:00
Kevin Harwell 3f668d3a19 Remote console: more output discrepancies
The remote console continued to have issues with its output.  In this case CLI
command output would either not show up (if verbose level = 0) or would contain
verbose prefixes (if verbose level > 0) once log messages were sent to the
remote console.  The fix now now adds verbose prefix data to all new lines
contained in a verbose log string.

(closes issue ASTERISK-22450)
Reported by: David Brillert
(closes issue AST-1193)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2825/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@399268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-17 18:37:43 +00:00
Mark Michelson 9bdbccac14 Fix other timeouts (atxferloopdelay and atxfernoanswertimeout) to use seconds instead of milliseconds.
Thanks to Richard Mudgett for pointing this out.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@399247 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-17 17:09:00 +00:00
Mark Michelson edb351ebf6 Switch transferdigittimeout to be configured as seconds instead of milliseconds.
This was an unintentional consequence of the update of features.conf to use the
config framework in Asterisk 12. Thanks to Marco Signorini on the Asterisk
developers list for pointing out the problem.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@399237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-17 16:09:46 +00:00
Matthew Jordan 5cf1cae533 Filter internal channels out of bridge enter/leave message handling
Some channels exist merely as an implementation detail in Asterisk, such as
ConfBridge's announcer/recorder channels. These channels should never be
exposed to the outside world, or to interfaces that report on Asterisk. We
already filter out such channels in snapshot processing; however, we failed to
filter out bridge related messages that involved these channels.

This patch filters out bridge related messages that are for such channels. This
prevents a spurious WARNING message from being displayed when those channels
move in and out of bridges.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@399146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-16 02:33:23 +00:00
Richard Mudgett 74c9781273 Restore Dial, Queue, and FollowMe 'I' option support.
The Dial, Queue, and FollowMe applications need to inhibit the bridging
initial connected line exchange in order to support the 'I' option.

* Replaced the pass_reference flag on ast_bridge_join() with a flags
parameter to pass other flags defined by enum ast_bridge_join_flags.

* Replaced the independent flag on ast_bridge_impart() with a flags
parameter to pass other flags defined by enum ast_bridge_impart_flags.

* Since the Dial, Queue, and FollowMe applications are now the only
callers of ast_bridge_call() and ast_bridge_call_with_flags(), changed the
calling contract to require the initial COLP exchange to already have been
done by the caller.

* Made all callers of ast_bridge_impart() check the return value.  It is
important.  As a precaution, I also made the compiler complain now if it
is not checked.

* Did some cleanup in parking_tests.c as a result of checking the
ast_bridge_impart() return value.

An independent, but associated change is:
* Reduce stack usage in ast_indicate_data() and add a dropping redundant
connected line verbose message.

(closes issue ASTERISK-22072)
Reported by: Joshua Colp

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@399136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 22:05:07 +00:00
David M. Lee fcde3a5320 Don't write to /tmp/refs when REF_DEBUG is not defined.
If MALLOC_DEBUG is enabled, then the debug destructor for the container
is used, which would erroneously write to /tmp/refs. This patch only
uses the debug destructor if ref_debug is used.

(closes issue ASTERISK-22536)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@399100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 20:54:27 +00:00
Richard Mudgett 2b9f4fe644 CLI bridge: Fix "bridge destroy <id>" and "bridge kick <id> <chan>" tab completion.
These two commands must deal with the live bridges container for tab
completion and not the stasis cache.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@399021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-12 23:41:25 +00:00
Richard Mudgett 9efc5a8a3f astobj2: Register the bridges container for debug inspection.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@399019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-12 23:34:28 +00:00
Richard Mudgett be81695a85 core_local: Fix memory corruption race condition.
The masquerade super test is failing on v12 with high fence violations and
crashing.  The fence violations are showing that party id allocated memory
strings are somehow getting corrupted in the
bridge_reconfigured_connected_line_update() function.  The invalid string
values happen to be the freed memory fill pattern.

After much puzzling, I deduced that the
bridge_reconfigured_connected_line_update() is copying a string out of the
source channel's caller party id struct just as another thread is updating
it with a new value.  The copying thread is using the old string pointer
being freed by the updating thread.  A search of the code found the
unreal_colp_redirect_indicate() routine updating the caller party id's
without holding the channel lock.

A latent bug in v1.8 and v11 hatched in v12 because of the bridging and
connected line changes.  :)

(issue ASTERISK-22221)
Reported by: Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398938 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-12 16:38:07 +00:00
Richard Mudgett b9f8a74838 Fix incorrect usages of ast_realloc().
There are several locations in the code base where this is done:
buf = ast_realloc(buf, new_size);

This is going to leak the original buf contents if the realloc fails.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-10 18:03:45 +00:00
Richard Mudgett cca2273fd2 MALLOC_DEBUG: Change fence magic number to be completely different from the freed magic number.
Race conditions between freeing a nul terminated string and
ast_strdup()'ing it are more likely to be detected if the fence and freed
magic numbers are completely different.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-09 23:23:02 +00:00
David M. Lee ffd49f6b2d Fix DEBUG_THREADS when lock is acquired in __constructor__
This patch fixes some long-standing bugs in debug threads that were
exacerbated with recent Optional API work in Asterisk 12.

With debug threads enabled, on some systems, there's a lock ordering
problem between our mutex and glibc's mutex protecting its module list
(Ubuntu Lucid, glibc 2.11.1 in this instance). In one thread, the module
list will be locked before acquiring our mutex. In another thread, our
mutex will be locked before locking the module list (which happens in
the depths of calling backtrace()).

This patch fixes this issue by moving backtrace() calls outside of
critical sections that have the mutex acquired. The bigger change was to
reentrancy tracking for ast_cond_{timed,}wait, which wrongly assumed
that waiting on the mutex was equivalent to a single unlock (it actually
suspends all recursive locks on the mutex).

(closes issue ASTERISK-22455)
Review: https://reviewboard.asterisk.org/r/2824/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-09 20:12:46 +00:00
Richard Mudgett 83d741f85e cdr: Change the number of container buckets to be similar to the channels container.
* Fix the temporary cdr candidate containers to use a prime number of
buckets.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-06 21:16:51 +00:00
Richard Mudgett ad42934fbc core_local: Fix LocalOptimizationBegin AMI event missing Source channel snapshot.
* Fix the LocalOptimizationBegin AMI event by eliminating an artificial
buffer size limitation that is too small anyway.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-06 20:20:16 +00:00
Richard Mudgett 334329de07 cdr: Fix some ref leaks.
* Added missing unregister of the cdr container in cdr_engine_shutdown().

* Fixed ref leak in off nominal path of cdr_object_alloc().

* Removed some unnecessary NULL checks in cdr_object_dtor().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-06 20:02:15 +00:00
Richard Mudgett 994a0da4d9 astobj2: Add warn unused attribute to some functions.
* Fixed resulting warnings with improper use of ao2_global_obj_replace().

* Made a couple uses of ao2_global_obj_replace_unref(x, NULL) into the
equivalent and more appropriate ao2_global_obj_release() call.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-06 19:20:06 +00:00
Kinsey Moore a91b9bda2e Fix build warnings
When AST_DEVMODE is not defined, ast_asserts are not compiled into the
binary. In some cases, this means variables are not referenced or are
set but unused which causes warnings to show up.

(closes issue ASTERISK-22446)
Reported by: Jason Parker (qwell)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-06 18:49:09 +00:00
Richard Mudgett 18000444ac astobj2: Only define ao2_bt() once.
* Make ao2_bt() not use single char variable names.

* Fix ao2_bt() formatting.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-05 21:46:46 +00:00
David M. Lee 7e84877b2c Fix graceful shutdown crash.
The cleanup code for optional_api needs to happen after all of the optional
API users and providers have unused/unprovided. Unfortunately, regsitering the
atexit() handler at the beginning of main() isn't soon enough, since module
destructors run after that.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 20:58:07 +00:00
Kevin Harwell 8cc162df5e Add a reloadable option for sorcery type objects
Some configuration objects currently won't place nice if reloaded.
Specifically, in this case the pjsip transport objects.  Now when
registering an object in sorcery one may specify that the object is
allowed to be reloaded or not.  If the object is set to not reload
then upon reloading of the configuration the objects of that type
will not be reloaded.  The initially loaded objects of that type
however will remain.

While the transport objects will not longer be reloaded it is still
possible for a user to configure an endpoint to an invalid transport.
A couple of log messages were added to help diagnose this problem if
it occurs.

(closes issue ASTERISK-22382)
Reported by: Rusty Newton
(closes issue ASTERISK-22384)
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2807/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 19:51:48 +00:00
Kevin Harwell 35e44ccf9c Fix various memory leaks
main/config.c - cleanup cache fie includes
res/res_security_log.c - unregister logger level
channesl/chan_sip.c - cleanup io context and notify_types
main/translator.c - cleanup at shutdown
main/named_acl.c - cleanup cli commands
main/indications.c - ast_get_indication_tone() unref default_tone_zone if used

(closes issues ASTERISK-22378)
Reported by: Corey Farrell
Patches:
     config_shutdown.patch uploaded by coreyfarrell (license 5909)
     res_security_log.patch uploaded by coreyfarrell (license 5909)
     chan_sip-11.patch uploaded by coreyfarrell (license 5909)
     indications_refleak.patch uploaded by coreyfarrell (license 5909)
     named_acl-cli_unreg-trunk.patch uploaded by coreyfarrell (license 5909)
     translate_shutdown.patch uploaded by coreyfarrell (license 5909)

........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 19:20:47 +00:00
Jonathan Rose 01593e9436 features_config: Ignore parkinglots in features.conf instead of failing to load
Parkinglots are defined in res_features.conf now, but this patch fixes
features_config so that features don't fail to load when parkinglots
are present in features.conf

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 18:18:09 +00:00
Kevin Harwell 4524c46bb2 Memory leak fix
ast_xmldoc_printable returns an allocated block that must be freed by the
caller.  Fixed manager.c and res_agi.c to stop leaking these results.

(closes issue ASTERISK-22395)
Reported by: Corey Farrell
Patches:
     manager-leaks-12.patch uploaded by coreyfarrell (license 5909)
     res_agi-xmldoc-leaks.patch uploaded by coreyfarrell (license 5909)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 17:57:16 +00:00
Jonathan Rose 90402bfda7 features_config: Don't require features.conf to be present for Asterisk to load
(closes issue ASTERISK-22426)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2806/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 16:57:41 +00:00
Kevin Harwell 0bcdb7f9ff Check return value on fwrite
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398002 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 15:32:13 +00:00
David M. Lee 5474e48966 optional_api: Fix linking problems between modules that export global symbols
With the new work in Asterisk 12, there are some uses of the
optional_api that are prone to failure. The details are rather involved,
and captured on [the wiki][1].

This patch addresses the issue by removing almost all of the magic from
the optional API implementation. Instead of relying on weak symbol
resolution, a new optional_api.c module was added to Asterisk core.

For modules providing an optional API, the pointer to the implementation
function is registered with the core. For modules that use an optional
API, a pointer to a stub function, along with a optional_ref function
pointer are registered with the core. The optional_ref function pointers
is set to the implementation function when it's provided, or the stub
function when it's now.

Since the implementation no longer relies on magic, it is now supported
on all platforms. In the spirit of choice, an OPTIONAL_API flag was
added, so we can disable the optional_api if needed (maybe it's buggy on
some bizarre platform I haven't tested on)

The AST_OPTIONAL_API*() macros themselves remained unchanged, so
existing code could remain unchanged. But to help with debugging the
optional_api, the patch limits the #include of optional API's to just
the modules using the API. This also reduces resource waste maintaining
optional_ref pointers that aren't used.

Other changes made as a part of this patch:
 * The stubs for http_websocket that wrap system calls set errno to
   ENOSYS.

 * res_http_websocket now properly increments module use count.

 * In loader.c, the while() wrappers around dlclose() were removed. The
   while(!dlclose()) is actually an anti-pattern, which can lead to
   infinite loops if the module you're attempting to unload exports a
   symbol that was directly linked to.

 * The special handling of nonoptreq on systems without weak symbol
   support was removed, since we no longer rely on weak symbols for
   optional_api.

 [1]: https://wiki.asterisk.org/wiki/x/wACUAQ

(closes issue ASTERISK-22296)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2797/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 13:39:35 +00:00
Richard Mudgett 8741cc7fb7 pbx.c: Make pbx_substitute_variables_helper_full() not mask variables.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 01:19:26 +00:00
Richard Mudgett 55b3f213af Revert last commit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 01:00:41 +00:00
Richard Mudgett 1440ad06cd pbx.c: Make ast_str_substitute_variables_full() not mask variables.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 01:00:00 +00:00
Kevin Harwell e7dcc5494f Verbose logging discrepancies
Refactored cases where a combination of ast_verbose/options_verbose were
present.  Also in general tried to eliminate, in as many places as possible,
where the options_verbose global variable was being used.  Refactored the way
local and remote consoles handle verbose message logging in an attempt to
solve the various discrepancies that sometimes would show between the two.

(closes issue AST-1193)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2798/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29 22:45:15 +00:00
Kevin Harwell 4017609f8f Memory leaks fix
(closes ASTERISK-22376)
Reported by: John Hardin
Patches:
     memleak.patch uploaded by jhardin (license 6512)
     memleak2.patch uploaded by jhardin (license 6512)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29 21:34:52 +00:00
Mark Michelson 8bbc12ef71 Remove extra debug message.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29 15:42:29 +00:00
Mark Michelson 70ffc1550c Resolve assumptions that bridge snapshots would be non-NULL for transfer stasis events.
Attempting to transfer an unbridged call would result in crashes in either CEL code or
in the conversion to AMI messages.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29 15:42:10 +00:00
Richard Mudgett 4fb3ae9ecf Fix some uninitialized buffers for CDR handling valgrind found.
* Made ast_strftime_locale() ensure that the output buffer is initialized.
The std library strftime() returns 0 and does not touch the buffer if it
has an error.  However, the function can also return 0 without an error.

(closes issue ASTERISK-22412)
Reported by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 23:14:57 +00:00
Richard Mudgett 45453100e9 Fixed problems with ast_cdr_serialize_variables().
* Fixed return value of ast_cdr_serialize_variables() on error.  It needs
to return 0 indicating no CDR variables found.

* Made ast_cdr_serialize_variables() check the return value of
cdr_object_format_property() and assert if nonzero.  A member of the
cdr_readonly_vars[] was not handled.

* Removed unused elements from cdr_readonly_vars[]: total_duration,
total_billsec, first_start, and first_answer.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 22:55:27 +00:00
Richard Mudgett 1b4793bb5e Made the on/off in CLI "cdr set debug [on|off]" case insensitive.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 22:42:26 +00:00
Richard Mudgett 8c7c10010f Make CDR variable name chandling consistently case insensitive.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 22:38:01 +00:00
Richard Mudgett 986911fa04 Make CDR code deal with channel names case insensitively.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 22:33:38 +00:00
Richard Mudgett fa3370fdee Some CDR code optimization.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397892 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 22:21:46 +00:00
Richard Mudgett ae6e4d27e2 pbx.c: Make ast_str_substitute_variables_full() not mask variables.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 16:12:27 +00:00
David M. Lee d7e16fadf8 ARI: WebSocket event cleanup
Stasis events (which get distributed over the ARI WebSocket) are created
by subscribing to the channel_all_cached and bridge_all_cached topics,
filtering out events for channels/bridges currently subscribed to.

There are two issues with that. First was a race condition, where
messages in-flight to the master subscribe-to-all-things topic would get
sent out, even though the events happened before the channel was put
into Stasis. Secondly, as the number of channels and bridges grow in the
system, the work spent filtering messages becomes excessive.

Since r395954, individual channels and bridges have caching topics, and
can be subscribed to individually. This patch takes advantage, so that
channels and bridges are subscribed to on demand, instead of filtering
the global topics.

The one case where filtering is still required is handling BridgeMerge
messages, which are published directly to the bridge_all topic.

Other than the change to how subscriptions work, this patch mostly just
moves code around. Most of the work generating JSON objects from
messages was moved to .to_json handlers on the message types. The
callback functions handling app subscriptions were moved from res_stasis
(b/c they were global to the model) to stasis/app.c (b/c they are local
to the app now).

(closes issue ASTERISK-21969)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2754/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-27 19:15:49 +00:00
Richard Mudgett f429557bf8 Made MALLOC_DEBUG less CPU intensive by default.
Storing a backtrace for each allocation in anticipation of a memory
management problem is very CPU intensive.

* Added the CLI "memory backtrace {on|off}" command to request that the
backtrace be gathered only on request.  The backtrace is off by default.

(issue ASTERISK-22221)
Reported by: Matt Jordan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-27 18:49:58 +00:00
Matthew Jordan ff68143bd0 Better handle clearing the OUTGOING flag when a channel leaves a bridge
When a channel with the OUTGOING flag leaves a bridge, and it will survive
being pulled from the bridge (either because it will execute dialplan,
go into another bridge, or live in a friendly autoloop), we have to clear
the OUTGOING flag. This is the signal to the CDR engine that this channel
is no longer a second class citizen, i.e., it is not "dialed".

The soft hangup flags are only half the picture. If a channel is being
moved from one bridge to another, the soft hangup flags aren't set; however,
the state of the bridge_channel will not be hung up. Since the channel does
not have one of the two hang up states, that implies that the channel is
still technically alive.

This patch modifies the check so that it checks both the soft hangup flags
as well as the bridge_channel state. If either suggests that the channel
is going to persist, we clear the OUTGOING flag.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-26 23:38:11 +00:00
David M. Lee 594ef4e5ab Fixed bucket.c for systems where tv_usec is not an unsigned long.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-26 21:30:12 +00:00
Richard Mudgett 7a60a318ce bridging: Fix a livelock with local channel optimization.
Use a better means of waking up the bridge channel thread.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-26 16:24:51 +00:00
Matthew Jordan 1888186add Fix the config_options_test
The config options test requires the entire configuration item to be transparent from
the documentation system. So we let it do that too.

As an aside, please do not use this power for evil. Documentation is your friend, and
you really should document your configurations. Hiding your module's configuration
information from the system attempting to enforce some sanity in the universe is something
only a Bond villain would contemplate.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-25 17:58:17 +00:00
Joshua Colp 9c713d12da Fix building of trunk.
Note: This is why I commit on the weekend.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 22:20:39 +00:00
Matthew Jordan f4bf1823e9 Fix channel reference leak in Originated channels
When originating channels, ast_pbx_outgoing_* caused the dialed channel
reference to be bumped twice. Ostensibly, this routine is bumping the channel
lifetime such that the channel doesn't get nuked in between locks/unlocks;
however, since the routine should return the dialed channel with its
reference bumped, it only needs to do this one time.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 22:12:57 +00:00
Richard Mudgett fd7ac4fecd Blank line tweaks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 21:51:19 +00:00