aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2013-11-29 16:54:20 +0100
committerAnders Svensson <[email protected]>2013-11-29 16:54:20 +0100
commit1c44eeb08945839f8ef3f39455ca081d039778b1 (patch)
tree597962354009123ca0ec19cfd258b7c9c3d89cb0
parent4e8172810e3e87cdc2d824453134ea6b3f99f1a2 (diff)
parent8b7faf3fecf7a8204b0d941713150adca4d20a7d (diff)
downloadotp-1c44eeb08945839f8ef3f39455ca081d039778b1.tar.gz
otp-1c44eeb08945839f8ef3f39455ca081d039778b1.tar.bz2
otp-1c44eeb08945839f8ef3f39455ca081d039778b1.zip
Merge branch 'maint'
-rw-r--r--lib/diameter/src/base/diameter_capx.erl19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/diameter/src/base/diameter_capx.erl b/lib/diameter/src/base/diameter_capx.erl
index 1a931a9854..93548ecafd 100644
--- a/lib/diameter/src/base/diameter_capx.erl
+++ b/lib/diameter/src/base/diameter_capx.erl
@@ -168,12 +168,13 @@ ipaddr(A) ->
%%
%% Build a CER record to send to a remote peer.
-%% Use the fact that diameter_caps has the same field names as CER.
+%% Use the fact that diameter_caps is expected to have the same field
+%% names as CER.
bCER(#diameter_caps{} = Rec, Dict) ->
- Values = lists:zip(Dict:'#info-'(diameter_base_CER, fields),
+ RecName = Dict:msg2rec('CER'),
+ Values = lists:zip(Dict:'#info-'(RecName, fields),
tl(tuple_to_list(Rec))),
- Dict:'#new-'(diameter_base_CER, [{K, map(K, V, Dict)}
- || {K,V} <- Values]).
+ Dict:'#new-'(RecName, [{K, map(K, V, Dict)} || {K,V} <- Values]).
%% map/3
%%
@@ -186,8 +187,9 @@ bCER(#diameter_caps{} = Rec, Dict) ->
%% since the corresponding dictionaries expect different values for a
%% 'Vendor-Id': a list for 3588, an integer for 6733.
-map('Vendor-Specific-Application-Id', L, Dict) ->
- Rec = Dict:'#new-'('diameter_base_Vendor-Specific-Application-Id', []),
+map('Vendor-Specific-Application-Id' = T, L, Dict) ->
+ RecName = Dict:name2rec(T),
+ Rec = Dict:'#new-'(RecName, []),
Def = Dict:'#get-'('Vendor-Id', Rec),
[vsa(V, Def) || V <- L];
map(_, V, _) ->
@@ -342,8 +344,9 @@ cs(LS, RS) ->
%% CER is a subset of CEA, the latter adding Result-Code and a few
%% more AVP's.
cea_from_cer(CER, Dict) ->
- [diameter_base_CER | Values] = Dict:'#get-'(CER),
- Dict:'#set-'(Values, Dict:'#new-'(diameter_base_CEA)).
+ RecName = Dict:msg2rec('CEA'),
+ [_ | Values] = Dict:'#get-'(CER),
+ Dict:'#set-'(Values, Dict:'#new-'(RecName)).
%% rCEA/3