[asterisk-commits] may: branch may/ooh323_qsig r397815 - in /team/may/ooh323_qsig: ./ addons/ ap...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 27 14:15:18 CDT 2013


Author: may
Date: Tue Aug 27 14:14:54 2013
New Revision: 397815

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397815
Log:
Multiple revisions 394623,394642,394686,394701,394715,394731,394744,394759,394776,394791,394793,394795,394808-394810,394825,394836,394846,394858,394870,394881

........
  r394623 | rmudgett | 2013-07-18 02:30:28 +0400 (Thu, 18 Jul 2013) | 11 lines
  
  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.
........
  r394642 | elguero | 2013-07-18 16:54:50 +0400 (Thu, 18 Jul 2013) | 25 lines
  
  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
........
  r394686 | dlee | 2013-07-18 18:08:21 +0400 (Thu, 18 Jul 2013) | 24 lines
  
  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/
........
  r394701 | mjordan | 2013-07-18 18:50:56 +0400 (Thu, 18 Jul 2013) | 10 lines
  
  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
........
  r394715 | qwell | 2013-07-18 20:03:12 +0400 (Thu, 18 Jul 2013) | 8 lines
  
  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/
........
  r394731 | jrose | 2013-07-18 20:49:44 +0400 (Thu, 18 Jul 2013) | 14 lines
  
  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/
........
  r394744 | dlee | 2013-07-18 22:05:07 +0400 (Thu, 18 Jul 2013) | 1 line
  
  Fixed null dereference when WebSocket subprotocol isn't specified
........
  r394759 | mmichelson | 2013-07-18 23:25:51 +0400 (Thu, 18 Jul 2013) | 11 lines
  
  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
........
  r394776 | rmudgett | 2013-07-19 02:01:42 +0400 (Fri, 19 Jul 2013) | 1 line
  
  Fixup doxygen on ast_hangup().
........
  r394791 | rmudgett | 2013-07-19 21:55:49 +0400 (Fri, 19 Jul 2013) | 10 lines
  
  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/
........
  r394793 | qwell | 2013-07-19 22:00:35 +0400 (Fri, 19 Jul 2013) | 6 lines
  
  Convert CCSS manager events to stasis.
  
  (closes issue ASTERISK-21473)
  
  Review: https://reviewboard.asterisk.org/r/2682/
........
  r394795 | kmoore | 2013-07-19 22:09:43 +0400 (Fri, 19 Jul 2013) | 7 lines
  
  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.
........
  r394808 | kmoore | 2013-07-19 23:23:39 +0400 (Fri, 19 Jul 2013) | 11 lines
  
  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)
........
  r394809 | jrose | 2013-07-19 23:35:21 +0400 (Fri, 19 Jul 2013) | 17 lines
  
  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/
........
  r394810 | jrose | 2013-07-19 23:40:27 +0400 (Fri, 19 Jul 2013) | 6 lines
  
  ARI: MOH start and stop for a channel
  
  (issue ASTERISK-21974)
  Reported by: Matt Jordan
  Review: https://reviewboard.asterisk.org/r/2680/
........
  r394825 | rmudgett | 2013-07-20 02:47:10 +0400 (Sat, 20 Jul 2013) | 2 lines
  
  Extract a repeated test into ast_channel_has_audio_frame_or_monitor().
........
  r394836 | rmudgett | 2013-07-20 03:30:10 +0400 (Sat, 20 Jul 2013) | 7 lines
  
  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.
........
  r394846 | rmudgett | 2013-07-20 05:11:38 +0400 (Sat, 20 Jul 2013) | 10 lines
  
  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.
........
  r394858 | kmoore | 2013-07-20 17:10:22 +0400 (Sat, 20 Jul 2013) | 16 lines
  
  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)
........
  r394870 | kmoore | 2013-07-20 17:25:05 +0400 (Sat, 20 Jul 2013) | 9 lines
  
  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/
........
  r394881 | mjordan | 2013-07-21 06:11:49 +0400 (Sun, 21 Jul 2013) | 11 lines
  
  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)
........

Merged revisions 394623,394642,394686,394701,394715,394731,394744,394759,394776,394791,394793,394795,394808-394810,394825,394836,394846,394858,394870,394881 from http://svn.asterisk.org/svn/asterisk/trunk

Added:
    team/may/ooh323_qsig/channels/chan_bridge_media.c
      - copied unchanged from r394881, trunk/channels/chan_bridge_media.c
    team/may/ooh323_qsig/res/res_sip/config_global.c
      - copied unchanged from r394881, trunk/res/res_sip/config_global.c
    team/may/ooh323_qsig/res/res_sip/config_system.c
      - copied unchanged from r394881, trunk/res/res_sip/config_system.c
    team/may/ooh323_qsig/res/res_sip/sip_global_headers.c
      - copied unchanged from r394881, trunk/res/res_sip/sip_global_headers.c
Modified:
    team/may/ooh323_qsig/   (props changed)
    team/may/ooh323_qsig/CHANGES
    team/may/ooh323_qsig/addons/chan_mobile.c
    team/may/ooh323_qsig/apps/app_bridgewait.c
    team/may/ooh323_qsig/apps/app_celgenuserevent.c
    team/may/ooh323_qsig/apps/app_dial.c
    team/may/ooh323_qsig/apps/app_directed_pickup.c
    team/may/ooh323_qsig/apps/app_meetme.c
    team/may/ooh323_qsig/apps/app_queue.c
    team/may/ooh323_qsig/apps/app_voicemail.c
    team/may/ooh323_qsig/apps/confbridge/conf_chan_announce.c
    team/may/ooh323_qsig/apps/confbridge/conf_chan_record.c
    team/may/ooh323_qsig/apps/confbridge/confbridge_manager.c
    team/may/ooh323_qsig/bridges/bridge_holding.c
    team/may/ooh323_qsig/bridges/bridge_native_rtp.c
    team/may/ooh323_qsig/channels/chan_dahdi.c
    team/may/ooh323_qsig/channels/chan_gulp.c
    team/may/ooh323_qsig/channels/chan_sip.c
    team/may/ooh323_qsig/channels/sig_analog.c
    team/may/ooh323_qsig/include/asterisk/astobj2.h
    team/may/ooh323_qsig/include/asterisk/audiohook.h
    team/may/ooh323_qsig/include/asterisk/cel.h
    team/may/ooh323_qsig/include/asterisk/channel.h
    team/may/ooh323_qsig/include/asterisk/core_unreal.h
    team/may/ooh323_qsig/include/asterisk/logger.h
    team/may/ooh323_qsig/include/asterisk/res_sip.h
    team/may/ooh323_qsig/include/asterisk/stasis_app.h
    team/may/ooh323_qsig/include/asterisk/stasis_app_playback.h
    team/may/ooh323_qsig/include/asterisk/stasis_channels.h
    team/may/ooh323_qsig/include/asterisk/stasis_system.h
    team/may/ooh323_qsig/main/asterisk.c
    team/may/ooh323_qsig/main/audiohook.c
    team/may/ooh323_qsig/main/bridging.c
    team/may/ooh323_qsig/main/bridging_roles.c
    team/may/ooh323_qsig/main/ccss.c
    team/may/ooh323_qsig/main/cdr.c
    team/may/ooh323_qsig/main/cel.c
    team/may/ooh323_qsig/main/channel.c
    team/may/ooh323_qsig/main/core_unreal.c
    team/may/ooh323_qsig/main/dial.c
    team/may/ooh323_qsig/main/features.c
    team/may/ooh323_qsig/main/http.c
    team/may/ooh323_qsig/main/manager.c
    team/may/ooh323_qsig/main/manager_bridging.c
    team/may/ooh323_qsig/main/manager_channels.c
    team/may/ooh323_qsig/main/pbx.c
    team/may/ooh323_qsig/main/stasis_cache.c
    team/may/ooh323_qsig/main/stasis_channels.c
    team/may/ooh323_qsig/main/stasis_system.c
    team/may/ooh323_qsig/res/parking/parking_manager.c
    team/may/ooh323_qsig/res/res_agi.c
    team/may/ooh323_qsig/res/res_http_websocket.c
    team/may/ooh323_qsig/res/res_mutestream.c
    team/may/ooh323_qsig/res/res_sip.c
    team/may/ooh323_qsig/res/res_sip.exports.in
    team/may/ooh323_qsig/res/res_sip/config_transport.c
    team/may/ooh323_qsig/res/res_sip/include/res_sip_private.h
    team/may/ooh323_qsig/res/res_sip/sip_configuration.c
    team/may/ooh323_qsig/res/res_sip_caller_id.c
    team/may/ooh323_qsig/res/res_sip_mwi.c
    team/may/ooh323_qsig/res/res_sip_one_touch_record_info.c
    team/may/ooh323_qsig/res/res_sip_pubsub.c
    team/may/ooh323_qsig/res/res_sip_refer.c
    team/may/ooh323_qsig/res/res_sip_sdp_rtp.c
    team/may/ooh323_qsig/res/res_sip_session.c
    team/may/ooh323_qsig/res/res_stasis.c
    team/may/ooh323_qsig/res/res_stasis_http_bridges.c
    team/may/ooh323_qsig/res/res_stasis_http_channels.c
    team/may/ooh323_qsig/res/res_stasis_http_playback.c
    team/may/ooh323_qsig/res/res_stasis_playback.c
    team/may/ooh323_qsig/res/stasis/control.c
    team/may/ooh323_qsig/res/stasis_http/ari_model_validators.c
    team/may/ooh323_qsig/res/stasis_http/ari_model_validators.h
    team/may/ooh323_qsig/res/stasis_http/resource_bridges.c
    team/may/ooh323_qsig/res/stasis_http/resource_bridges.h
    team/may/ooh323_qsig/res/stasis_http/resource_channels.c
    team/may/ooh323_qsig/res/stasis_http/resource_channels.h
    team/may/ooh323_qsig/rest-api/api-docs/bridges.json
    team/may/ooh323_qsig/rest-api/api-docs/channels.json
    team/may/ooh323_qsig/rest-api/api-docs/playback.json
    team/may/ooh323_qsig/rest-api/api-docs/recordings.json
    team/may/ooh323_qsig/tests/test_app.c
    team/may/ooh323_qsig/tests/test_cdr.c
    team/may/ooh323_qsig/tests/test_cel.c
    team/may/ooh323_qsig/tests/test_stasis_endpoints.c
    team/may/ooh323_qsig/tests/test_voicemail_api.c

Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Aug 27 14:14:54 2013
@@ -1,1 +1,1 @@
-/trunk:1-380157,380165-391000,391012,391016-393400,393410-393530,393542-393834,393843-394050,394065-394089,394103-394600
+/trunk:1-380157,380165-391000,391012,391016-393400,393410-393530,393542-393834,393843-394050,394065-394089,394103-394600,394623-394881

Modified: team/may/ooh323_qsig/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/CHANGES?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/CHANGES (original)
+++ team/may/ooh323_qsig/CHANGES Tue Aug 27 14:14:54 2013
@@ -294,6 +294,10 @@
    the Local channel. This affects the LocalBridge, LocalOptimizationBegin,
    and LocalOptimizationEnd events.
 
+ * The option 'allowmultiplelogin' can now be set or overriden in a particular
+   account. When set in the general context, it will act as the default
+   setting for defined accounts.
+
 AGI (Asterisk Gateway Interface)
 ------------------
  * The manager event AGIExec has been split into AGIExecStart and AGIExecEnd.
@@ -319,6 +323,27 @@
  * When a CDR is dispatched, user defined CDR variables from both parties are
    included in the resulting CDR. If both parties have the same variable, only
    the Party A value is provided.
+
+CEL (Channel Event Logging)
+------------------
+ * The 'extra' field of all CEL events that use it now consists of a JSON blob
+   with key/value pairs which are defined in the Asterisk 12 CEL documentation.
+
+ * AST_CEL_BLINDTRANSFER events now report the transferee bridge unique
+   identifier, extension, and context in a JSON blob as the extra string
+   instead of the transferee channel name as the peer.
+
+ * AST_CEL_ATTENDEDTRANSFER events now report the peer as NULL and additional
+   information in the 'extra' string as a JSON blob. For transfers that occur
+   between two bridged channels, the 'extra' JSON blob contains the primary
+   bridge unique identifier, the secondary channel name, and the secondary
+   bridge unique identifier. For transfers that occur between a bridged channel
+   and a channel running an app, the 'extra' JSON blob contains the primary
+   bridge unique identifier, the secondary channel name, and the app name.
+
+ * AST_CEL_LOCAL_OPTIMIZE events have been added to convey local channel
+   optimizations with the record occurring for the semi-one channel and
+   the semi-two channel name in the peer field.
 
 Features
 -------------------

Modified: team/may/ooh323_qsig/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/addons/chan_mobile.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/addons/chan_mobile.c (original)
+++ team/may/ooh323_qsig/addons/chan_mobile.c Tue Aug 27 14:14:54 2013
@@ -1339,9 +1339,7 @@
 
 static int mbl_ast_hangup(struct mbl_pvt *pvt)
 {
-	if (pvt->owner) {
-		ast_hangup(pvt->owner);
-	}
+	ast_hangup(pvt->owner);
 	return 0;
 }
 

Modified: team/may/ooh323_qsig/apps/app_bridgewait.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_bridgewait.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/apps/app_bridgewait.c (original)
+++ team/may/ooh323_qsig/apps/app_bridgewait.c Tue Aug 27 14:14:54 2013
@@ -54,26 +54,44 @@
 			Put a call into the holding bridge.
 		</synopsis>
 		<syntax>
+			<parameter name="role" required="false">
+				<para>Defines the channel's purpose for entering the holding bridge. Values are case sensitive.
+				</para>
+				<enumlist>
+					<enum name="participant">
+						<para>The channel will enter the holding bridge to be placed on hold
+						until it is removed from the bridge for some reason. (default)</para>
+					</enum>
+					<enum name="announcer">
+						<para>The channel will enter the holding bridge to make announcements
+						to channels that are currently in the holding bridge. While an
+						announcer is present, holding for the participants will be
+						suspended.</para>
+					</enum>
+				</enumlist>
+			</parameter>
 			<parameter name="options">
 				<optionlist>
-					<option name="A">
-						<para>The channel will join the holding bridge as an
-						announcer</para>
+					<option name="m">
+						<argument name="class" required="true" />
+						<para>The specified MOH class will be used/suggested for
+						music on hold operations. This option will only be useful for
+						entertainment modes that use it (m and h).</para>
 					</option>
-					<option name="m">
-						<argument name="class" required="false" />
-						<para>Play music on hold to the entering channel while it is
-						on hold. If the <emphasis>class</emphasis> is included, then
-						that class of music on hold will take priority over the
-						channel default.</para>
-					</option>
-					<option name="r">
-						<para>Play a ringing tone to the entering channel while it is
-						on hold.</para>
+					<option name="e">
+						<para>Which entertainment mechanism should be used while on hold
+						in the holding bridge. Only the first letter is read.</para>
+						<enumlist>
+							<enum name="m"><para>Play music on hold (default)</para></enum>
+							<enum name="r"><para>Ring without pause</para></enum>
+							<enum name="s"><para>Generate silent audio</para></enum>
+							<enum name="h"><para>Put the channel on hold</para></enum>
+							<enum name="n"><para>No entertainment</para></enum>
+						</enumlist>
 					</option>
 					<option name="S">
 						<argument name="duration" required="true" />
-						<para>Automatically end the hold and return to the PBX after
+						<para>Automatically exit the bridge and return to the PBX after
 						<emphasis>duration</emphasis> seconds.</para>
 					</option>
 				</optionlist>
@@ -87,12 +105,8 @@
 	</application>
  ***/
 /* BUGBUG Add bridge name/id parameter to specify which holding bridge to join (required) */
-/* BUGBUG Add h(moh-class) option to put channel on hold using AST_CONTROL_HOLD/AST_CONTROL_UNHOLD while in bridge */
-/* BUGBUG Add s option to send silence media frames to channel while in bridge (uses a silence generator) */
-/* BUGBUG Add n option to send no media to channel while in bridge (Channel should not be answered yet) */
 /* BUGBUG The channel may or may not be answered with the r option. */
 /* BUGBUG You should not place an announcer into a holding bridge with unanswered channels. */
-/* BUGBUG Not supplying any option flags will assume the m option with the default music class. */
 
 static char *app = "BridgeWait";
 static struct ast_bridge *holding_bridge;
@@ -100,22 +114,21 @@
 AST_MUTEX_DEFINE_STATIC(bridgewait_lock);
 
 enum bridgewait_flags {
-	MUXFLAG_PLAYMOH = (1 << 0),
-	MUXFLAG_RINGING = (1 << 1),
+	MUXFLAG_MOHCLASS = (1 << 0),
+	MUXFLAG_ENTERTAINMENT = (1 << 1),
 	MUXFLAG_TIMEOUT = (1 << 2),
-	MUXFLAG_ANNOUNCER = (1 << 3),
 };
 
 enum bridgewait_args {
+	OPT_ARG_ENTERTAINMENT,
 	OPT_ARG_MOHCLASS,
 	OPT_ARG_TIMEOUT,
 	OPT_ARG_ARRAY_SIZE, /* Always the last element of the enum */
 };
 
 AST_APP_OPTIONS(bridgewait_opts, {
-	AST_APP_OPTION('A', MUXFLAG_ANNOUNCER),
-	AST_APP_OPTION('r', MUXFLAG_RINGING),
-	AST_APP_OPTION_ARG('m', MUXFLAG_PLAYMOH, OPT_ARG_MOHCLASS),
+	AST_APP_OPTION_ARG('e', MUXFLAG_ENTERTAINMENT, OPT_ARG_ENTERTAINMENT),
+	AST_APP_OPTION_ARG('m', MUXFLAG_MOHCLASS, OPT_ARG_MOHCLASS),
 	AST_APP_OPTION_ARG('S', MUXFLAG_TIMEOUT, OPT_ARG_TIMEOUT),
 });
 
@@ -147,18 +160,38 @@
 	return 0;
 }
 
-static void apply_option_moh(struct ast_channel *chan, char *class_arg)
-{
-	ast_channel_set_bridge_role_option(chan, "holding_participant", "idle_mode", "musiconhold");
-	ast_channel_set_bridge_role_option(chan, "holding_participant", "moh_class", class_arg);
-}
-
-static void apply_option_ringing(struct ast_channel *chan)
-{
-	ast_channel_set_bridge_role_option(chan, "holding_participant", "idle_mode", "ringing");
-}
-
-static int process_options(struct ast_channel *chan, struct ast_flags *flags, char **opts, struct ast_bridge_features *features)
+static int apply_option_moh(struct ast_channel *chan, const char *class_arg)
+{
+	return ast_channel_set_bridge_role_option(chan, "holding_participant", "moh_class", class_arg);
+}
+
+static int apply_option_entertainment(struct ast_channel *chan, const char *entertainment_arg)
+{
+	char entertainment = entertainment_arg[0];
+	switch (entertainment) {
+	case 'm':
+		return ast_channel_set_bridge_role_option(chan, "holding_participant", "idle_mode", "musiconhold");
+	case 'r':
+		return ast_channel_set_bridge_role_option(chan, "holding_participant", "idle_mode", "ringing");
+	case 's':
+		return ast_channel_set_bridge_role_option(chan, "holding_participant", "idle_mode", "silence");
+	case 'h':
+		return ast_channel_set_bridge_role_option(chan, "holding_participant", "idle_mode", "hold");
+	case 'n':
+		return ast_channel_set_bridge_role_option(chan, "holding_participant", "idle_mode", "none");
+	default:
+		ast_log(LOG_ERROR, "Invalid argument for BridgeWait entertainment '%s'\n", entertainment_arg);
+		return -1;
+	}
+}
+
+enum wait_bridge_roles {
+	ROLE_PARTICIPANT = 0,
+	ROLE_ANNOUNCER,
+	ROLE_INVALID,
+};
+
+static int process_options(struct ast_channel *chan, struct ast_flags *flags, char **opts, struct ast_bridge_features *features, enum wait_bridge_roles role)
 {
 	if (ast_test_flag(flags, MUXFLAG_TIMEOUT)) {
 		if (apply_option_timeout(features, opts[OPT_ARG_TIMEOUT])) {
@@ -166,21 +199,47 @@
 		}
 	}
 
-	if (ast_test_flag(flags, MUXFLAG_ANNOUNCER)) {
-		/* Announcer specific stuff */
-		ast_channel_add_bridge_role(chan, "announcer");
+	switch (role) {
+	case ROLE_PARTICIPANT:
+		if (ast_channel_add_bridge_role(chan, "holding_participant")) {
+			return -1;
+		}
+
+		if (ast_test_flag(flags, MUXFLAG_MOHCLASS)) {
+			if (apply_option_moh(chan, opts[OPT_ARG_MOHCLASS])) {
+				return -1;
+			}
+		}
+
+		if (ast_test_flag(flags, MUXFLAG_ENTERTAINMENT)) {
+			if (apply_option_entertainment(chan, opts[OPT_ARG_ENTERTAINMENT])) {
+				return -1;
+			}
+		}
+
+		break;
+	case ROLE_ANNOUNCER:
+		if (ast_channel_add_bridge_role(chan, "announcer")) {
+			return -1;
+		}
+		break;
+	case ROLE_INVALID:
+		ast_assert(0);
+		return -1;
+	}
+
+	return 0;
+}
+
+static enum wait_bridge_roles validate_role(const char *role)
+{
+	if (!strcmp(role, "participant")) {
+		return ROLE_PARTICIPANT;
+	} else if (!strcmp(role, "announcer")) {
+		return ROLE_ANNOUNCER;
 	} else {
-		/* Non Announcer specific stuff */
-		ast_channel_add_bridge_role(chan, "holding_participant");
-
-		if (ast_test_flag(flags, MUXFLAG_PLAYMOH)) {
-			apply_option_moh(chan, opts[OPT_ARG_MOHCLASS]);
-		} else if (ast_test_flag(flags, MUXFLAG_RINGING)) {
-			apply_option_ringing(chan);
-		}
-	}
-
-	return 0;
+		return ROLE_INVALID;
+	}
 }
 
 static int bridgewait_exec(struct ast_channel *chan, const char *data)
@@ -188,8 +247,11 @@
 	struct ast_bridge_features chan_features;
 	struct ast_flags flags = { 0 };
 	char *parse;
+	enum wait_bridge_roles role = ROLE_PARTICIPANT;
+	char *opts[OPT_ARG_ARRAY_SIZE] = { NULL, };
 
 	AST_DECLARE_APP_ARGS(args,
+		AST_APP_ARG(role);
 		AST_APP_ARG(options);
 		AST_APP_ARG(other);		/* Any remaining unused arguments */
 	);
@@ -209,18 +271,26 @@
 	parse = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, parse);
 
+	if (!ast_strlen_zero(args.role)) {
+		role = validate_role(args.role);
+		if (role == ROLE_INVALID) {
+			ast_log(LOG_ERROR, "Requested waiting bridge role '%s' is invalid.\n", args.role);
+			return -1;
+		}
+	}
+
 	if (ast_bridge_features_init(&chan_features)) {
 		ast_bridge_features_cleanup(&chan_features);
 		return -1;
 	}
 
 	if (args.options) {
-		char *opts[OPT_ARG_ARRAY_SIZE] = { NULL, };
 		ast_app_parse_options(bridgewait_opts, &flags, opts, args.options);
-		if (process_options(chan, &flags, opts, &chan_features)) {
-			ast_bridge_features_cleanup(&chan_features);
-			return -1;
-		}
+	}
+
+	if (process_options(chan, &flags, opts, &chan_features, role)) {
+		ast_bridge_features_cleanup(&chan_features);
+		return -1;
 	}
 
 	ast_bridge_join(holding_bridge, chan, NULL, &chan_features, NULL, 0);

Modified: team/may/ooh323_qsig/apps/app_celgenuserevent.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_celgenuserevent.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/apps/app_celgenuserevent.c (original)
+++ team/may/ooh323_qsig/apps/app_celgenuserevent.c Tue Aug 27 14:14:54 2013
@@ -75,9 +75,9 @@
 	parse = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, parse);
 
-	blob = ast_json_pack("{s: s, s: s}",
+	blob = ast_json_pack("{s: s, s: {s: s}}",
 		"event", args.event,
-		"extra", args.extra);
+		"extra", "extra", args.extra);
 	if (!blob) {
 		return res;
 	}

Modified: team/may/ooh323_qsig/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_dial.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/apps/app_dial.c (original)
+++ team/may/ooh323_qsig/apps/app_dial.c Tue Aug 27 14:14:54 2013
@@ -60,7 +60,6 @@
 #include "asterisk/stringfields.h"
 #include "asterisk/global_datastores.h"
 #include "asterisk/dsp.h"
-#include "asterisk/cel.h"
 #include "asterisk/aoc.h"
 #include "asterisk/ccss.h"
 #include "asterisk/indications.h"

Modified: team/may/ooh323_qsig/apps/app_directed_pickup.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_directed_pickup.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/apps/app_directed_pickup.c (original)
+++ team/may/ooh323_qsig/apps/app_directed_pickup.c Tue Aug 27 14:14:54 2013
@@ -46,7 +46,6 @@
 #include "asterisk/features.h"
 #include "asterisk/manager.h"
 #include "asterisk/callerid.h"
-#include "asterisk/cel.h"
 
 #define PICKUPMARK "PICKUPMARK"
 

Modified: team/may/ooh323_qsig/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_meetme.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/apps/app_meetme.c (original)
+++ team/may/ooh323_qsig/apps/app_meetme.c Tue Aug 27 14:14:54 2013
@@ -2368,10 +2368,8 @@
 
 	if (conf->origframe)
 		ast_frfree(conf->origframe);
-	if (conf->lchan)
-		ast_hangup(conf->lchan);
-	if (conf->chan)
-		ast_hangup(conf->chan);
+	ast_hangup(conf->lchan);
+	ast_hangup(conf->chan);
 	if (conf->fd >= 0)
 		close(conf->fd);
 	if (conf->recordingfilename) {

Modified: team/may/ooh323_qsig/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_queue.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/apps/app_queue.c (original)
+++ team/may/ooh323_qsig/apps/app_queue.c Tue Aug 27 14:14:54 2013
@@ -103,7 +103,6 @@
 #include "asterisk/taskprocessor.h"
 #include "asterisk/aoc.h"
 #include "asterisk/callerid.h"
-#include "asterisk/cel.h"
 #include "asterisk/data.h"
 #include "asterisk/term.h"
 #include "asterisk/dial.h"

Modified: team/may/ooh323_qsig/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_voicemail.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/apps/app_voicemail.c (original)
+++ team/may/ooh323_qsig/apps/app_voicemail.c Tue Aug 27 14:14:54 2013
@@ -13780,9 +13780,7 @@
 
 exit_vmsayname_test:
 
-	if (test_channel1) {
-		ast_hangup(test_channel1);
-	}
+	ast_hangup(test_channel1);
 
 	return res ? AST_TEST_FAIL : AST_TEST_PASS;
 }

Modified: team/may/ooh323_qsig/apps/confbridge/conf_chan_announce.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/confbridge/conf_chan_announce.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/apps/confbridge/conf_chan_announce.c (original)
+++ team/may/ooh323_qsig/apps/confbridge/conf_chan_announce.c Tue Aug 27 14:14:54 2013
@@ -134,6 +134,7 @@
 	.send_text = ast_unreal_sendtext,
 	.queryoption = ast_unreal_queryoption,
 	.setoption = ast_unreal_setoption,
+	.properties = AST_CHAN_TP_ANNOUNCER,
 };
 
 struct ast_channel_tech *conf_announce_get_tech(void)

Modified: team/may/ooh323_qsig/apps/confbridge/conf_chan_record.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/confbridge/conf_chan_record.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/apps/confbridge/conf_chan_record.c (original)
+++ team/may/ooh323_qsig/apps/confbridge/conf_chan_record.c Tue Aug 27 14:14:54 2013
@@ -86,6 +86,7 @@
 	.call = rec_call,
 	.read = rec_read,
 	.write = rec_write,
+	.properties = AST_CHAN_TP_RECORDER,
 };
 
 struct ast_channel_tech *conf_record_get_tech(void)

Modified: team/may/ooh323_qsig/apps/confbridge/confbridge_manager.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/confbridge/confbridge_manager.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/apps/confbridge/confbridge_manager.c (original)
+++ team/may/ooh323_qsig/apps/confbridge/confbridge_manager.c Tue Aug 27 14:14:54 2013
@@ -195,13 +195,16 @@
 {
 	struct ast_bridge_blob *blob = stasis_message_data(message);
 	const char *conference_name;
-	RAII_VAR(struct ast_str *, bridge_text,
-		ast_manager_build_bridge_state_string(blob->bridge, ""),
-		ast_free);
+	RAII_VAR(struct ast_str *, bridge_text, NULL, ast_free);
 	RAII_VAR(struct ast_str *, channel_text, NULL, ast_free);
 
 	ast_assert(blob != NULL);
 	ast_assert(event != NULL);
+
+	bridge_text = ast_manager_build_bridge_state_string(blob->bridge, "");
+	if (!bridge_text) {
+		return;
+	}
 
 	conference_name = ast_json_string_get(ast_json_object_get(blob->blob, "conference"));
 	ast_assert(conference_name != NULL);

Modified: team/may/ooh323_qsig/bridges/bridge_holding.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/bridges/bridge_holding.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/bridges/bridge_holding.c (original)
+++ team/may/ooh323_qsig/bridges/bridge_holding.c Tue Aug 27 14:14:54 2013
@@ -54,18 +54,18 @@
 	HOLDING_ROLE_ANNOUNCER = (1 << 1),
 };
 
-/* BUGBUG Add IDLE_MODE_HOLD option to put channel on hold using AST_CONTROL_HOLD/AST_CONTROL_UNHOLD while in bridge */
-/* BUGBUG Add IDLE_MODE_SILENCE to send silence media frames to channel while in bridge (uses a silence generator) */
-/* BUGBUG A channel without the holding_participant role will assume IDLE_MODE_MOH with the default music class. */
 enum idle_modes {
 	IDLE_MODE_NONE = 0,
 	IDLE_MODE_MOH,
 	IDLE_MODE_RINGING,
+	IDLE_MODE_SILENCE,
+	IDLE_MODE_HOLD,
 };
 
 /*! \brief Structure which contains per-channel role information */
 struct holding_channel {
 	struct ast_flags holding_roles;
+	struct ast_silence_generator *silence_generator;
 	enum idle_modes idle_mode;
 };
 
@@ -84,6 +84,15 @@
 		ast_indicate(bridge_channel->chan, -1);
 		break;
 	case IDLE_MODE_NONE:
+		break;
+	case IDLE_MODE_SILENCE:
+		if (hc->silence_generator) {
+			ast_channel_stop_silence_generator(bridge_channel->chan, hc->silence_generator);
+			hc->silence_generator = NULL;
+		}
+		break;
+	case IDLE_MODE_HOLD:
+		ast_bridge_channel_queue_control_data(bridge_channel, AST_CONTROL_UNHOLD, NULL, 0);
 		break;
 	}
 }
@@ -103,6 +112,7 @@
 {
 	struct holding_channel *hc = bridge_channel->tech_pvt;
 	const char *moh_class;
+	size_t moh_length;
 
 	if (!hc) {
 		return;
@@ -118,6 +128,14 @@
 		break;
 	case IDLE_MODE_NONE:
 		break;
+	case IDLE_MODE_SILENCE:
+		hc->silence_generator = ast_channel_start_silence_generator(bridge_channel->chan);
+		break;
+	case IDLE_MODE_HOLD:
+		moh_class = ast_bridge_channel_get_role_option(bridge_channel, "holding_participant", "moh_class");
+		moh_length = moh_class ? strlen(moh_class + 1) : 0;
+		ast_bridge_channel_queue_control_data(bridge_channel, AST_CONTROL_HOLD, moh_class, moh_length);
+		break;
 	}
 }
 
@@ -133,11 +151,17 @@
 	}
 
 	if (ast_strlen_zero(idle_mode)) {
-		hc->idle_mode = IDLE_MODE_NONE;
+		hc->idle_mode = IDLE_MODE_MOH;
 	} else if (!strcmp(idle_mode, "musiconhold")) {
 		hc->idle_mode = IDLE_MODE_MOH;
 	} else if (!strcmp(idle_mode, "ringing")) {
 		hc->idle_mode = IDLE_MODE_RINGING;
+	} else if (!strcmp(idle_mode, "none")) {
+		hc->idle_mode = IDLE_MODE_NONE;
+	} else if (!strcmp(idle_mode, "silence")) {
+		hc->idle_mode = IDLE_MODE_SILENCE;
+	} else if (!strcmp(idle_mode, "hold")) {
+		hc->idle_mode = IDLE_MODE_HOLD;
 	} else {
 		ast_debug(2, "channel %s idle mode '%s' doesn't match any expected idle mode\n", ast_channel_name(us), idle_mode);
 	}

Modified: team/may/ooh323_qsig/bridges/bridge_native_rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/bridges/bridge_native_rtp.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/bridges/bridge_native_rtp.c (original)
+++ team/may/ooh323_qsig/bridges/bridge_native_rtp.c Tue Aug 27 14:14:54 2013
@@ -45,7 +45,6 @@
 #include "asterisk/bridging_technology.h"
 #include "asterisk/frame.h"
 #include "asterisk/rtp_engine.h"
-#include "asterisk/audiohook.h"
 
 /*! \brief Forward declarations for frame hook usage */
 static int native_rtp_bridge_join(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel);
@@ -85,13 +84,7 @@
 /*! \brief Internal helper function which checks whether the channels are compatible with our native bridging */
 static int native_rtp_bridge_capable(struct ast_channel *chan)
 {
-	if (ast_channel_monitor(chan) || (ast_channel_audiohooks(chan) &&
-		!ast_audiohook_write_list_empty(ast_channel_audiohooks(chan))) ||
-		!ast_framehook_list_contains_no_active(ast_channel_framehooks(chan))) {
-		return 0;
-	} else {
-		return 1;
-	}
+	return ast_channel_has_audio_frame_or_monitor(chan);
 }
 
 /*! \brief Internal helper function which gets all RTP information (glue and instances) relating to the given channels */

Modified: team/may/ooh323_qsig/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/channels/chan_dahdi.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/channels/chan_dahdi.c (original)
+++ team/may/ooh323_qsig/channels/chan_dahdi.c Tue Aug 27 14:14:54 2013
@@ -107,7 +107,6 @@
 #include "asterisk/callerid.h"
 #include "asterisk/adsi.h"
 #include "asterisk/cli.h"
-#include "asterisk/cel.h"
 #include "asterisk/features.h"
 #include "asterisk/musiconhold.h"
 #include "asterisk/say.h"

Modified: team/may/ooh323_qsig/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/channels/chan_gulp.c?view=diff&rev=397815&r1=397814&r2=397815
==============================================================================
--- team/may/ooh323_qsig/channels/chan_gulp.c (original)
+++ team/may/ooh323_qsig/channels/chan_gulp.c Tue Aug 27 14:14:54 2013
@@ -56,6 +56,7 @@
 #include "asterisk/dsp.h"
 #include "asterisk/stasis_endpoints.h"
 #include "asterisk/stasis_channels.h"
+#include "asterisk/indications.h"
 
 #include "asterisk/res_sip.h"
 #include "asterisk/res_sip_session.h"
@@ -600,6 +601,18 @@
 
 	ast_channel_named_callgroups_set(chan, session->endpoint->named_callgroups);
 	ast_channel_named_pickupgroups_set(chan, session->endpoint->named_pickupgroups);
+
+	if (!ast_strlen_zero(session->endpoint->language)) {
+		ast_channel_language_set(chan, session->endpoint->language);
+	}
+
+	if (!ast_strlen_zero(session->endpoint->zone)) {
+		struct ast_tone_zone *zone = ast_get_indication_zone(session->endpoint->zone);
+		if (!zone) {

[... 6904 lines stripped ...]



More information about the asterisk-commits mailing list