Fix ANI2 support (bug #2788)

git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@160 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Mark Spencer 2004-11-07 18:58:05 +00:00
parent 8ae7489b5a
commit 56dc30315b

12
q931.c
View File

@ -1501,11 +1501,11 @@ static FUNC_DUMP(dump_generic_digits)
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 @@ static FUNC_RECV(receive_generic_digits)
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');