asterisk/asterisk.git
6 years agoFix build warning (which is transmogrified into an error) with my compiler due to...
Joshua Colp [Mon, 17 Jun 2013 12:28:34 +0000 (12:28 +0000)]
Fix build warning (which is transmogrified into an error) with my compiler due to uninitialized variable.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391982 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake cdr_mysql compile again by not directly setting the run-time CDR object
Matthew Jordan [Mon, 17 Jun 2013 03:31:19 +0000 (03:31 +0000)]
Make cdr_mysql compile again by not directly setting the run-time CDR object

A stray ast_cdr_setvar was missed in cdr_mysql (silly addons). This has now
been refactored to not set the property, as the property would have been set
on a run-time object that was already dispatched to the backend. The module
simply remembers the value it wanted to set and writes it to MySQL later
in the processing.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391964 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUpdate Asterisk's CDRs for the new bridging framework
Matthew Jordan [Mon, 17 Jun 2013 03:00:38 +0000 (03:00 +0000)]
Update Asterisk's CDRs for the new bridging framework

This patch is the initial push to update Asterisk's CDR engine for the new
bridging framework. This patch guts the existing CDR engine and builds the new
on top of messages coming across Stasis. As changes in channel state and bridge
state are detected, CDRs are built and dispatched accordingly. This
fundamentally changes CDRs in a few ways.
(1) CDRs are now *very* reflective of the actual state of channels and bridges.
    This means CDRs track well with what an actual channel is doing - which
    is useful in transfer scenarios (which were previously difficult to pin
    down). It does, however, mean that CDRs cannot be 'fooled'. Previous
    behavior in Asterisk allowed for CDR applications, channels, and other
    properties to be spoofed in parts of the code - this no longer works.
(2) CDRs have defined behavior in multi-party scenarios. This behavior will not
    be what everyone wants, but it is a defined behavior and as such, it is
    predictable.
(3) The CDR manipulation functions and applications have been overhauled. Major
    changes have been made to ResetCDR and ForkCDR in particular. Many of the
    options for these two applications no longer made any sense with the new
    framework and the (slightly) more immutable nature of CDRs.

There are a plethora of other changes. For a full description of CDR behavior,
see the CDR specification on the Asterisk wiki.

(closes issue ASTERISK-21196)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix regression in MWI stasis handling.
Mark Michelson [Fri, 14 Jun 2013 23:26:50 +0000 (23:26 +0000)]
Fix regression in MWI stasis handling.

In revision 389733, mwi state allocation was placed into its
own function instead of performing the allocation in-line when
required. The issue was that in ast_publish_mwi_state_full(),
the local variable "uniqueid" was no longer being set, but it was
still being used as the topic for MWI. This meant that all MWI
publications ended up being published to the "" (empty string)
mailbox topic. Thus MWI subscriptions for specific mailboxes were
never notified of mailbox state changes.

This change fixes the issue by removing the local uniqueid variable
from ast_publish_mwi_state_full() and instead referencing the
mwi_state->uniqueid field since it has been properly set.

(closes issue ASTERISK-21913)
Reported by Malcolm Davenport

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391921 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoEnsure that the number of added contacts never goes below 0.
Joshua Colp [Fri, 14 Jun 2013 21:57:31 +0000 (21:57 +0000)]
Ensure that the number of added contacts never goes below 0.

This can happen when a REGISTER request is removing a contact.

(closes issue ASTERISK-21911)
Reported by: mdavenport

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391902 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRevert parts of r391855 that were not ready to go in to trunk
Kinsey Moore [Fri, 14 Jun 2013 18:50:21 +0000 (18:50 +0000)]
Revert parts of r391855 that were not ready to go in to trunk

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391856 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix two more possible crashes in CEL
Kinsey Moore [Fri, 14 Jun 2013 18:46:00 +0000 (18:46 +0000)]
Fix two more possible crashes in CEL

These are locations that should return valid snapshots, but need to be
handled if not.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391855 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapp_mixmonitor: Fix crashes caused by unloading app_mixmonitor
Jonathan Rose [Fri, 14 Jun 2013 16:32:43 +0000 (16:32 +0000)]
app_mixmonitor: Fix crashes caused by unloading app_mixmonitor

Unloading app_mixmonitor while active mixmonitors were running would
cause a segfault. This patch fixes that by making it impossible to
unload app_mixmonitor while mixmonitors are active.

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391828 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix a crash in CEL bridge snapshot handling
Kinsey Moore [Fri, 14 Jun 2013 16:12:44 +0000 (16:12 +0000)]
Fix a crash in CEL bridge snapshot handling

Properly search for bridge association structures so that they are
found when expected and handle cases where they don't exist.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391777 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPublish bridge snapshots more often
Kinsey Moore [Fri, 14 Jun 2013 16:08:55 +0000 (16:08 +0000)]
Publish bridge snapshots more often

Bridge snapshot events were missing some important transitions that
were noticed in subsequent snapshots. Snapshots will now be published
on all bridge reconfigurations.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391776 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake the utils directory compile... again.
Matthew Jordan [Thu, 13 Jun 2013 21:53:45 +0000 (21:53 +0000)]
Make the utils directory compile... again.

Utils is a source folder that lies,
eventually all developers will cry,
"I know I must maintain it,
But really with this last commit
I can kiss my software ethics good-bye."

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391732 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapp_confbridge: Fix memory leak on reload.
Richard Mudgett [Thu, 13 Jun 2013 19:04:41 +0000 (19:04 +0000)]
app_confbridge: Fix memory leak on reload.

The config framework options should not be registered multiple times.
Instead the configuration just needs to be reprocessed by the config
framework.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391701 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoJust return outright on a reload since we have already processed configuration.
Mark Michelson [Thu, 13 Jun 2013 18:26:25 +0000 (18:26 +0000)]
Just return outright on a reload since we have already processed configuration.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391699 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoEnsure that Asterisk still starts up when cel.conf is missing
Kinsey Moore [Thu, 13 Jun 2013 18:20:31 +0000 (18:20 +0000)]
Ensure that Asterisk still starts up when cel.conf is missing

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391689 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix memory leak in features_config.c
Mark Michelson [Thu, 13 Jun 2013 18:17:13 +0000 (18:17 +0000)]
Fix memory leak in features_config.c

The options should not be registered multiple times. Instead, the configuration just needs
to be reprocessed by the config framework. This also exposed that we were not properly telling
the config framework to treat the configuration processing with the "reload" semantics when
a reload occurred. Both of these errors are fixed now.

Thanks to Richard Mudgett for discovering the leak.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391676 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoBlow away usage of libjansson's foreach macro
Matthew Jordan [Thu, 13 Jun 2013 18:14:38 +0000 (18:14 +0000)]
Blow away usage of libjansson's foreach macro

While very handy, this macro didn't occur until a later version of libjansson.
We'd prefer to be compatible with older versions still - as such, iteration
over key/value pairs in a JSON object have to be done with a little bit more
manual work.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391675 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRefactor CEL bridge events on top of Stasis-Core
Kinsey Moore [Thu, 13 Jun 2013 13:46:40 +0000 (13:46 +0000)]
Refactor CEL bridge events on top of Stasis-Core

This pulls bridge-related CEL event triggers out of the code in which
they were residing and pulls them into cel.c where they are now
triggered by changes in bridge snapshots. To get access to the
Stasis-Core parking topic in cel.c, the Stasis-Core portions of parking
init have been pulled into core Asterisk init.

This also adds a new CEL event (AST_CEL_BRIDGE_TO_CONF) that indicates
a two-party bridge has transitioned to a multi-party conference. The
reverse cannot occur in CEL terms even though it may occur in actuality
and two party bridges which receive a AST_CEL_BRIDGE_TO_CONF will be
treated as multi-party conferences for the duration of the bridge.

Review: https://reviewboard.asterisk.org/r/2563/
(closes issue ASTERISK-21564)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391643 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRefactor CEL channel events on top of Stasis-Core
Kinsey Moore [Thu, 13 Jun 2013 13:15:56 +0000 (13:15 +0000)]
Refactor CEL channel events on top of Stasis-Core

This uses the channel state change events from Stasis-Core to determine
when channel-related CEL events should be raised. Those refactored in
this patch are:
* AST_CEL_CHANNEL_START
* AST_CEL_ANSWER
* AST_CEL_APP_START
* AST_CEL_APP_END
* AST_CEL_HANGUP
* AST_CEL_CHANNEL_END

Retirement of Linked IDs is also refactored.

CEL configuration has been refactored to use the config framework.

Note: Some HANGUP events are not generated correctly because the bridge
layer does not propagate hangupcause/hangupsource information yet.

Review: https://reviewboard.asterisk.org/r/2544/
(closes issue ASTERISK-21563)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391622 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd support for requiring that all queued messages on a caching topic have been handl...
Joshua Colp [Thu, 13 Jun 2013 11:02:16 +0000 (11:02 +0000)]
Add support for requiring that all queued messages on a caching topic have been handled before
retrieving from the cache and also change adding channels to an endpoint to be an immediate
operation.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391596 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix segfault for certain invalid WebSocket input.
David M. Lee [Wed, 12 Jun 2013 21:08:40 +0000 (21:08 +0000)]
Fix segfault for certain invalid WebSocket input.

The WebSocket code would allocate, on the stack, a string large enough
to hold a key provided by the client, and the WEBSOCKET_GUID. If the key
is NULL, this causes a segfault. If the key is too large, it could
overflow the stack.

This patch checks the key for NULL and checks the length of the key to
avoid stack smashing nastiness.

(closes issue ASTERISK-21825)
Reported by: Alfred Farrugia
Tested by: Alfred Farrugia, David M. Lee
Patches:
    issueA21825_check_if_key_is_sent.patch uploaded by Walter Doekes (license 5674)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391561 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix memory leak while loading modules, adding formats, and destroying endpoints
Matthew Jordan [Wed, 12 Jun 2013 02:29:08 +0000 (02:29 +0000)]
Fix memory leak while loading modules, adding formats, and destroying endpoints

This patch fixes three memory leaks
 * When we load a module with the LOAD_PRIORITY flag, we remove its entry from
   the load order list. Unfortunately, we don't free the memory associated with
   entry in the list. This patch corrects that and properly frees the memory
   for the module in the list.

 * When adding a custom format (such as SILK or CELT), the routine for adding
   the format was leaking a reference. RAII_VAR cleans this up properly.

 * We now de-ref the channel_snapshot appropriately when an endpoint is
   disposed of
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391521 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix memory leaks in stasis_channels and bridge_native_rtp
Matthew Jordan [Wed, 12 Jun 2013 02:13:31 +0000 (02:13 +0000)]
Fix memory leaks in stasis_channels and bridge_native_rtp

This patch fixes two memory leaks:
 * A memory leak in packing channels into a multi-channel blob payload when
   publishing dial messages. The multi-channel blob payload does not steal
   the references - this approach was chosen because it works well with the
   RAII_VAR macro. Unfortunately, this does mean that you actually have to use
   the RAII_VAR macro (or manually deref it yourself)
 * RTP instances returned as a result of one of the glue operations are ref
   counted and have to be de-ref'd appropriately. We now do that, as saying
   that we should do it and then not would be silly.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391479 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove incorrect comment about local channel optimization occurring when performing...
Mark Michelson [Tue, 11 Jun 2013 22:57:09 +0000 (22:57 +0000)]
Remove incorrect comment about local channel optimization occurring when performing an attended transfer on an entire bridge.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391455 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agobridge_native_rtp: Fix native bridge tech being incompatible when it should be.
Jonathan Rose [Tue, 11 Jun 2013 22:21:36 +0000 (22:21 +0000)]
bridge_native_rtp: Fix native bridge tech being incompatible when it should be.

When checking compatability for the native RTP bridge technology there is a
race condition between clearing framehooks that are destroyed when leaving
certain bridges with certain technologies (such as bridge_native_rtp) and
joining bridges with the bridge_native_rtp technology. Yes, that means a
channel in a native RTP bridge could move to another native RTP bridge and
be considered incompatible with the new native RTP bridge causing it to
revert to a simple bridge technology0. This fixes that bug by ignoring
framehooks that have been marked for destruction when checking for
compatibility with the bridge_native_rtp technology.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391453 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agobridge_native_rtp: Fix possible segfaults on leaves/joins
Jonathan Rose [Tue, 11 Jun 2013 19:44:47 +0000 (19:44 +0000)]
bridge_native_rtp: Fix possible segfaults on leaves/joins

native_rtp_bridge_get can return any result from the ast_rtp_glue_result
enumerator and the join/leave functions for bridge_native_rtp seem to assume
that if the result wasn't local that it was remote. Meanwhile forbid can be
returned by that function which can mean certain glue pointers are NULL. Then
when the join/leave functions try to use members of that pointer, boom.
Segfault.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391430 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd vtable and methods for to_json and to_ami for Stasis messages
David M. Lee [Tue, 11 Jun 2013 15:46:35 +0000 (15:46 +0000)]
Add vtable and methods for to_json and to_ami for Stasis messages

When a Stasis message type is defined in a loadable module, handling
those messages for AMI and res_stasis events can be cumbersome.

This patch adds a vtable to stasis_message_type, with to_ami and
to_json virtual functions. These allow messages to be handled
abstractly without putting module-specific code in core.

As an example, the VarSet AMI event was refactored to use the to_ami
virtual function.

(closes issue ASTERISK-21817)
Review: https://reviewboard.asterisk.org/r/2579/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391403 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix issue with no sound in both way in case of previous call to chan_unistim phone...
Igor Goncharovskiy [Tue, 11 Jun 2013 10:24:04 +0000 (10:24 +0000)]
Fix issue with no sound in both way in case of previous call to chan_unistim phone was canceled.

(related to ASTERISK-20183)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391380 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoIAX2: Transfer Reject: Lock bridgecallno before touching it, refactor
Alec L Davis [Tue, 11 Jun 2013 08:13:39 +0000 (08:13 +0000)]
IAX2: Transfer Reject: Lock bridgecallno before touching it, refactor

1). When touching the bridgecallno, we need to lock it.

2). Remove magic number '0' and replace with TRANSFER_NONE.

3). Exit early if no bridgecallno.

4). Reduce indentation.

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391335 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake the reload stasis message bump the ref count of its sub-object
Matthew Jordan [Mon, 10 Jun 2013 22:38:04 +0000 (22:38 +0000)]
Make the reload stasis message bump the ref count of its sub-object

JSON objects are reference stealing. Hence, if you've RAII_VAR'd some
subobject and want to pack it into another JSON object, you have to bump
the reference count. Using the 'O' option during the pack will bump the
reference count for you.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391314 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoChange chan_skinny to use core transfer API.
Damien Wedhorn [Mon, 10 Jun 2013 21:04:43 +0000 (21:04 +0000)]
Change chan_skinny to use core transfer API.

Changes for both attended and blind transfers in chan_skinny to use the new transfer API instead of masquerade.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391297 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd AGI command arguments to AsyncAGI event
Kinsey Moore [Mon, 10 Jun 2013 16:03:51 +0000 (16:03 +0000)]
Add AGI command arguments to AsyncAGI event

This makes the AGI AsyncAGI event put provided AGI command arguments in
the event's environment.

(closes issue ASTERISK-21304)
Patch-By: Dirk Wendland

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391271 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoTemporary fix for people using sample features.conf from previous Asterisk versions.
Mark Michelson [Mon, 10 Jun 2013 15:32:02 +0000 (15:32 +0000)]
Temporary fix for people using sample features.conf from previous Asterisk versions.

People who use the features.conf.sample file from Asterisk 11 and before in trunk were
given a rude awakening when features configuration changes were made. Because it uses the
config framework and the config framework is strict about what is accepted and what isn't,
people that had parking options configured found that Asterisk no longer started. This is
because parking options are currently handled in res_parking.conf instead of features.conf.

This fix seeks to create a temporary band-aid fix for the problem, but having parking options
from the general section be passed to a handler that will simply print that the option is no
longer supported. This will not cause Asterisk to exit.

The fix only applies to options in the general section. There are two main reasons for this:

1) The sample features.conf file only has parking options in the general section. There are no
configured parking lots. Therefore it's not quite as "urgent" to get the parking lot parsing
fixed.

2) The plan is to move parking configuration back from res_parking.conf to features.conf. When
that happens, the parking lots will also be addressed at that time.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391269 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd announce-to-first-user option for app_queue
Matthew Jordan [Mon, 10 Jun 2013 14:36:15 +0000 (14:36 +0000)]
Add announce-to-first-user option for app_queue

In r386792, the ability to play prompts to the first caller in a call queue was
added. While this is arguably a bug fix for those who expect the first caller
to continue receiving prompts while the agent is dialed, it has the side effect
of preventing the first caller from hearing the agent immediately upon
bridging. This may not be a problem for those who really want this option, but
for those who didn't care whether or not the first caller in queue heard their
position, it was an issue.

This patch disables the ability for the first caller in the queue to hear
prompts and adds a new option, announce-to-first-user, to queues.conf. Those
who the behavior can enable it by setting this value to True.

Note that if we ever implement the ability to have the prompts be stopped
upon bridging, this option can be removed.

(closes issue ASTERISK-21782)
Reported by: Remi Quezada
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391245 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoStasis-HTTP: Flesh out bridge-related capabilities
Kinsey Moore [Mon, 10 Jun 2013 13:07:11 +0000 (13:07 +0000)]
Stasis-HTTP: Flesh out bridge-related capabilities

This adds support for Stasis applications to receive bridge-related
messages when the application shows interest in a given bridge.

To supplement this work and test it, this also adds support for the
following bridge-related Stasis-HTTP functionality:
* GET stasis/bridges
* GET stasis/bridges/{bridgeId}
* POST stasis/bridges
* DELETE stasis/bridges/{bridgeId}
* POST stasis/bridges/{bridgeId}/addChannel
* POST stasis/bridges/{bridgeId}/removeChannel

Review: https://reviewboard.asterisk.org/r/2572/
(closes issue ASTERISK-21711)
(closes issue ASTERISK-21621)
(closes issue ASTERISK-21622)
(closes issue ASTERISK-21623)
(closes issue ASTERISK-21624)
(closes issue ASTERISK-21625)
(closes issue ASTERISK-21626)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391199 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_iax2: nativebridge refactor, missed unlock bridgecallno
Alec L Davis [Mon, 10 Jun 2013 09:33:56 +0000 (09:33 +0000)]
chan_iax2: nativebridge refactor, missed unlock bridgecallno
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391154 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agofix bad edit after conflict resolution
Alec L Davis [Mon, 10 Jun 2013 08:38:03 +0000 (08:38 +0000)]
fix bad edit after conflict resolution
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391112 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoIAX2: refactor nativebridge transfer
Alec L Davis [Mon, 10 Jun 2013 08:30:31 +0000 (08:30 +0000)]
IAX2: refactor nativebridge transfer

remove triple checking of iaxs[fr->callno]->transferring

reduce indentation.

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391102 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoIAX2: fix race condition with nativebridge transfers.
Alec L Davis [Mon, 10 Jun 2013 07:35:06 +0000 (07:35 +0000)]
IAX2: fix race condition with nativebridge transfers.

1). When touching the bridgecallno, we need to lock it.

2). stop_stuff() which calls iax2_destroy_helper()
    Assumes the lock on the pvt is already held, when iax2_destroy_helper() is called.
    Thus we need to lock the bridgecallno pvt before we call stop_stuff(iaxs[fr->callno]->bridgecallno);

3).   When evaluating the state of 'callno->transferring' of the current leg,
    we can't change it to READY unless the bridgecallno is locked.
      Why, if we are interrupted by the other call leg before 'transferring = TRANSFER_RELEASED',
    the interrupt will find that it is READY and that the bridgecallno is also READY so Releases the legs.

(closes issue ASTERISK-21409)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391064 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoClean up MWI topic pool before message type destruction
Matthew Jordan [Sun, 9 Jun 2013 21:11:25 +0000 (21:11 +0000)]
Clean up MWI topic pool before message type destruction

Topics need to be disposed of prior to the message types that are published
on them. This includes topic pools. This prevents an assertion from being
raised on shutdown.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391040 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoOnly initialize manager_bridging during startup
Matthew Jordan [Sat, 8 Jun 2013 22:18:38 +0000 (22:18 +0000)]
Only initialize manager_bridging during startup

This moves the initialization call behind the protection against
reloads. We don't want to re-add message router routes during
reloads.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391016 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd backtrace generation to MALLOC_DEBUG memory corruption reports
Matthew Jordan [Sat, 8 Jun 2013 22:09:07 +0000 (22:09 +0000)]
Add backtrace generation to MALLOC_DEBUG memory corruption reports

This patch allows astmm to access the backtrace generation code in Asterisk.
When memory is allocated, a backtrace is created and stored with the memory
region that tracks the allocation. If a memory corruption is detected, the
backtrace is printed to the astmm log. The backtrace will make use of the
BETTER_BACKTRACES build option if available.

As a result, this patch moves the backtrace generation code into its own file
and uses the non-wrapped versions of the C library memory allocation routines.
This allows the memory allocation code to safely use the backtrace generation
routines without infinitely recursing.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391012 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd more support for native bridging.
Richard Mudgett [Sat, 8 Jun 2013 06:31:50 +0000 (06:31 +0000)]
Add more support for native bridging.

* Added a start technology callback that technologies can use to start
bridging operations.  It is expected that native bridges will find this
useful.

* Factored out bridge_channel_complete_join().

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390991 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix a crash when a bridge switches from the softmix bridge technology to another.
Richard Mudgett [Sat, 8 Jun 2013 05:18:22 +0000 (05:18 +0000)]
Fix a crash when a bridge switches from the softmix bridge technology to another.

A three party bridge uses the softmix bridging technology.  This
technology has a dedicated thread used to perform the analog mixing.  When
one of these parties leaves the bridge, the bridge technology is changed
from the softmix technology to a two-party mixing technology.  Changing
technologies is done by removing channels from the old technology and
adding them to the new technology.  Since the remaining channels do not
leave the bridge, the softmix mixing thread could continue to process all
channels in the bridge.  If the bridge code is not able to start
destruction of the softmix technology before the softmix mixing thread
wakes up, a crash happens.

* Added a stop technology callback that technologies can use to request
any helper threads to stop in preparation for being destroyed.

(closes issue AST-1156)
Reported by: John Bigelow

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390975 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUpdate some doxygen comments.
Richard Mudgett [Sat, 8 Jun 2013 02:13:58 +0000 (02:13 +0000)]
Update some doxygen comments.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390957 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoThe bridge uniqueid is available for softmix destructor.
Richard Mudgett [Sat, 8 Jun 2013 02:10:47 +0000 (02:10 +0000)]
The bridge uniqueid is available for softmix destructor.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390956 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd some bridge identifiers to some softmix messages.
Richard Mudgett [Sat, 8 Jun 2013 01:12:57 +0000 (01:12 +0000)]
Add some bridge identifiers to some softmix messages.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390940 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_parking: Add parking_devicestate.c left out from previous commit
Jonathan Rose [Fri, 7 Jun 2013 20:51:19 +0000 (20:51 +0000)]
res_parking: Add parking_devicestate.c left out from previous commit

(issue ASTERISK-21645)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2545/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390920 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake app_queue AMI events more consistent. Give Join/Leave more useful names.
Jason Parker [Fri, 7 Jun 2013 19:51:19 +0000 (19:51 +0000)]
Make app_queue AMI events more consistent.  Give Join/Leave more useful names.

This also removes the eventwhencalled and eventmemberstatus configuration
options.  These events can just be filtered via manager.conf blacklists.

(closes issue ASTERISK-21469)
Review: https://reviewboard.asterisk.org/r/2586/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390901 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoImplement ARI POST to /channels, to originate a call.
Jason Parker [Fri, 7 Jun 2013 18:39:42 +0000 (18:39 +0000)]
Implement ARI POST to /channels, to originate a call.

(closes issue ASTERISK-21617)
Review: https://reviewboard.asterisk.org/r/2597/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390885 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoEnsure that all unit tests compile with the cache clear rework in place
Kinsey Moore [Fri, 7 Jun 2013 16:22:24 +0000 (16:22 +0000)]
Ensure that all unit tests compile with the cache clear rework in place

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390864 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_parking: Automatically generate extensions, hints, etc.
Jonathan Rose [Fri, 7 Jun 2013 16:07:18 +0000 (16:07 +0000)]
res_parking: Automatically generate extensions, hints, etc.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390849 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapp_meetme: Refactor manager events to use stasis
Jonathan Rose [Fri, 7 Jun 2013 15:54:26 +0000 (15:54 +0000)]
app_meetme: Refactor manager events to use stasis

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390848 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRework stasis cache clear events
Kinsey Moore [Fri, 7 Jun 2013 12:56:56 +0000 (12:56 +0000)]
Rework stasis cache clear events

Stasis cache clear message payloads now consist of a stasis_message
representative of the message to be cleared from the cache. This allows
multiple parallel caches to coexist and be cleared properly by the same
cache clear message even when keyed on different fields.

This change fixes a bug where multiple cache clears could be posted for
channels. The cache clear is now produced in the destructor instead of
ast_hangup.

Additionally, dummy channels are no longer capable of producing channel
snapshots.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390830 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRefactor chan_dahdi/sig_analog/sig_pri and chan_misdn to use the common transfer...
Richard Mudgett [Fri, 7 Jun 2013 01:06:49 +0000 (01:06 +0000)]
Refactor chan_dahdi/sig_analog/sig_pri and chan_misdn to use the common transfer functions.

(closes issue ASTERISK-21523)
Reported by: Matt Jordan

(closes issue ASTERISK-21524)
Reported by: Matt Jordan

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390804 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoTweak applicationmap and featuregroup config containers.
Richard Mudgett [Fri, 7 Jun 2013 00:33:20 +0000 (00:33 +0000)]
Tweak applicationmap and featuregroup config containers.

* Change applicationmap and featuregroup to replace duplicate config items
rather than reject them.

* Remove some unneeded warning messages when getting the applicationmap
allows duplicates from DYNAMIC_FEATURES.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390803 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoConditionally reject duplicate entries in applicationmap containers.
Mark Michelson [Thu, 6 Jun 2013 23:32:13 +0000 (23:32 +0000)]
Conditionally reject duplicate entries in applicationmap containers.

When reading from a config file, it's important to reject duplicates. Otherwise,
featuregroups will have ambiguity when pointing to applicationmap items. However,
when constructing the channel's current applicationmap, we don't care about duplicate
names since it's the DTMF that identifies a feature, not the name.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390787 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoReimplement bridging and DTMF features related channel variables in the bridging...
Richard Mudgett [Thu, 6 Jun 2013 22:46:54 +0000 (22:46 +0000)]
Reimplement bridging and DTMF features related channel variables in the bridging core.

* The channel variable ATTENDED_TRANSFER_COMPLETE_SOUND is no longer
channel driver specific.  If the channel variable is set on the
transferrer channel, the sound will be played to the target of an attended
transfer.

* The channel variable BRIDGEPEER becomes a comma separated list of peers
in a multi-party bridge.  The BRIDGEPEER value can have a maximum of 10
peers listed.  Any more peers in the bridge will not be included in the
list.  BRIDGEPEER is not valid in holding bridges like parking since those
channels do not talk to each other even though they are in a bridge.

* The channel variable BRIDGEPVTCALLID is only valid for two party bridges
and will contain a value if the BRIDGEPEER's channel driver supports it.

* The channel variable DYNAMIC_PEERNAME is redundant with BRIDGEPEER and
is removed.  The more useful DYNAMIC_WHO_ACTIVATED gives the channel name
that activated the dynamic feature.

* The channel variables DYNAMIC_FEATURENAME and DYNAMIC_WHO_ACTIVATED are
set only on the channel executing the dynamic feature.  Executing a
dynamic feature on the bridge peer in a multi-party bridge will execute it
on all peers of the activating channel.

(closes issue ASTERISK-21555)
Reported by: Matt Jordan

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390771 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRefactor the features configuration scheme.
Mark Michelson [Thu, 6 Jun 2013 21:40:35 +0000 (21:40 +0000)]
Refactor the features configuration scheme.

Features configuration is handled in its own API in
features_config.h and features_config.c. This way, features
configuration is accessible to anything that needs it.

In addition, features configuration has been altered to
be more channel-oriented. Most callers of features API
code will be supplying a channel so that the individual
channel's settings will be acquired rather than the global
setting.

Missing from this commit is XML documentation for the
features configuration. That will be handled in a separate
commit.

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

(issue ASTERISK-21542)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390751 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix compiler warning.
Richard Mudgett [Thu, 6 Jun 2013 20:50:25 +0000 (20:50 +0000)]
Fix compiler warning.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390734 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years ago* Fix a couple missed hook installs that need AST_BRIDGE_HOOK_REMOVE_ON_PULL.
Richard Mudgett [Thu, 6 Jun 2013 20:47:10 +0000 (20:47 +0000)]
* Fix a couple missed hook installs that need AST_BRIDGE_HOOK_REMOVE_ON_PULL.

* Rename some hook flag parameters to remove_flags.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390733 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix documentation generation
Kinsey Moore [Thu, 6 Jun 2013 20:37:48 +0000 (20:37 +0000)]
Fix documentation generation

Regression from r390701

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390730 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove props that people will yell at me for.
Jason Parker [Thu, 6 Jun 2013 20:32:15 +0000 (20:32 +0000)]
Remove props that people will yell at me for.

I'm sorry I broke automerge. :(

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390729 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix documentation that was in review during the great suffix/prefix swap
Kinsey Moore [Thu, 6 Jun 2013 20:30:56 +0000 (20:30 +0000)]
Fix documentation that was in review during the great suffix/prefix swap

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390728 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoSplit AGI manager events, to remove SubEvent field.
Jason Parker [Thu, 6 Jun 2013 19:51:12 +0000 (19:51 +0000)]
Split AGI manager events, to remove SubEvent field.

This moves them to stasis, in the process.

(closes issue ASTERISK-21470)
Review: https://reviewboard.asterisk.org/r/2587/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390701 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoConvert message_router routes to ao2. Add support for removal.
Jason Parker [Thu, 6 Jun 2013 19:44:45 +0000 (19:44 +0000)]
Convert message_router routes to ao2.  Add support for removal.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390698 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoParking: Enable code responsible for intercepting park exten transfers
Jonathan Rose [Thu, 6 Jun 2013 18:21:18 +0000 (18:21 +0000)]
Parking: Enable code responsible for intercepting park exten transfers

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390669 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd a BUGBUG note.
Richard Mudgett [Thu, 6 Jun 2013 01:52:05 +0000 (01:52 +0000)]
Add a BUGBUG note.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390639 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMisc core external attended transfer fixes.
Richard Mudgett [Thu, 6 Jun 2013 00:16:23 +0000 (00:16 +0000)]
Misc core external attended transfer fixes.

* Fix external attended transfer bridge move/swap method.  One of the
transferrer channels was not kicked out of the bridge.

* Fix several off-nominal extended attended transfer paths.  Mainly the
channels involved needed to be hung up or kicked out of the bridge.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390613 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake local channels use ast_channel_move() instead of the inlined version.
Richard Mudgett [Wed, 5 Jun 2013 23:29:43 +0000 (23:29 +0000)]
Make local channels use ast_channel_move() instead of the inlined version.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390612 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoCorrected comment on stasis_cache_get
David M. Lee [Wed, 5 Jun 2013 21:14:46 +0000 (21:14 +0000)]
Corrected comment on stasis_cache_get

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390585 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFixed refcounting problems with chanspy AMI support.
David M. Lee [Wed, 5 Jun 2013 21:14:03 +0000 (21:14 +0000)]
Fixed refcounting problems with chanspy AMI support.

The ast_multi_channel_blob_get_channel function does not bump the refcount on
the channel snapshot that it returns. This is typical for Stasis message
payloads, since being immutable means that the object won't get unreffed out
from underneath you.

The manager code for chanspy was unreffing the snapshots it got out of the
multi-channel blob, which was one unref too many.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390584 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove remaining traces of remove_on_pull from hooks and hook APIs.
Mark Michelson [Wed, 5 Jun 2013 19:19:48 +0000 (19:19 +0000)]
Remove remaining traces of remove_on_pull from hooks and hook APIs.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390550 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoGive the AST_BRIDGE_HOOK_REMOVE_ON_PULL a legitimate value.
Mark Michelson [Wed, 5 Jun 2013 18:21:19 +0000 (18:21 +0000)]
Give the AST_BRIDGE_HOOK_REMOVE_ON_PULL a legitimate value.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390525 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoChange the remove_on_pull flag on ast_bridge_hook to be a set of flags.
Mark Michelson [Wed, 5 Jun 2013 18:07:23 +0000 (18:07 +0000)]
Change the remove_on_pull flag on ast_bridge_hook to be a set of flags.

This change is used to make bridge hook removal more generic. This way,
depending on the circumstance, the appropriate bridge hooks may be
removed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390510 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPublish the channel state snapshot *before* calling device state so a device state...
Joshua Colp [Wed, 5 Jun 2013 14:50:46 +0000 (14:50 +0000)]
Publish the channel state snapshot *before* calling device state so a device state producer can use
an up to date snapshot.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390473 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFixed a consistency problem with channel snapshot and endpoint state.
David M. Lee [Wed, 5 Jun 2013 14:47:30 +0000 (14:47 +0000)]
Fixed a consistency problem with channel snapshot and endpoint state.

When channels are added to an endpoint, the code originally posted a channel
snapshot to the endoint's topic directly. Turns out, this is a bad idea.

This causes the endpoint to see an inconsistent view of the channel, since it
will later receive in-flight messages with old channel snapshots.

This patch instead just publishes channel state immediately after setting up
the forward to the endpoint's topic. This gives the endpoints a consistent
view of the channel's state.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390472 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd BUGBUG comment.
Richard Mudgett [Tue, 4 Jun 2013 22:55:46 +0000 (22:55 +0000)]
Add BUGBUG comment.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390440 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoSimple lock, assignment, unlock sandwich optimization.
Richard Mudgett [Tue, 4 Jun 2013 22:51:04 +0000 (22:51 +0000)]
Simple lock, assignment, unlock sandwich optimization.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390439 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoCorrected the docs on ast_manager_event_blob_create
David M. Lee [Tue, 4 Jun 2013 15:55:19 +0000 (15:55 +0000)]
Corrected the docs on ast_manager_event_blob_create

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390398 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoCorrect autoconf script for finding UUID support.
David M. Lee [Mon, 3 Jun 2013 15:57:42 +0000 (15:57 +0000)]
Correct autoconf script for finding UUID support.

The library that provides UUID support varies greatly from system to
system. On most Linux distros, it's in libuuid. On OpenBSD, it's in
libe2fs-uuid. On OS X, it is in libsystem.

This patch plays hide-and-seek with UUID support, looking for it in the
three places we know about. It also corrects the Makefile so that it uses
the configured library name and include path.

(closes issue ASTERISK-21816)
Reported by: Brad Latus (snuffy)
Tested by: Brad Latus (snuffy)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390352 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRefactor code and fix a reference leak
Kinsey Moore [Fri, 31 May 2013 19:00:51 +0000 (19:00 +0000)]
Refactor code and fix a reference leak

Refactor some channel blob publishing code to use
ast_channel_publish_blob now that it is available and fix a JSON
reference leak that was occurring during varset publishing.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390317 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove ast_channel_bridge() and associated code called only by it.
Richard Mudgett [Fri, 31 May 2013 16:15:32 +0000 (16:15 +0000)]
Remove ast_channel_bridge() and associated code called only by it.

* Added some more BUGBUG notes.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390291 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFixup hold/unhold with attended and blind transfers.
Richard Mudgett [Fri, 31 May 2013 15:34:20 +0000 (15:34 +0000)]
Fixup hold/unhold with attended and blind transfers.

* DTMF attended and blind transfers have hold/unhold behavior restored.

* External attended and blind transfers unhold the transfered party when
the transfer is initiated.

* Made prohibit blind transferring a bridge marked as masquerade only.
(ConfBridge bridges)

* Made running an application or playing a file inside a bridge post the
hold/unhold messages if MOH is requested.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390289 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoReplace ast_manager_publish_message() with a more useful version.
Jason Parker [Fri, 31 May 2013 14:36:08 +0000 (14:36 +0000)]
Replace ast_manager_publish_message() with a more useful version.

It's much easier to just create a blob of the message.  Convert some AMI events
to use it.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390268 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove remnant of snapshot blob JSON types
Kinsey Moore [Fri, 31 May 2013 12:41:10 +0000 (12:41 +0000)]
Remove remnant of snapshot blob JSON types

Remove usage of the once-mandatory snapshot blob type field, refactor
confbridge stasis messages accordingly, and remove
ast_bridge_blob_json_type().

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390250 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd snapshot cache that indexes by channel name
Kinsey Moore [Fri, 31 May 2013 12:27:29 +0000 (12:27 +0000)]
Add snapshot cache that indexes by channel name

This adds a new channel snapshot cache in parallel to the existing
cache; the difference being that it indexes the channel snapshots by
channel name instead of channel uniqueid.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390249 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMultiple revisions 390228-390229
Alexandr Anikin [Fri, 31 May 2013 10:42:19 +0000 (10:42 +0000)]
Multiple revisions 390228-390229

........
  r390228 | may | 2013-05-31 14:19:52 +0400 (Fri, 31 May 2013) | 14 lines

  reject call attempts when gatekeeper is configured but not registered

  (closes issue ASTERISK-21800)
  Reported by: Dmitry Melekhov
  Patches:
          ASTERISK-21800-1.patch
  Tested by: Dmitry Melekhov
  ........

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

  Merged revisions 390223 from http://svn.asterisk.org/svn/asterisk/branches/10
........
  r390229 | may | 2013-05-31 14:34:20 +0400 (Fri, 31 May 2013) | 4 lines

  remove unnecessary declarations
  (issue ASTERISK-21800)
........

Merged revisions 390228-390229 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390230 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoLet find do its own globbing.
Walter Doekes [Fri, 31 May 2013 07:57:28 +0000 (07:57 +0000)]
Let find do its own globbing.

Previously a stray .c file would cause xmldocs to not get built.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390180 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMissed a line from a bad merge in r390122
David M. Lee [Thu, 30 May 2013 19:23:53 +0000 (19:23 +0000)]
Missed a line from a bad merge in r390122

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390154 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAvoid unnecessary cleanups during immediate shutdown
David M. Lee [Thu, 30 May 2013 17:05:53 +0000 (17:05 +0000)]
Avoid unnecessary cleanups during immediate shutdown

This patch addresses issues during immediate shutdowns, where modules
are not unloaded, but Asterisk atexit handlers are run.

In the typical case, this usually isn't a big deal. But the
introduction of the Stasis message bus makes it much more likely for
asynchronous activity to be happening off in some thread during
shutdown.

During an immediate shutdown, Asterisk skips unloading modules. But
while it is processing the atexit handlers, there is a window of time
where some of the core message types have been cleaned up, but the
message bus is still running. Specifically, it's still running
module subscriptions that might be using the core message types. If a
message is received by that subscription in that window, it will
attempt to use a message type that has been cleaned up.

To solve this problem, this patch introduces ast_register_cleanup().
This function operates identically to ast_register_atexit(), except
that cleanup calls are not invoked on an immediate shutdown. All of
the core message type and topic cleanup was moved from atexit handlers
to cleanup handlers.

This ensures that core type and topic cleanup only happens if the
modules that used them are first unloaded.

This patch also changes the ast_assert() when accessing a cleaned up
or uninitialized message type to an error log message. Message type
functions are actually NULL safe across the board, so the assert was a
bit heavy handed. Especially for anyone with DO_CRASH enabled.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390122 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix segfault when dealing with chan_agent channels.
Richard Mudgett [Wed, 29 May 2013 20:24:18 +0000 (20:24 +0000)]
Fix segfault when dealing with chan_agent channels.

Check the returned bridged pointer for NULL to avoid a crash.  It looks
like chan_agent is returning a NULL pointer when it probably should be
returning a pointer to the channel the Agent channel is pretending to be.

(closes issue ASTERISK-21793)
Reported by: Rodrigo P. Telles
Patches:
      jira_asterisk_21793_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: Rodrigo P. Telles
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390068 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove unused RAII vars.
Jason Parker [Wed, 29 May 2013 19:54:01 +0000 (19:54 +0000)]
Remove unused RAII vars.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390042 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPack the right number of items into the status and receive fax blobs
Matthew Jordan [Wed, 29 May 2013 03:22:04 +0000 (03:22 +0000)]
Pack the right number of items into the status and receive fax blobs

The code was still attempting to pack an additional item into the blobs
that didn't exist. Crashes ensued. This patch modifies the publishing of
these messages so that the correct number of items are packed in the JSON.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389990 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoResolve a merge conflict
Kinsey Moore [Wed, 29 May 2013 02:26:17 +0000 (02:26 +0000)]
Resolve a merge conflict

When ast_channel_cached_blob_create was merged,
ast_channel_blob_create_from_cache was partially removed in an
unresolved merge conflict. This restores ast_channel_blob_create_from_cache
and refactors usage of ast_channel_cached_blob_create (requires an
ast_channel) to use ast_channel_blob_create_from_cache (requires a
channel uniqueid) instead.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389974 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix a memory copying bug in slinfactory which was causing mixmonitor issues.
Jonathan Rose [Tue, 28 May 2013 17:47:29 +0000 (17:47 +0000)]
Fix a memory copying bug in slinfactory which was causing mixmonitor issues.

Reported by: Michael Walton
Tested by: Jonathan Rose
Patches:
    slinfactory.c.ASTERISK-21799.patch uploaded by Michael Walton (license 6502)
(closes issue ASTERISK-21799)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389897 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd missing NULL check to acquire_bridge() function.
Mark Michelson [Tue, 28 May 2013 15:54:53 +0000 (15:54 +0000)]
Add missing NULL check to acquire_bridge() function.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389870 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd attended transfer support for chan_sip.c
Mark Michelson [Tue, 28 May 2013 15:26:15 +0000 (15:26 +0000)]
Add attended transfer support for chan_sip.c

This now uses the core API for performing attended transfers.

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

(Closes issue ASTERISK-21520)
reported by Matt Jordan

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389869 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdds support for a core attended transfer function plus adds some hiding of masquerades.
Mark Michelson [Tue, 28 May 2013 14:45:31 +0000 (14:45 +0000)]
Adds support for a core attended transfer function plus adds some hiding of masquerades.

The attended transfer API call can complete the attended transfer in a number of ways
depending on the current bridged states of the channels involved.

The hiding of masquerades is done in some bridging-related functions, such as the manager
Bridge action and the Bridge dialplan application. In addition, call pickup was edited
to "move" a channel rather than masquerade it.

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

(closes issue ASTERISK-21334)
Reported by Matt Jordan

(closes issue Asterisk-21336)
Reported by Matt Jordan

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389848 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix some more fax test errors due to needing the peer in a bridge
Matthew Jordan [Mon, 27 May 2013 01:33:12 +0000 (01:33 +0000)]
Fix some more fax test errors due to needing the peer in a bridge

In r389799, a number of fax errors in gateway mode were fixed by using the
appropriate function to get a channel's peer while in a bridge. This patch
does two things:
(1) It uses the same function in res_fax_spandsp while starting the fax
    gateway. Without this, the fax gateway will not actually start up, as
    res_fax_spandsp also must inspect the channel's peer in a two-party
    bridge
(2) It refactors some ao2 objects in sendfax_exec to use RAII_VAR. This was
    reverted in r389799 as some off nominal paths were getting hit without
    the fix in (1) that indicated an ao2 object issue; this turned out to
    be a red herring (which is an odd phrase)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389827 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoInitialize the message type before the topic
Matthew Jordan [Mon, 27 May 2013 00:06:40 +0000 (00:06 +0000)]
Initialize the message type before the topic

Caching topics will during initialization attempt to reference
their message type. The message type therefore has to be
initialized prior to the topic to prevent the dreaded assertion.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389813 65c4cc65-6c06-0410-ace0-fbb531ad65f3