[erlang-questions] Question about basic use of diameter

Anders Svensson anders.otp@REDACTED
Fri Sep 13 17:27:34 CEST 2013


[Adding the list Cc I bungled in my reply below.]

One more comment ...

On Fri, Sep 13, 2013 at 5:13 PM, Anders Svensson <anders.otp@REDACTED> wrote:
> Hi Tim.
>
> On Fri, Sep 13, 2013 at 4:42 PM, Tim Watson <watson.timothy@REDACTED> wrote:
>> Hi Anders,
>>
>> On 13 Sep 2013, at 12:02, Anders Svensson wrote:
>
>> 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-'...
>
> Your compilation of the example code looks to have included a
> different version of the diameter hrls than the diameter itself:
> diameter and the client have different ideas of the definition of
> record diameter_base_ACR. Could you have compiled the example code
> with something other than the R16B01 you've run it with?

Another explanation would be having included hrls you've generated
from a modified dictionary.

Anders


>
> This error is what causes the connection to be dropped.
>
> Anders
>
>
>
>
>> {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
>>



More information about the erlang-questions mailing list