<div dir="ltr"><div>Tim,</div><div> <br></div><div>I didn't spot anything crazy by quickly scanning through these.</div>How does your pick_peer callback look like?<div class="gmail_extra"><br></div><div class="gmail_extra">
Ferenc<br><br><div class="gmail_quote">On 13 September 2013 15:43, Tim Watson <span dir="ltr"><<a href="mailto:watson.timothy@gmail.com" target="_blank">watson.timothy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Ferenc,<br>
<br>
Thanks for the quick reply.<br>
<div class="im"><br>
On 13 Sep 2013, at 11:41, Ferenc Holzhauser wrote:<br>
> For {error, no_service} of your own code: what does diameter:services() say?<br>
> If diameter:start_service(...) worked then you should have something in that list that is called ?NAME.<br>
> If it is not the case then check if you called start_service with the correct data.<br>
> If you certainly did then I'm guessing rb is going to help out with some errors to debug.<br>
><br>
> Generally diameter:service_info(yourservicenamehere, all) gives good information for troubleshooting when your service is running.<br>
><br>
<br>
</div>Except that I can't tell what I'm supposed to be looking for. I'm guessing some AVP isn't set right, but I'm not sure which. Both the client and the server nodes seem to contain the relevant [client] and [XX_service] entries when the tests execute, but I still get no_service when attempting to call. The test suite is executing this:<br>

<br>
    Sid = diameter:session_id(atom_to_list(client)),<br>
    ACR = #diameter_base_ACR{ 'Session-Id' = Sid,<br>
                              'Accounting-Record-Type' = ?'DIAMETER_BASE_ACCOUNTING-RECORD-TYPE_EVENT_RECORD',<br>
                              'Accounting-Record-Number' = 1 },<br>
    {ok, #diameter_base_ACA{}} = diameter:call(demo_diameter_test_client, client, ACR, []),<br>
<br>
The client has the following callback enabled:<br>
<br>
prepare_request(#diameter_packet{ msg = Req }, _,<br>
                {_, #diameter_caps{ origin_host = {OH, DH},<br>
                                    origin_realm = {OR, DR} }}) -><br>
  {send, Req#diameter_base_ACR{ 'Origin-Host' = OH,<br>
                                'Origin-Realm' = OR,<br>
                                'Destination-Realm' = DR }}.<br>
<br>
If I start the server and client manually, instead of the no_service error, I get {error, no_connection}:<br>
<br>
(demo@iske)1><br>
(demo@iske)1> diameter:service_info(demo_diameter_service, all).<br>
[{capabilities,[{'Origin-Host',"<a href="http://service.example.com" target="_blank">service.example.com</a>"},<br>
                {'Origin-Realm',"<a href="http://example.com" target="_blank">example.com</a>"},<br>
                {'Vendor-Id',193},<br>
                {'Product-Name',"Server"},<br>
                {'Origin-State-Id',[]},<br>
                {'Host-IP-Address',[]},<br>
                {'Supported-Vendor-Id',[]},<br>
                {'Auth-Application-Id',[0]},<br>
                {'Inband-Security-Id',[]},<br>
                {'Acct-Application-Id',[]},<br>
                {'Vendor-Specific-Application-Id',[]},<br>
                {'Firmware-Revision',[]}]},<br>
 {applications,[[{alias,demo_diameter_service},<br>
                 {dictionary,diameter_gen_base_rfc3588},<br>
                 {module,[diameter_callback,<br>
                          {diameter_callback,undefined,undefined,undefined,undefined,<br>
                                             undefined,undefined,undefined,undefined,undefined,[]}]},<br>
                 {init_state,demo_diameter_service},<br>
                 {id,0},<br>
                 {mutable,false},<br>
                 {options,[{answer_errors,report},<br>
                           {request_errors,answer_3xxx}]}]]},<br>
 {transport,[[{ref,#Ref<0.0.0.769>},<br>
              {type,listen},<br>
              {options,[{transport_module,diameter_tcp},<br>
                        {transport_config,[{reuseaddr,true},<br>
                                           {ip,{127,0,0,1}},<br>
                                           {port,3868}]}]},<br>
              {accept,[[{watchdog,{<0.245.0>,<br>
                                   {1379,78445,351797},<br>
                                   initial}}]]},<br>
              {statistics,[]}]]},<br>
 {pending,[]},<br>
 {options,[{sequence,{0,32}},<br>
           {share_peers,false},<br>
           {use_shared_peers,false},<br>
           {restrict_connections,nodes}]}]<br>
(demo@iske)2> code:add_patha("/Users/t4/work/spikes/diameter-demo/test/ebin").<br>
true<br>
(demo@iske)3> demo_diameter_test_client:start().<br>
ok<br>
(demo@iske)4> diameter:services().<br>
[demo_diameter_service,client]<br>
(demo@iske)5> diameter:service_info(client, all).<br>
[{capabilities,[{'Origin-Host',"<a href="http://client.example.com" target="_blank">client.example.com</a>"},<br>
                {'Origin-Realm',"<a href="http://example.com" target="_blank">example.com</a>"},<br>
                {'Vendor-Id',0},<br>
                {'Product-Name',"Client"},<br>
                {'Origin-State-Id',[]},<br>
                {'Host-IP-Address',[]},<br>
                {'Supported-Vendor-Id',[]},<br>
                {'Auth-Application-Id',[0]},<br>
                {'Inband-Security-Id',[]},<br>
                {'Acct-Application-Id',[]},<br>
                {'Vendor-Specific-Application-Id',[]},<br>
                {'Firmware-Revision',[]}]},<br>
 {applications,[[{alias,client},<br>
                 {dictionary,diameter_gen_base_rfc3588},<br>
                 {module,[demo_diameter_test_client]},<br>
                 {init_state,client},<br>
                 {id,0},<br>
                 {mutable,false},<br>
                 {options,[{answer_errors,report},<br>
                           {request_errors,answer_3xxx}]}]]},<br>
 {transport,[]},<br>
 {pending,[]},<br>
 {options,[{sequence,{0,32}},<br>
           {share_peers,false},<br>
           {use_shared_peers,false},<br>
           {restrict_connections,nodes}]}]<br>
(demo@iske)6 demo_diameter_test_client:connect().<br>
{ok,#Ref<0.0.0.1340>}<br>
(demo@iske)7> diameter:service_info(client, all).<br>
[{capabilities,[{'Origin-Host',"<a href="http://client.example.com" target="_blank">client.example.com</a>"},<br>
                {'Origin-Realm',"<a href="http://example.com" target="_blank">example.com</a>"},<br>
                {'Vendor-Id',0},<br>
                {'Product-Name',"Client"},<br>
                {'Origin-State-Id',[]},<br>
                {'Host-IP-Address',[]},<br>
                {'Supported-Vendor-Id',[]},<br>
                {'Auth-Application-Id',[0]},<br>
                {'Inband-Security-Id',[]},<br>
                {'Acct-Application-Id',[]},<br>
                {'Vendor-Specific-Application-Id',[]},<br>
                {'Firmware-Revision',[]}]},<br>
 {applications,[[{alias,client},<br>
                 {dictionary,diameter_gen_base_rfc3588},<br>
                 {module,[demo_diameter_test_client]},<br>
                 {init_state,client},<br>
                 {id,0},<br>
                 {mutable,false},<br>
                 {options,[{answer_errors,report},<br>
                           {request_errors,answer_3xxx}]}]]},<br>
 {transport,[[{ref,#Ref<0.0.0.1340>},<br>
              {type,connect},<br>
              {options,[{reconnect_timer,5000},<br>
                        {transport_module,diameter_tcp},<br>
                        {transport_config,[{raddr,{127,0,0,1}},<br>
                                           {rport,3868},<br>
                                           {reuseaddr,true},<br>
                                           {ip,{127,0,0,1}}]}]},<br>
              {watchdog,{<0.303.0>,{1379,78639,682458},okay}},<br>
              {peer,{<0.304.0>,{1379,78639,686181}}},<br>
              {apps,[{0,client}]},<br>
              {caps,[{origin_host,{"<a href="http://client.example.com" target="_blank">client.example.com</a>",<br>
                                   "<a href="http://service.example.com" target="_blank">service.example.com</a>"}},<br>
                     {origin_realm,{"<a href="http://example.com" target="_blank">example.com</a>","<a href="http://example.com" target="_blank">example.com</a>"}},<br>
                     {host_ip_address,{[{127,0,0,1}],[{127,0,0,1}]}},<br>
                     {vendor_id,{0,193}},<br>
                     {product_name,{"Client","Server"}},<br>
                     {origin_state_id,{[],[]}},<br>
                     {supported_vendor_id,{[],[]}},<br>
                     {auth_application_id,{[0],[0]}},<br>
                     {inband_security_id,{[],[]}},<br>
                     {acct_application_id,{[],[]}},<br>
                     {vendor_specific_application_id,{[],...}},<br>
                     {firmware_revision,{...}},<br>
                     {avp,...}]},<br>
              {port,[{owner,<0.306.0>},<br>
                     {module,diameter_tcp},<br>
                     {socket,{{127,0,0,1},53123}},<br>
                     {peer,{{127,0,0,1},3868}},<br>
                     {statistics,[{recv_oct,136},<br>
                                  {recv_cnt,1},<br>
                                  {recv_max,136},<br>
                                  {recv_avg,136},<br>
                                  {recv_dvi,...},<br>
                                  {...}|...]}]},<br>
              {statistics,[{{{0,257,0},recv},1},{{{0,257,1},send},1}]}]]},<br>
 {pending,[]},<br>
 {options,[{sequence,{0,32}},<br>
           {share_peers,false},<br>
           {use_shared_peers,false},<br>
           {restrict_connections,nodes}]}]<br>
(demo@iske8> diameter:service_info(demo_diameter_service, all).<br>
[{capabilities,[{'Origin-Host',"<a href="http://service.example.com" target="_blank">service.example.com</a>"},<br>
                {'Origin-Realm',"<a href="http://example.com" target="_blank">example.com</a>"},<br>
                {'Vendor-Id',193},<br>
                {'Product-Name',"Server"},<br>
                {'Origin-State-Id',[]},<br>
                {'Host-IP-Address',[]},<br>
                {'Supported-Vendor-Id',[]},<br>
                {'Auth-Application-Id',[0]},<br>
                {'Inband-Security-Id',[]},<br>
                {'Acct-Application-Id',[]},<br>
                {'Vendor-Specific-Application-Id',[]},<br>
                {'Firmware-Revision',[]}]},<br>
 {applications,[[{alias,demo_diameter_service},<br>
                 {dictionary,diameter_gen_base_rfc3588},<br>
                 {module,[diameter_callback,<br>
                          {diameter_callback,undefined,undefined,undefined,undefined,<br>
                                             undefined,undefined,undefined,undefined,undefined,[]}]},<br>
                 {init_state,demo_diameter_service},<br>
                 {id,0},<br>
                 {mutable,false},<br>
                 {options,[{answer_errors,report},<br>
                           {request_errors,answer_3xxx}]}]]},<br>
 {transport,[[{ref,#Ref<0.0.0.769>},<br>
              {type,listen},<br>
              {options,[{transport_module,diameter_tcp},<br>
                        {transport_config,[{reuseaddr,true},<br>
                                           {ip,{127,0,0,1}},<br>
                                           {port,3868}]}]},<br>
              {accept,[[{watchdog,{<0.308.0>,<br>
                                   {1379,78639,684566},<br>
                                   initial}}],<br>
                       [{watchdog,{<0.245.0>,{1379,78445,351797},okay}},<br>
                        {peer,{<0.246.0>,{1379,78639,685678}}},<br>
                        {apps,[{0,demo_diameter_service}]},<br>
                        {caps,[{origin_host,{"<a href="http://service.example.com" target="_blank">service.example.com</a>",<br>
                                             "<a href="http://client.example.com" target="_blank">client.example.com</a>"}},<br>
                               {origin_realm,{"<a href="http://example.com" target="_blank">example.com</a>","<a href="http://example.com" target="_blank">example.com</a>"}},<br>
                               {host_ip_address,{[{127,0,...}],[{127,...}]}},<br>
                               {vendor_id,{193,0}},<br>
                               {product_name,{"Server",[...]}},<br>
                               {origin_state_id,{[],...}},<br>
                               {supported_vendor_id,{...}},<br>
                               {auth_application_id,...},<br>
                               {...}|...]},<br>
                        {port,[{owner,<0.255.0>},<br>
                               {module,diameter_tcp},<br>
                               {socket,{{127,0,...},3868}},<br>
                               {peer,{{127,...},53123}},<br>
                               {statistics,[{...}|...]}]}]]},<br>
              {statistics,[{{{0,257,0},send},1},{{{0,257,1},recv},1}]}]]},<br>
 {pending,[]},<br>
 {options,[{sequence,{0,32}},<br>
           {share_peers,false},<br>
           {use_shared_peers,false},<br>
           {restrict_connections,nodes}]}]<br>
(demo@iske)9> demo_diameter_test_client:call().<br>
{error,no_connection}<br>
<br>
<br>
</blockquote></div><br></div></div>