[Asterisk-cvs] asterisk/channels chan_zap.c,1.224,1.225

markster at lists.digium.com markster at lists.digium.com
Sat May 15 18:39:26 CDT 2004


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

Modified Files:
	chan_zap.c 
Log Message:
Don't call out an FXO until at least 2 seconds after it was hungup.


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.224
retrieving revision 1.225
diff -u -d -r1.224 -r1.225
--- chan_zap.c	13 May 2004 18:23:34 -0000	1.224
+++ chan_zap.c	15 May 2004 22:50:51 -0000	1.225
@@ -426,6 +426,7 @@
 	int channel;				/* Channel Number */
 	int span;					/* Span number */
 	int dialing;
+	time_t guardtime;			/* Must wait this much time before using for new call */
 	int dialednone;
 	int use_callerid;			/* Whether or not to use caller id on this channel */
 	int hidecallerid;
@@ -1973,6 +1974,13 @@
 					tone_zone_play_tone(p->subs[SUB_REAL].zfd, -1);
 			}
 			break;
+		case SIG_FXSGS:
+		case SIG_FXSLS:
+		case SIG_FXSKS:
+			/* Make sure we're not made available for at least two seconds */
+			time(&p->guardtime);
+			p->guardtime += 2;
+			break;
 		default:
 			tone_zone_play_tone(p->subs[SUB_REAL].zfd, -1);
 		}
@@ -5763,7 +5771,10 @@
 		return 0;
 	/* If do not distrub, definitely not */
 	if (p->dnd)
-		return 0;	
+		return 0;
+	/* If guard time, definitely not */
+	if (time(NULL) < p->guardtime)
+		return 0;
 		
 	/* If no owner definitely available */
 	if (!p->owner) {




More information about the svn-commits mailing list