[Asterisk-cvs] asterisk channel.c,1.141,1.142 manager.c,1.76,1.77

markster at lists.digium.com markster at lists.digium.com
Sat Oct 23 08:16:01 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv444

Modified Files:
	channel.c manager.c 
Log Message:
First pass at making transfer work within agent (not tested, shouldn't break anything that currently worked)


Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -d -r1.141 -r1.142
--- channel.c	3 Oct 2004 04:19:58 -0000	1.141
+++ channel.c	23 Oct 2004 12:19:47 -0000	1.142
@@ -2479,6 +2479,15 @@
 	return (((now->tv_sec * 1000) + now->tv_usec / 1000) - ((then->tv_sec * 1000) + then->tv_usec / 1000));
 }
 
+struct ast_channel *ast_bridged_channel(struct ast_channel *chan)
+{
+	struct ast_channel *bridged;
+	bridged = chan->_bridge;
+	if (bridged && bridged->pvt->bridged_channel) 
+		bridged = bridged->pvt->bridged_channel(chan, bridged);
+	return bridged;
+}
+
 static void bridge_playfile(struct ast_channel *chan, struct ast_channel *peer, char *sound, int remain) 
 {
 	int res=0, min=0, sec=0,check=0;
@@ -2552,20 +2561,20 @@
 	/* Stop if we're a zombie or need a soft hangup */
 	if (c0->zombie || ast_check_hangup_locked(c0) || c1->zombie || ast_check_hangup_locked(c1)) 
 		return -1;
-	if (c0->bridge) {
+	if (c0->_bridge) {
 		ast_log(LOG_WARNING, "%s is already in a bridge with %s\n", 
-			c0->name, c0->bridge->name);
+			c0->name, c0->_bridge->name);
 		return -1;
 	}
-	if (c1->bridge) {
+	if (c1->_bridge) {
 		ast_log(LOG_WARNING, "%s is already in a bridge with %s\n", 
-			c1->name, c1->bridge->name);
+			c1->name, c1->_bridge->name);
 		return -1;
 	}
 	
 	/* Keep track of bridge */
-	c0->bridge = c1;
-	c1->bridge = c0;
+	c0->_bridge = c1;
+	c1->_bridge = c0;
 	cs[0] = c0;
 	cs[1] = c1;
 	
@@ -2632,8 +2641,8 @@
 			if (option_verbose > 2) 
 				ast_verbose(VERBOSE_PREFIX_3 "Attempting native bridge of %s and %s\n", c0->name, c1->name);
 			if (!(res = c0->pvt->bridge(c0, c1, flags, fo, rc))) {
-				c0->bridge = NULL;
-				c1->bridge = NULL;
+				c0->_bridge = NULL;
+				c1->_bridge = NULL;
 				manager_event(EVENT_FLAG_CALL, "Unlink", 
 					"Channel1: %s\r\n"
 					"Channel2: %s\r\n"
@@ -2737,8 +2746,8 @@
 		cs[0] = cs[1];
 		cs[1] = cs[2];
 	}
-	c0->bridge = NULL;
-	c1->bridge = NULL;
+	c0->_bridge = NULL;
+	c1->_bridge = NULL;
 	manager_event(EVENT_FLAG_CALL, "Unlink", 
 					"Channel1: %s\r\n"
 					"Channel2: %s\r\n"

Index: manager.c
===================================================================
RCS file: /usr/cvsroot/asterisk/manager.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- manager.c	3 Oct 2004 21:18:26 -0000	1.76
+++ manager.c	23 Oct 2004 12:19:47 -0000	1.77
@@ -682,8 +682,8 @@
 		}
 	}
 	while(c) {
-		if (c->bridge)
-			snprintf(bridge, sizeof(bridge), "Link: %s\r\n", c->bridge->name);
+		if (c->_bridge)
+			snprintf(bridge, sizeof(bridge), "Link: %s\r\n", c->_bridge->name);
 		else
 			bridge[0] = '\0';
 		ast_mutex_lock(&s->lock);




More information about the svn-commits mailing list