[asterisk-commits] file: branch file/bridging_colp r391425 - /team/file/bridging_colp/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 11 12:30:46 CDT 2013


Author: file
Date: Tue Jun 11 12:30:45 2013
New Revision: 391425

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=391425
Log:
Update connected line information on push/pull. Not yet complete!

Modified:
    team/file/bridging_colp/main/bridging.c

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=391425&r1=391424&r2=391425
==============================================================================
--- team/file/bridging_colp/main/bridging.c (original)
+++ team/file/bridging_colp/main/bridging.c Tue Jun 11 12:30:45 2013
@@ -485,6 +485,34 @@
 }
 
 /*!
+* \internal
+* \brief Clear connected line information on channels within bridge.
+*
+* \param bridge_channel Channel being pulled.
+*
+* \return Nothing
+*/
+static void bridge_channel_pull_connected_line_update(struct ast_bridge_channel *bridge_channel)
+{
+	struct ast_bridge *bridge = bridge_channel->bridge;
+	struct ast_party_connected_line connected;
+	struct ast_bridge_channel *peer;
+
+	if (!(bridge->technology->capabilities & AST_BRIDGE_CAPABILITY_1TO1MIX)) {
+		return;
+	}
+
+	ast_party_connected_line_init(&connected);
+	ast_channel_update_connected_line(bridge_channel->chan, &connected, NULL);
+
+	if ((peer = ast_bridge_channel_peer(bridge_channel))) {
+		ast_channel_update_connected_line(peer->chan, &connected, NULL);
+	}
+
+	ast_party_connected_line_free(&connected);
+}
+
+/*!
  * \internal
  * \brief Pull the bridge channel out of its current bridge.
  * \since 12.0.0
@@ -519,6 +547,8 @@
 		}
 	}
 
+	bridge_channel_pull_connected_line_update(bridge_channel);
+
 	/* Remove channel from the bridge */
 	if (!bridge_channel->suspended) {
 		--bridge->num_active;
@@ -533,6 +563,40 @@
 
 	bridge->reconfigured = 1;
 	ast_bridge_publish_leave(bridge, bridge_channel->chan);
+}
+
+/*!
+* \internal
+* \brief Update connected line information on channels within bridge.
+*
+* \param bridge_channel Channel being pushed.
+*
+* \return Nothing
+*/
+static void bridge_channel_push_connected_line_update(struct ast_bridge_channel *bridge_channel)
+{
+	struct ast_bridge *bridge = bridge_channel->bridge;
+	struct ast_bridge_channel *peer;
+	struct ast_party_connected_line connected;
+
+	if (!(bridge->technology->capabilities & AST_BRIDGE_CAPABILITY_1TO1MIX) ||
+		!(peer = ast_bridge_channel_peer(bridge_channel))) {
+		return;
+	}
+
+	ast_party_connected_line_init(&connected);
+
+	ast_channel_lock(bridge_channel->chan);
+	ast_connected_line_copy_from_caller(&connected, ast_channel_caller(bridge_channel->chan));
+	ast_channel_unlock(bridge_channel->chan);
+	ast_channel_update_connected_line(peer->chan, &connected, NULL);
+
+	ast_channel_lock(peer->chan);
+	ast_connected_line_copy_from_caller(&connected, ast_channel_caller(peer->chan));
+	ast_channel_unlock(peer->chan);
+	ast_channel_update_connected_line(bridge_channel->chan, &connected, NULL);
+
+	ast_party_connected_line_free(&connected);
 }
 
 /*!
@@ -587,6 +651,8 @@
 		ast_bridge_change_state(swap, AST_BRIDGE_CHANNEL_STATE_HANGUP);
 		bridge_channel_pull(swap);
 	}
+
+	bridge_channel_push_connected_line_update(bridge_channel);
 
 	/* Clear any BLINDTRANSFER since the transfer has completed. */
 	pbx_builtin_setvar_helper(bridge_channel->chan, "BLINDTRANSFER", NULL);




More information about the asterisk-commits mailing list