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

markster at lists.digium.com markster at lists.digium.com
Fri Nov 5 15:25:48 CST 2004


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

Modified Files:
	q931.c 
Log Message:
Fix ANI II digits (bug #2788)


Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri/q931.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- q931.c	5 Nov 2004 02:12:02 -0000	1.96
+++ q931.c	5 Nov 2004 20:27:56 -0000	1.97
@@ -1501,11 +1501,11 @@
 		switch(encoding) {
 		case 0:		/* BCD even */
 		case 1:		/* 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);
 			if(!encoding || (idx+1 < len)) {	/* Special handling for 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);
 			}
 			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] >> 4) & 0x0f);
+				value = value * 10 + (ie->data[idx-2] & 0x0f);
 				if(!encoding || (idx+1 < len))	/* Special handling for BCD odd */
-					value = value * 10 + (ie->data[idx-2] & 0x0f);
+					value = value * 10 + ((ie->data[idx-2] >> 4) & 0x0f);
 				break;
 			case 2:		/* IA5 */
 				value = value * 10 + (ie->data[idx-2] - '0');
@@ -2938,8 +2938,7 @@
 			c->ourcallstate = Q931_CALL_STATE_OUTGOING_CALL_PROCEEDING;
 			c->peercallstate = Q931_CALL_STATE_INCOMING_CALL_PROCEEDING;
 		}
-		else
-			pri->ev.proceeding.progress = c->progress;
+		pri->ev.proceeding.progress = c->progress;
 		pri->ev.proceeding.cref = c->cr;
 		pri->ev.proceeding.call = c;
 		return Q931_RES_HAVEEVENT;




More information about the svn-commits mailing list