asterisk/asterisk.git
6 years agoRemove the unsafe bridge parameter from ast_bridge_hook_callback's.
Richard Mudgett [Fri, 26 Jul 2013 21:34:23 +0000 (21:34 +0000)]
Remove the unsafe bridge parameter from ast_bridge_hook_callback's.

Most hook callbacks did not need the bridge parameter.  The pointer value
could become invalid if the channel is moved to another bridge while it is
executing.

* Fixed some issues in feature_attended_transfer() as a result.

* Reduce the bridge inhibit count in
attended_transfer_properties_shutdown() after it has restored the bridge
channel hooks.

* Removed basic bridge requirement on feature_blind_transfer().  It does
not require the basic bridge like feature_attended_transfer().

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

6 years agoImproved feature limits interval hook implementaion.
Richard Mudgett [Fri, 26 Jul 2013 21:10:24 +0000 (21:10 +0000)]
Improved feature limits interval hook implementaion.

* Fixed feature limits to not use special members of struct
ast_bridge_features.

* Fixed memory leak in off nominal paths of bridge_builtin_set_limits().

* Fixed off nominal path in ast_bridge_features_limits_construct() freeing
unallocated memory if it was not called by bridge_builtin_set_limits().

* Made bridge_builtin_interval_features.so unloadable.

* Simplified parking's use of its duration interval hook.

* Made BridgeWait S option not depend upon another module being loaded.

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

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

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

6 years agoFix /stasis/res/app_replaced unit test.
David M. Lee [Fri, 26 Jul 2013 17:42:08 +0000 (17:42 +0000)]
Fix /stasis/res/app_replaced unit test.

A typo in recent changes caused the JSON ApplicationReplaced message to
fail to build, so the message wasn't being sent out the WebSocket.

Related, the replaced application would also unregister itself when it
disconnected, which would actually unregister the new application. This
was also fixed.

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

6 years agoAdd name argument to BridgeWait() so multiple holding bridges may be used
Jonathan Rose [Fri, 26 Jul 2013 16:34:56 +0000 (16:34 +0000)]
Add name argument to BridgeWait() so multiple holding bridges may be used

Changes arguments for BridgeWait from BridgeWait(role, options) to
BridgeWait(bridge_name, role, options). Now multiple holding bridges may
be created and referenced by this application.

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

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

6 years agoRemove some unnecessary parentheses.
Richard Mudgett [Fri, 26 Jul 2013 00:03:13 +0000 (00:03 +0000)]
Remove some unnecessary parentheses.

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

6 years agoRevision
Richard Mudgett [Thu, 25 Jul 2013 21:39:49 +0000 (21:39 +0000)]
Revision

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

6 years agoFix crash due to trying to send a re-invite while in the incorrect state.
Joshua Colp [Thu, 25 Jul 2013 20:54:17 +0000 (20:54 +0000)]
Fix crash due to trying to send a re-invite while in the incorrect state.

This crash would occur if a re-invite was queued while the initial INVITE
transaction was still occurring and the response to the INVITE was not ACKed.
This lack of ACK would cause the INVITE session state to never reach confirmed.
Once the transaction terminated, however, the queued re-invite would occur and
cause a crash due to this lack of state change.

This fix checks the INVITE session state before performing the re-invite to
ensure it is in the required confirmed state.

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

6 years agoChange the default value for "allowsubscribe" to yes to match chan_sip.
Joshua Colp [Thu, 25 Jul 2013 19:18:42 +0000 (19:18 +0000)]
Change the default value for "allowsubscribe" to yes to match chan_sip.

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

6 years agoRestore bridging files history.
Richard Mudgett [Thu, 25 Jul 2013 18:27:10 +0000 (18:27 +0000)]
Restore bridging files history.

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

6 years agoRemove some dead parking call
Matthew Jordan [Thu, 25 Jul 2013 15:29:55 +0000 (15:29 +0000)]
Remove some dead parking call

Since nothing is using these global parking functions, remove them!

The first of many.

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

6 years agoRemove dead bridging code from features
Matthew Jordan [Thu, 25 Jul 2013 14:34:09 +0000 (14:34 +0000)]
Remove dead bridging code from features

This removes the previously #if 0'd code. The functionality removed has either
been subsumed by the Bridging API or is no longer applicable.

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

6 years agoFix incorrect reference to stasis/bridging.h
Matthew Jordan [Thu, 25 Jul 2013 04:18:05 +0000 (04:18 +0000)]
Fix incorrect reference to stasis/bridging.h

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

6 years agoA great big renaming patch
Matthew Jordan [Thu, 25 Jul 2013 04:06:32 +0000 (04:06 +0000)]
A great big renaming patch

This patch renames the bridging* files to bridge*. This may seem pedantic
and silly, but it fits better in line with current Asterisk naming conventions:
* channel is not "channeling"
* monitor is not "monitoring"
etc.

A bridge is an object. It is a first class citizen in Asterisk. "Bridging" is
the act of using a bridge on a set of channels - and the API that fulfills that
role is more than just the action.

(closes issue ASTERISK-22130)

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

6 years agoMove after bridge callbacks into their own file
Matthew Jordan [Thu, 25 Jul 2013 02:20:23 +0000 (02:20 +0000)]
Move after bridge callbacks into their own file

One more major refactoring to go.

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

6 years agoImprove initial INVITE handling and fix crash due to rapidly arriving CANCEL.
Joshua Colp [Thu, 25 Jul 2013 00:44:24 +0000 (00:44 +0000)]
Improve initial INVITE handling and fix crash due to rapidly arriving CANCEL.

(closes issue ASTERISK-22150)

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

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

6 years agoSimplify interval hooks since there is only one bridge threading model now.
Richard Mudgett [Wed, 24 Jul 2013 23:40:12 +0000 (23:40 +0000)]
Simplify interval hooks since there is only one bridge threading model now.

* Convert interval timers to use the ast_waitfor_nandfds() timeout.

* Remove bridge channel action for intervals.  Now the main loop handles
running interval hooks.

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

6 years agoRefactor ast_bridge_features struct.
Richard Mudgett [Wed, 24 Jul 2013 21:13:00 +0000 (21:13 +0000)]
Refactor ast_bridge_features struct.

* Reduced the number of hook containers to just dtmf_hooks,
interval_hooks, and other_hooks.  As a result, several functions dealing
with the different hook containers could be combined.

* Extended the generic hook struct for DTMF and interval hooks instead of
using a variant record.

* Merged the special talk detector hook into the other_hooks container.

* Replaced ast_bridge_features_set_talk_detector() with
ast_bridge_talk_detector_hook().

(issue ASTERISK-22107)

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

6 years ago* Refactor setup_bridge_features_builtin().
Richard Mudgett [Wed, 24 Jul 2013 20:28:59 +0000 (20:28 +0000)]
* Refactor setup_bridge_features_builtin().

* Add an error message so you know when a feature is not available and you
tried to use it.  It usually means the module has not been loaded.

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

6 years agoExport exports.in as well
Matthew Jordan [Wed, 24 Jul 2013 19:32:23 +0000 (19:32 +0000)]
Export exports.in as well

Because is is rather needed.

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

6 years agoUpdate bridge_channel refactorings; export bridge_ symbol
Matthew Jordan [Wed, 24 Jul 2013 19:24:09 +0000 (19:24 +0000)]
Update bridge_channel refactorings; export bridge_ symbol

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

6 years agoAdd pjproject to install_prereq.
Jason Parker [Wed, 24 Jul 2013 18:51:06 +0000 (18:51 +0000)]
Add pjproject to install_prereq.

Also fixes spacing, in passing.

(closes issue ASTERISK-22131)

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

6 years agoTweak another magic number
Kinsey Moore [Wed, 24 Jul 2013 18:08:19 +0000 (18:08 +0000)]
Tweak another magic number

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

6 years agoMake AMI BridgeInfo action more verbose
Kinsey Moore [Wed, 24 Jul 2013 17:49:56 +0000 (17:49 +0000)]
Make AMI BridgeInfo action more verbose

Ensure that the BridgeInfo command provides adequate state information
about channels by publishing the full channel snapshot for
BridgeInfoChannel subevents. This prevents a two-stage lookup since
most consumers will be keying on channel names instead of uniqueids.

(closes issue ASTERISK-22140)

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

6 years agoTweak a magic number
Kinsey Moore [Wed, 24 Jul 2013 17:33:45 +0000 (17:33 +0000)]
Tweak a magic number

(closes issue ASTERISK-22146)

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

6 years agoAdd missing end-of-file line terminators.
Richard Mudgett [Wed, 24 Jul 2013 16:01:20 +0000 (16:01 +0000)]
Add missing end-of-file line terminators.

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

6 years agoAdd missing line terminator to debug message.
Richard Mudgett [Wed, 24 Jul 2013 15:50:51 +0000 (15:50 +0000)]
Add missing line terminator to debug message.

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

6 years agoPerform the initial renaming of the Bridging API
Matthew Jordan [Wed, 24 Jul 2013 15:38:18 +0000 (15:38 +0000)]
Perform the initial renaming of the Bridging API

This patch does the following:
 * It pulls out bridge_channel and puts it into its own translation unit
 * It adds public and protected headers for bridging_channel. Protected
   functions are appropriate only for the Bridging API and sub-classes of a
   bridge.

(issue ASTERISK-22130)

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

6 years agoLet the compiler do more type checking with bridge hook callbacks.
Richard Mudgett [Wed, 24 Jul 2013 14:35:03 +0000 (14:35 +0000)]
Let the compiler do more type checking with bridge hook callbacks.

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

6 years agoFix a check in bridge_native_rtp which determined if attaching the framehook failed...
Joshua Colp [Tue, 23 Jul 2013 22:32:39 +0000 (22:32 +0000)]
Fix a check in bridge_native_rtp which determined if attaching the framehook failed or not.

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

6 years agofunc_channel: dtmf_features setting
Jonathan Rose [Tue, 23 Jul 2013 21:32:33 +0000 (21:32 +0000)]
func_channel: dtmf_features setting

Allows reading andsetting dtmf features via a channel function
CHANNEL(dtmf_features)

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

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

6 years agoAdd some debug messages to make it clear what RTP bridging functionality is in use.
Joshua Colp [Tue, 23 Jul 2013 21:14:24 +0000 (21:14 +0000)]
Add some debug messages to make it clear what RTP bridging functionality is in use.

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

6 years agoFix some logic so native RTP bridge will occur when monitor, audiohooks, or framehook...
Joshua Colp [Tue, 23 Jul 2013 21:01:06 +0000 (21:01 +0000)]
Fix some logic so native RTP bridge will occur when monitor, audiohooks, or framehooks are not present.

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

6 years agoPull softmix bridge parameters into a sub structure.
Richard Mudgett [Tue, 23 Jul 2013 19:14:44 +0000 (19:14 +0000)]
Pull softmix bridge parameters into a sub structure.

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

6 years agoDrop the reference count on the correct object.
Joshua Colp [Tue, 23 Jul 2013 18:41:29 +0000 (18:41 +0000)]
Drop the reference count on the correct object.

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

6 years agoReinclude sys/stat.h in chan_dahdi.c and remove redundant include in utils.c
Richard Mudgett [Tue, 23 Jul 2013 18:41:18 +0000 (18:41 +0000)]
Reinclude sys/stat.h in chan_dahdi.c and remove redundant include in utils.c

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

6 years agoSome chan_dahdi protected function renaming.
Richard Mudgett [Tue, 23 Jul 2013 16:26:36 +0000 (16:26 +0000)]
Some chan_dahdi protected function renaming.

analog_lib_handles --> dahdi_analog_lib_handles
enable_dtmf_detect --> dahdi_dtmf_detect_enable
disable_dtmf_detect --> dahdi_dtmf_detect_disable
dahdi_enable_ec --> dahdi_ec_enable
dahdi_disable_ec --> dahdi_ec_disable
update_conf --> dahdi_conf_update
dahdi_link --> dahdi_master_slave_link
dahdi_unlink --> dahdi_master_slave_unlink

(closes issue ASTERISK-22129)
Reported by: rmudgett

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

6 years agoRestore chan_dahdi native bridging and PRI tromboned call elimination.
Richard Mudgett [Tue, 23 Jul 2013 15:59:32 +0000 (15:59 +0000)]
Restore chan_dahdi native bridging and PRI tromboned call elimination.

Created a native_dahdi bridging technology for use with the new bridging
API.

The new bridging technology is part of the chan_dahdi channel driver
because it is very specific to that driver.  Rather than include the new
code directly into chan_dahdi.c the new bridge technology is in its own
file and linked into chan_dahdi.so.  A large part of this change is the
mechanical process of moving declarations around so chan_dahdi.c can be
split up into more files later.

* Changed the bridging core to pass NULL frames into the channel
technologies instead of discarding them.  The channel technologies may
need the proding to determine if their configuration is still valid.

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

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

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

6 years agoMake DTMF attended transfer support feature-complete.
Mark Michelson [Tue, 23 Jul 2013 15:28:11 +0000 (15:28 +0000)]
Make DTMF attended transfer support feature-complete.

This greatly modifies the operation of DTMF attended transfers so that
the full range of options from features.conf applies.

In addition, a new option has been added that allows for a transferer
to switch between bridges during a transfer before completing the
transfer.

(closes issue ASTERISK-21543)
reported by Matt Jordan

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

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

6 years agoNo more teapots.
David M. Lee [Tue, 23 Jul 2013 14:57:03 +0000 (14:57 +0000)]
No more teapots.

Now that the ARI implementation is nearing some definition of
completeness, we should properly respond with 501's for unimplemented
functionality, instead of the almost humorous 418.

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

6 years agoKill the zombies
Matthew Jordan [Tue, 23 Jul 2013 14:49:53 +0000 (14:49 +0000)]
Kill the zombies

In previous versions of Asterisk, the zombies roamed freely,
unchecked and uncontrolled. They ravaged Asterisk systems with
their biting and their nashing and their pointy teeth.

Sometimes, you couldn't even hang them up.

Now, zombies are rare. They still *technically* exist in certain
places, but they are controlled. Kind of like a zombie zoo: you can
see them, but you can't touch them, and they can't touch you.
Bring your kids!

Because zombies are now population controlled with a very short lifespan,
there's no reason to rename the channels to '%s<ZOMBIE>'. The channels
are guaranteed to die off quickly; the rename really is just confusing
at this point.

This patch finally removes the renaming. On the plus side: this made
my life easier in CDRs during call pickup and attended transfers to
an Asterisk application. It will make other folks lives easier as well!

Review: https://reviewboard.astierks.org/r/2690/

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

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

6 years agoAdd DTLS-SRTP support to chan_pjsip
Kinsey Moore [Tue, 23 Jul 2013 13:52:06 +0000 (13:52 +0000)]
Add DTLS-SRTP support to chan_pjsip

This patch introduces DTLS-SRTP support to chan_pjsip and the options
necessary to configure it including an option to allow choosing between
32 and 80 byte SRTP tag lengths.

During the implementation and testing of this patch, three other bugs
were found and their fixes are included with this patch. The two in
chan_sip were a segfault relating to DTLS setup and mistaken call
rejection. The third bug fix prevents chan_pjsip from attempting to
perform bridge optimization between two endpoints if either of them is
running any form of SRTP.

Review: https://reviewboard.asterisk.org/r/2683/
(closes issue ASTERISK-21419)

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

6 years agoContinue events when ARI WebSocket reconnects
David M. Lee [Tue, 23 Jul 2013 13:42:46 +0000 (13:42 +0000)]
Continue events when ARI WebSocket reconnects

This patch addresses a bug in the /ari/events WebSocket in handling
reconnects.

When a Stasis application's associated WebSocket was disconnected and
reconnected, it would not receive events for any channels or bridges
it was subscribed to.

The fix was to lazily clean up Stasis application registrations,
instead of removing them as soon as the WebSocket goes away.

When an application is unregistered at the WebSocket level, the
underlying application is simply deactivated. If the application
WebSocket is reconnected, the application is reactivated for the new
connection.

To avoid memory leaks from lingering, unused application, the
application list is cleaned up whenever new applications are
registered/unregistered.

(closes issue ASTERISK-21970)
Review: https://reviewboard.asterisk.org/r/2678/

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

6 years agoFix bridge/channel AMI event ordering issues
David M. Lee [Tue, 23 Jul 2013 13:39:50 +0000 (13:39 +0000)]
Fix bridge/channel AMI event ordering issues

The stasis_cache_update messages are somewhat cumbersome to handle
with the stasis_message_router. Since all updates have the same
message type, they are normally handled with the same route.

Since caching itself is a first class component of stasis-core, it
makes sense for the router to handle the cache update messages itself.
This patch adds stasis_message_router_add_cache_update() and
stasis_message_router_remove_cache_update() to handle the routing of
stasis_cache_update messages.

This patch also corrects an issue with manager_{bridging,channels}.c,
where events might be reordered. The reordering occurs because the
components use different message routers, which they needed because
they both needed to route cache update messages. They now both use
manager's router, and add cache routes for just the cache updates they
are interested in.

(closes issue ASTERISK-22038)
Review: https://reviewboard.asterisk.org/r/2677/

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

6 years agoAdd missing newline
Kinsey Moore [Tue, 23 Jul 2013 12:56:19 +0000 (12:56 +0000)]
Add missing newline

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

6 years agoExpose the chan_pjsip implementation pvt and session in a defined manner.
Joshua Colp [Tue, 23 Jul 2013 12:27:03 +0000 (12:27 +0000)]
Expose the chan_pjsip implementation pvt and session in a defined manner.

This allows modules outside of chan_pjsip itself to get the session given
only an Asterisk channel.

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

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

6 years agoFix unbalanced lock when serializing CDR variables
Matthew Jordan [Tue, 23 Jul 2013 00:16:59 +0000 (00:16 +0000)]
Fix unbalanced lock when serializing CDR variables

I'm only surprised that this didn't cause larger problems.

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

6 years agoRemove some BUGBUG notes that have been handled.
Richard Mudgett [Tue, 23 Jul 2013 00:02:04 +0000 (00:02 +0000)]
Remove some BUGBUG notes that have been handled.

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

6 years agoMake the CEL blind transfer test pass consistently
Kinsey Moore [Mon, 22 Jul 2013 20:42:28 +0000 (20:42 +0000)]
Make the CEL blind transfer test pass consistently

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

6 years agoUpdate copyright year to 2013 in asterisk.c; some whitespace fixes
Matthew Jordan [Mon, 22 Jul 2013 13:52:10 +0000 (13:52 +0000)]
Update copyright year to 2013 in asterisk.c; some whitespace fixes

(closes issue ASTERISK-22179)
Reported by: Malcolm Davenport
........

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

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

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

6 years agoBlocked revisions 395020
Matthew Jordan [Sun, 21 Jul 2013 23:13:29 +0000 (23:13 +0000)]
Blocked revisions 395020

........
Add an upgrade note for libuuid dependency; remove note in CHANGES

This patch notes that libuuid is now a dependency for res_rtp_asterisk; this
was introduced in between 11.4.0 and 11.5.0 to resolve a dependency for
pjproject, which res_rtp_asterisk uses for ICE/STUN/TURN support.

It also removes a conflicting note from CHANGES. While support for playing
prompts to the first participant was added for app_queue, it was disabled
by default and an option added to enable it. That was properly noted in the
UPGRADE.txt file.

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

6 years agoClean up documentation
Matthew Jordan [Sun, 21 Jul 2013 22:09:23 +0000 (22:09 +0000)]
Clean up documentation

This patch cleans up documentation in func_channel for the following items:
* rtpsource
* secure_signaling
* secure_media
* various OOH323 parameters

(closes issue ASTERISK-20969)
Reported by: snuffy
patches:
  func_chan-update.diff uploaded by snuffy (License 5024)
........

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

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

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

6 years agoProvide proper ring tone in indications.conf for Malaysia
Matthew Jordan [Sun, 21 Jul 2013 18:17:17 +0000 (18:17 +0000)]
Provide proper ring tone in indications.conf for Malaysia

The ring tone provided in the sample indications.conf was incorrect. This patch
modifies the sample ring tone to be what it should:
  ring = 425/400,0/200,425/400,0/2000

This brings it in line with the tone definition in DAHDI 2.7.0. (zonedata.c)

(closes issue ASTERISK-21997)
Reported by: Filip Jenicek
patches:
  malaysia_ring.patch uploaded by phill (License 6277)
........

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

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

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

6 years agoAlways install safe_asterisk; add configuration file support
Matthew Jordan [Sun, 21 Jul 2013 18:12:00 +0000 (18:12 +0000)]
Always install safe_asterisk; add configuration file support

This patch modifies the behavior of safe_asterisk in two ways:
(1) It modifies the Asterisk Makefile such that safe_asterisk is always
    installed on a 'make install'. This was done as bugfixes in the
    safe_asterisk script were not applied in previous version of Asterisk
    without first removing the old version of the script.
(2) In order to keep a newly installed version of safe_asterisk from impacting
    local modifications, a new config file - safe_asterisk.conf.sample - has
    been provided. Settings that were previously modified in safe_asterisk can
    be set there instead.

(closes issue ASTERISK-21965)
Reported by: Jeremy Kister
patches:
  safe_asterisk.patch uploaded by jkister (License 6232)

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

6 years agoTolerate presence of RFC2965 Cookie2 header by ignoring it
Matthew Jordan [Sun, 21 Jul 2013 03:10:41 +0000 (03:10 +0000)]
Tolerate presence of RFC2965 Cookie2 header by ignoring it

This patch modifies parsing of cookies in Asterisk's http server by doing an
explicit comparison of the "Cookie" header instead of looking at the first
6 characters to determine if the header is a cookie header. This avoids
parsing "Cookie2" headers and overwriting the previously parsed "Cookie"
header.

Note that we probably should be appending the cookies in each "Cookie"
header to the parsed results; however, while clients can send multiple
cookie headers they never really do. While this patch doesn't improve
Asterisk's behavior in that regard, it shouldn't make it any worse either.

Note that the solution in this patch was pointed out on the issue by the
issue reporter, Stuart Henderson.

(closes issue ASTERISK-21789)
Reported by: Stuart Henderson
Tested by: mjordan, Stuart Henderson
........

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

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

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

6 years agoUpdate PostgreSQL realtime scripts with schema for queue_log table
Matthew Jordan [Sun, 21 Jul 2013 02:39:37 +0000 (02:39 +0000)]
Update PostgreSQL realtime scripts with schema for queue_log table

This patch updates the realtime SQL scripts with an entry that will create the
queue_log table. This brings the PostgreSQL scripts inline with the MySQL
scripts, with respect to what tables they will create.

(closes issue ASTERISK-21021)
Reported by: Eugene
patches:
  queue_log.sql uploaded by varnav (license 6360)
........

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

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

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

6 years agoAdd additional control frame types to the IAX2 parser for debug messages
Matthew Jordan [Sun, 21 Jul 2013 02:30:58 +0000 (02:30 +0000)]
Add additional control frame types to the IAX2 parser for debug messages

This patch adds some of the more recent control frame types to the IAX2
parser. When IAX2 debugging is enabled, it will now show more of the control
frame types.

(closes issue ASTERISK-22120)
Reported by: Birger "WIMPy" Harzenetter
patches:
  iaxcmds.diff uploaded by wimpy

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

6 years agoDocument connectedline parameter for chan_iax2
Matthew Jordan [Sun, 21 Jul 2013 02:26:31 +0000 (02:26 +0000)]
Document connectedline parameter for chan_iax2

The connectedline parameter for a chan_iax2 peer was undocumented. This patch
documents the options in the sample configuration file.

(closes issue ASTERISK-21953)
Reported by: Birger "WIMPy" Harzenetter
........

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

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

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

6 years agoAllow setting allowmultiplelogin on an account basis
Matthew Jordan [Sun, 21 Jul 2013 02:11:49 +0000 (02:11 +0000)]
Allow setting allowmultiplelogin on an account basis

This patch modifies manager to allow the allowmultiplelogin setting to be set
on an account by account basis. When set in the general context, it will act
as the default for the defined accounts. Setting it in the account will
override the general setting.

(closes issue ASTERISK-21324)
Reported by: vldmr
patches:
  asterisk-manager-per-user-allowmultiplelogin.patch uploaded by vldmr (License 6487)

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

6 years agoAdd CEL local optimization record type
Kinsey Moore [Sat, 20 Jul 2013 13:25:05 +0000 (13:25 +0000)]
Add CEL local optimization record type

This adds a new CEL event type, AST_CEL_LOCAL_OPTIMIZE, to represent
local channel optimizations. Local channel optimizations were one of
several things conveyed by the now defunct BRIDGE_UPDATE event type.
This also adds a unit test to test generation of this new CEL event.

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

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

6 years agoAdd transfer support to CEL
Kinsey Moore [Sat, 20 Jul 2013 13:10:22 +0000 (13:10 +0000)]
Add transfer support to CEL

This adds CEL support for blind and attended transfers and call pickup.
During the course of adding this functionality I noticed that
CONF_ENTER, CONF_EXIT, and BRIDGE_TO_CONF events are particularly
useless without a bridge identifier, so I added that as well.

This adds tests for blind transfers, several types of attended
transfers, and call pickup.

The extra field in CEL records now consists of a JSON blob whose fields
are defined on a per-event basis.

Review: https://reviewboard.asterisk.org/r/2658/
(closes issue ASTERISK-21565)

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

6 years agoRegroup the ao2 search_flags.
Richard Mudgett [Sat, 20 Jul 2013 01:11:38 +0000 (01:11 +0000)]
Regroup the ao2 search_flags.

Moved the OBJ_POINTER, OBJ_KEY, and OBJ_PARTIAL_KEY flags together into a
field and renamed them to OBJ_SEARCH_OBJECT, OBJ_SEARCH_KEY, and
OBJ_SEARCH_PARTIAL_KEY respectively.  The values were selected to keep
existing code compiling and working until the codebase can be changed to
stop using these values as bit flags and use them as an enum field.

The old names are defined to the new names for backward compatibility.

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

6 years agoMinor optimizations.
Richard Mudgett [Fri, 19 Jul 2013 23:30:10 +0000 (23:30 +0000)]
Minor optimizations.

* Made ast_audiohook_detach_list() and ast_audiohook_write_list_empty()
NULL tolerant.

* Made ast_audiohook_detach_list() return void since it is a destructor.

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

6 years agoExtract a repeated test into ast_channel_has_audio_frame_or_monitor().
Richard Mudgett [Fri, 19 Jul 2013 22:47:10 +0000 (22:47 +0000)]
Extract a repeated test into ast_channel_has_audio_frame_or_monitor().

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

6 years agoARI: MOH start and stop for a channel
Jonathan Rose [Fri, 19 Jul 2013 19:40:27 +0000 (19:40 +0000)]
ARI: MOH start and stop for a channel

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

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

6 years agoARI: Bridge Playback, Bridge Record
Jonathan Rose [Fri, 19 Jul 2013 19:35:21 +0000 (19:35 +0000)]
ARI: Bridge Playback, Bridge Record

Adds a new channel driver for creating channels for specific purposes
in bridges, primarily to act as either recorders or announcers. Adds
ARI commands for playing announcements to ever participant in a bridge
as well as for recording a bridge. This patch also includes some
documentation/reponse fixes to related ARI models such as playback
controls.

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

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

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

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

6 years agoFilter channels used as internal mechanisms
Kinsey Moore [Fri, 19 Jul 2013 19:23:39 +0000 (19:23 +0000)]
Filter channels used as internal mechanisms

This adds new flags to the channel tech properties that flag it as
different types of implementation detail used exclusively to provide a
feature. Examples of channels that would have these flags include the
announcement and recording channels used by confbridge which are the
only two marked as such by this patch.

Review: https://reviewboard.asterisk.org/r/2633/
(closes issue ASTERISK-21873)

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

6 years agoFix crash when using temporary peers
Kinsey Moore [Fri, 19 Jul 2013 18:09:43 +0000 (18:09 +0000)]
Fix crash when using temporary peers

Temporary peers do not have an associated Stasis endpoint and quite a
bit of code in chan_sip assumes that all peers have a Stasis endpoint.
All endpoint accesses in chan_sip are now wrapped in an endpoint
NULL-check.

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

6 years agoConvert CCSS manager events to stasis.
Jason Parker [Fri, 19 Jul 2013 18:00:35 +0000 (18:00 +0000)]
Convert CCSS manager events to stasis.

(closes issue ASTERISK-21473)

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

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

6 years agoMade audiohooks, framehooks, and monitor prevent local channel optimization.
Richard Mudgett [Fri, 19 Jul 2013 17:55:49 +0000 (17:55 +0000)]
Made audiohooks, framehooks, and monitor prevent local channel optimization.

Audiohooks, framehooks, and monitor represent state on a local channel
that will go away if it is optimized out.

(closes issue ASTERISK-21954)
Reported by: rmudgett

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

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

6 years agoFixup doxygen on ast_hangup().
Richard Mudgett [Thu, 18 Jul 2013 22:01:42 +0000 (22:01 +0000)]
Fixup doxygen on ast_hangup().

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

6 years agoAdd a bunch of options from sip.conf to res_sip.conf
Mark Michelson [Thu, 18 Jul 2013 19:25:51 +0000 (19:25 +0000)]
Add a bunch of options from sip.conf to res_sip.conf

For a complete list of the options added, see the review linked
at the bottom of this commit message.

(closes issue ASTERISK-21506)
reported by Matt Jordan

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

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

6 years agoFixed null dereference when WebSocket subprotocol isn't specified
David M. Lee [Thu, 18 Jul 2013 18:05:07 +0000 (18:05 +0000)]
Fixed null dereference when WebSocket subprotocol isn't specified

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

6 years agobridge_holding/app_bridgewait: Add new entertainment options
Jonathan Rose [Thu, 18 Jul 2013 16:49:44 +0000 (16:49 +0000)]
bridge_holding/app_bridgewait: Add new entertainment options

This patch adds more entertainment options to holding bridges and the
bridge_wait application. Also, holding bridges will now use music on
hold as the default entertainment option instead of none. The
parameters for app_bridgewait have changed to (role, options) from
the previous (options) and the options themselves have changed as
well (entertainment options are now contained in an enumerator, role
specification is handled by the role parameter, etc)

(closes issue ASTERISK-21923)
Reported by: Matthew Jordan
Review: https://reviewboard.asterisk.org/r/2679/

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

6 years agoARI: Add support for suppressing media streams.
Jason Parker [Thu, 18 Jul 2013 16:03:12 +0000 (16:03 +0000)]
ARI: Add support for suppressing media streams.

Also convert res_mutestream to use the core feature behind this.

(closes issue ASTERISK-21618)

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

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

6 years agoTweak debug statements
Matthew Jordan [Thu, 18 Jul 2013 14:50:56 +0000 (14:50 +0000)]
Tweak debug statements

This patch does two things:
1. It moves the debug statement that shows the HTTP sub-protocols being
   compared after the string length calculation such that it shows the correct
   string length in the output
2. It adds some additional debug that displays when it matches on a
   sub-protocol and when it fails

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

6 years agoFix caching topic shutdown assertions
David M. Lee [Thu, 18 Jul 2013 14:08:21 +0000 (14:08 +0000)]
Fix caching topic shutdown assertions

The recent changes to update stasis_cache_topics directly from the
publisher thread uncovered a race condition, which was causing asserts
in the /stasis/core tests.

If the caching topic's subscription is the last reference to the
caching topic, it will destroy the caching topic after the final
message has been processed. When dispatching to a different thread,
this usually gave the unsubscribe enough time to finish before
destruction happened. Now, however, it consistently destroys before
unsubscription is complete.

This patch adds an extra reference to the caching topic, to hold it
for the duration of the unsubscription.

This patch also removes an extra unref that was happening when the
final message was received by the caching topic. It was put there
because of an extra ref that was put into the caching topic's
constructor. Both have been removed, which makes the destructor a bit
less confusing.

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

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

6 years agoProperly indicate failure to open an audio stream in res_agi
Michael L. Young [Thu, 18 Jul 2013 12:54:50 +0000 (12:54 +0000)]
Properly indicate failure to open an audio stream in res_agi

If there is an error streaming an audio file, the current return status makes it
difficult for an AGI script to determine that there was an error with the audio
file.

This patches changes the result to return -1 and the function returns
RESULT_FAILURE instead of RESULT_SUCCESS.  From looking at other parts of
res_agi, this would appear to be the proper way to handle an error.

(closes issue ASTERISK-21903)
Reported by: Ariel Wainer
Tested by: Ariel Wainer
Patches:
asterisk-21903-return-stream-res_1.8.diff
by Michael L. Young (license 5026)

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

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

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

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

6 years agoChange ast_hangup() to return void and be NULL safe.
Richard Mudgett [Wed, 17 Jul 2013 22:30:28 +0000 (22:30 +0000)]
Change ast_hangup() to return void and be NULL safe.

Since ast_hangup() is effectively a channel destructor, it should be a
void function.

* Make the few silly callers checking the return value no longer do so.
Only the CDR and CEL unit tests checked the return value.

* Make all callers take advantage of the NULL safe change and remove the
NULL check before the call.

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

6 years agoRemove some completed and no longer relevant BUGBUG notes.
Richard Mudgett [Wed, 17 Jul 2013 19:27:26 +0000 (19:27 +0000)]
Remove some completed and no longer relevant BUGBUG notes.

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

6 years agoapp_confbridge: Eliminate a reference leak for confbridge announcer channels
Jonathan Rose [Wed, 17 Jul 2013 18:26:19 +0000 (18:26 +0000)]
app_confbridge: Eliminate a reference leak for confbridge announcer channels

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

6 years agoLeft over spacing issues of review 726.
Tzafrir Cohen [Wed, 17 Jul 2013 17:49:54 +0000 (17:49 +0000)]
Left over spacing issues of review 726.

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

6 years agohandle DAHDI_EVENT_REMOVED on a pri D-Channel
Tzafrir Cohen [Wed, 17 Jul 2013 16:56:14 +0000 (16:56 +0000)]
handle DAHDI_EVENT_REMOVED on a pri D-Channel

When a DAHDI device is removed at run-time it sends the event
DAHDI_EVENT_REMOVED on each channel. This is intended to signal the
userspace program to close the respective file handle, as the driver of
the device will need all of them closed to properly clean-up.

This event has long since been handled in chan_dahdi (chan_zap at the
time). However the event that is sent on a D-Channel of a "PRI" (ISDN)
span simply gets ignored.

This commit adds handling for closing the file descriptor (and shutting
down the span, while we're at it).

It also adds a CLI command 'pri destroy span <N>' to destroy the span
and its DAHDI channels.

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

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

6 years agoAdd 'kick all' capability to ConfBridge CLI command
Matthew Jordan [Tue, 16 Jul 2013 22:33:27 +0000 (22:33 +0000)]
Add 'kick all' capability to ConfBridge CLI command

This patch adds the ability to kick all users out of a conference from the
ConfBridge kick CLI command. It is invoked by passing 'all' as the channel
parameter to the CLI command, i.e., "confbridge kick <conf> all".

Note that this patch was modified slightly to conform to trunk.

(closes issue ASTERISK-21827)
Reported by: dorianlogan
patches:
  kickall-patch_v2.diff uploaded by dorianlogan (License 6504)

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

6 years agoRe-order handlers in CEL to ensure that HANGUP events happen after APP_END
Matthew Jordan [Tue, 16 Jul 2013 22:25:33 +0000 (22:25 +0000)]
Re-order handlers in CEL to ensure that HANGUP events happen after APP_END

When a channel is hungup, both an APP_END event and a HANGUP event can be
fired. To ensure that HANGUP events occur after APP_END events, the method
callbacks for the APP_END event should be processed prior to the callbacks
for the HANGUP event.

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

6 years agoDebug logging to help with WebSocket connection problems
David M. Lee [Tue, 16 Jul 2013 21:44:12 +0000 (21:44 +0000)]
Debug logging to help with WebSocket connection problems

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

6 years agochan_gulp: Fix gulp_indicate() handling of AST_CONTROL_PVT_CAUSE_CODE.
Richard Mudgett [Tue, 16 Jul 2013 20:00:25 +0000 (20:00 +0000)]
chan_gulp: Fix gulp_indicate() handling of AST_CONTROL_PVT_CAUSE_CODE.

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

6 years agoPrevent crash from trying to end a session in an invalid way.
Mark Michelson [Tue, 16 Jul 2013 19:13:04 +0000 (19:13 +0000)]
Prevent crash from trying to end a session in an invalid way.

This ensures that code that was only meant to be run on a reinvite failure
only runs on a reinvite failure.

(closes issue ASTERISK-22061)
reported by Rusty Newton

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

6 years agoRemove some dead code dealing with old bridging method.
Richard Mudgett [Tue, 16 Jul 2013 18:49:26 +0000 (18:49 +0000)]
Remove some dead code dealing with old bridging method.

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

6 years agoSimplify bridge_simple chan join code.
Richard Mudgett [Tue, 16 Jul 2013 18:48:49 +0000 (18:48 +0000)]
Simplify bridge_simple chan join code.

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

6 years agoRe-order cleanup
Matthew Jordan [Tue, 16 Jul 2013 18:22:07 +0000 (18:22 +0000)]
Re-order cleanup

This patch attempts to fix some possible race conditions in shutdown of the
CDR engine. It:
* Adds a cleanup handler to only unsubscribe and join on stasis messages during
  graceful shutdown. The cleanup handler should execute before the regular atexit
  handler, as we want to unsubscribe for any further messages before dispatching
  the CDRs.
* The CDRs are now locked when we dispatch them on shutdown.

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

6 years agoFixed null dereference when WebSocket protocol is omitted
David M. Lee [Tue, 16 Jul 2013 15:30:09 +0000 (15:30 +0000)]
Fixed null dereference when WebSocket protocol is omitted

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

6 years agoReplace chan_agent with app_agent_pool.
Richard Mudgett [Mon, 15 Jul 2013 23:20:55 +0000 (23:20 +0000)]
Replace chan_agent with app_agent_pool.

The ill conceived chan_agent is no more.  It is now replaced by
app_agent_pool.

Agents login using the AgentLogin() application as before.  The
AgentLogin() application no longer does any authentication.
Authentication is now the responsibility of the dialplan.  (Besides, the
authentication done by chan_agent did not match what the voice prompts
asked for.)

Sample extensions.conf
[login]
; Sample agent 1001 login
; Set COLP for in between calls so the agent does not see the last caller COLP.
exten => 1001,1,Set(CONNECTEDLINE(all)="Agent Waiting" <1001>)
; Give the agent DTMF transfer and disconnect features when connected to a caller.
same => n,Set(CHANNEL(dtmf-features)=TX)
same => n,AgentLogin(1001)
same => n,NoOp(AGENT_STATUS is ${AGENT_STATUS})
same => n,Hangup()

[caller]
; Sample caller direct connect to agent 1001
exten => 800,1,AgentRequest(1001)
same => n,NoOp(AGENT_STATUS is ${AGENT_STATUS})
same => n,Hangup()

; Sample caller going through a Queue to agent 1001
exten => 900,1,Queue(agent_q)
same => n,Hangup()

Sample queues.conf
[agent_q]
member => Local/800@caller,,SuperAgent,Agent:1001

Under the hood operation overview:
1) Logged in agents wait for callers in an agents holding bridge.
2) Caller requests an agent using AgentRequest()
3) A basic bridge is created, the agent is notified, and caller joins the
   basic bridge to wait for the agent.
4) The agent is either automatically connected to the caller or must ack
   the call to connect.
5) The agent is moved from the agents holding bridge to the basic bridge.
6) The agent and caller talk.
7) The connection is ended by either party.
8) The agent goes back to the agents holding bridge.

To avoid some locking issues with the agent holding bridge, I needed to
make some changes to the after bridge callback support.  The after bridge
callback is now a list of requested callbacks with the last to be added
the only active callback.  The after bridge callback for failed callbacks
will always happen in the channel thread when the channel leaves the
bridging system or is destroyed.

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

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

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

6 years agoRemove misleading documentation for channel snapshot creation.
Mark Michelson [Mon, 15 Jul 2013 22:05:57 +0000 (22:05 +0000)]
Remove misleading documentation for channel snapshot creation.

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

6 years agoDocument the ari.conf allowed_origins setting
David M. Lee [Mon, 15 Jul 2013 21:22:12 +0000 (21:22 +0000)]
Document the ari.conf allowed_origins setting

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

6 years agoRemove some callbacks and functions which are not needed.
Joshua Colp [Mon, 15 Jul 2013 13:43:37 +0000 (13:43 +0000)]
Remove some callbacks and functions which are not needed.

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

6 years agoProvide error message for QUEUE_MEMBER when member is not in queue
Matthew Jordan [Sun, 14 Jul 2013 02:41:43 +0000 (02:41 +0000)]
Provide error message for QUEUE_MEMBER when member is not in queue

When QUEUE_MEMBER is used and the member specified is not in the queue,
Asterisk provides an ERROR message that indicates that the option specified
is not valid. This patch now properly displays an ERROR message that the
member is not in the queue if an interface is specified.

(closes issue ASTERISK-21980)
Reported by: Avraam David
........

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

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

6 years agoRemove redundant code in dns.c
Matthew Jordan [Sun, 14 Jul 2013 02:05:04 +0000 (02:05 +0000)]
Remove redundant code in dns.c

Peter J Philipp pointed out that there are two checks that ensure that len is
not less than 0. If len is less than 0, the function returns. Having both of
them is clearly redundant.

This removes the second and attempts to clarify (slightly) the error condition.

(closes issue ASTERISK-21772)
Reported by: Peter J Philipp

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

6 years agoClarify documentation for function PASSTHRU
Matthew Jordan [Sun, 14 Jul 2013 02:00:02 +0000 (02:00 +0000)]
Clarify documentation for function PASSTHRU

It is not apparent to the average user that the PASSTHRU function should not
be passed as ${PASSTHRU(string)} but just as PASSTHRU(string) to functions
which take a variable name and not its contents.

This patch clarifies the behavior in the documentation and provides an example.

(closes issue ASTERISK-21717)
Reported by: Richard Miller
patches:
  func_strings.diff uploaded by Richard Miller (license 5685)
........

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

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

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

6 years agoFix FRACK message from external redirects; handle outbound channels better
Matthew Jordan [Sat, 13 Jul 2013 23:28:23 +0000 (23:28 +0000)]
Fix FRACK message from external redirects; handle outbound channels better

This patch does the following:
 * It simplifies the Dial handling in CDRs. As a rule, the caller in a dial
   relationship is always the Party A. There was some logic present in the
   handling of the dial message that could, conceivably, pick the caller
   as Party A for the beginning of the dial and the peer as Party A for the
   end of the dial. This shouldn't have happened if the code in the bridging
   framework was doing its job; however, that was broken and it led to the
   FRACK. As it is, this code was overly ocmplex and not needed: the caller,
   if present, should always be Party A. Period.
 * It properly checks to see if a channel will continue on in the dialplan.
   ast_check_hangup - much like cake at the end - is a lie. It will tell
   you that you are hungup when you are not. Do not believe it.

   I would make this function tell the truth, but I'm nervous that we've been
   depending on it sitting on its throne of lies for far too long, and it would
   probably break lots of things. So I'm just checking the "internal" soft
   hangup flags, like everyone else.

(closes issue ASTERISK-22060)
Reported by: Mark Michelson

(issue ASTERISK-21831)
Reported by: Matt Jordan

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

6 years agoPretty up a debug message if the referred-by-uri isn't available
Matthew Jordan [Sat, 13 Jul 2013 22:14:04 +0000 (22:14 +0000)]
Pretty up a debug message if the referred-by-uri isn't available

Instead of formatting a NULL pointer into a "%s" format string (which is
usually not a good thing to do), we instead print "Unknown".

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