diff options
author | Anders Svensson <[email protected]> | 2012-08-31 17:46:01 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2012-08-31 17:46:01 +0200 |
commit | 258f6b8df56d113b100b55e9e124099f13014935 (patch) | |
tree | e7a65aa94bb54f5a1aff10391f9ae7b4f22687a9 /lib/diameter/src/base/diameter_service.erl | |
parent | 8400bd1c26722b1ee01152ed351c6620444c0e32 (diff) | |
parent | 0f99881f5e5858ece3e3353663917a39301e1a93 (diff) | |
download | otp-258f6b8df56d113b100b55e9e124099f13014935.tar.gz otp-258f6b8df56d113b100b55e9e124099f13014935.tar.bz2 otp-258f6b8df56d113b100b55e9e124099f13014935.zip |
Merge branch 'anders/diameter/avp_errors/OTP-10202' into maint
* anders/diameter/avp_errors/OTP-10202:
Add a testcase
Fix answer-message blunder
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_service.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index 54594db292..725cccda1e 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -2617,9 +2617,15 @@ str(T) -> %% question. The third form allows messages to be sent as is, without %% a dictionary, which is needed in the case of relay agents, for one. +%% Messages will be header/avps list as a relay and the only AVP's we +%% look for are in the common dictionary. This is required since the +%% relay dictionary doesn't inherit the common dictionary (which maybe +%% it should). get_avp_value(?RELAY, Name, Msg) -> get_avp_value(?BASE, Name, Msg); +%% Message sent as a header/avps list, probably a relay case but not +%% necessarily. get_avp_value(Dict, Name, [#diameter_header{} | Avps]) -> try {Code, _, VId} = Dict:avp_header(Name), @@ -2633,6 +2639,7 @@ get_avp_value(Dict, Name, [#diameter_header{} | Avps]) -> undefined end; +%% Outgoing message as a name/values list. get_avp_value(_, Name, [_MsgName | Avps]) -> case lists:keyfind(Name, 1, Avps) of {_, V} -> @@ -2641,6 +2648,11 @@ get_avp_value(_, Name, [_MsgName | Avps]) -> undefined end; +%% Record might be an answer message in the common dictionary. +get_avp_value(Dict, Name, Rec) + when Dict /= ?BASE, element(1, Rec) == 'diameter_base_answer-message' -> + get_avp_value(?BASE, Name, Rec); + %% Message is typically a record but not necessarily: diameter:call/4 %% can be passed an arbitrary term. get_avp_value(Dict, Name, Rec) -> |