<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Samuel,<div><br></div><div>I managed to get mine to work to an extent. The one issue was as Anders pointed out the ssl tuple and two other issues:</div><div><br></div><div>1. The dictionaries and IDs in the dictionaries must be all correct, if they don't match, the peer connections don't come up and</div><div>2. The fact that I needed to include a local IP address in the connection configuration. This is really annoying because I am using a VPN to test and this IP address can change at any time, even in the same session. </div><div><br></div><div>I traced the diameter tcp module and had to figure out the negotiation between the applications to get it right.</div><div><br></div><div>Regards,<br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Courier New'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Courier New'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><p style="font-family: Arial; font-size: 11px; line-height: 1.4em; margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; letter-spacing: 1px; color: rgb(0, 105, 141); font-weight: bold; "><span class="Apple-style-span" style="font-weight: normal; ">Rudolph van Graan</span></p></div></div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On 26 Mar 2013, at 14:48, S X <<a href="mailto:erlangprogram@gmail.com">erlangprogram@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div><div>Hi, Rudolph & Anders,<br><br></div>Not sure your problem is resolved or not.<br><br></div>I was able to use the diameter sample code with the local/remote mode, i.e. Start a diameter server in an erts on a pc, and start a diameter client in an erts on another pc (I use virtual machines as pcs here). They can communicate different types of diameter messages without problems.<br>
</div><div><br></div><div>However, when I try to use a diameter client (the sample code) from an erts to connect a diameter server which is not running within an erts (other diameter server not implemented in erlang). It doesn't work(can not build up a connection). I am not quite familiar with the detailed implementation of the erlang diameter library now. I am feeling that the erlang diameter relies on the erlang nodes, which means all the peers are built up only on the erts (distributed erlang runtimes). Does the erlang diameter only work within erlang environment? Or in order to talk to other diameter servers, does it need to write another erlang client using some functions from the erlang diameter library, like encode/decode? The sample client code doesn't work in this situation.<br>
<br></div><div>I am not sure my understanding above is correct or not. Can you provide some guidance?<br><br></div><div>Thanks,<br><br>Samuel<br><br></div><span style="border-collapse:separate;border-spacing:0px"></span></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 21, 2013 at 9:00 AM, Anders Svensson <span dir="ltr"><<a href="mailto:anders.otp@gmail.com" target="_blank">anders.otp@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">One more time to the list ...<br>
<br>
On Thu, Mar 21, 2013 at 12:58 PM, Anders Svensson <<a href="mailto:anders.otp@gmail.com">anders.otp@gmail.com</a>> wrote:<br>
> The problem looks to be that there's an {ssl, false} option being into<br>
> diameter_tcp and then down to gen_tcp, which causes it to raise<br>
> badarg. What OTP release is this? I can't say I recall the example<br>
> code passing this tuple.<br>
><br>
> /Anders, Erlang/OTP<br>
<div><div class="h5">><br>
><br>
><br>
> On Wed, Mar 20, 2013 at 6:08 PM, Rudolph van Graan <<a href="mailto:rvg.mailing@me.com">rvg.mailing@me.com</a>> wrote:<br>
>> Hi there,<br>
>><br>
>> I'm trying to start up the Erlang diameter demo application shipped with<br>
>> Erlang/OTP. The issue is that, no matter what format I try, I can't get the<br>
>> client to connect to a remote diameter server.<br>
>><br>
>> In that example, I started the application as follows:<br>
>><br>
>> 3> diameter:start(), client:start().<br>
>> ok<br>
>><br>
>> 4> client:connect({tcp,{10,151,0,166},{10,249,20,174},3868}).<br>
>> {ok,#Ref<0.0.0.643>}<br>
>><br>
>> 7> client:call().<br>
>> {error,no_connection}<br>
>><br>
>><br>
>> Here, my local IP address is {10,151,0,166} and the remote one is<br>
>> {10,249,20,174}.<br>
>><br>
>> TCP to the server is working:<br>
>><br>
>> telnet 10.249.20.174 3868<br>
>> Trying 10.249.20.174...<br>
>> Connected to 10.249.20.174.<br>
>> Escape character is '^]'.<br>
>><br>
>><br>
>> I traced diameter_tcp and I can see that it is getting a badarg error<br>
>> somewhere:<br>
>><br>
>> (<0.114.0>) returned from diameter_tcp:start/3 -> {ok,<0.115.0>,<br>
>> [{10,151,0,166}]}<br>
>> (<0.116.0>) call<br>
>> diameter_tcp:handle_info({'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg},{monitor,<0.114.0>,<0.115.0>})<br>
>> (<0.116.0>) call<br>
>> diameter_tcp:m({'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg},{monitor,<0.114.0>,<0.115.0>})<br>
>> (<0.116.0>) returned from diameter_tcp:m/2 -> ok<br>
>><br>
>> Does anyone have an idea what I am doing wrong? My feeling is that it has to<br>
>> do with the local ip address. I don't understand why I even need to supply a<br>
>> local IP address and the documentation isn't very clear.<br>
>><br>
>> Thanks,<br>
>><br>
>> Rudolph<br>
>><br>
>><br>
>> Here is the trace:<br>
>><br>
>> (<0.84.0>) call diameter_tcp:start_link({monitor,<0.114.0>,<0.115.0>})<br>
>> (<0.116.0>) call diameter_tcp:init({monitor,<0.114.0>,<0.115.0>})<br>
>> (<0.116.0>) call diameter_tcp:i({monitor,<0.114.0>,<0.115.0>})<br>
>> (<0.116.0>) returned from diameter_tcp:i/1 -> {monitor,<0.114.0>,<0.115.0>}<br>
>> (<0.84.0>) returned from diameter_tcp:start_link/1 -> {ok,<0.116.0>}<br>
>> (<0.115.0>) call diameter_tcp:ssl([{ssl,false},<br>
>> {ip,{10,151,0,166}},<br>
>> {raddr,{10,249,20,174}},<br>
>> {rport,3868},<br>
>> {reuseaddr,true}])<br>
>> (<0.115.0>) call diameter_tcp:ssl_opts([])<br>
>> (<0.115.0>) returned from diameter_tcp:ssl_opts/1 -> false<br>
>> (<0.115.0>) returned from diameter_tcp:ssl/1 -> {false,<br>
>> [{ssl,false},<br>
>> {ip,{10,151,0,166}},<br>
>> {raddr,{10,249,20,174}},<br>
>> {rport,3868},<br>
>> {reuseaddr,true}]}<br>
>> (<0.115.0>) call<br>
>> diameter_tcp:i(connect,#Ref<0.0.0.643>,gen_tcp,<0.114.0>,false,[{ssl,false},<br>
>> {ip,{10,151,0,166}},<br>
>> {raddr,{10,249,20,174}},<br>
>> {rport,3868},<br>
>> {reuseaddr,true}],[])<br>
>> (<0.115.0>) call<br>
>> diameter_tcp:i(connect,#Ref<0.0.0.643>,gen_tcp,<0.114.0>,[{ssl,false},<br>
>> {ip,{10,151,0,166}},<br>
>> {raddr,{10,249,20,174}},<br>
>> {rport,3868},<br>
>> {reuseaddr,true}],[])<br>
>> (<0.115.0>) call diameter_tcp:get_addr([{ip,{10,151,0,166}}],[])<br>
>> (<0.115.0>) call diameter_tcp:addr([{ip,{10,151,0,166}}],[])<br>
>> (<0.115.0>) returned from diameter_tcp:addr/2 -> {10,151,0,166}<br>
>> (<0.115.0>) returned from diameter_tcp:get_addr/2 -> {10,151,0,166}<br>
>> (<0.115.0>) call diameter_tcp:get_addr([{raddr,{10,249,20,174}}],[])<br>
>> (<0.115.0>) call diameter_tcp:addr([{raddr,{10,249,20,174}}],[])<br>
>> (<0.115.0>) returned from diameter_tcp:addr/2 -> {10,249,20,174}<br>
>> (<0.115.0>) returned from diameter_tcp:get_addr/2 -> {10,249,20,174}<br>
>> (<0.115.0>) call diameter_tcp:get_port([{rport,3868}])<br>
>> (<0.115.0>) returned from diameter_tcp:get_port/1 -> 3868<br>
>> (<0.115.0>) call<br>
>> diameter_tcp:gen_opts({10,151,0,166},[{ssl,false},{reuseaddr,true}])<br>
>> (<0.115.0>) returned from diameter_tcp:gen_opts/2 -> [binary,<br>
>> {packet,0},<br>
>> {active,once},<br>
>> {ip,{10,151,0,166}},<br>
>> {ssl,false},<br>
>> {reuseaddr,true}]<br>
>> (<0.82.0>) returned from diameter_tcp:start_link/1 -> {ok,<0.115.0>,<br>
>> [{10,151,0,166}]}<br>
>> (<0.115.0>) call diameter_tcp:connect(gen_tcp,{10,249,20,174},3868,[binary,<br>
>> {packet,0},<br>
>> {active,once},<br>
>> {ip,{10,151,0,166}},<br>
>> {ssl,false},<br>
>> {reuseaddr,true}])<br>
>> (<0.114.0>) returned from diameter_tcp:start/3 -> {ok,<0.115.0>,<br>
>> [{10,151,0,166}]}<br>
>> (<0.116.0>) call<br>
>> diameter_tcp:handle_info({'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg},{monitor,<0.114.0>,<0.115.0>})<br>
>> (<0.116.0>) call<br>
>> diameter_tcp:m({'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg},{monitor,<0.114.0>,<0.115.0>})<br>
>> (<0.116.0>) returned from diameter_tcp:m/2 -> ok<br>
>> (<0.116.0>) call<br>
>> diameter_tcp:x({'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg})<br>
>> (<0.116.0>) call<br>
>> diameter_tcp:terminate({shutdown,{'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg}},{monitor,<0.114.0>,<0.115.0>})<br>
>> (<0.116.0>) returned from diameter_tcp:terminate/2 -> ok<br>
>><br>
>><br>
>><br>
</div></div>>> _______________________________________________<br>
>> erlang-questions mailing list<br>
>> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
>><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>
</blockquote></div><br></div></body></html>