aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_traffic.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-09-03 13:32:04 +0200
committerAnders Svensson <[email protected]>2017-09-03 13:32:04 +0200
commit87f5f42374b2b4f43fee91ff77f2c739bcf9abf6 (patch)
tree6e258a456ceb69db071df764a974cd0d5116b558 /lib/diameter/src/base/diameter_traffic.erl
parent7c5cf17a3e2e5f870138f4a3efee6fb1ff63a87d (diff)
parent3cba7ec073e449db99173ad07a5652a2026f0aa5 (diff)
downloadotp-87f5f42374b2b4f43fee91ff77f2c739bcf9abf6.tar.gz
otp-87f5f42374b2b4f43fee91ff77f2c739bcf9abf6.tar.bz2
otp-87f5f42374b2b4f43fee91ff77f2c739bcf9abf6.zip
Merge branch 'anders/diameter/Proxy-Info/OTP-9869' into maint
* anders/diameter/Proxy-Info/OTP-9869: Fix handling of Proxy-Info in answers formulated by diameter
Diffstat (limited to 'lib/diameter/src/base/diameter_traffic.erl')
-rw-r--r--lib/diameter/src/base/diameter_traffic.erl20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl
index 9a1c28c42d..c719ef4739 100644
--- a/lib/diameter/src/base/diameter_traffic.erl
+++ b/lib/diameter/src/base/diameter_traffic.erl
@@ -1032,15 +1032,15 @@ answer_message(RC,
origin_realm = {OR,_}},
#diameter_packet{avps = Avps,
errors = Es}) ->
- {Code, _, Vid} = Dict0:avp_header('Session-Id'),
['answer-message', {'Origin-Host', OH},
{'Origin-Realm', OR},
- {'Result-Code', RC}]
- ++ session_id(Code, Vid, Avps)
- ++ failed_avp(RC, Es).
+ {'Result-Code', RC}
+ | session_id(Dict0, Avps)
+ ++ failed_avp(RC, Es)
+ ++ proxy_info(Dict0, Avps)].
-session_id(Code, Vid, Avps)
- when is_list(Avps) ->
+session_id(Dict0, Avps) ->
+ {Code, _, Vid} = Dict0:avp_header('Session-Id'),
try
#diameter_avp{data = Bin} = find_avp(Code, Vid, Avps),
[{'Session-Id', [Bin]}]
@@ -1058,6 +1058,14 @@ failed_avp(RC, [_ | Es]) ->
failed_avp(_, [] = No) ->
No.
+proxy_info(Dict0, Avps) ->
+ {Code, _, Vid} = Dict0:avp_header('Proxy-Info'),
+ [{'AVP', [A#diameter_avp{value = undefined}
+ || [#diameter_avp{code = C, vendor_id = I} = A | _]
+ <- Avps,
+ C == Code,
+ I == Vid]}].
+
%% find_avp/3
%% Grouped ...