From 1da8a27f08a890d3ba44ad9707b848ff8afbc1f5 Mon Sep 17 00:00:00 2001
From: Anders Svensson
Date: Sat, 16 Feb 2013 01:14:12 +0100
Subject: Answer 5xxx errors with application_opt() request_errors = answer
RFC 3588 allowed only 3xxx result codes in an answer-message (that is,
an answer that sets the E-bit) while RFC 6733 also allows 5xxx result
codes. Setting request_errors = answer tells diameter to answer 5xxx
errors itself. Returning {answer_message, integer()} from a
handle_request callback allows both 3xxx and 5xxx result codes to be
set. {protocol_error, integer()} is retained for 3xxx result codes.
---
lib/diameter/doc/src/diameter.xml | 33 ++++++++++++++++++++++++---------
lib/diameter/doc/src/diameter_app.xml | 27 ++++++++++++++++++++-------
2 files changed, 44 insertions(+), 16 deletions(-)
(limited to 'lib/diameter/doc')
diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml
index accf21cf98..379e9f0738 100644
--- a/lib/diameter/doc/src/diameter.xml
+++ b/lib/diameter/doc/src/diameter.xml
@@ -188,7 +188,7 @@ Defaults to the value of the alias option if unspecified.
-
Specifies whether or not the &app_pick_peer;
-application callback can modify the application state,
+application callback can modify the application state.
Defaults to false if unspecified.
@@ -226,22 +226,37 @@ question is as if a callback had taken place and returned
Defaults to report if unspecified.
-{request_errors, answer_3xxx|callback}
+{request_errors, answer_3xxx|answer|callback}
-
Determines the manner in which incoming requests are handled when an
-error other than 3007, DIAMETER_APPLICATION_UNSUPPORTED. (With which no
-application callback module can be associated.)
+error other than 3007, DIAMETER_APPLICATION_UNSUPPORTED (which cannot
+be associated with an application callback module), is detected.
-If answer_3xxx then the request is answered by diameter
-without a &app_handle_request; callback taking place if a 3xxx series
-error (protocol errors) is detected.
-If callback then even 3xxx errors result in an application
-&app_handle_request; callback.
+If answer_3xxx then requests are answered without a
+&app_handle_request; callback taking place.
+If answer then even 5xxx errors are answered without a
+callback unless the connection in question has configured the RFC 3588
+common dictionary as noted below.
+If callback then a &app_handle_request; callback always takes
+place and the return value determines the answer sent to the peer.
Defaults to answer_3xxx if unspecified.
+
+
+
+Answers sent by diameter set the E-bit in the Diameter Header.
+Since RFC 3588 allowed only 3xxx result codes in an
+answer-message, answer has the same semantics as
+answer_3xxx if the peer connection in question has configured
+the RFC 3588 common dictionary, diameter_gen_base_rfc3588.
+RFC 6733 allows both 3xxx and 5xxx result codes in an
+answer-message so a connection configured with the RFC 6733
+common dictionary, diameter_gen_base_rfc6733, does
+distinguish between answer_3xxx and answer.
+
diff --git a/lib/diameter/doc/src/diameter_app.xml b/lib/diameter/doc/src/diameter_app.xml
index 5c23c9d683..d0f1b22ebd 100644
--- a/lib/diameter/doc/src/diameter_app.xml
+++ b/lib/diameter/doc/src/diameter_app.xml
@@ -475,6 +475,7 @@ not selected.
| discard
| {eval|eval_packet, Action, PostF}
Reply = {reply, &packet; | &message;}
+ | {answer_message, 3000..3999|5000..5999}
| {protocol_error, 3000..3999}
Opt = &mod_call_opt;
PostF = &mod_evaluable;
@@ -545,22 +546,25 @@ preserved in the outgoing answer, appropriate values otherwise
being set by diameter.
-{protocol_error, 3000..3999}
+{answer_message, 3000..3999|5000..5999}
-
Send an answer message to the peer containing the specified
-protocol error.
+Result-Code.
Equivalent to
{reply, ['answer-message' | Avps]
where Avps sets the Origin-Host, Origin-Realm, the specified
-Result-Code and (if the request sent one) Session-Id AVP's.
+Result-Code and (if the request contained one) Session-Id AVP's.
-Returning a non-3xxx value in a protocol_error tuple
-will cause the request process in question to fail.
+Returning a value other than 3xxx or 5xxx will cause the request
+process in question to fail, as will returning a 5xxx value if the
+peer connection in question has been configured with the RFC 3588
+common dictionary diameter_gen_base_rfc3588.
+(Since RFC 3588 only allows 3xxx values in an answer-message.)
{relay, Opts}
@@ -613,11 +617,20 @@ containing the encoded binary.
The return value is ignored.
+{protocol_error, 3000..3999}
+-
+
+Equivalent to {answer_message, 3000..3999}.
+
+
+
-Note that protocol errors detected by diameter will result in an
-answer message without handle_request/3 being invoked.
+Requests containing errors may be answered by diameter, without a
+callback taking place, depending on the value of the
+&mod_application_opt; request_errors.
+
--
cgit v1.2.3