[svn-commits] mmichelson: branch mmichelson/more_transfer r388649 - in /team/mmichelson/mor...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon May 13 17:02:23 CDT 2013


Author: mmichelson
Date: Mon May 13 17:02:21 2013
New Revision: 388649

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388649
Log:
Partially revert r388647 in favor of copying caller data when a multiparty transfer is performed.

Because I also did a massive update, I pulled in SIP changes and needed to adjust the SIP code
to have the final parameter for a blind transfer callback.


Modified:
    team/mmichelson/more_transfer/bridges/bridge_builtin_features.c
    team/mmichelson/more_transfer/channels/chan_sip.c

Modified: team/mmichelson/more_transfer/bridges/bridge_builtin_features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/more_transfer/bridges/bridge_builtin_features.c?view=diff&rev=388649&r1=388648&r2=388649
==============================================================================
--- team/mmichelson/more_transfer/bridges/bridge_builtin_features.c (original)
+++ team/mmichelson/more_transfer/bridges/bridge_builtin_features.c Mon May 13 17:02:21 2013
@@ -95,21 +95,14 @@
 	return res;
 }
 
-/*!
- * \internal
- * \brief Copy information from the caller to a separate channel.
- *
- * This causes datastores and channel variables to be inherited from the
- * caller channel to the dest channel.
- *
- * \note Both channels must be locked before calling this function
- * \param dest Destination channel
- * \param caller Source channel
- */
 static void copy_caller_data(struct ast_channel *dest, struct ast_channel *caller)
 {
+	ast_channel_lock_both(caller, dest);
+	ast_connected_line_copy_from_caller(ast_channel_connected(dest), ast_channel_caller(caller));
 	ast_channel_inherit_variables(caller, dest);
 	ast_channel_datastore_inherit(caller, dest);
+	ast_channel_unlock(dest);
+	ast_channel_unlock(caller);
 }
 
 /*! \brief Helper function that creates an outgoing channel and returns it immediately */
@@ -130,11 +123,7 @@
 	}
 
 	/* Before we actually dial out let's inherit appropriate information. */
-	ast_channel_lock_both(caller, chan);
-	ast_connected_line_copy_from_caller(ast_channel_connected(chan), ast_channel_caller(caller));
 	copy_caller_data(chan, caller);
-	ast_channel_unlock(chan);
-	ast_channel_unlock(caller);
 
 	/* Since the above worked fine now we actually call it and return the channel */
 	if (ast_call(chan, destination, 0)) {
@@ -180,10 +169,9 @@
 {
 	struct ast_channel *transferer_channel = user_data;
 
-	ast_channel_lock_both(transferer_channel, new_channel);
-	copy_caller_data(new_channel, transferer_channel);
-	ast_channel_unlock(new_channel);
-	ast_channel_unlock(transferer_channel);
+	if (transfer_type == AST_BRIDGE_TRANSFER_MULTI_PARTY) {
+		copy_caller_data(new_channel, transferer_channel);
+	}
 }
 
 /*! \brief Internal built in feature for blind transfers */

Modified: team/mmichelson/more_transfer/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/more_transfer/channels/chan_sip.c?view=diff&rev=388649&r1=388648&r2=388649
==============================================================================
--- team/mmichelson/more_transfer/channels/chan_sip.c (original)
+++ team/mmichelson/more_transfer/channels/chan_sip.c Mon May 13 17:02:21 2013
@@ -26249,9 +26249,11 @@
  * we may send out.
  *
  * \param chan The new outbound channel
- * \user_data A blind_transfer_cb_data struct
+ * \param user_data A blind_transfer_cb_data struct
+ * \param transfer_type Unused
  */
-static void blind_transfer_cb(struct ast_channel *chan, void *user_data)
+static void blind_transfer_cb(struct ast_channel *chan, void *user_data,
+		enum ast_transfer_type transfer_type)
 {
 	struct blind_transfer_cb_data *cb_data = user_data;
 




More information about the svn-commits mailing list