[svn-commits] mattf: trunk r6 - in /trunk: isup.c mtp3.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Aug 3 12:45:13 MST 2006


Author: mattf
Date: Thu Aug  3 14:45:12 2006
New Revision: 6

URL: http://svn.digium.com/view/libss7?rev=6&view=rev
Log:
Add support for ANSI style CICs

Modified:
    trunk/isup.c
    trunk/mtp3.c

Modified: trunk/isup.c
URL: http://svn.digium.com/view/libss7/trunk/isup.c?rev=6&r1=5&r2=6&view=diff
==============================================================================
--- trunk/isup.c (original)
+++ trunk/isup.c Thu Aug  3 14:45:12 2006
@@ -653,8 +653,8 @@
 		mh->cic[0] = c->cic & 0xff;
 		mh->cic[1] = (c->cic >> 8) & 0x0f;
 	} else {
-		ss7_error(ss7, "Incomplete support for non ITU style switchtypes\n");
-		return -1;
+		mh->cic[0] = c->cic & 0xff;
+		mh->cic[1] = (c->cic >> 8) & 0x03f;
 	}
 
 	mh->type = messagetype;
@@ -754,8 +754,7 @@
 	if (ss7->switchtype == SS7_ITU) {
 		cic = mh->cic[0] | ((mh->cic[1] << 8) & 0x0f);
 	} else {
-		ss7_error(ss7, "Don't handle non ITU switchtypes yet\n");
-		return -1;
+		cic = mh->cic[0] | ((mh->cic[1] << 8) & 0x3f);
 	}
 	/* Find us in the message list */
 	for (x = 0; x < sizeof(messages)/sizeof(struct message_data); x++)
@@ -791,8 +790,7 @@
 	if (ss7->switchtype == SS7_ITU) {
 		cic = mh->cic[0] | ((mh->cic[1] << 8) & 0x0f);
 	} else {
-		ss7_error(ss7, "Don't handle non ITU switchtypes yet\n");
-		return -1;
+		cic = mh->cic[0] | ((mh->cic[1] << 8) & 0x3f);
 	}
 
 	/* Find us in the message list */

Modified: trunk/mtp3.c
URL: http://svn.digium.com/view/libss7/trunk/mtp3.c?rev=6&r1=5&r2=6&view=diff
==============================================================================
--- trunk/mtp3.c (original)
+++ trunk/mtp3.c Thu Aug  3 14:45:12 2006
@@ -30,7 +30,7 @@
 		case SIG_ISUP:
 			return "ISUP";
 		default:
-			return "Unknown User part";
+			return "Unknown";
 	}
 }
 
@@ -68,6 +68,11 @@
 static inline unsigned char get_ni(unsigned char sio)
 {
 	return (sio >> 6) & 0x3;
+}
+
+static inline unsigned char get_priority(unsigned char sio)
+{
+	return (sio >> 4) & 0x3;
 }
 
 int set_routinglabel(unsigned char *sif, struct routing_label *rl)
@@ -315,6 +320,7 @@
 	unsigned char *sio = &buf[0];
 	unsigned char *sif = &buf[1];
 	unsigned char ni = get_ni(*sio);
+	unsigned char priority = get_priority(*sio);
 	unsigned char userpart = get_userpart(*sio);
 	struct routing_label rl;
 	unsigned int siflen = len - 1;
@@ -327,7 +333,7 @@
 
 	ss7_message(ss7, "\tOPC 0x%x DPC 0x%x\n", rl.opc, rl.dpc);
 
-	ss7_message(ss7, "\tUser Part: %s (%x)\n", userpart2str(userpart), userpart);
+	ss7_message(ss7, "\tUser Part: %s (%x) Priority: %d\n", userpart2str(userpart), userpart, priority);
 
 	/* Pass it to the correct user part */
 	switch (userpart) {



More information about the svn-commits mailing list