libisdn: advanced error reporting, part 1
Just a short update on libisdn (the current name of the OpenZAP ISDN stack), before i fall asleep
This is how IE errors will be reported as of now, if you’ve turned on debug loglevel (i’m only abusing ERR for the pretty red color):
2009-07-07 01:02:25.848853 [ERR] Span:1 Message parser error(s)
=================== Errors reported for message - 5 (0x05) ===================
* IE id: 24 (0x18), name: "N/A", size: 3, offset: 9
[01] error message: Size invalid
diagnostic: Message element is either too small or too large
details: expected size: 3 - 0 octet(s)
octets:
|-{9}-> 18 01 83
---------------------------------------------------------------[ 1 error(s) ]--
I’m going to add some more information (IE / Message names / Call info) in the future. Next step is to change parts of the message decoding function to relax some of the IE checks or, if possible, skip decoding a faulty IE so we can still check them all and report multiple issues in one report. Another thing we can add now is diagnostic information in Cause IEs sent to the other side (e.g. ID of the invalid IE in a message).
UPDATE: Some minor modifications to the output format:
2009-07-07 21:52:55.38692 [DEBUG] Span:1 Q931Umes[Q.931 NT][5]() returned -3002 2009-07-07 21:52:55.38692 [ERR] Span:1 Message parser error(s) =================== Errors reported for message - 5 (0x05) =================== * IE id: 4 (0x04), name: "N/A", size: 5, offset: 4 <01> error message: Not allowed here description: Message element is not allowed in this state/message details: N/A raw octets: [ 04 03 80 90 a3 ] ---------------------------------------------------------------[ 1 error(s) ]--