Allow encoding all variation of A-F address digits in ISUP, SCCP, MAP/CAMEL.

git-svn-id: http://yate.null.ro/svn/yate/trunk@6277 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2017-11-01 16:59:05 +00:00
parent fc2ea0387b
commit 03a41bb9ee
3 changed files with 90 additions and 40 deletions

View File

@ -780,20 +780,37 @@ static unsigned char setDigits(SS7MSU& msu, const char* val, unsigned char nai,
unsigned char n = 0;
if (('0' <= c) && (c <= '9'))
n = c - '0';
else if ('.' == c)
n = 15;
else if ('A' == c)
n = 10;
else if ('B' == c)
n = 11;
else if ('C' == c)
n = 12;
else if ('D' == c)
n = 13;
else if ('E' == c)
n = 14;
else
continue;
else switch (c) {
case 'A':
case 'a':
n = 10;
break;
case 'B':
case 'b':
case '*':
n = 11;
break;
case 'C':
case 'c':
case '#':
n = 12;
break;
case 'D':
case 'd':
n = 13;
break;
case 'E':
case 'e':
n = 14;
break;
case 'F':
case 'f':
case '.':
n = 15;
break;
default:
continue;
}
odd = !odd;
if (odd)
buf[len] = n;

View File

@ -639,20 +639,34 @@ static DataBlock* setDigits(const char* val)
unsigned char n = 0;
if (('0' <= c) && (c <= '9'))
n = c - '0';
else if ('.' == c)
n = 15;
else if ('A' == c)
n = 10;
else if ('B' == c)
n = 11;
else if ('C' == c)
n = 12;
else if ('D' == c)
n = 13;
else if ('E' == c)
n = 14;
else
continue;
else switch (c) {
case 'A':
case 'a':
n = 10;
break;
case 'B':
case 'b':
n = 11;
break;
case 'C':
case 'c':
n = 12;
break;
case 'D':
case 'd':
n = 13;
break;
case 'E':
case 'e':
n = 14;
break;
case 'F':
case 'f':
n = 15;
break;
default:
continue;
}
odd = !odd;
if (odd)
buf[len] = n;

View File

@ -1879,18 +1879,37 @@ static void setDigits(DataBlock& data, const char* val, unsigned char nai, int b
unsigned char n = 0;
if (('0' <= c) && (c <= '9'))
n = c - '0';
else if ('.' == c)
n = 15;
else if ('A' == c)
n = 10;
else if ('B' == c)
n = 11;
else if ('C' == c)
n = 12;
else if ('D' == c)
n = 13;
else
continue;
else switch (c) {
case 'A':
case 'a':
n = 10;
break;
case 'B':
case 'b':
case '*':
n = 11;
break;
case 'C':
case 'c':
case '#':
n = 12;
break;
case 'D':
case 'd':
n = 13;
break;
case 'E':
case 'e':
n = 14;
break;
case 'F':
case 'f':
case '.':
n = 15;
break;
default:
continue;
}
odd = !odd;
if (odd)
buf[len] = n;