[libss7-commits] mattf: trunk r36 - in /trunk: libss7.h ss7.c

libss7-commits at lists.digium.com libss7-commits at lists.digium.com
Fri Sep 1 14:37:27 MST 2006


Author: mattf
Date: Fri Sep  1 16:37:27 2006
New Revision: 36

URL: http://svn.digium.com/view/libss7?rev=36&view=rev
Log:
Add support for alarms

Modified:
    trunk/libss7.h
    trunk/ss7.c

Modified: trunk/libss7.h
URL: http://svn.digium.com/view/libss7/trunk/libss7.h?rev=36&r1=35&r2=36&view=diff
==============================================================================
--- trunk/libss7.h (original)
+++ trunk/libss7.h Fri Sep  1 16:37:27 2006
@@ -164,6 +164,10 @@
 
 int ss7_write(struct ss7 *ss7, int fd);
 
+void ss7_link_alarm(struct ss7 *ss7, int fd);
+
+void ss7_link_noalarm(struct ss7 *ss7, int fd);
+
 char * ss7_event2str(int event);
 
 /* ISUP call related message functions */

Modified: trunk/ss7.c
URL: http://svn.digium.com/view/libss7/trunk/ss7.c?rev=36&r1=35&r2=36&view=diff
==============================================================================
--- trunk/ss7.c (original)
+++ trunk/ss7.c Fri Sep  1 16:37:27 2006
@@ -138,6 +138,32 @@
 		mtp2_start(ss7->links[i]);
 
 	return 0;
+}
+
+void ss7_link_alarm(struct ss7 *ss7, int fd)
+{
+	int i;
+	int winner = -1;
+
+	for (i = 0; i < ss7->numlinks; i++) {
+		if (ss7->links[i]->fd == fd)
+			winner = i;
+	}
+	if (winner > -1)
+		mtp2_stop(ss7->links[i]);
+}
+
+void ss7_link_noalarm(struct ss7 *ss7, int fd)
+{
+	int i;
+	int winner = -1;
+
+	for (i = 0; i < ss7->numlinks; i++) {
+		if (ss7->links[i]->fd == fd)
+			winner = i;
+	}
+	if (winner > -1)
+		mtp2_start(ss7->links[i]);
 }
 
 int ss7_add_link(struct ss7 *ss7, int fd)



More information about the libss7-commits mailing list