[libpri-commits] rmudgett: branch 1.4 r2333 - in /branches/1.4: pri_q931.h q931.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Mon Nov 17 17:27:03 CST 2014


Author: rmudgett
Date: Mon Nov 17 17:26:55 2014
New Revision: 2333

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2333
Log:
q931.c: Made not recognize ie 0x01 for switches other than 4ESS, 5ESS, NI2, and DMS-100.

An incoming SETUP message needs to reject the invalid ie 0x01 on switches
other than 4ESS, 5ESS, NI2, and DMS-100.

LIBPRI-74 #close
Reported by: Richard Mudgett

Modified:
    branches/1.4/pri_q931.h
    branches/1.4/q931.c

Modified: branches/1.4/pri_q931.h
URL: http://svnview.digium.com/svn/libpri/branches/1.4/pri_q931.h?view=diff&rev=2333&r1=2332&r2=2333
==============================================================================
--- branches/1.4/pri_q931.h (original)
+++ branches/1.4/pri_q931.h Mon Nov 17 17:26:55 2014
@@ -137,9 +137,6 @@
 #define SERVICE_CHANGE_STATUS_OUTOFSERVICE        2
 #define SERVICE_CHANGE_STATUS_REQCONTINUITYCHECK  3  /* not supported */
 #define SERVICE_CHANGE_STATUS_SHUTDOWN            4  /* not supported */
-
-/* Special codeset 0 IE */
-#define	NATIONAL_CHANGE_STATUS		0x1
 
 /* Q.931 / National ISDN Information Elements */
 #define Q931_LOCKING_SHIFT			0x90

Modified: branches/1.4/q931.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/q931.c?view=diff&rev=2333&r1=2332&r2=2333
==============================================================================
--- branches/1.4/q931.c (original)
+++ branches/1.4/q931.c Mon Nov 17 17:26:55 2014
@@ -2681,10 +2681,33 @@
 		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);
 	}
 	pri_message(ctrl, " ]\n");
+
+	switch (ctrl->switchtype) {
+	case PRI_SWITCH_NI2:
+	case PRI_SWITCH_DMS100:
+	case PRI_SWITCH_LUCENT5E:
+	case PRI_SWITCH_ATT4ESS:
+		break;
+	default:
+		/* ie not supported by this switch type */
+		pri_message(ctrl, "%c   %s is treated as unknown by current switch type.\n",
+			prefix, ie2str(full_ie));
+		break;
+	}
 }
 
 static int receive_change_status(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
 {
+	switch (ctrl->switchtype) {
+	case PRI_SWITCH_NI2:
+	case PRI_SWITCH_DMS100:
+	case PRI_SWITCH_LUCENT5E:
+	case PRI_SWITCH_ATT4ESS:
+		break;
+	default:
+		/* ie not supported by this switch type */
+		return -1;
+	}
 	call->changestatus = ie->data[0] & 0x0f;
 	return 0;
 }
@@ -3955,8 +3978,11 @@
 }
 
 static struct ie ies[] = {
+	/* Codeset 0 - Comprehension required ie's with varying support. */
+	{ 1, Q931_IE_SEGMENTED_MSG, "Segmented Message" }, /* Not supported.  Just ie name is available for message decode. */
+	{ 1, Q931_IE_CHANGE_STATUS, "Change Status Information", dump_change_status, receive_change_status, transmit_change_status },
+
 	/* Codeset 0 - Common */
-	{ 1, NATIONAL_CHANGE_STATUS, "Change Status Information", dump_change_status, receive_change_status, transmit_change_status },
 	{ 0, Q931_LOCKING_SHIFT, "Locking Shift", dump_shift },
 	{ 0, Q931_BEARER_CAPABILITY, "Bearer Capability", dump_bearer_capability, receive_bearer_capability, transmit_bearer_capability },
 	{ 0, Q931_CAUSE, "Cause", dump_cause, receive_cause, transmit_cause },
@@ -3988,7 +4014,6 @@
 	{ 1, Q931_IE_FEATURE_ACTIVATE, "Feature Activation" },
 	{ 1, Q931_IE_INFO_REQUEST, "Feature Request" },
 	{ 1, Q931_IE_FEATURE_IND, "Feature Indication" },
-	{ 1, Q931_IE_SEGMENTED_MSG, "Segmented Message" },
 	{ 1, Q931_IE_CALL_IDENTITY, "Call Identity", dump_call_identity },
 	{ 1, Q931_IE_ENDPOINT_ID, "Endpoint Identification" },
 	{ 1, Q931_IE_NOTIFY_IND, "Notification Indicator", dump_notify, receive_notify, transmit_notify },
@@ -4000,7 +4025,6 @@
 	{ 1, Q931_IE_USER_USER, "User-User Information", dump_user_user, receive_user_user, transmit_user_user },
 	{ 1, Q931_IE_ESCAPE_FOR_EXT, "Escape for Extension" },
 	{ 1, Q931_IE_CALL_STATUS, "Call Status" },
-	{ 1, Q931_IE_CHANGE_STATUS, "Change Status Information", dump_change_status, receive_change_status, transmit_change_status },
 	{ 1, Q931_IE_CONNECTED_ADDR, "Connected Address", dump_connected_number, receive_connected_number, transmit_connected_number },
 	{ 1, Q931_IE_CONNECTED_NUM, "Connected Number", dump_connected_number, receive_connected_number, transmit_connected_number },
 	{ 1, Q931_IE_CONNECTED_SUBADDR, "Connected Subaddress", dump_connected_subaddr, receive_connected_subaddr, transmit_connected_subaddr },
@@ -4792,7 +4816,7 @@
 				}
 				return total_res;
 			} else {
-				pri_error(ctrl, "!! Don't know how to add an IE %s (%d)\n", ie2str(ie), ie);
+				pri_error(ctrl, "!! Don't know how to add IE %d (%s)\n", ie, ie2str(ie));
 				return -1;
 			}
 		}




More information about the libpri-commits mailing list