[Asterisk-cvs] asterisk channel.c,1.243,1.244

kpfleming kpfleming
Tue Oct 4 19:33:10 CDT 2005


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

Modified Files:
	channel.c 
Log Message:
support call duration limits on inbound OSP calls (issue #5346)


Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.243
retrieving revision 1.244
diff -u -d -r1.243 -r1.244
--- channel.c	29 Sep 2005 17:40:24 -0000	1.243
+++ channel.c	4 Oct 2005 23:28:57 -0000	1.244
@@ -273,6 +273,31 @@
 	return;
 }
 
+/*--- ast_channel_cmpwhentohangup: Compare a offset with when to hangup channel */
+int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset)
+{
+	time_t whentohangup;
+
+	if (chan->whentohangup == 0) {
+		if (offset == 0)
+			return (0);
+		else
+			return (-1);
+	} else { 
+		if (offset == 0)
+			return (1);
+		else {
+			whentohangup = offset + time (NULL);
+			if (chan->whentohangup < whentohangup)
+				return (1);
+			else if (chan->whentohangup == whentohangup)
+				return (0);
+			else
+				return (-1);
+		}
+	}
+}
+
 /*--- ast_channel_register: Register a new telephony channel in Asterisk */
 int ast_channel_register(const struct ast_channel_tech *tech)
 {




More information about the svn-commits mailing list