[libpri-commits] mattf: branch 1.4 r653 - in /branches/1.4: q921.c q931.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Tue Dec 23 15:38:26 CST 2008


Author: mattf
Date: Tue Dec 23 15:38:25 2008
New Revision: 653

URL: http://svn.digium.com/view/libpri?view=rev&rev=653
Log:
Add some additional debug for Q.921 MDL messages as well as fix a bug in RESTART messages on BRI

Modified:
    branches/1.4/q921.c
    branches/1.4/q931.c

Modified: branches/1.4/q921.c
URL: http://svn.digium.com/view/libpri/branches/1.4/q921.c?view=diff&rev=653&r1=652&r2=653
==============================================================================
--- branches/1.4/q921.c (original)
+++ branches/1.4/q921.c Tue Dec 23 15:38:25 2008
@@ -638,6 +638,7 @@
     	direction_tag,
 	h->h.tei,
 	h->h.ea2);
+
 	switch (h->h.data[0] & Q921_FRAMETYPE_MASK) {
 	case 0:
 	case 2:
@@ -728,6 +729,44 @@
 	len - 3);
 		break;
 	};
+
+	if ((h->u.ft == 3) && (h->u.m3 == 0) && (h->u.m2 == 0) && (h->u.data[0] == 0x0f)) {
+		int ri;
+		int tei;
+
+		ri = (h->u.data[1] << 8) | h->u.data[2];
+		tei = (h->u.data[4] >> 1);
+		/* TEI assignment related */
+		switch (h->u.data[3]) {
+		case Q921_TEI_IDENTITY_REQUEST:
+			type = "TEI Identity Request";
+			break;
+		case Q921_TEI_IDENTITY_ASSIGNED:
+			type = "TEI Identity Assigned";
+			break;
+		case Q921_TEI_IDENTITY_CHECK_REQUEST:
+			type = "TEI Identity Check Request";
+			break;
+		case Q921_TEI_IDENTITY_REMOVE:
+			type = "TEI Identity Remove";
+			break;
+		case Q921_TEI_IDENTITY_DENIED:
+			type = "TEI Identity Denied";
+			break;
+		case Q921_TEI_IDENTITY_CHECK_RESPONSE:
+			type = "TEI Identity Check Response";
+			break;
+		case Q921_TEI_IDENTITY_VERIFY:
+			type = "TEI Identity Verify";
+			break;
+		default:
+			type = "Unknown";
+			break;
+		}
+		pri_message(pri, "%c MDL Message: %s (%d)\n", direction_tag, type, h->u.data[3]);
+		pri_message(pri, "%c RI: %d\n", direction_tag, ri);
+		pri_message(pri, "%c Ai: %d E:%d\n", direction_tag, (h->u.data[4] >> 1) & 0x7f, h->u.data[4] & 1);
+	}
 }
 
 static pri_event *q921_dchannel_up(struct pri *pri)

Modified: branches/1.4/q931.c
URL: http://svn.digium.com/view/libpri/branches/1.4/q931.c?view=diff&rev=653&r1=652&r2=653
==============================================================================
--- branches/1.4/q931.c (original)
+++ branches/1.4/q931.c Tue Dec 23 15:38:25 2008
@@ -2985,7 +2985,7 @@
 int q931_restart(struct pri *pri, int channel)
 {
 	struct q931_call *c;
-	c = q931_getcall(pri, 0 | 0x8000, 0);
+	c = q931_getcall(pri, 0 | 0x8000, 1);
 	if (!c)
 		return -1;
 	if (!channel)




More information about the libpri-commits mailing list