Diameter dictionary definition for protocol error answers

Hi,

Is it necessary to have explicit diameter application dictionary definitions for application specific answers (i.e. application specific command code) that have a Result-Code in the 3xxx or 5xxx range, e.g. to have an explicit dictionary definition of the respective answer with the “E” bit set?

What happens if there is no such definition and an application receives an application specific (i.e. application specific command code) answer with such an Result-Code? Is this handled as an “decode error” and the processing is configured with the {answer_errors, callback|report|discard} application_opt() like explained here:

Thanks,

Cristian

1 Like

Hey,

You do not need a separate dictionary entry for “error answers” (answers with the E bit set) or for specific 3xxx/5xxx Result-Code values. Dictionaries define commands/AVPs; the handling of the E bit and whether 3xxx vs. 5xxx are valid in answers follows the common base dictionary in use (RFC 3588 vs. RFC 6733). With the RFC 6733 common dictionary, both 3xxx and 5xxx result codes are valid in error answers; with RFC 3588 only 3xxx are. The stack applies these semantics without requiring dedicated “error answer” command specs.

If an application receives an answer whose application/command cannot be decoded due to missing dictionary support, it’s treated as a decode error. By default, such an incoming answer causes the request process to fail and diameter:call/4 returns {error, failure}—unless you change the behavior with the diameter:application_opt() answer_errors option.

answer_errors controls what happens to answers that contain decode errors:

  • callback - your handle_answer/4 is invoked and the #diameter_packet{errors = [...]} field lists the issues.

  • report - the answer is discarded, no callback, a warning is logged.

  • discard - the answer is silently discarded. (This is the current default.)

So, in short: you don’t need explicit “error answer” dictionary entries for 3xxx/5xxx with the E-bit; but if an incoming answer can’t be decoded because a dictionary is missing/incomplete, it’s handled according to your configured answer_errors policy.

1 Like