[erlang-questions] Question about basic use of diameter

Tim Watson watson.timothy@REDACTED
Fri Sep 13 16:42:37 CEST 2013


Hi Anders,

On 13 Sep 2013, at 12:02, Anders Svensson wrote:
> 
> The diameter application doesn't care. All that RFC 6733 requires of
> Origin-Host is that it be unique within a single host (6.3), while
> Origin-Realm is expected to be related to the DNS domain name (6.4,
> 1.2; could be clearer). Using the physical host/domain is fairly
> typical it seems.
> 

Ok fair enough.

>> After attempts to write and test a basic relay kept failing, I tried using the server.erl and client.erl from the diameter application's ./examples/code directory and things don't seem to be working properly:
> 
[snip]
> You haven't told the example server to start listening: you need to
> call server:listen(tcp) as well. Here's how it should look:
> 
>  6> up: <0.56.0>
>  client:call().
>  {ok,{diameter_base_RAA,"client;1440573120;1;nonode@REDACTED",
>                         2001,"server.example.com","example.com",[],[],[],[],[],
>                         [],[],[],[],[]}}
> 
[snip]

Oops, I forgot about that (when using the example client/server code), but the peer always goes down immediately after coming up:

1> diameter:start().
ok
2> server:start().
ok
3> server:listen(tcp).
{ok,#Ref<0.0.0.53>}
4> client:start().
ok
5> client:connect(tcp).
{ok,#Ref<0.0.0.99>}
6> up: <0.55.0>
down: <0.55.0>

6> 
6>      

It doesn't do that when I start the client from another shell though - then it connects fine! - but the ACR being passed across the wire doesn't seem to encode properly - I assumed that because both the client and server application's are configured with `{dictionary, ?DIAMETER_DICT_COMMON}' that it wouldn't be necessary to do anything "special" to get them to encode/decode properly...

1> diameter:start().
ok
2> client:start().
ok
3> client:connect(tcp).
{ok,#Ref<0.0.0.53>}
4> client:call().

=ERROR REPORT==== 13-Sep-2013::15:02:02 ===
Error in process <0.63.0> with exit value: {{badrecord,diameter_base_ACR},[{client_cb,prepare_request,3,[{file,"src/client_cb.erl"},{line,55}]},{diameter_traffic,send_request,6,[{file,"base/diameter_traffic.erl"},{line,1195}]},{diameter_traffic,'-send_request/4-fun-0-'... 

{error,encode}
 

> 
> Haven't seen this one but give the above a try for starters.
> 

Just to clarify, this is an untouched version of server.erl, server_cb.erl, client.erl and client_cb.erl that I'm experimenting with - just to try and figure out what's going awry with my own code. In my own tests, calls to diameter:service/0 show the client and server configured on their respective nodes, and the server has run diameter:add_transport(Name, {listen, server(T)}) (and the client, connect(...) and so on) during initialisation. I shall try to make a bit more progress before taking up any more of your time anyway.

Thanks!

Tim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130913/f9c68228/attachment.htm>


More information about the erlang-questions mailing list