aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/examples/code/client.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-08-19 12:36:27 +0200
committerAnders Svensson <[email protected]>2017-08-19 13:15:34 +0200
commitbc86d93f4c842487e1c1ea37ba743d5fe9169c58 (patch)
tree1aa3ef639572889f2e250f8ed1ac9c45ec1a507e /lib/diameter/examples/code/client.erl
parentfa233bb7bc4f37632166c468a0381e695433c318 (diff)
downloadotp-bc86d93f4c842487e1c1ea37ba743d5fe9169c58.tar.gz
otp-bc86d93f4c842487e1c1ea37ba743d5fe9169c58.tar.bz2
otp-bc86d93f4c842487e1c1ea37ba743d5fe9169c58.zip
Use map decoding in example client
As introduced in commit 1b3b64af and adjusted in commit e0603ba1. There's nothing client-specific about it, but keep the record format in the server example for the sake of coverage.
Diffstat (limited to 'lib/diameter/examples/code/client.erl')
-rw-r--r--lib/diameter/examples/code/client.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/diameter/examples/code/client.erl b/lib/diameter/examples/code/client.erl
index 6fb90b1c09..0864919cdd 100644
--- a/lib/diameter/examples/code/client.erl
+++ b/lib/diameter/examples/code/client.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,7 +39,6 @@
-module(client).
-include_lib("diameter/include/diameter.hrl").
--include_lib("diameter/include/diameter_gen_base_rfc6733.hrl").
-export([start/1, %% start a service
start/2, %%
@@ -71,6 +70,7 @@
{'Product-Name', "Client"},
{'Auth-Application-Id', [0]},
{string_decode, false},
+ {decode_format, map},
{application, [{alias, common},
{dictionary, diameter_gen_base_rfc6733},
{module, client_cb}]}]).
@@ -108,9 +108,9 @@ connect(T) ->
call(Name) ->
SId = diameter:session_id(?L(Name)),
- RAR = #diameter_base_RAR{'Session-Id' = SId,
- 'Auth-Application-Id' = 0,
- 'Re-Auth-Request-Type' = 0},
+ RAR = ['RAR' | #{'Session-Id' => SId,
+ 'Auth-Application-Id' => 0,
+ 'Re-Auth-Request-Type' => 0}],
diameter:call(Name, common, RAR, []).
call() ->