[Asterisk-cvs] asterisk/channels chan_zap.c,1.382,1.383

markster at lists.digium.com markster at lists.digium.com
Wed Dec 1 13:46:18 CST 2004


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

Modified Files:
	chan_zap.c 
Log Message:
Don't create the channel if there already is one...


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.382
retrieving revision 1.383
diff -u -d -r1.382 -r1.383
--- chan_zap.c	1 Dec 2004 04:35:34 -0000	1.382
+++ chan_zap.c	1 Dec 2004 18:44:52 -0000	1.383
@@ -4465,6 +4465,10 @@
 	int x,y;
 	int features;
 	ZT_PARAMS ps;
+	if (i->subs[index].owner) {
+		ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]);
+		return NULL;
+	}
 	tmp = ast_channel_alloc(0);
 	if (tmp) {
 		ps.channo = i->channel;
@@ -4569,9 +4573,6 @@
 			strncpy(tmp->accountcode, i->accountcode, sizeof(tmp->accountcode)-1);
 		if (i->amaflags)
 			tmp->amaflags = i->amaflags;
-		if (i->subs[index].owner) {
-			ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]);
-		}
 		i->subs[index].owner = tmp;
 		strncpy(tmp->context, i->context, sizeof(tmp->context)-1);
 		/* Copy call forward info */




More information about the svn-commits mailing list