[Asterisk-cvs] libpri pri_q921.h,1.6,1.7 q921.c,1.10,1.11 q931.c,1.49,1.50

markster at lists.digium.com markster at lists.digium.com
Sat Apr 10 21:54:17 CDT 2004


Update of /usr/cvsroot/libpri
In directory mongoose.digium.com:/tmp/cvs-serv24643

Modified Files:
	pri_q921.h q921.c q931.c 
Log Message:
Revert jcdutton's changes which are not subject to be disclaimed


Index: pri_q921.h
===================================================================
RCS file: /usr/cvsroot/libpri/pri_q921.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- pri_q921.h	11 Apr 2004 01:27:11 -0000	1.6
+++ pri_q921.h	11 Apr 2004 01:55:54 -0000	1.7
@@ -148,7 +148,7 @@
 } q921_state;
 
 /* Dumps a *known good* Q.921 packet */
-extern void q921_dump(struct pri *pri, q921_h *h, int len, int showraw, int txrx);
+extern void q921_dump(q921_h *h, int len, int showraw, int txrx);
 
 /* Bring up the D-channel */
 extern void q921_start(struct pri *pri, int now);

Index: q921.c
===================================================================
RCS file: /usr/cvsroot/libpri/q921.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- q921.c	11 Apr 2004 01:27:11 -0000	1.10
+++ q921.c	11 Apr 2004 01:55:54 -0000	1.11
@@ -78,7 +78,7 @@
 #endif
 	/* Just send it raw */
 	if (pri->debug & PRI_DEBUG_Q921_DUMP)
-		q921_dump(pri, h, len, pri->debug & PRI_DEBUG_Q921_RAW, 1);
+		q921_dump(h, len, pri->debug & PRI_DEBUG_Q921_RAW, 1);
 	/* Write an extra two bytes for the FCS */
 	res = write(pri->fd, h, len + 2);
 	if (res != (len + 2)) {
@@ -486,27 +486,13 @@
 	return NULL;
 }
 
-void q921_dump(struct pri *pri, q921_h *h, int len, int showraw, int txrx)
+void q921_dump(q921_h *h, int len, int showraw, int txrx)
 {
 	int x;
         char *type;
 	char direction_tag;
-	char *cmd_rsp;
 	
 	direction_tag = txrx ? '>' : '<';
-        /* If we are PRI_CPE: Use "Command" if we are transmitting and C/R bit is 0.
-         *                    Use "Response" if we are transmitting and C/R bit is 1.
-         *                    Use "Command" if we are receiving and C/R bit is 1.
-         *                    Use "Response" if we are receiving and C/R bit is 0.
-         *
-         * If we are PRI_NETWORK: Use "Command" if we are transmitting and C/R bit is 1.
-         *                        Use "Response" if we are transmitting and C/R bit is 0.
-         *                        Use "Command" if we are receiving and C/R bit is 0.
-         *                        Use "Response" if we are receiving and C/R bit is 1.
-         */
-        cmd_rsp = (((pri->localtype == PRI_CPE)?0:1) ^ txrx ^ h->h.c_r) ? "Command" : "Response";
-
-
 	if (showraw) {
 		char *buf = malloc(len * 3 + 1);
 		int buflen = 0;
@@ -532,13 +518,12 @@
 	}
 	
 	pri_message(
-"%c SAPI: %02d  C/R: %d EA: %d [%s]\n"
+"%c SAPI: %02d  C/R: %d EA: %d\n"
 "%c  TEI: %03d        EA: %d\n", 
     	direction_tag,
 	h->h.sapi, 
 	h->h.c_r,
 	h->h.ea1,
-	cmd_rsp,
     	direction_tag,
 	h->h.tei,
 	h->h.ea2);
@@ -701,7 +686,7 @@
 	len -= 2;
 	
 	if (pri->debug & PRI_DEBUG_Q921_DUMP)
-		q921_dump(pri, h, len, pri->debug & PRI_DEBUG_Q921_RAW, 0);
+		q921_dump(h, len, pri->debug & PRI_DEBUG_Q921_RAW, 0);
 
 	/* Check some reject conditions -- Start by rejecting improper ea's */
 	if (h->h.ea1 || !(h->h.ea2))

Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri/q931.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- q931.c	11 Apr 2004 01:27:11 -0000	1.49
+++ q931.c	11 Apr 2004 01:55:54 -0000	1.50
@@ -1149,7 +1149,7 @@
 
 static void dump_sending_complete(q931_ie *ie, int len, char prefix)
 {
-	pri_message("%c Sending Complete.\n", prefix);
+	pri_message("%c Sending Complete (len=%2d)\n", prefix, ie->len);
 }
 
 static int receive_sending_complete(struct pri *pri, q931_call *call, int msgtype, q931_ie *ie, int len)
@@ -1410,8 +1410,7 @@
 	int x=0, r;
 	c = txrx ? '>' : '<';
 	pri_message("%c Protocol Discriminator: %s (%d)  len=%d\n", c, disc2str(h->pd), h->pd, len);
-	pri_message("%c Call Ref: len=%2d (reference %d/0x%X) (%s)\n",
-		c, h->crlen, q931_cr(h) & 0x7fff, q931_cr(h) & 0x7fff, (q931_cr(h) & 0x8000) ? "Terminator" : "Originator");
+	pri_message("%c Call Ref: len=%2d (reference %d/0x%X) (%s)\n", c, h->crlen, q931_cr(h), q931_cr(h), (h->crv[0] & 0x80) ? "Terminator" : "Originator");
 	/* Message header begins at the end of the call reference number */
 	mh = (q931_mh *)(h->contents + h->crlen);
 	pri_message("%c Message type: %s (%d)\n", c, msg2str(mh->msg), mh->msg);




More information about the svn-commits mailing list