Description of the binary field is:
Caller number, expressed with compressed BCD code, and the surplus bits are filled with “0xF”
Python 3.x has this built-in for bytes objects.
>>> c = b'3\x00\x02\x05\x15\x13GO\xff\xff\xff\xff\xff\xff\xff\xff' >>> c.hex() '330002051513474fffffffffffffffff'
And back:
>>> c = "9F1A020840" >>> bytes.fromhex(c) b'\x9f\x1a\x02\x08@'