[Asterisk-cvs] libpri q931.c,1.97,1.98

markster at lists.digium.com markster at lists.digium.com
Sun Nov 7 13:56:21 CST 2004


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

Modified Files:
	q931.c 
Log Message:
Fix ANI2 support (bug #2788)


Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri/q931.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- q931.c	5 Nov 2004 20:27:56 -0000	1.97
+++ q931.c	7 Nov 2004 18:58:05 -0000	1.98
@@ -1501,11 +1501,11 @@
 		switch(encoding) {
 		case 0:		/* BCD even */
 		case 1:		/* BCD odd */
-			pri_message("%d", ie->data[idx-2] & 0x0f);
-			value = value * 10 + (ie->data[idx-2] & 0x0f);
+			pri_message("%d", (ie->data[idx-2] >> 4) & 0x0f);
+			value = value * 10 + ((ie->data[idx-2] >> 4) & 0x0f);
 			if(!encoding || (idx+1 < len)) {	/* Special handling for BCD odd */
-				pri_message("%d", (ie->data[idx-2] >> 4) & 0x0f);
-				value = value * 10 + ((ie->data[idx-2] >> 4) & 0x0f);
+				pri_message("%d", ie->data[idx-2] & 0x0f);
+				value = value * 10 + (ie->data[idx-2] & 0x0f);
 			}
 			break;
 		case 2:		/* IA5 */
@@ -1551,9 +1551,9 @@
 			switch(encoding) {
 			case 0:		/* BCD even */
 			case 1:		/* BCD odd */
-				value = value * 10 + (ie->data[idx-2] & 0x0f);
+				value = value * 10 + ((ie->data[idx-2] >> 4) & 0x0f);
 				if(!encoding || (idx+1 < len))	/* Special handling for BCD odd */
-					value = value * 10 + ((ie->data[idx-2] >> 4) & 0x0f);
+					value = value * 10 + (ie->data[idx-2] & 0x0f);
 				break;
 			case 2:		/* IA5 */
 				value = value * 10 + (ie->data[idx-2] - '0');




More information about the svn-commits mailing list