[libpri-commits] trunk - r301 /trunk/q931.c

libpri-commits at lists.digium.com libpri-commits at lists.digium.com
Thu Jan 19 14:56:10 MST 2006


Author: mattf
Date: Thu Jan 19 15:56:10 2006
New Revision: 301

URL: http://svn.digium.com/view/libpri?rev=301&view=rev
Log:
More fixes for RLT

Modified:
    trunk/q931.c

Modified: trunk/q931.c
URL: http://svn.digium.com/view/libpri/trunk/q931.c?rev=301&r1=300&r2=301&view=diff
==============================================================================
--- trunk/q931.c (original)
+++ trunk/q931.c Thu Jan 19 15:56:10 2006
@@ -1174,27 +1174,57 @@
 	if (ie->len < 1)
 		return -1;
 
-	if ((ie->data[i] & 0xe0) != 0x80) {
-		pri_error(pri, "!! Invalid Protocol Profile field 0x%X\n", ie->data[i]);
-		return -1;
-	}
-	switch(next_protocol = protocol = (ie->data[i] & 0x1f)) {
-	case Q932_PROTOCOL_CMIP:
-	case Q932_PROTOCOL_ACSE:
-		if (pri->debug & PRI_DEBUG_APDU)
-			pri_message(pri, "!! Don't know how to handle Q.932 Protocol Profile of type 0x%X\n", protocol);
-		return -1;
-	case Q932_PROTOCOL_EXTENSIONS:
-		state = Q932_STATE_NFE;
-		next_protocol = Q932_PROTOCOL_ROSE;
-		break;
-	case Q932_PROTOCOL_ROSE:
-		break;
-	default:
-		pri_error(pri, "!! Invalid Q.932 Protocol Profile of type 0x%X received\n", protocol);
-		return -1;
-	}
-	i++;
+	if (pri->switchtype != PRI_SWITCH_DMS100) {
+		if ((ie->data[i] & 0xe0) != 0x80) {
+			pri_error(pri, "!! Invalid Protocol Profile field 0x%X\n", ie->data[i]);
+			return -1;
+		}
+		switch(next_protocol = protocol = (ie->data[i] & 0x1f)) {
+		case Q932_PROTOCOL_CMIP:
+		case Q932_PROTOCOL_ACSE:
+			if (pri->debug & PRI_DEBUG_APDU)
+				pri_message(pri, "!! Don't know how to handle Q.932 Protocol Profile of type 0x%X\n", protocol);
+			return -1;
+		case Q932_PROTOCOL_EXTENSIONS:
+			state = Q932_STATE_NFE;
+			next_protocol = Q932_PROTOCOL_ROSE;
+			break;
+		case Q932_PROTOCOL_ROSE:
+			break;
+		default:
+			pri_error(pri, "!! Invalid Q.932 Protocol Profile of type 0x%X received\n", protocol);
+			return -1;
+		}
+		i++;
+	} else { /* Silly DMS100s */
+		switch(next_protocol = protocol = (ie->data[i] & 0x1f)) {
+		case Q932_PROTOCOL_CMIP:
+		case Q932_PROTOCOL_ACSE:
+			if (pri->debug & PRI_DEBUG_APDU)
+				pri_message(pri, "!! Don't know how to handle Q.932 Protocol Profile of type 0x%X\n", protocol);
+			return -1;
+		case Q932_PROTOCOL_EXTENSIONS:
+			state = Q932_STATE_NFE;
+			next_protocol = Q932_PROTOCOL_ROSE;
+			break;
+		case Q932_PROTOCOL_ROSE:
+			break;
+		default:
+			pri_error(pri, "!! Invalid Q.932 Protocol Profile of type 0x%X received\n", protocol);
+			return -1;
+		}
+		if (!(ie->data[i] & 0x80)) {
+			i++;
+			if (((ie->data[i] & 0x7f) != RLT_OPERATION_IND) || !(ie->data[i] & 0x80)) {
+				pri_error(pri, "!! Do not support operation 0x%x\n", ie->data[i] & 0xff);
+				return -1;
+			}
+		}
+		i++;
+	}
+
+
+
 
 	if (ie->len < 3)
 		return -1;



More information about the libpri-commits mailing list