[asterisk-commits] kmoore: branch kmoore/stasis-bridging-channel_events r388480 - in /team/kmoor...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 13 09:39:23 CDT 2013


Author: kmoore
Date: Mon May 13 09:39:18 2013
New Revision: 388480

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388480
Log:
Multiple revisions 388310-388311,388316-388317,388323-388324,388342,388352,388377,388379,388382,388429

........
  r388310 | mmichelson | 2013-05-10 09:53:17 -0500 (Fri, 10 May 2013) | 8 lines
  
  Merge blind transfer suport and SIP implementation to bridge_construction
  
  Review: https://reviewboard.asterisk.org/r/2470
  
  (closes issue ASTERISK-21335)
  Reported by Matt Jordan
........
  r388311 | file | 2013-05-10 10:08:15 -0500 (Fri, 10 May 2013) | 6 lines
  
  Move chan_iax2 to using the new blind transfer API call.
  
  Review: https://reviewboard.asterisk.org/r/2483/
  
  (closes issue ASTERISK-21518)
........
  r388316 | file | 2013-05-10 10:26:40 -0500 (Fri, 10 May 2013) | 6 lines
  
  Add support for native bridging RTP capable channels within the new bridging work.
  
  Review: https://reviewboard.asterisk.org/r/2465/
  
  (closes issue ASTERISK-20869)
........
  r388317 | file | 2013-05-10 10:49:32 -0500 (Fri, 10 May 2013) | 2 lines
  
  Missed this one.
........
  r388323 | jrose | 2013-05-10 11:00:26 -0500 (Fri, 10 May 2013) | 1 line
  
  Add timer parking bridge swap, clean up some documentation, remove swap inhibit to from the parking bridge.
........
  r388324 | root | 2013-05-10 11:17:20 -0500 (Fri, 10 May 2013) | 6 lines
  
  Avoided __ast names for the private variables created by the 
  STASIS_MESSAGE_TYPE_*() macros.
  ........
  
  Merged revisions 388318 from file:///srv/subversion/repos/asterisk/trunk
........
  r388342 | rmudgett | 2013-05-10 11:39:49 -0500 (Fri, 10 May 2013) | 59 lines
  
  Create unreal channel framework for derivative channels like local channels.
  
  Part of the bridging work being done needs the ability to manipulate local
  channels in new ways:
  
  1) When one-touch parking a multi-party bridge, a local channel needs to
  be created between the bridge being parked and the park holding bridge.
  In this case, the local;2 channel needs to be pushed into the parking
  bridge since there isn't a dialplan location to execute.
  
  2) When attended transferring a multi-party bridge to an application like
  voicemail using channel driver protocol transfers.  A local channel needs
  to be created between the transferred bridge and the application.  In this
  case, the local;2 channel needs to masquerade into the channel running
  voicemail.
  
  3) The ConfBridge announcer channels need to replace the chan_bridge
  channels with an unreal channel framework channel for implementation
  reasons.  (The chan_bridge driver will be deleted as a result.)
  
  4) The chan_agent channel driver will use the unreal channel framework to
  create Agent channels.
  
  The chan_local.c file is refactored into core_local.c and core_unreal.c
  and moves local channel support into the system core.
  
  The new API calls for custom local channel manipulation are:
  
  ast_local_get_peer() - Get the other local channel in the pair.  Useful
  for getting the local;2 channel after an ast_request().
  
  ast_local_setup_bridge() - After performing an ast_request(), using this
  call will make the subsequent ast_call() push the local;2 channel into the
  specified bridge.
  
  ast_local_setup_masquerade() - After performing an ast_request(), using
  this call will make the subsequent ast_call() masquerade the local;2
  channel into the specified channel.
  
  Changes/fixes in local/unreal channel behavior:
  
  * Made unreal COLP indicate handling always set the caller information on
  the other unreal channel in the pair.  Previously this happened only in
  the local;2 to local;1 direction.
  
  * Fixed using the wrong callerid when checking if the exten exists in
  local_call().
  
  * Renamed LOCAL_MOH_PASSTHRU to AST_UNREAL_MOH_INTERCEPT and invert the
  use of the flag to match the new name.  This makes the unreal channels
  default to not keeping state information in case they optimize.  Local
  channels still behave the same for the /m option.
  
  (closes issue ASTERISK-21713)
  Reported by: Matt Jordan
  Tested by: rmudgett
  
  Review: https://reviewboard.asterisk.org/r/2508/
........
  r388352 | root | 2013-05-10 12:17:20 -0500 (Fri, 10 May 2013) | 16 lines
  
  Address unload order issues for res_stasis* modules
  
  I've noticed when doing a graceful shutdown that the res_stasis_http.so
  module gets unloaded before the modules that use it, which causes some
  asserts during their unload.
  
  While r386928 was a quick hack to get it to not assert and die, this
  patch increases the use counts on res_stasis.so and res_stasis_http.so
  properly. It's a bigger change than I expected, hence the review instead
  of just committing it.
  
  Review: https://reviewboard.asterisk.org/r/2489/
  ........
  
  Merged revisions 388350 from file:///srv/subversion/repos/asterisk/trunk
........
  r388377 | rmudgett | 2013-05-10 15:29:34 -0500 (Fri, 10 May 2013) | 1 line
  
  Replace inlined versions of ast_channel_get_bridge_channel() with the call.
........
  r388379 | rmudgett | 2013-05-10 15:50:41 -0500 (Fri, 10 May 2013) | 1 line
  
  Add BUGBUG note about a race condition.
........
  r388382 | root | 2013-05-10 16:17:20 -0500 (Fri, 10 May 2013) | 38 lines
  
  Multiple revisions 388375,388380
  
  ........
    r388375 | elguero | 2013-05-10 15:28:18 -0500 (Fri, 10 May 2013) | 11 lines
    
    Fix Finding Extensions With Patterns Using ODBC Realtime
    
    After the merge of support for the realtime sorcery module, extensions that
    contained a pattern were not being found through odbc realtime.  It was tracked
    down to this one line that was advancing to the next variable list before it
    should have been.  The removal of this one line fixes this.
    
    Tested this fix on my machine.
    
    Received confirmation that this is the right fix from file on IRC.
  ........
    r388380 | mmichelson | 2013-05-10 15:50:53 -0500 (Fri, 10 May 2013) | 17 lines
    
    Fix memory leak in pbx_dundi
    
    pbx_dundi added an io context without removing
    it. This caused a memory leak when the module was
    unloaded.
    
    (closes ASTERISK-21718)
    Reported by Corey Farrell
    Patches:
    	pbx_dundi-ast_io_remove.patch uploaded by Corey Farrell (License #5909)
    ........
    
    Merged revisions 388376 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    ........
    
    Merged revisions 388378 from http://svn.asterisk.org/svn/asterisk/branches/11
  ........
  
  Merged revisions 388375,388380 from file:///srv/subversion/repos/asterisk/trunk
........
  r388429 | root | 2013-05-10 17:17:20 -0500 (Fri, 10 May 2013) | 27 lines
  
  Allow mISDN to send PROGRESS messsage.
  
  * Made isdn_msg_parser.c build a progress message with the mandatory
  progress indicator IE.  (The mISDNuser NT state machine rejected sending
  the incomplete message.)
  
  Note: The associated mISDN and mISDNuser patches respectively are viewable
  here:
  http://svnview.digium.com/svn/thirdparty?view=rev&rev=200
  http://svnview.digium.com/svn/thirdparty?view=rev&rev=201
  
  (closes issue AST-1153)
  Reported by: Guenther Kelleter
  Patches:
        progress-chan_misdn.diff (license #6372) patch uploaded by Guenther Kelleter
        progress-misdn.diff (license #6372) mISDN patch uploaded by Guenther Kelleter
        progress-misdnuser.diff (license #6372) mISDNuser patch uploaded by Guenther Kelleter
  ........
  
  Merged revisions 388425 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 388426 from http://svn.asterisk.org/svn/asterisk/branches/11
  ........
  
  Merged revisions 388427 from file:///srv/subversion/repos/asterisk/trunk
........

Merged revisions 388310-388311,388316-388317,388323-388324,388342,388352,388377,388379,388382,388429 from http://svn.asterisk.org/svn/asterisk/team/group/bridge_construction

Added:
    team/kmoore/stasis-bridging-channel_events/bridges/bridge_native_rtp.c
      - copied unchanged from r388429, team/group/bridge_construction/bridges/bridge_native_rtp.c
    team/kmoore/stasis-bridging-channel_events/include/asterisk/core_local.h
      - copied unchanged from r388429, team/group/bridge_construction/include/asterisk/core_local.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/core_unreal.h
      - copied unchanged from r388429, team/group/bridge_construction/include/asterisk/core_unreal.h
    team/kmoore/stasis-bridging-channel_events/main/core_local.c
      - copied unchanged from r388429, team/group/bridge_construction/main/core_local.c
    team/kmoore/stasis-bridging-channel_events/main/core_unreal.c
      - copied unchanged from r388429, team/group/bridge_construction/main/core_unreal.c
Removed:
    team/kmoore/stasis-bridging-channel_events/channels/chan_local.c
Modified:
    team/kmoore/stasis-bridging-channel_events/   (props changed)
    team/kmoore/stasis-bridging-channel_events/CHANGES
    team/kmoore/stasis-bridging-channel_events/addons/chan_ooh323.c
    team/kmoore/stasis-bridging-channel_events/apps/app_bridgewait.c
    team/kmoore/stasis-bridging-channel_events/apps/app_chanspy.c
    team/kmoore/stasis-bridging-channel_events/apps/app_confbridge.c
    team/kmoore/stasis-bridging-channel_events/apps/app_dial.c
    team/kmoore/stasis-bridging-channel_events/apps/app_followme.c
    team/kmoore/stasis-bridging-channel_events/apps/app_mixmonitor.c
    team/kmoore/stasis-bridging-channel_events/apps/app_queue.c
    team/kmoore/stasis-bridging-channel_events/apps/app_stasis.c
    team/kmoore/stasis-bridging-channel_events/bridges/bridge_builtin_features.c
    team/kmoore/stasis-bridging-channel_events/channels/chan_agent.c
    team/kmoore/stasis-bridging-channel_events/channels/chan_gulp.c
    team/kmoore/stasis-bridging-channel_events/channels/chan_h323.c
    team/kmoore/stasis-bridging-channel_events/channels/chan_iax2.c
    team/kmoore/stasis-bridging-channel_events/channels/chan_jingle.c
    team/kmoore/stasis-bridging-channel_events/channels/chan_mgcp.c
    team/kmoore/stasis-bridging-channel_events/channels/chan_motif.c
    team/kmoore/stasis-bridging-channel_events/channels/chan_sip.c
    team/kmoore/stasis-bridging-channel_events/channels/chan_skinny.c
    team/kmoore/stasis-bridging-channel_events/channels/chan_unistim.c
    team/kmoore/stasis-bridging-channel_events/channels/misdn/isdn_msg_parser.c
    team/kmoore/stasis-bridging-channel_events/include/asterisk/_private.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/bridging.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/bridging_features.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/ccss.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/channel.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/framehook.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/rtp_engine.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/stasis.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/stasis_app.h
    team/kmoore/stasis-bridging-channel_events/main/asterisk.c
    team/kmoore/stasis-bridging-channel_events/main/bridging.c
    team/kmoore/stasis-bridging-channel_events/main/bridging_basic.c
    team/kmoore/stasis-bridging-channel_events/main/channel.c
    team/kmoore/stasis-bridging-channel_events/main/loader.c
    team/kmoore/stasis-bridging-channel_events/main/manager.c
    team/kmoore/stasis-bridging-channel_events/main/pbx.c
    team/kmoore/stasis-bridging-channel_events/main/rtp_engine.c
    team/kmoore/stasis-bridging-channel_events/pbx/pbx_dundi.c
    team/kmoore/stasis-bridging-channel_events/res/parking/parking_bridge.c
    team/kmoore/stasis-bridging-channel_events/res/parking/parking_bridge_features.c
    team/kmoore/stasis-bridging-channel_events/res/res_config_odbc.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis_http.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis_http_asterisk.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis_http_bridges.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis_http_channels.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis_http_endpoints.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis_http_events.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis_http_playback.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis_http_recordings.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis_http_sounds.c
    team/kmoore/stasis-bridging-channel_events/res/res_stasis_websocket.c
    team/kmoore/stasis-bridging-channel_events/rest-api-templates/res_stasis_http_resource.c.mustache
    team/kmoore/stasis-bridging-channel_events/tests/test_res_stasis.c

Propchange: team/kmoore/stasis-bridging-channel_events/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/kmoore/stasis-bridging-channel_events/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon May 13 09:39:18 2013
@@ -1,1 +1,1 @@
-/team/group/bridge_construction:1-388296
+/team/group/bridge_construction:1-388479

Modified: team/kmoore/stasis-bridging-channel_events/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/CHANGES?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/CHANGES (original)
+++ team/kmoore/stasis-bridging-channel_events/CHANGES Mon May 13 09:39:18 2013
@@ -83,6 +83,8 @@
 chan_local
 ------------------
  * The /b option is removed.
+
+ * chan_local moved into the system core and is no longer a loadable module.
 
 chan_mobile
 ------------------

Modified: team/kmoore/stasis-bridging-channel_events/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/addons/chan_ooh323.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/addons/chan_ooh323.c (original)
+++ team/kmoore/stasis-bridging-channel_events/addons/chan_ooh323.c Mon May 13 09:39:18 2013
@@ -117,7 +117,6 @@
 	.fixup = ooh323_fixup,
 	.send_html = 0,
 	.queryoption = ooh323_queryoption,
-	.bridge = ast_rtp_instance_bridge,		/* XXX chan unlocked ? */
 	.early_bridge = ast_rtp_instance_early_bridge,
 	.func_channel_read = function_ooh323_read,
 	.func_channel_write = function_ooh323_write,

Modified: team/kmoore/stasis-bridging-channel_events/apps/app_bridgewait.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/apps/app_bridgewait.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/apps/app_bridgewait.c (original)
+++ team/kmoore/stasis-bridging-channel_events/apps/app_bridgewait.c Mon May 13 09:39:18 2013
@@ -197,7 +197,7 @@
 	if (!holding_bridge) {
 		holding_bridge = ast_bridge_base_new(AST_BRIDGE_CAPABILITY_HOLDING,
 			AST_BRIDGE_FLAG_MERGE_INHIBIT_TO | AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM
-				| AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM);
+				| AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM | AST_BRIDGE_FLAG_TRANSFER_PROHIBITED);
 	}
 	ast_mutex_unlock(&bridgewait_lock);
 	if (!holding_bridge) {

Modified: team/kmoore/stasis-bridging-channel_events/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/apps/app_chanspy.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/apps/app_chanspy.c (original)
+++ team/kmoore/stasis-bridging-channel_events/apps/app_chanspy.c Mon May 13 09:39:18 2013
@@ -482,15 +482,18 @@
 static int start_spying(struct ast_autochan *autochan, const char *spychan_name, struct ast_audiohook *audiohook)
 {
 	int res = 0;
-	struct ast_channel *peer = NULL;
 
 	ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan_name, ast_channel_name(autochan->chan));
 
 	ast_set_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC | AST_AUDIOHOOK_SMALL_QUEUE);
 	res = ast_audiohook_attach(autochan->chan, audiohook);
 
-	if (!res && ast_test_flag(ast_channel_flags(autochan->chan), AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(autochan->chan))) {
-		ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);
+	if (!res) {
+		ast_channel_lock(autochan->chan);
+		if (ast_channel_is_bridged(autochan->chan)) {
+			ast_softhangup_nolock(autochan->chan, AST_SOFTHANGUP_UNBRIDGE);
+		}
+		ast_channel_unlock(autochan->chan);
 	}
 	return res;
 }

Modified: team/kmoore/stasis-bridging-channel_events/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/apps/app_confbridge.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/apps/app_confbridge.c (original)
+++ team/kmoore/stasis-bridging-channel_events/apps/app_confbridge.c Mon May 13 09:39:18 2013
@@ -1323,7 +1323,7 @@
 
 		/* Create an actual bridge that will do the audio mixing */
 		conference->bridge = ast_bridge_base_new(AST_BRIDGE_CAPABILITY_MULTIMIX,
-			AST_BRIDGE_FLAG_MASQUERADE_ONLY);
+			AST_BRIDGE_FLAG_MASQUERADE_ONLY | AST_BRIDGE_FLAG_TRANSFER_BRIDGE_ONLY);
 		if (!conference->bridge) {
 			ao2_ref(conference, -1);
 			conference = NULL;

Modified: team/kmoore/stasis-bridging-channel_events/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/apps/app_dial.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/apps/app_dial.c (original)
+++ team/kmoore/stasis-bridging-channel_events/apps/app_dial.c Mon May 13 09:39:18 2013
@@ -26,7 +26,6 @@
  */
 
 /*** MODULEINFO
-	<depend>chan_local</depend>
 	<support_level>core</support_level>
  ***/
 

Modified: team/kmoore/stasis-bridging-channel_events/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/apps/app_followme.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/apps/app_followme.c (original)
+++ team/kmoore/stasis-bridging-channel_events/apps/app_followme.c Mon May 13 09:39:18 2013
@@ -36,7 +36,6 @@
  */
 
 /*** MODULEINFO
-	<depend>chan_local</depend>
 	<support_level>core</support_level>
  ***/
 

Modified: team/kmoore/stasis-bridging-channel_events/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/apps/app_mixmonitor.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/apps/app_mixmonitor.c (original)
+++ team/kmoore/stasis-bridging-channel_events/apps/app_mixmonitor.c Mon May 13 09:39:18 2013
@@ -411,7 +411,6 @@
 
 static int startmon(struct ast_channel *chan, struct ast_audiohook *audiohook) 
 {
-	struct ast_channel *peer = NULL;
 	int res = 0;
 
 	if (!chan)
@@ -419,8 +418,13 @@
 
 	ast_audiohook_attach(chan, audiohook);
 
-	if (!res && ast_test_flag(ast_channel_flags(chan), AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan)))
-		ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);	
+	if (!res) {
+		ast_channel_lock(chan);
+		if (ast_channel_is_bridged(chan)) {
+			ast_softhangup_nolock(chan, AST_SOFTHANGUP_UNBRIDGE);
+		}
+		ast_channel_unlock(chan);
+	}
 
 	return res;
 }

Modified: team/kmoore/stasis-bridging-channel_events/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/apps/app_queue.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/apps/app_queue.c (original)
+++ team/kmoore/stasis-bridging-channel_events/apps/app_queue.c Mon May 13 09:39:18 2013
@@ -5275,7 +5275,7 @@
 	}
 
 	/* if the calling channel has AST_CAUSE_ANSWERED_ELSEWHERE set, make sure this is inherited.
-		(this is mainly to support chan_local)
+		(this is mainly to support unreal/local channels)
 	*/
 	if (ast_channel_hangupcause(qe->chan) == AST_CAUSE_ANSWERED_ELSEWHERE) {
 		qe->cancel_answered_elsewhere = 1;

Modified: team/kmoore/stasis-bridging-channel_events/apps/app_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/apps/app_stasis.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/apps/app_stasis.c (original)
+++ team/kmoore/stasis-bridging-channel_events/apps/app_stasis.c Mon May 13 09:39:18 2013
@@ -93,6 +93,7 @@
 {
 	int r = 0;
 
+	stasis_app_ref();
 	r |= ast_register_application_xml(stasis, app_exec);
 	return r;
 }
@@ -100,12 +101,15 @@
 static int unload_module(void)
 {
 	int r = 0;
-
 	r |= ast_unregister_application(stasis);
+	stasis_app_unref();
 	return r;
 }
 
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS,
-		"Stasis dialplan application",
-		.load = load_module,
-		.unload = unload_module);
+AST_MODULE_INFO(ASTERISK_GPL_KEY,
+	AST_MODFLAG_DEFAULT,
+	"Stasis dialplan application",
+	.load = load_module,
+	.unload = unload_module,
+	.nonoptreq = "res_stasis",
+	);

Modified: team/kmoore/stasis-bridging-channel_events/bridges/bridge_builtin_features.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/bridges/bridge_builtin_features.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/bridges/bridge_builtin_features.c (original)
+++ team/kmoore/stasis-bridging-channel_events/bridges/bridge_builtin_features.c Mon May 13 09:39:18 2013
@@ -105,7 +105,7 @@
 	/* Fill the variable with the extension and context we want to call */
 	snprintf(destination, sizeof(destination), "%s@%s", exten, context);
 
-	/* Now we request that chan_local prepare to call the destination */
+	/* Now we request a local channel to prepare to call the destination */
 	chan = ast_request("Local", ast_channel_nativeformats(caller), caller, destination,
 		&cause);
 	if (!chan) {

Modified: team/kmoore/stasis-bridging-channel_events/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/channels/chan_agent.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/channels/chan_agent.c (original)
+++ team/kmoore/stasis-bridging-channel_events/channels/chan_agent.c Mon May 13 09:39:18 2013
@@ -31,7 +31,6 @@
  * \ingroup channel_drivers
  */
 /*** MODULEINFO
-        <depend>chan_local</depend>
         <depend>res_monitor</depend>
 	<support_level>core</support_level>
  ***/
@@ -2589,5 +2588,5 @@
 		.unload = unload_module,
 		.reload = reload,
 		.load_pri = AST_MODPRI_CHANNEL_DRIVER,
-		.nonoptreq = "res_monitor,chan_local",
+		.nonoptreq = "res_monitor",
 	       );

Modified: team/kmoore/stasis-bridging-channel_events/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/channels/chan_gulp.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/channels/chan_gulp.c (original)
+++ team/kmoore/stasis-bridging-channel_events/channels/chan_gulp.c Mon May 13 09:39:18 2013
@@ -132,7 +132,6 @@
 	.send_text = gulp_sendtext,
 	.send_digit_begin = gulp_digit_begin,
 	.send_digit_end = gulp_digit_end,
-	.bridge = ast_rtp_instance_bridge,
 	.call = gulp_call,
 	.hangup = gulp_hangup,
 	.answer = gulp_answer,

Modified: team/kmoore/stasis-bridging-channel_events/channels/chan_h323.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/channels/chan_h323.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/channels/chan_h323.c (original)
+++ team/kmoore/stasis-bridging-channel_events/channels/chan_h323.c Mon May 13 09:39:18 2013
@@ -275,7 +275,6 @@
 	.write = oh323_write,
 	.indicate = oh323_indicate,
 	.fixup = oh323_fixup,
-	.bridge = ast_rtp_instance_bridge,
 };
 
 static const char* redirectingreason2str(int redirectingreason)

Modified: team/kmoore/stasis-bridging-channel_events/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/channels/chan_iax2.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/channels/chan_iax2.c (original)
+++ team/kmoore/stasis-bridging-channel_events/channels/chan_iax2.c Mon May 13 09:39:18 2013
@@ -101,6 +101,7 @@
 #include "asterisk/test.h"
 #include "asterisk/data.h"
 #include "asterisk/netsock2.h"
+#include "asterisk/bridging.h"
 
 #include "iax2/include/iax2.h"
 #include "iax2/include/firmware.h"
@@ -9216,130 +9217,6 @@
 	}
 }
 
-struct iax_dual {
-	struct ast_channel *chan1;
-	struct ast_channel *chan2;
-	char *park_exten;
-	char *park_context;
-};
-
-static void *iax_park_thread(void *stuff)
-{
-	struct iax_dual *d;
-	int res;
-	int ext = 0;
-
-	d = stuff;
-
-	ast_debug(4, "IAX Park: Transferer channel %s, Transferee %s\n",
-		ast_channel_name(d->chan2), ast_channel_name(d->chan1));
-
-	res = ast_park_call_exten(d->chan1, d->chan2, d->park_exten, d->park_context, 0, &ext);
-	if (res) {
-		/* Parking failed. */
-		ast_hangup(d->chan1);
-	} else {
-		ast_log(LOG_NOTICE, "Parked on extension '%d'\n", ext);
-	}
-	ast_hangup(d->chan2);
-
-	ast_free(d->park_exten);
-	ast_free(d->park_context);
-	ast_free(d);
-	return NULL;
-}
-
-/*! DO NOT hold any locks while calling iax_park */
-static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2, const char *park_exten, const char *park_context)
-{
-	struct iax_dual *d;
-	struct ast_channel *chan1m, *chan2m;/* Chan2m: The transferer, chan1m: The transferee */
-	pthread_t th;
-
-	chan1m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, ast_channel_accountcode(chan2), ast_channel_exten(chan1), ast_channel_context(chan1), ast_channel_linkedid(chan1), ast_channel_amaflags(chan1), "Parking/%s", ast_channel_name(chan1));
-	chan2m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, ast_channel_accountcode(chan2), ast_channel_exten(chan2), ast_channel_context(chan2), ast_channel_linkedid(chan2), ast_channel_amaflags(chan2), "IAXPeer/%s", ast_channel_name(chan2));
-	d = ast_calloc(1, sizeof(*d));
-	if (!chan1m || !chan2m || !d) {
-		if (chan1m) {
-			ast_hangup(chan1m);
-		}
-		if (chan2m) {
-			ast_hangup(chan2m);
-		}
-		ast_free(d);
-		return -1;
-	}
-	d->park_exten = ast_strdup(park_exten);
-	d->park_context = ast_strdup(park_context);
-	if (!d->park_exten || !d->park_context) {
-		ast_hangup(chan1m);
-		ast_hangup(chan2m);
-		ast_free(d->park_exten);
-		ast_free(d->park_context);
-		ast_free(d);
-		return -1;
-	}
-
-	/* Make formats okay */
-	ast_format_copy(ast_channel_readformat(chan1m), ast_channel_readformat(chan1));
-	ast_format_copy(ast_channel_writeformat(chan1m), ast_channel_writeformat(chan1));
-
-	/* Prepare for taking over the channel */
-	if (ast_channel_masquerade(chan1m, chan1)) {
-		ast_hangup(chan1m);
-		ast_hangup(chan2m);
-		ast_free(d->park_exten);
-		ast_free(d->park_context);
-		ast_free(d);
-		return -1;
-	}
-
-	/* Setup the extensions and such */
-	ast_channel_context_set(chan1m, ast_channel_context(chan1));
-	ast_channel_exten_set(chan1m, ast_channel_exten(chan1));
-	ast_channel_priority_set(chan1m, ast_channel_priority(chan1));
-
-	ast_do_masquerade(chan1m);
-
-	/* We make a clone of the peer channel too, so we can play
-	   back the announcement */
-
-	/* Make formats okay */
-	ast_format_copy(ast_channel_readformat(chan2m), ast_channel_readformat(chan2));
-	ast_format_copy(ast_channel_writeformat(chan2m), ast_channel_writeformat(chan2));
-	ast_channel_parkinglot_set(chan2m, ast_channel_parkinglot(chan2));
-
-	/* Prepare for taking over the channel */
-	if (ast_channel_masquerade(chan2m, chan2)) {
-		ast_hangup(chan1m);
-		ast_hangup(chan2m);
-		ast_free(d->park_exten);
-		ast_free(d->park_context);
-		ast_free(d);
-		return -1;
-	}
-
-	/* Setup the extensions and such */
-	ast_channel_context_set(chan2m, ast_channel_context(chan2));
-	ast_channel_exten_set(chan2m, ast_channel_exten(chan2));
-	ast_channel_priority_set(chan2m, ast_channel_priority(chan2));
-
-	ast_do_masquerade(chan2m);
-
-	d->chan1 = chan1m;	/* Transferee */
-	d->chan2 = chan2m;	/* Transferer */
-	if (ast_pthread_create_detached_background(&th, NULL, iax_park_thread, d) < 0) {
-		/* Could not start thread */
-		ast_hangup(chan1m);
-		ast_hangup(chan2m);
-		ast_free(d->park_exten);
-		ast_free(d->park_context);
-		ast_free(d);
-		return -1;
-	}
-	return 0;
-}
-
 static int check_provisioning(struct sockaddr_in *sin, int sockfd, char *si, unsigned int ver)
 {
 	unsigned int ourver;
@@ -10769,56 +10646,28 @@
 				break;
 			case IAX_COMMAND_TRANSFER:
 			{
-				struct ast_channel *bridged_chan;
-				struct ast_channel *owner;
-
 				iax2_lock_owner(fr->callno);
 				if (!iaxs[fr->callno]) {
 					/* Initiating call went away before we could transfer. */
 					break;
 				}
-				owner = iaxs[fr->callno]->owner;
-				bridged_chan = owner ? ast_bridged_channel(owner) : NULL;
-				if (bridged_chan && ies.called_number) {
-					const char *context;
-
-					context = ast_strdupa(iaxs[fr->callno]->context);
+				if (iaxs[fr->callno]->owner) {
+					struct ast_channel *owner = iaxs[fr->callno]->owner;
+					char *context = ast_strdupa(iaxs[fr->callno]->context);
 
 					ast_channel_ref(owner);
-					ast_channel_ref(bridged_chan);
 					ast_channel_unlock(owner);
 					ast_mutex_unlock(&iaxsl[fr->callno]);
 
-					/* Set BLINDTRANSFER channel variables */
-					pbx_builtin_setvar_helper(owner, "BLINDTRANSFER", ast_channel_name(bridged_chan));
-					pbx_builtin_setvar_helper(bridged_chan, "BLINDTRANSFER", ast_channel_name(owner));
-
-					/* DO NOT hold any locks while calling ast_parking_ext_valid() */
-					if (ast_parking_ext_valid(ies.called_number, owner, context)) {
-						ast_debug(1, "Parking call '%s'\n", ast_channel_name(bridged_chan));
-						if (iax_park(bridged_chan, owner, ies.called_number, context)) {
-							ast_log(LOG_WARNING, "Failed to park call '%s'\n",
-								ast_channel_name(bridged_chan));
-						}
-					} else {
-						if (ast_async_goto(bridged_chan, context, ies.called_number, 1)) {
-							ast_log(LOG_WARNING,
-								"Async goto of '%s' to '%s@%s' failed\n",
-								ast_channel_name(bridged_chan), ies.called_number, context);
-						} else {
-							ast_debug(1, "Async goto of '%s' to '%s@%s' started\n",
-								ast_channel_name(bridged_chan), ies.called_number, context);
-						}
+					if (ast_bridge_transfer_blind(owner, ies.called_number,
+								context, NULL, NULL) != AST_BRIDGE_TRANSFER_SUCCESS) {
+						ast_log(LOG_WARNING, "Blind transfer of '%s' to '%s@%s' failed\n",
+							ast_channel_name(owner), ies.called_number,
+							context);
 					}
+
 					ast_channel_unref(owner);
-					ast_channel_unref(bridged_chan);
-
 					ast_mutex_lock(&iaxsl[fr->callno]);
-				} else {
-					ast_debug(1, "Async goto not applicable on call %d\n", fr->callno);
-					if (owner) {
-						ast_channel_unlock(owner);
-					}
 				}
 
 				break;

Modified: team/kmoore/stasis-bridging-channel_events/channels/chan_jingle.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/channels/chan_jingle.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/channels/chan_jingle.c (original)
+++ team/kmoore/stasis-bridging-channel_events/channels/chan_jingle.c Mon May 13 09:39:18 2013
@@ -205,7 +205,6 @@
 	.send_text = jingle_sendtext,
 	.send_digit_begin = jingle_digit_begin,
 	.send_digit_end = jingle_digit_end,
-	.bridge = ast_rtp_instance_bridge,
 	.call = jingle_call,
 	.hangup = jingle_hangup,
 	.answer = jingle_answer,

Modified: team/kmoore/stasis-bridging-channel_events/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/channels/chan_mgcp.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/channels/chan_mgcp.c (original)
+++ team/kmoore/stasis-bridging-channel_events/channels/chan_mgcp.c Mon May 13 09:39:18 2013
@@ -480,7 +480,6 @@
 	.fixup = mgcp_fixup,
 	.send_digit_begin = mgcp_senddigit_begin,
 	.send_digit_end = mgcp_senddigit_end,
-	.bridge = ast_rtp_instance_bridge,
 	.func_channel_read = acf_channel_read,
 };
 

Modified: team/kmoore/stasis-bridging-channel_events/channels/chan_motif.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/channels/chan_motif.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/channels/chan_motif.c (original)
+++ team/kmoore/stasis-bridging-channel_events/channels/chan_motif.c Mon May 13 09:39:18 2013
@@ -360,7 +360,6 @@
 	.send_text = jingle_sendtext,
 	.send_digit_begin = jingle_digit_begin,
 	.send_digit_end = jingle_digit_end,
-	.bridge = ast_rtp_instance_bridge,
 	.call = jingle_call,
 	.hangup = jingle_hangup,
 	.answer = jingle_answer,

Modified: team/kmoore/stasis-bridging-channel_events/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/channels/chan_sip.c?view=diff&rev=388480&r1=388479&r2=388480
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/channels/chan_sip.c (original)
+++ team/kmoore/stasis-bridging-channel_events/channels/chan_sip.c Mon May 13 09:39:18 2013
@@ -176,7 +176,6 @@
 /*** MODULEINFO
 	<use type="module">res_crypto</use>
 	<use type="module">res_http_websocket</use>
-	<depend>chan_local</depend>
 	<support_level>core</support_level>
  ***/
 
@@ -295,6 +294,7 @@
 #include "sip/include/security_events.h"
 #include "asterisk/sip_api.h"
 #include "asterisk/app.h"
+#include "asterisk/bridging.h"
 #include "asterisk/stasis_endpoints.h"
 
 /*** DOCUMENTATION
@@ -1202,8 +1202,6 @@
 					      struct sip_request *req, const char *uri);
 static struct sip_pvt *get_sip_pvt_byid_locked(const char *callid, const char *totag, const char *fromtag);
 static void check_pendings(struct sip_pvt *p);
-static void *sip_park_thread(void *stuff);
-static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct sip_request *req, uint32_t seqno, const char *park_exten, const char *park_context);
 
 static void *sip_pickup_thread(void *stuff);
 static int sip_pickup(struct ast_channel *chan);
@@ -1544,7 +1542,6 @@
 	.fixup = sip_fixup,			/* called with chan locked */
 	.send_digit_begin = sip_senddigit_begin,	/* called with chan unlocked */
 	.send_digit_end = sip_senddigit_end,
-	.bridge = ast_rtp_instance_bridge,			/* XXX chan unlocked ? */
 	.early_bridge = ast_rtp_instance_early_bridge,
 	.send_text = sip_sendtext,		/* called with chan locked */
 	.func_channel_read = sip_acf_channel_read,
@@ -24430,160 +24427,6 @@
 	}
 }
 
-
-/*! \brief Park SIP call support function
-	Starts in a new thread, then parks the call
-	XXX Should we add a wait period after streaming audio and before hangup?? Sometimes the
-		audio can't be heard before hangup
-*/
-static void *sip_park_thread(void *stuff)
-{
-	struct ast_channel *transferee, *transferer;	/* Chan1: The transferee, Chan2: The transferer */
-	struct sip_dual *d;
-	int ext;
-	int res;
-
-	d = stuff;
-	transferee = d->chan1;
-	transferer = d->chan2;
-
-	ast_debug(4, "SIP Park: Transferer channel %s, Transferee %s\n", ast_channel_name(transferer), ast_channel_name(transferee));
-
-	res = ast_park_call_exten(transferee, transferer, d->park_exten, d->park_context, 0, &ext);
-
-	sip_pvt_lock(ast_channel_tech_pvt(transferer));
-#ifdef WHEN_WE_KNOW_THAT_THE_CLIENT_SUPPORTS_MESSAGE
-	if (res) {
-		destroy_msg_headers(ast_channel_tech_pvt(transferer));
-		ast_string_field_set(ast_channel_tech_pvt(transferer), msg_body, "Unable to park call.");
-		transmit_message(ast_channel_tech_pvt(transferer), 0, 0);
-	} else {
-		/* Then tell the transferer what happened */
-		destroy_msg_headers(ast_channel_tech_pvt(transferer));
-		sprintf(buf, "Call parked on extension '%d'.", ext);
-		ast_string_field_set(ast_channel_tech_pvt(transferer), msg_body, buf);
-		transmit_message(ast_channel_tech_pvt(transferer), 0, 0);
-	}
-#endif
-
-	/* Any way back to the current call??? */
-	/* Transmit response to the REFER request */
-	if (!res)	{
-		/* Transfer succeeded */
-		append_history(ast_channel_tech_pvt(transferer), "SIPpark", "Parked call on %d", ext);
-		transmit_notify_with_sipfrag(ast_channel_tech_pvt(transferer), d->seqno, "200 OK", TRUE);
-		sip_pvt_unlock(ast_channel_tech_pvt(transferer));
-		ast_channel_hangupcause_set(transferer, AST_CAUSE_NORMAL_CLEARING);
-		ast_hangup(transferer); /* This will cause a BYE */
-		ast_debug(1, "SIP Call parked on extension '%d'\n", ext);
-	} else {
-		transmit_notify_with_sipfrag(ast_channel_tech_pvt(transferer), d->seqno, "503 Service Unavailable", TRUE);
-		append_history(ast_channel_tech_pvt(transferer), "SIPpark", "Parking failed\n");
-		sip_pvt_unlock(ast_channel_tech_pvt(transferer));
-		ast_debug(1, "SIP Call parked failed \n");
-		/* Do not hangup call */
-	}
-	deinit_req(&d->req);
-	ast_free(d->park_exten);
-	ast_free(d->park_context);
-	ast_free(d);
-	return NULL;
-}
-
-/*! DO NOT hold any locks while calling sip_park */
-static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct sip_request *req, uint32_t seqno, const char *park_exten, const char *park_context)
-{
-	struct sip_dual *d;
-	struct ast_channel *transferee, *transferer;
-	pthread_t th;
-
-	transferee = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, ast_channel_accountcode(chan1), ast_channel_exten(chan1), ast_channel_context(chan1), ast_channel_linkedid(chan1), ast_channel_amaflags(chan1), "Parking/%s", ast_channel_name(chan1));
-	transferer = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, ast_channel_accountcode(chan2), ast_channel_exten(chan2), ast_channel_context(chan2), ast_channel_linkedid(chan2), ast_channel_amaflags(chan2), "SIPPeer/%s", ast_channel_name(chan2));
-	d = ast_calloc(1, sizeof(*d));
-	if (!transferee || !transferer || !d) {
-		if (transferee) {
-			ast_hangup(transferee);
-		}
-		if (transferer) {
-			ast_hangup(transferer);
-		}
-		ast_free(d);
-		return -1;
-	}
-	d->park_exten = ast_strdup(park_exten);
-	d->park_context = ast_strdup(park_context);
-	if (!d->park_exten || !d->park_context) {
-		ast_hangup(transferee);
-		ast_hangup(transferer);
-		ast_free(d->park_exten);
-		ast_free(d->park_context);
-		ast_free(d);
-		return -1;
-	}
-
-	/* Make formats okay */

[... 2953 lines stripped ...]



More information about the asterisk-commits mailing list