[asterisk-commits] file: branch file/bridging r106398 - in /team/file/bridging: include/asterisk...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 6 12:43:18 CST 2008


Author: file
Date: Thu Mar  6 12:43:18 2008
New Revision: 106398

URL: http://svn.digium.com/view/asterisk?view=rev&rev=106398
Log:
Add another state used during the smart bridge operation. Now bridged channels won't get serviced until they update their own threading model.

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

Modified: team/file/bridging/include/asterisk/bridging.h
URL: http://svn.digium.com/view/asterisk/team/file/bridging/include/asterisk/bridging.h?view=diff&rev=106398&r1=106397&r2=106398
==============================================================================
--- team/file/bridging/include/asterisk/bridging.h (original)
+++ team/file/bridging/include/asterisk/bridging.h Thu Mar  6 12:43:18 2008
@@ -53,6 +53,7 @@
 	AST_BRIDGE_CHANNEL_STATE_FEATURE,  /*! Channel is currently executing a feature */
 	AST_BRIDGE_CHANNEL_STATE_MERGE,    /*! Channel is part of a bridge merge operation */
 	AST_BRIDGE_CHANNEL_STATE_DTMF,     /*! A DTMF stream is playing/to be played on this channel */
+	AST_BRIDGE_CHANNEL_STATE_SMART,    /*! Channel is part of a bridge undergoing a smart bridge operation */
 };
 
 /*! \brief Flags used for bridge features */

Modified: team/file/bridging/main/bridging.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/bridging.c?view=diff&rev=106398&r1=106397&r2=106398
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Thu Mar  6 12:43:18 2008
@@ -562,8 +562,7 @@
 				ast_debug(1, "Bridge technology %s failed to join %p to bridge %p\n", new_technology->name, bridge_channel2, bridge);
 		}
 		/* Fourth we notify the bridge channel so they can call the respective bridge channel thread function */
-		pthread_kill(bridge_channel2->thread, SIGURG);
-		ast_cond_signal(&bridge_channel2->cond);
+		ast_bridge_change_state(bridge_channel2, AST_BRIDGE_CHANNEL_STATE_SMART);
 	}
 
 	/* Now that all the channels are gone the old bridge technology destruction can be finalized */
@@ -652,6 +651,9 @@
 			break;
 		} else if (bridge_channel->state == AST_BRIDGE_CHANNEL_STATE_DTMF) {
 			ast_debug(1, "Bridge channel %p entering DTMF stream state.\n", bridge_channel);
+			break;
+		} else if (bridge_channel->state == AST_BRIDGE_CHANNEL_STATE_SMART) {
+			ast_debug(1, "Bridge channel %p entering smart bridge state.\n", bridge_channel);
 			break;
 		}
 	}
@@ -808,6 +810,10 @@
 		} else if (bridge_channel->state == AST_BRIDGE_CHANNEL_STATE_DTMF) {
 			bridge_channel_dtmf_stream(bridge, bridge_channel);
 			ast_bridge_rebuild(bridge);
+		} 
+		if (bridge_channel->state == AST_BRIDGE_CHANNEL_STATE_SMART) {
+			bridge_channel->state = AST_BRIDGE_CHANNEL_STATE_WAIT;
+			ast_bridge_rebuild(bridge);
 		}
 	}
 
@@ -1388,7 +1394,6 @@
 		if (attended_bridge_result == AST_BRIDGE_CHANNEL_STATE_DEPART) {
 			/* We want to impart them upon the bridge and just have us return to it as normal */
 			ast_bridge_impart(bridge, chan, NULL, NULL);
-			bridge_channel->state = AST_BRIDGE_CHANNEL_STATE_WAIT;
 		} else {
 			ast_bridge_impart(bridge, chan, bridge_channel->chan, NULL);
 		}




More information about the asterisk-commits mailing list