[libpri-commits] mattf: trunk r531 - /trunk/q921.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Fri Feb 29 16:30:18 CST 2008


Author: mattf
Date: Fri Feb 29 16:30:17 2008
New Revision: 531

URL: http://svn.digium.com/view/libpri?view=rev&rev=531
Log:
Add support for responding to TEI requests (Q.921 PC23.x)

Modified:
    trunk/q921.c

Modified: trunk/q921.c
URL: http://svn.digium.com/view/libpri/trunk/q921.c?view=diff&rev=531&r1=530&r2=531
==============================================================================
--- trunk/q921.c (original)
+++ trunk/q921.c Fri Feb 29 16:30:17 2008
@@ -110,7 +110,7 @@
 	f->data[2] = ri & 0xff;
 	f->data[3] = message;
 	f->data[4] = (ai << 1) | 1;
-//	if (pri->debug & PRI_DEBUG_Q921_STATE)
+	if (pri->debug & PRI_DEBUG_Q921_STATE)
 		pri_message(pri, "Sending TEI management message %d, TEI=%d\n", message, ai);
 	q921_transmit(pri, (q921_h *)f, 8);
 	free(f);
@@ -821,6 +821,18 @@
 			return NULL;
 		}
 		pri->q921_state = Q921_TEI_ASSIGNED;
+		break;
+	case Q921_TEI_IDENTITY_CHECK_REQUEST:
+		/* We're assuming one TEI per PRI in TE PTMP mode */
+
+		/* If no subchannel (TEI) ignore */
+		if (!pri->subchannel)
+			return NULL;
+
+		/* If it's addressed to the group TEI or to our TEI specifically, we respond */
+		if ((tei == Q921_TEI_GROUP) || (tei == pri->subchannel->tei))
+			q921_send_tei(pri, Q921_TEI_IDENTITY_CHECK_RESPONSE, random() % 65535, pri->subchannel->tei, 0);
+
 		break;
 	}
 	return NULL;	/* Do we need to return something??? */




More information about the libpri-commits mailing list