[asterisk-commits] mmichelson: branch mmichelson/transfer r388651 - in /team/mmichelson/transfer...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 13 17:08:37 CDT 2013


Author: mmichelson
Date: Mon May 13 17:08:33 2013
New Revision: 388651

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388651
Log:
Resolve conflict.


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

Propchange: team/mmichelson/transfer/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/mmichelson/transfer/
------------------------------------------------------------------------------
--- bridge_construction-integrated (original)
+++ bridge_construction-integrated Mon May 13 17:08:33 2013
@@ -1,1 +1,1 @@
-/trunk:1-388275
+/trunk:1-388603

Propchange: team/mmichelson/transfer/
------------------------------------------------------------------------------
--- transfer-integrated (original)
+++ transfer-integrated Mon May 13 17:08:33 2013
@@ -1,1 +1,1 @@
-/team/group/bridge_construction:1-388303
+/team/group/bridge_construction:1-388650

Modified: team/mmichelson/transfer/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/CHANGES?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/CHANGES (original)
+++ team/mmichelson/transfer/CHANGES Mon May 13 17:08:33 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/mmichelson/transfer/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/addons/chan_ooh323.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/addons/chan_ooh323.c (original)
+++ team/mmichelson/transfer/addons/chan_ooh323.c Mon May 13 17:08:33 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/mmichelson/transfer/apps/app_bridgewait.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/apps/app_bridgewait.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/apps/app_bridgewait.c (original)
+++ team/mmichelson/transfer/apps/app_bridgewait.c Mon May 13 17:08:33 2013
@@ -28,6 +28,7 @@
  */
 
 /*** MODULEINFO
+	<depend>bridge_holding</depend>
 	<support_level>core</support_level>
  ***/
 

Modified: team/mmichelson/transfer/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/apps/app_chanspy.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/apps/app_chanspy.c (original)
+++ team/mmichelson/transfer/apps/app_chanspy.c Mon May 13 17:08:33 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/mmichelson/transfer/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/apps/app_dial.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/apps/app_dial.c (original)
+++ team/mmichelson/transfer/apps/app_dial.c Mon May 13 17:08:33 2013
@@ -26,7 +26,6 @@
  */
 
 /*** MODULEINFO
-	<depend>chan_local</depend>
 	<support_level>core</support_level>
  ***/
 

Modified: team/mmichelson/transfer/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/apps/app_followme.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/apps/app_followme.c (original)
+++ team/mmichelson/transfer/apps/app_followme.c Mon May 13 17:08:33 2013
@@ -36,7 +36,6 @@
  */
 
 /*** MODULEINFO
-	<depend>chan_local</depend>
 	<support_level>core</support_level>
  ***/
 

Modified: team/mmichelson/transfer/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/apps/app_mixmonitor.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/apps/app_mixmonitor.c (original)
+++ team/mmichelson/transfer/apps/app_mixmonitor.c Mon May 13 17:08:33 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/mmichelson/transfer/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/apps/app_queue.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/apps/app_queue.c (original)
+++ team/mmichelson/transfer/apps/app_queue.c Mon May 13 17:08:33 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/mmichelson/transfer/apps/app_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/apps/app_stasis.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/apps/app_stasis.c (original)
+++ team/mmichelson/transfer/apps/app_stasis.c Mon May 13 17:08:33 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/mmichelson/transfer/bridges/bridge_builtin_features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/bridges/bridge_builtin_features.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/bridges/bridge_builtin_features.c (original)
+++ team/mmichelson/transfer/bridges/bridge_builtin_features.c Mon May 13 17:08:33 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/mmichelson/transfer/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/chan_agent.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/chan_agent.c (original)
+++ team/mmichelson/transfer/channels/chan_agent.c Mon May 13 17:08:33 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/mmichelson/transfer/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/chan_gulp.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/chan_gulp.c (original)
+++ team/mmichelson/transfer/channels/chan_gulp.c Mon May 13 17:08:33 2013
@@ -103,8 +103,10 @@
 {
 	struct gulp_pvt *pvt = obj;
 	int i;
+
 	ao2_cleanup(pvt->session);
 	pvt->session = NULL;
+
 	for (i = 0; i < SIP_MEDIA_SIZE; ++i) {
 		ao2_cleanup(pvt->media[i]);
 		pvt->media[i] = NULL;
@@ -132,7 +134,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,
@@ -172,15 +173,16 @@
 /*! \brief Dialplan function for constructing a dial string for calling all contacts */
 static int gulp_dial_contacts(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 {
+	RAII_VAR(struct ast_sip_endpoint *, endpoint, NULL, ao2_cleanup);
+	RAII_VAR(struct ast_str *, dial, NULL, ast_free_ptr);
+	const char *aor_name;
+	char *rest;
+
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(endpoint_name);
 		AST_APP_ARG(aor_name);
 		AST_APP_ARG(request_user);
 	);
-	RAII_VAR(struct ast_sip_endpoint *, endpoint, NULL, ao2_cleanup);
-	const char *aor_name;
-	char *rest;
-	RAII_VAR(struct ast_str *, dial, NULL, ast_free_ptr);
 
 	AST_STANDARD_APP_ARGS(args, data);
 
@@ -289,12 +291,14 @@
 static void gulp_get_codec(struct ast_channel *chan, struct ast_format_cap *result)
 {
 	struct gulp_pvt *pvt = ast_channel_tech_pvt(chan);
+
 	ast_format_cap_copy(result, pvt->session->endpoint->codecs);
 }
 
 static int send_direct_media_request(void *data)
 {
 	RAII_VAR(struct ast_sip_session *, session, data, ao2_cleanup);
+
 	return ast_sip_session_refresh(session, NULL, NULL, session->endpoint->direct_media_method, 1);
 }
 
@@ -470,6 +474,7 @@
 	}
 
 	ao2_ref(session, -1);
+
 	return (status == PJ_SUCCESS) ? 0 : -1;
 }
 
@@ -491,6 +496,7 @@
 		ao2_cleanup(session);
 		return -1;
 	}
+
 	return 0;
 }
 
@@ -542,8 +548,8 @@
 static int gulp_write(struct ast_channel *ast, struct ast_frame *frame)
 {
 	struct gulp_pvt *pvt = ast_channel_tech_pvt(ast);
+	struct ast_sip_session_media *media;
 	int res = 0;
-	struct ast_sip_session_media *media;
 
 	switch (frame->frametype) {
 	case AST_FRAME_VOICE:
@@ -588,7 +594,9 @@
 static int fixup(void *data)
 {
 	struct fixup_data *fix_data = data;
+
 	fix_data->session->channel = fix_data->chan;
+
 	return 0;
 }
 
@@ -598,6 +606,7 @@
 	struct gulp_pvt *pvt = ast_channel_tech_pvt(newchan);
 	struct ast_sip_session *session = pvt->session;
 	struct fixup_data fix_data;
+
 	fix_data.session = session;
 	fix_data.chan = newchan;
 
@@ -624,6 +633,7 @@
 static void indicate_data_destroy(void *obj)
 {
 	struct indicate_data *ind_data = obj;
+
 	ast_free(ind_data->frame_data);
 	ao2_ref(ind_data->session, -1);
 }
@@ -632,35 +642,40 @@
 		int condition, int response_code, const void *frame_data, size_t datalen)
 {
 	struct indicate_data *ind_data = ao2_alloc(sizeof(*ind_data), indicate_data_destroy);
+
 	if (!ind_data) {
 		return NULL;
 	}
+
 	ind_data->frame_data = ast_malloc(datalen);
 	if (!ind_data->frame_data) {
 		ao2_ref(ind_data, -1);
 		return NULL;
 	}
+
 	memcpy(ind_data->frame_data, frame_data, datalen);
 	ind_data->datalen = datalen;
 	ind_data->condition = condition;
 	ind_data->response_code = response_code;
 	ao2_ref(session, +1);
 	ind_data->session = session;
+
 	return ind_data;
 }
 
 static int indicate(void *data)
 {
+	pjsip_tx_data *packet = NULL;
 	struct indicate_data *ind_data = data;
 	struct ast_sip_session *session = ind_data->session;
 	int response_code = ind_data->response_code;
-	pjsip_tx_data *packet = NULL;
 
 	if (pjsip_inv_answer(session->inv_session, response_code, NULL, NULL, &packet) == PJ_SUCCESS) {
 		ast_sip_session_send_response(session, packet);
 	}
 
 	ao2_ref(ind_data, -1);
+
 	return 0;
 }
 
@@ -702,11 +717,11 @@
 /*! \brief Function called by core to ask the channel to indicate some sort of condition */
 static int gulp_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen)
 {
-	int res = 0;
 	struct gulp_pvt *pvt = ast_channel_tech_pvt(ast);
 	struct ast_sip_session *session = pvt->session;
 	struct ast_sip_session_media *media;
 	int response_code = 0;
+	int res = 0;
 
 	switch (condition) {
 	case AST_CONTROL_RINGING:
@@ -802,8 +817,8 @@
 {
 	struct gulp_pvt *pvt = ast_channel_tech_pvt(chan);
 	struct ast_sip_session *session = pvt->session;
+	struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
 	int res = 0;
-	struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
 
 	switch (session->endpoint->dtmf) {
 	case AST_SIP_DTMF_RFC_4733:
@@ -890,8 +905,8 @@
 {
 	struct gulp_pvt *pvt = ast_channel_tech_pvt(ast);
 	struct ast_sip_session *session = pvt->session;
+	struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
 	int res = 0;
-	struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
 
 	switch (session->endpoint->dtmf) {
 	case AST_SIP_DTMF_INFO:
@@ -927,8 +942,8 @@
 
 static int call(void *data)
 {
+	pjsip_tx_data *packet;
 	struct ast_sip_session *session = data;
-	pjsip_tx_data *packet;
 
 	if (pjsip_inv_invite(session->inv_session, &packet) != PJ_SUCCESS) {
 		ast_queue_hangup(session->channel);
@@ -937,6 +952,7 @@
 	}
 
 	ao2_ref(session, -1);
+
 	return 0;
 }
 
@@ -952,6 +968,7 @@
 		ao2_cleanup(session);
 		return -1;
 	}
+
 	return 0;
 }
 
@@ -1011,17 +1028,21 @@
 static void hangup_data_destroy(void *obj)
 {
 	struct hangup_data *h_data = obj;
+
 	h_data->chan = ast_channel_unref(h_data->chan);
 }
 
 static struct hangup_data *hangup_data_alloc(int cause, struct ast_channel *chan)
 {
 	struct hangup_data *h_data = ao2_alloc(sizeof(*h_data), hangup_data_destroy);
+
 	if (!h_data) {
 		return NULL;
 	}
+
 	h_data->cause = cause;
 	h_data->chan = ast_channel_ref(chan);
+
 	return h_data;
 }
 
@@ -1048,6 +1069,7 @@
 
 	ao2_cleanup(pvt);
 	ao2_cleanup(h_data);
+
 	return 0;
 }
 
@@ -1058,6 +1080,7 @@
 	struct ast_sip_session *session = pvt->session;
 	int cause = hangup_cause2sip(ast_channel_hangupcause(session->channel));
 	struct hangup_data *h_data = hangup_data_alloc(cause, ast);
+
 	if (!h_data) {
 		goto failure;
 	}
@@ -1066,6 +1089,7 @@
 		ast_log(LOG_WARNING, "Unable to push hangup task to the threadpool. Expect bad things\n");
 		goto failure;
 	}
+
 	return 0;
 
 failure:
@@ -1077,6 +1101,7 @@
 	ast_channel_tech_pvt_set(ast, NULL);
 
 	ao2_cleanup(pvt);
+
 	return -1;
 }
 
@@ -1090,9 +1115,10 @@
 static int request(void *obj)
 {
 	struct request_data *req_data = obj;
+	struct ast_sip_session *session = NULL;
 	char *tmp = ast_strdupa(req_data->dest), *endpoint_name = NULL, *request_user = NULL;
 	RAII_VAR(struct ast_sip_endpoint *, endpoint, NULL, ao2_cleanup);
-	struct ast_sip_session *session = NULL;
+
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(endpoint);
 		AST_APP_ARG(aor);

Modified: team/mmichelson/transfer/channels/chan_h323.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/chan_h323.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/chan_h323.c (original)
+++ team/mmichelson/transfer/channels/chan_h323.c Mon May 13 17:08:33 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/mmichelson/transfer/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/chan_iax2.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/chan_iax2.c (original)
+++ team/mmichelson/transfer/channels/chan_iax2.c Mon May 13 17:08:33 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/mmichelson/transfer/channels/chan_jingle.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/chan_jingle.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/chan_jingle.c (original)
+++ team/mmichelson/transfer/channels/chan_jingle.c Mon May 13 17:08:33 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/mmichelson/transfer/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/chan_mgcp.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/chan_mgcp.c (original)
+++ team/mmichelson/transfer/channels/chan_mgcp.c Mon May 13 17:08:33 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/mmichelson/transfer/channels/chan_motif.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/chan_motif.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/chan_motif.c (original)
+++ team/mmichelson/transfer/channels/chan_motif.c Mon May 13 17:08:33 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/mmichelson/transfer/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/chan_sip.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/chan_sip.c (original)
+++ team/mmichelson/transfer/channels/chan_sip.c Mon May 13 17:08:33 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>
  ***/
 
@@ -1543,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,
@@ -29793,18 +29791,25 @@
 		ast_string_field_set(p, peername, ext);
 	/* Recalculate our side, and recalculate Call ID */
 	ast_sip_ouraddrfor(&p->sa, &p->ourip, p);
-	/* When chan_sip is first loaded, we may have a peer entry but it hasn't re-registered yet.
-	   If the peer hasn't re-registered, we have not checked for NAT yet.  With the new
-	   auto_* settings, we need to check for NAT so we do not have one-way audio. */
-	check_for_nat(&p->ourip, p);
-	set_peer_nat(p, p->relatedpeer);
-
-	if (p->natdetected && ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
-		ast_copy_flags(&p->flags[0], &p->relatedpeer->flags[0], SIP_NAT_FORCE_RPORT);
-	}
-
-	if (p->natdetected && ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) {
-		ast_copy_flags(&p->flags[1], &p->relatedpeer->flags[1], SIP_PAGE2_SYMMETRICRTP);
+	/* When chan_sip is first loaded or reloaded, we need to check for NAT and set the appropiate flags
+	   now that we have the auto_* settings. */
+	check_for_nat(&p->sa, p);
+	/* If there is a peer related to this outgoing call and it hasn't re-registered after
+	   a reload, we need to set the peer's NAT flags accordingly. */
+	if (p->relatedpeer) {
+
+		if (!ast_strlen_zero(p->relatedpeer->fullcontact) && !p->natdetected &&
+			(ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_RPORT) && !ast_test_flag(&p->flags[0], SIP_NAT_FORCE_RPORT))) {
+			/* We need to make an attempt to determine if a peer is behind NAT
+			   if the peer has the auto_force_rport flag set. */
+			struct ast_sockaddr tmpaddr;
+
+			__set_address_from_contact(p->relatedpeer->fullcontact, &tmpaddr, 0);
+
+			check_for_nat(&tmpaddr, p);
+		}
+
+		set_peer_nat(p, p->relatedpeer);
 	}
 
 	do_setnat(p);
@@ -31025,7 +31030,8 @@
 		 * specified, use that address instead. */
 		/* XXX May need to revisit the final argument; does the realtime DB store whether
 		 * the original contact was over TLS or not? XXX */
-		if (!ast_test_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT) || ast_sockaddr_isnull(&peer->addr)) {
+		if ((!ast_test_flag(&peer->flags[2],  SIP_PAGE3_NAT_AUTO_RPORT) && !ast_test_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT))
+		    || ast_sockaddr_isnull(&peer->addr)) {
 			__set_address_from_contact(ast_str_buffer(fullcontact), &peer->addr, 0);
 		}
 	}
@@ -32609,7 +32615,7 @@
 
 	/* Disable early RTP bridge  */
 	if ((instance || vinstance || tinstance) &&
-		!ast_bridged_channel(chan) &&
+		!ast_channel_is_bridged(chan) &&
 		!sip_cfg.directrtpsetup) {
 		sip_pvt_unlock(p);
 		ast_channel_unlock(chan);
@@ -34739,5 +34745,5 @@
 		.unload = unload_module,
 		.reload = reload,
 		.load_pri = AST_MODPRI_CHANNEL_DRIVER,
-		.nonoptreq = "res_crypto,chan_local,res_http_websocket",
+		.nonoptreq = "res_crypto,res_http_websocket",
 	       );

Modified: team/mmichelson/transfer/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/chan_skinny.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/chan_skinny.c (original)
+++ team/mmichelson/transfer/channels/chan_skinny.c Mon May 13 17:08:33 2013
@@ -1635,7 +1635,6 @@
 	.fixup = skinny_fixup,
 	.send_digit_begin = skinny_senddigit_begin,
 	.send_digit_end = skinny_senddigit_end,
-	.bridge = ast_rtp_instance_bridge,
 };
 
 static int skinny_extensionstate_cb(char *context, char *id, struct ast_state_cb_info *info, void *data);

Modified: team/mmichelson/transfer/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/chan_unistim.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/chan_unistim.c (original)
+++ team/mmichelson/transfer/channels/chan_unistim.c Mon May 13 17:08:33 2013
@@ -708,7 +708,6 @@
 	.send_digit_begin = unistim_senddigit_begin,
 	.send_digit_end = unistim_senddigit_end,
 	.send_text = unistim_sendtext,
-	.bridge = ast_rtp_instance_bridge,
 };
 
 static void send_start_rtp(struct unistim_subchannel *);

Modified: team/mmichelson/transfer/channels/misdn/isdn_msg_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/channels/misdn/isdn_msg_parser.c?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/channels/misdn/isdn_msg_parser.c (original)
+++ team/mmichelson/transfer/channels/misdn/isdn_msg_parser.c Mon May 13 17:08:33 2013
@@ -282,6 +282,8 @@
 	msg_t *msg =(msg_t*)create_l3msg(CC_PROGRESS | REQUEST, MT_PROGRESS,  bc?bc->l3_id:-1, sizeof(PROGRESS_t) ,nt);
 
 	progress=(PROGRESS_t*)((msg->data+HEADER_LEN));
+
+	enc_ie_progress(&progress->PROGRESS, msg, 0, nt ? 1 : 5, 8, nt, bc);
 
 	if (bc->fac_out.Function != Fac_None) {
 		enc_ie_facility(&progress->FACILITY, msg, &bc->fac_out, nt);

Modified: team/mmichelson/transfer/include/asterisk/_private.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/include/asterisk/_private.h?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/include/asterisk/_private.h (original)
+++ team/mmichelson/transfer/include/asterisk/_private.h Mon May 13 17:08:33 2013
@@ -61,6 +61,15 @@
 int ast_bridging_init(void);
 
 /*!
+ * \brief Initialize the local proxy channel.
+ * \since 12.0.0
+ *
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_local_init(void);
+
+/*!
  * \brief Reload asterisk modules.
  * \param name the name of the module to reload
  *

Modified: team/mmichelson/transfer/include/asterisk/bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/include/asterisk/bridging.h?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/include/asterisk/bridging.h (original)
+++ team/mmichelson/transfer/include/asterisk/bridging.h Mon May 13 17:08:33 2013
@@ -851,18 +851,18 @@
 int ast_bridge_unsuspend(struct ast_bridge *bridge, struct ast_channel *chan);
 
 /*!
- * \brief Check and optimize out the local channels between bridges.
- * \since 12.0.0
- *
- * \param chan Local channel writing a frame into the channel driver.
- * \param peer Other local channel in the pair.
+ * \brief Check and optimize out the unreal channels between bridges.
+ * \since 12.0.0
+ *
+ * \param chan Unreal channel writing a frame into the channel driver.
+ * \param peer Other unreal channel in the pair.
  *
  * \note It is assumed that chan is already locked.
  *
- * \retval 0 if local channels were not optimized out.
- * \retval non-zero if local channels were optimized out.
- */
-int ast_bridge_local_optimized_out(struct ast_channel *chan, struct ast_channel *peer);
+ * \retval 0 if unreal channels were not optimized out.
+ * \retval non-zero if unreal channels were optimized out.
+ */
+int ast_bridge_unreal_optimized_out(struct ast_channel *chan, struct ast_channel *peer);
 
 /*!
  * \brief Try locking the bridge_channel.

Modified: team/mmichelson/transfer/include/asterisk/ccss.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/include/asterisk/ccss.h?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/include/asterisk/ccss.h (original)
+++ team/mmichelson/transfer/include/asterisk/ccss.h Mon May 13 17:08:33 2013
@@ -1485,10 +1485,12 @@
  * \verbatim extension at context \endverbatim as a starting point
  *
  * \details
- * The CC_INTERFACES channel variable will have the interfaces that should be
- * called back for a specific PBX instance. This version of the function is used
- * mainly by chan_local, wherein we need to set CC_INTERFACES based on an extension
- * and context that appear in the middle of the tree of dialed interfaces
+ * The CC_INTERFACES channel variable will have the interfaces
+ * that should be called back for a specific PBX instance.  This
+ * version of the function is used mainly by local channels,
+ * wherein we need to set CC_INTERFACES based on an extension
+ * and context that appear in the middle of the tree of dialed
+ * interfaces.
  *
  * \note
  * This function will lock the channel as well as the list of monitors stored

Modified: team/mmichelson/transfer/include/asterisk/rtp_engine.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/include/asterisk/rtp_engine.h?view=diff&rev=388651&r1=388650&r2=388651
==============================================================================
--- team/mmichelson/transfer/include/asterisk/rtp_engine.h (original)
+++ team/mmichelson/transfer/include/asterisk/rtp_engine.h Mon May 13 17:08:33 2013
@@ -1541,24 +1541,6 @@
 struct ast_rtp_glue *ast_rtp_instance_get_glue(const char *type);
 
 /*!
- * \brief Bridge two channels that use RTP instances
- *
- * \param c0 First channel part of the bridge
- * \param c1 Second channel part of the bridge
- * \param flags Bridging flags

[... 1727 lines stripped ...]



More information about the asterisk-commits mailing list