<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">I found out the problem why the connectivity is failing.  The timing of exchanging the ICE candidates is very important.  As I was manually copy pasting the generated ICE ufrag/password/relay candidates between the two shells one after another, it was getting timed out.  But, if the candidates are copy/pasted on the two shells pretty fast, the connection is getting through and the data is getting relayed through the TURN server.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">But, I have two questions about that..</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">1) I did not see any timeout happening when the host/srflx candidates get selected, but only for relay candidates.  Is it correct?</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">2) Is there any way to configure the timeout before declaring the stream/component as failed?  Is there any settings for that?</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">Anand</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 17 May 2016 at 16:31, Anand Sivaram <span dir="ltr"><<a href="mailto:aspnair@gmail.com" target="_blank">aspnair@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">Hello All,</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">In order to verify the TURN functionality, I modified the simple-example code as given below.  I setup coturn in one of the AWS servers with a username and password.</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">1. Just before calling nice_agent_gather_candidates(), included the following </font><span style="font-family:monospace,monospace">code.</span></div><div class="gmail_default"><font face="monospace, monospace">nice_agent_set_relay_info(agent, stream_id, 1, turn_addr, turn_port,</font></div><div class="gmail_default"><font face="monospace, monospace">    COTURN_LOGIN, COTURN_PASSWORD, NICE_RELAY_TYPE_TURN_UDP)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">With this change, I could see relay along with host and srflx candidates in the list of gathered candidates, but still it was using host/srflx.</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">2. In order to force using relay, I made the following change in print_local_data() to print only the relay candidates.</font></div><div class="gmail_default"><font face="monospace, monospace">for (item = cands; item; item = item->next) {</font></div><div class="gmail_default"><font face="monospace, monospace">  NiceCandidate *c = (NiceCandidate *)item->data;</font></div><div class="gmail_default"><font face="monospace, monospace">  if((c->type == NICE_CANDIDATE_TYPE_HOST) || (c->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE)) {</font></div><div class="gmail_default"><font face="monospace, monospace">      continue;  //do not print these candidates</font></div><div class="gmail_default"><font face="monospace, monospace">  }</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">Then, I copy pasted the generated data between the two simple-example instances as I did previously.</font></div><div class="gmail_default"><font face="monospace, monospace">But, this time I am getting the following message as the connectivity check failed.</font></div><div class="gmail_default"><font face="monospace, monospace">SIGNAL: state changed stream 1 comp 1 connecting[2]</font></div><div class="gmail_default"><font face="monospace, monospace">SIGNAL: state changed stream 1 comp 1 failed[5]</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">I captured all messages using wireshark.  Interestingly both Allocation Success Response and CreatePermission Success Response are coming back from the TURN server.  Also, libnice is sending a few Send Indication to the relay address of the other party.  But, after this libnice is sending a Refresh Request with a lifetime = 0 and the communication with TURN server is closed down.</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">Any idea how to proceed?</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">Thanks and Regards</font></div><span class="HOEnZb"><font color="#888888"><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">Anand</font></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><br></div></font></span></div></div>
</blockquote></div><br></div>