<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 12pt; ">Hi,</div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 12pt; "><br></div><div style="background-color: transparent; "><font face="'Courier New', courier, monaco, monospace, sans-serif">My video call application using libnice and turn server for symmetric NAT traversal.</font></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal; "><font face="'Courier New', courier, monaco, monospace, sans-serif">In some case, I can gather relay server for both video and audio like below sdp:</font></div><div style="color: rgb(0, 0, 0); font-size: 16px;
 font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal; "><font face="'Courier New', courier, monaco, monospace, sans-serif"><br></font></div><div style="background-color: transparent; "><font face="'Courier New', courier, monaco, monospace, sans-serif"><div style="background-color: transparent; "><span style="font-size: 13px; ">v=0</span></div><div style="background-color: transparent; "><span style="font-size: small;">o=- 2184017736251815492 8580066925214433698 IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">s=-</span></div><div style="background-color: transparent; "><span style="font-size: small;">t=0 0</span></div><div style="background-color: transparent; "><span style="font-size: small;">m=video 33993 RTP/AVP 98</span></div><div style="background-color: transparent; "><span style="font-size: small;">c=IN IP4
 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtpmap:98 theora/90000</span></div><div style="background-color: transparent; "><span style="font-size: 13px; ">a=candidate:1 1 UDP 2013266431 192.168.1.41 33993 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:2 1 UDP 2013266431 192.168.2.14 39193 typ host</span></div><div style="background-color: transparent; "><span style="font-size: 13px; ">a=candidate:3 1 UDP 1677721855 210.245.54.74 60885 typ srflx</span></div><div style="background-color: transparent; "><span style="font-size: 13px; ">a=candidate:4 1 UDP 1006633215 83.150.122.225 55671 typ relay</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-pwd:7SBrRWChu2A3z+hsKpNN0r</span></div><div style="background-color: transparent; "><span style="font-size:
 small;">a=ice-ufrag:bdDn</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtcp:0</span></div><div style="background-color: transparent; "><span style="font-size: small;">m=audio 38143 PCMU/AVP 0</span></div><div style="background-color: transparent; "><span style="font-size: small;">c=IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtpmap:0 PCMU/8000</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:1 1 UDP 2013266431 192.168.1.41 38143 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:2 1 UDP 2013266431 192.168.2.14 48049 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:3 1 UDP 1677721855 210.245.54.74 61047 typ srflx</span></div><div style="background-color: transparent; "><span
 style="font-size: small;">a=candidate:4 1 UDP 1006633215 83.150.122.225 62630 typ relay</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-pwd:Pqc3Or66wkjS+wN6z73ww8</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-ufrag:m9AG</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtcp:0</span></div><div style="color: rgb(0, 0, 0); font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 16px; font-style: normal; "><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal; ">but in another time, I only gather relay server for audio or video or nothing:</div><div style="background-color: transparent; "><div style="background-color: transparent; "><span style="font-size: 13px;
 ">v=0</span></div><div style="background-color: transparent; "><span style="font-size: small;">o=- 8769129355780658083 7584008823329948515 IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">s=-</span></div><div style="background-color: transparent; "><span style="font-size: small;">t=0 0</span></div><div style="background-color: transparent; "><span style="font-size: small;">m=video 52520 RTP/AVP 98</span></div><div style="background-color: transparent; "><span style="font-size: small;">c=IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtpmap:98 theora/90000</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:1 1 UDP 2013266431 192.168.1.41 52520 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:2 1 UDP 2013266431 192.168.2.14
 41380 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:3 1 UDP 1677721855 210.245.54.74 61557 typ srflx</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:4 1 UDP 1006633215 83.150.122.225 59608 typ relay</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-pwd:fHBGxclzwZqz6fNl+PdAYI</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-ufrag:0GRT</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtcp:0</span></div><div style="background-color: transparent; "><span style="font-size: small;">m=audio 58936 PCMU/AVP 0</span></div><div style="background-color: transparent; "><span style="font-size: small;">c=IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtpmap:0
 PCMU/8000</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:1 1 UDP 2013266431 192.168.1.41 58936 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:2 1 UDP 2013266431 192.168.2.14 50804 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-pwd:GmuIDz7o9IHVLxqhr52JeM</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-ufrag:dX+Z</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtcp:0</span></div><div style="color: rgb(0, 0, 0); font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 16px; font-style: normal; ">=================================================================</div></div></font></div><div style="background-color: transparent; "><font face="'Courier New', courier, monaco,
 monospace, sans-serif"><div style="background-color: transparent; "><span style="font-size: 13px; ">v=0</span></div><div style="background-color: transparent; "><span style="font-size: small;">o=- 4016385316294493094 2686950318062895343 IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">s=-</span></div><div style="background-color: transparent; "><span style="font-size: small;">t=0 0</span></div><div style="background-color: transparent; "><span style="font-size: small;">m=video 46895 RTP/AVP 98</span></div><div style="background-color: transparent; "><span style="font-size: small;">c=IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtpmap:98 theora/90000</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:1 1 UDP 2013266431 192.168.1.41 46895 typ host</span></div><div
 style="background-color: transparent; "><span style="font-size: small;">a=candidate:2 1 UDP 2013266431 192.168.2.14 38023 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-pwd:2EOBEvTTpL/e88j2ymvd6f</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-ufrag:IIX4</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtcp:0</span></div><div style="background-color: transparent; "><span style="font-size: small;">m=audio 57581 PCMU/AVP 0</span></div><div style="background-color: transparent; "><span style="font-size: small;">c=IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtpmap:0 PCMU/8000</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:1 1 UDP 2013266431 192.168.1.41 57581 typ host</span></div><div
 style="background-color: transparent; "><span style="font-size: small;">a=candidate:2 1 UDP 2013266431 192.168.2.14 48726 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-pwd:WGag9CGVWa4UpCJ6Myeyto</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-ufrag:LgYu</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtcp:0</span></div><div style="color: rgb(0, 0, 0); font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 16px; font-style: normal; ">==================================================================</div></font></div><div style="color: rgb(0, 0, 0); font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal; "><span style="font-size: 13px; "><span style="background-color: transparent; ">v=0</span><br></span></div><div
 style="background-color: transparent; "><font face="'Courier New', courier, monaco, monospace, sans-serif"><div style="background-color: transparent; "><span style="font-size: small;">o=- 8900533634173556908 2270264087450858543 IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">s=-</span></div><div style="background-color: transparent; "><span style="font-size: small;">t=0 0</span></div><div style="background-color: transparent; "><span style="font-size: small;">m=video 47791 RTP/AVP 98</span></div><div style="background-color: transparent; "><span style="font-size: small;">c=IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtpmap:98 theora/90000</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:1 1 UDP 2013266431 192.168.1.41 47791 typ host</span></div><div style="background-color:
 transparent; "><span style="font-size: small;">a=candidate:2 1 UDP 2013266431 192.168.2.14 33952 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-pwd:+jft1vZC9UNJg//cgrFzSn</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-ufrag:fnyD</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtcp:0</span></div><div style="background-color: transparent; "><span style="font-size: small;">m=audio 39922 PCMU/AVP 0</span></div><div style="background-color: transparent; "><span style="font-size: small;">c=IN IP4 192.168.1.41</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtpmap:0 PCMU/8000</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:1 1 UDP 2013266431 192.168.1.41 39922 typ host</span></div><div style="background-color:
 transparent; "><span style="font-size: small;">a=candidate:2 1 UDP 2013266431 192.168.2.14 58084 typ host</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:3 1 UDP 1677721855 210.245.54.74 63425 typ srflx</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=candidate:4 1 UDP 1006633215 83.150.122.225 55358 typ relay</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-pwd:JqbJd1xHYFkkIK6U9B7BL3</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=ice-ufrag:G93f</span></div><div style="background-color: transparent; "><span style="font-size: small;">a=rtcp:0</span></div><div style="background-color: transparent; "><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style:
 normal; ">I'm using seperate turn server with </div><div style="background-color: transparent; "><div style="background-color: transparent; ">## Max relay per username.</div><div style="background-color: transparent; ">max_relay_per_username = 10</div><div style="background-color: transparent; "><br></div><div style="background-color: transparent; ">## Allocation lifetime.</div><div style="background-color: transparent; ">allocation_lifetime = 360</div><div style="color: rgb(0, 0, 0); font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 16px; font-style: normal; "><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal; ">And my source code :</div><div style="font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal; ">
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><!--StartFragment--><span style=" color:#c0c0c0;">    </span>self->v_stream_id<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>nice_agent_add_stream<span style=" color:#c0c0c0;"> </span>(self->v_agent,<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">1</span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 192, 192); ">    </span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">nice_agent_set_relay_info</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">(</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">self</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">-></span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">v_agent</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif;
 ">,</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 192, 192); "> </span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">self</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">-></span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">v_stream_id</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">,</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 192, 192); "> </span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(128, 0, 128);
 ">NICE_COMPONENT_TYPE_RTP</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">,</span><br></pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">                              </span>NUMB_IP,<span style=" color:#c0c0c0;"> </span>NUMB_PORT,<span style=" color:#c0c0c0;"> </span>NUMB_USER,<span style=" color:#c0c0c0;"> </span>NUMB_PASS,<span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">NICE_RELAY_TYPE_TURN_UDP</span>);</pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">    </span>nice_agent_gather_candidates<span style=" color:#c0c0c0;"> </span>(self->v_agent,<span style=" color:#c0c0c0;"> </span>self->v_stream_id);</pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">    </span>nice_agent_attach_recv<span style=" color:#c0c0c0;"> </span>(self->v_agent,<span style=" color:#c0c0c0;"> </span>self->v_stream_id,<span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">NICE_COMPONENT_TYPE_RTP</span>,</pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">                            </span>g_main_context_default(),<span style=" color:#c0c0c0;"> </span>cb_nice_v_recv,</pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">                            </span>self);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><font color="#008000"><br></font></pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">    </span>self->a_stream_id<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>nice_agent_add_stream<span style=" color:#c0c0c0;"> </span>(self->a_agent,<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">1</span>);</pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">    </span>nice_agent_set_relay_info(self->a_agent,<span style=" color:#c0c0c0;"> </span>self->a_stream_id,<span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">NICE_COMPONENT_TYPE_RTP</span>,</pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">                              </span>NUMB_IP,<span style=" color:#c0c0c0;"> </span>NUMB_PORT,<span style=" color:#c0c0c0;"> </span>NUMB_USER,<span style=" color:#c0c0c0;"> </span>NUMB_PASS,<span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">NICE_RELAY_TYPE_TURN_UDP</span>);</pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 192, 192); ">    </span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">nice_agent_gather_candidates</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 192, 192); "> </span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">(</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">self</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">-></span><span style="background-color: transparent; font-family: 'Courier New',
 courier, monaco, monospace, sans-serif; ">a_agent</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">,</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 192, 192); "> </span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">self</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">-></span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">a_stream_id</span><span style="background-color: transparent; font-family: 'Courier New', courier, monaco, monospace, sans-serif; ">);</span><br></pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">    </span>nice_agent_attach_recv<span style=" color:#c0c0c0;"> </span>(self->a_agent,<span style=" color:#c0c0c0;"> </span>self->a_stream_id,<span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">NICE_COMPONENT_TYPE_RTP</span>,</pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">                            </span>g_main_context_default(),<span style=" color:#c0c0c0;"> </span>cb_nice_a_recv,</pre>
<pre style="color: rgb(0, 0, 0); margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;">                            </span>self);<!--EndFragment--></pre></div></div><div style="color: rgb(0, 0, 0); font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 16px; font-style: normal; "><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal; ">After gathering done:</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal; ">
<pre style="margin-top: 0px; margin-bottom: 0px; "><!--StartFragment--><span style=" color:#c0c0c0;">    </span>local_cands<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>nice_agent_get_local_candidates(self->v_agent,<span style=" color:#c0c0c0;"> </span>self->v_stream_id,<span style=" color:#c0c0c0;"> </span>c_id);</pre><pre style="margin-top: 0px; margin-bottom: 0px; ">    ...</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; ">and<!--EndFragment--></pre><pre style="margin-top: 0px; margin-bottom: 0px; "><pre style="margin-top: 0px; margin-bottom: 0px; ">    local_cands<span style="color: rgb(192, 192, 192); "> </span>=<span style="color: rgb(192, 192, 192); "> </span>nice_agent_get_local_candidates(self->a_agent,<span style="color: rgb(192, 192, 192); "> </span>self->a_stream_id,<span style="color: rgb(192, 192, 192); "> </span>c_id);</pre><pre style="margin-top: 0px; margin-bottom: 0px; ">    ...</pre><pre style="margin-top: 0px; margin-bottom: 0px; "><br></pre><pre style="margin-top: 0px; margin-bottom: 0px; ">Can anyone help me to gather relay server all time ?</pre></pre></div></font></div></div></body></html>