[asterisk-commits] file: branch file/bridging_colp r392141 - in /team/file/bridging_colp: includ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 18 11:10:36 CDT 2013


Author: file
Date: Tue Jun 18 11:10:34 2013
New Revision: 392141

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392141
Log:
Remove stuff which is no longer applicable.

Modified:
    team/file/bridging_colp/include/asterisk/channel.h
    team/file/bridging_colp/main/bridging.c
    team/file/bridging_colp/main/channel.c

Modified: team/file/bridging_colp/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/file/bridging_colp/include/asterisk/channel.h?view=diff&rev=392141&r1=392140&r2=392141
==============================================================================
--- team/file/bridging_colp/include/asterisk/channel.h (original)
+++ team/file/bridging_colp/include/asterisk/channel.h Tue Jun 18 11:10:34 2013
@@ -2023,52 +2023,6 @@
  * avoidance involving these two channels.
  */
 int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clone);
-
-/*!
- * \brief Setup a masquerade to transfer a call.
- * \since 1.8
- *
- * \param target_chan Target of the call transfer.  (Masquerade original channel)
- * \param target_id New connected line information for the target channel.
- * \param target_held TRUE if the target call is on hold.
- * \param transferee_chan Transferee of the call transfer. (Masquerade clone channel)
- * \param transferee_id New connected line information for the transferee channel.
- * \param transferee_held TRUE if the transferee call is on hold.
- *
- * \details
- * Party A - Transferee
- * Party B - Transferer
- * Party C - Target of transfer
- *
- * Party B transfers A to C.
- *
- * Party A is connected to bridged channel B1.
- * Party B is connected to channels C1 and C2.
- * Party C is connected to bridged channel B2.
- *
- * Party B -- C1 == B1 -- Party A
- *               __/
- *              /
- * Party B -- C2 == B2 -- Party C
- *
- * Bridged channel B1 is masqueraded into channel C2.  Where B1
- * is the masquerade clone channel and C2 is the masquerade
- * original channel.
- *
- * \see ast_channel_masquerade()
- *
- * \note Has the same locking requirements as ast_channel_masquerade().
- *
- * \retval 0 on success.
- * \retval -1 on error.
- */
-int ast_channel_transfer_masquerade(
-	struct ast_channel *target_chan,
-	const struct ast_party_connected_line *target_id,
-	int target_held,
-	struct ast_channel *transferee_chan,
-	const struct ast_party_connected_line *transferee_id,
-	int transferee_held);
 
 /*!
  * \brief Gives the string form of a given cause code.

Modified: team/file/bridging_colp/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridging_colp/main/bridging.c?view=diff&rev=392141&r1=392140&r2=392141
==============================================================================
--- team/file/bridging_colp/main/bridging.c (original)
+++ team/file/bridging_colp/main/bridging.c Tue Jun 18 11:10:34 2013
@@ -1158,8 +1158,6 @@
 	default:
 		break;
 	}
-
-/* BUGBUG bridge join or impart needs to do CONNECTED_LINE updates if the channels are being swapped and it is a 1-1 bridge. */
 
 	/* Simply write the frame out to the bridge technology. */
 /* BUGBUG The tech is where AST_CONTROL_ANSWER hook should go. (early bridge) */

Modified: team/file/bridging_colp/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridging_colp/main/channel.c?view=diff&rev=392141&r1=392140&r2=392141
==============================================================================
--- team/file/bridging_colp/main/channel.c (original)
+++ team/file/bridging_colp/main/channel.c Tue Jun 18 11:10:34 2013
@@ -6334,116 +6334,6 @@
 	return __ast_channel_masquerade(original, clone, NULL);
 }
 
-/*!
- * \internal
- * \brief Copy the source connected line information to the destination for a transfer.
- * \since 1.8
- *
- * \param dest Destination connected line
- * \param src Source connected line
- *
- * \return Nothing
- */
-static void party_connected_line_copy_transfer(struct ast_party_connected_line *dest, const struct ast_party_connected_line *src)
-{
-	struct ast_party_connected_line connected;
-
-	connected = *((struct ast_party_connected_line *) src);
-	connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
-
-	/* Make sure empty strings will be erased. */
-	if (!connected.id.name.str) {
-		connected.id.name.str = "";
-	}
-	if (!connected.id.number.str) {
-		connected.id.number.str = "";
-	}
-	if (!connected.id.subaddress.str) {
-		connected.id.subaddress.str = "";
-	}
-	if (!connected.id.tag) {
-		connected.id.tag = "";
-	}
-
-	ast_party_connected_line_copy(dest, &connected);
-}
-
-/*! Transfer masquerade connected line exchange data. */
-struct xfer_masquerade_ds {
-	/*! New ID for the target of the transfer (Masquerade original channel) */
-	struct ast_party_connected_line target_id;
-	/*! New ID for the transferee of the transfer (Masquerade clone channel) */
-	struct ast_party_connected_line transferee_id;
-	/*! TRUE if the target call is held. (Masquerade original channel) */
-	int target_held;
-	/*! TRUE if the transferee call is held. (Masquerade clone channel) */
-	int transferee_held;
-};
-
-/*!
- * \internal
- * \brief Destroy the transfer connected line exchange datastore information.
- * \since 1.8
- *
- * \param data The datastore payload to destroy.
- *
- * \return Nothing
- */
-static void xfer_ds_destroy(void *data)
-{
-	struct xfer_masquerade_ds *ds = data;
-
-	ast_party_connected_line_free(&ds->target_id);
-	ast_party_connected_line_free(&ds->transferee_id);
-	ast_free(ds);
-}
-
-static const struct ast_datastore_info xfer_ds_info = {
-	.type = "xfer_colp",
-	.destroy = xfer_ds_destroy,
-};
-
-/*
- * BUGBUG ast_channel_transfer_masquerade() can be deleted when bridging COLP has been reimplemented.
- *
- * ast_bridge_transfer_attended() will need to do something like
- * this when it has to do a masquerade into an application.
- */
-int ast_channel_transfer_masquerade(
-	struct ast_channel *target_chan,
-	const struct ast_party_connected_line *target_id,
-	int target_held,
-	struct ast_channel *transferee_chan,
-	const struct ast_party_connected_line *transferee_id,
-	int transferee_held)
-{
-	struct ast_datastore *xfer_ds;
-	struct xfer_masquerade_ds *xfer_colp;
-	int res;
-
-	xfer_ds = ast_datastore_alloc(&xfer_ds_info, NULL);
-	if (!xfer_ds) {
-		return -1;
-	}
-
-	xfer_colp = ast_calloc(1, sizeof(*xfer_colp));
-	if (!xfer_colp) {
-		ast_datastore_free(xfer_ds);
-		return -1;
-	}
-	party_connected_line_copy_transfer(&xfer_colp->target_id, target_id);
-	xfer_colp->target_held = target_held;
-	party_connected_line_copy_transfer(&xfer_colp->transferee_id, transferee_id);
-	xfer_colp->transferee_held = transferee_held;
-	xfer_ds->data = xfer_colp;
-
-	res = __ast_channel_masquerade(target_chan, transferee_chan, xfer_ds);
-	if (res) {
-		ast_datastore_free(xfer_ds);
-	}
-	return res;
-}
-
 /*! \brief this function simply changes the name of the channel and issues a manager_event
  *         with out unlinking and linking the channel from the ao2_container.  This should
  *         only be used when the channel has already been unlinked from the ao2_container.
@@ -6719,62 +6609,6 @@
 #endif	//BUGBUG
 
 /*!
- * \internal
- * \brief Transfer COLP between target and transferee channels.
- * \since 1.8
- *
- * \param transferee Transferee channel to exchange connected line information.
- * \param colp Connected line information to exchange.
- *
- * \return Nothing
- */
-static void masquerade_colp_transfer(struct ast_channel *transferee, struct xfer_masquerade_ds *colp)
-{
-	struct ast_control_read_action_payload *frame_payload;
-	int payload_size;
-	int frame_size;
-	unsigned char connected_line_data[1024];
-
-	/* Release any hold on the target. */
-	if (colp->target_held) {
-		ast_queue_unhold(transferee);
-	}
-
-	/*
-	 * Since transferee may not actually be bridged to another channel,
-	 * there is no way for us to queue a frame so that its connected
-	 * line status will be updated.  Instead, we use the somewhat
-	 * hackish approach of using a special control frame type that
-	 * instructs ast_read() to perform a specific action.  In this
-	 * case, the frame we queue tells ast_read() to call the
-	 * connected line interception macro configured for transferee.
-	 */
-
-	/* Reset any earlier private connected id representation */
-	ast_party_id_reset(&colp->target_id.priv);
-	ast_party_id_reset(&colp->transferee_id.priv);
-
-	payload_size = ast_connected_line_build_data(connected_line_data,
-		sizeof(connected_line_data), &colp->target_id, NULL);
-	if (payload_size != -1) {
-		frame_size = payload_size + sizeof(*frame_payload);
-		frame_payload = ast_alloca(frame_size);
-		frame_payload->action = AST_FRAME_READ_ACTION_CONNECTED_LINE_MACRO;
-		frame_payload->payload_size = payload_size;
-		memcpy(frame_payload->payload, connected_line_data, payload_size);
-		ast_queue_control_data(transferee, AST_CONTROL_READ_ACTION, frame_payload,
-			frame_size);
-	}
-	/*
-	 * In addition to queueing the read action frame so that the
-	 * connected line info on transferee will be updated, we also are
-	 * going to queue a plain old connected line update on transferee to
-	 * update the target.
-	 */
-	ast_channel_queue_connected_line_update(transferee, &colp->transferee_id, NULL);
-}
-
-/*!
  * \brief Masquerade a channel
  *
  * \note Assumes _NO_ channels and _NO_ channel pvt's are locked.  If a channel is locked while calling
@@ -6800,8 +6634,6 @@
 	struct ast_channel *clonechan, *chans[2];
 	struct ast_channel *bridged;
 	struct ast_cdr *cdr;
-	struct ast_datastore *xfer_ds;
-	struct xfer_masquerade_ds *xfer_colp;
 	struct ast_format rformat;
 	struct ast_format wformat;
 	struct ast_format tmp_format;
@@ -6869,15 +6701,6 @@
 	ao2_unlink(channels, original);
 	ao2_unlink(channels, clonechan);
 
-	/* Get any transfer masquerade connected line exchange data. */
-	xfer_ds = ast_channel_datastore_find(original, &xfer_ds_info, NULL);
-	if (xfer_ds) {
-		ast_channel_datastore_remove(original, xfer_ds);
-		xfer_colp = xfer_ds->data;
-	} else {
-		xfer_colp = NULL;
-	}
-
 	/*
 	 * Stop any visible indication on the original channel so we can
 	 * transfer it to the clonechan taking the original's place.
@@ -6885,14 +6708,6 @@
 	visible_indication = ast_channel_visible_indication(original);
 	ast_channel_unlock(original);
 	ast_indicate(original, -1);
-
-	/*
-	 * Release any hold on the transferee channel before going any
-	 * further with the masquerade.
-	 */
-	if (xfer_colp && xfer_colp->transferee_held) {
-		ast_indicate(clonechan, AST_CONTROL_UNHOLD);
-	}
 
 	/* Start the masquerade channel contents rearangement. */
 	ast_channel_lock_both(original, clonechan);
@@ -7231,19 +7046,6 @@
 		ast_channel_unlock(original);
 	}
 	ast_indicate(original, AST_CONTROL_SRCCHANGE);
-
-	if (xfer_colp) {
-		/*
-		 * After the masquerade, the original channel pointer actually
-		 * points to the new transferee channel and the bridged channel
-		 * is still the intended transfer target party.
-		 */
-		masquerade_colp_transfer(original, xfer_colp);
-	}
-
-	if (xfer_ds) {
-		ast_datastore_free(xfer_ds);
-	}
 
 	if (!clone_was_zombie) {
 		ao2_link(channels, clonechan);




More information about the asterisk-commits mailing list