So this one knocked me for six the other day,
MSISDN AVP 700 / vendor ID 10415, used to advertise the subscriber’s MSISDN in signaling.
I formatted the data as an Octet String, with the MSISDN from the database and moved on my merry way.
Not so fast…
The MSISDN AVP is of type OctetString.
This AVP contains an MSISDN, in international number format as described in ITU-T Rec E.164 , encoded as a TBCD-string, i.e. digits from 0 through 9 are encoded 0000 to 1001;
1111 is used as a filler when there is an odd number of digits; bits 8 to 5 of octet n encode digit 2n; bits 4 to 1 of octet n encode digit 2(n-1)+1.ETSI TS 129 329 / 6.3.2 MSISDN AVP
In practice this means if you have an odd lengthed MSISDN value, we need to add some padding to round it out to an even-lengthed value.
This padding happens between the last and second last digit of the MSISDN (because if we added it at the start we’d break the Country Code, etc) and as MSISDNs are variable length subscriber numbers.
Why it can’t be just after the last digit I don’t really know.
1111 in octet string is best known as the letter F,
Say your MSISDN is 61 4 12345678 (11 digits shown as string) we would need to add octet-string of 1111 (aka F) between the 7 and the 8 at the end, to provide 61 4 1234567f8 (12 digits) in the AVP,
Not that complicated, just kind of confusing.