How to prevent ICE candidates from being added to SDP, tho STUN is configured

1,679 views
Skip to first unread message

Dipak Biswas

unread,
Feb 10, 2014, 3:54:33 PM2/10/14
to discuss...@googlegroups.com
Hi All,

I'm looking for avoiding Chrome to add the ice candidates in to final SDP (offer or answer).

I want to configure STUN servers to be passed to RTCPeerConnection call to find my Public IP to populate c= and m= lines but I don't want it to either (1) start finding out possible ICE candidates, (2) if that's not possible, at least don't allow them to be added to the final SDP offer or answer.

Please share any ideas how to acheive that. I modified the JsSIP script as follows, but that didn't help:

this.peerConnection.onicecandidate = function(e) {

      if (e.candidate) {

        console.log(LOG_PREFIX +'ICE candidate received: '+ e.candidate.candidate);

        if (disableICE) {

                console.log(LOG_PREFIX +'Disable ICE candidates!!!');

                e.candidate=null;

                //self.onIceCompleted();

        }       

      } else {

        console.log(LOG_PREFIX +'End of ICE candidates!!!');

        self.onIceCompleted(); 

      } 

    };


Thanks,

Dipak

Dipak Biswas

unread,
Feb 18, 2014, 12:23:51 PM2/18/14
to discuss...@googlegroups.com
Bump!

Could anybody please help me out here? I know that what I'm trying to do here is quite against what webRTC standard is recommending but I think this is useful when we want to control (thru c= line) where we want to receive the RTP packets. Simple STUN resolution is sufficient in my case and I don't want ICE to come in and figure out that both clients are in same internal LAN and completely ignore the c= line.

Thanks,
Dipak

Mallinath Bareddy

unread,
Feb 18, 2014, 5:47:30 PM2/18/14
to discuss...@googlegroups.com
If clients are in same network, don't provide any stun or turn information to PC config. But ICE is mandatory in setting up the connections.

rafael...@yahoo.de

unread,
Feb 22, 2014, 2:13:09 PM2/22/14
to discuss...@googlegroups.com
Or just stripp it out of the SDP.... Reason is still unclear to me though

Bryan Paluch

unread,
Feb 24, 2014, 3:05:23 PM2/24/14
to discuss...@googlegroups.com
You can't simply just fill in the c line and have everything work. The peerConnection object expects for you to complete the call using STUN/ICE.

If you want to make sure the clients ONLY use the host candidates you would do something like this.

//when you get a candidate

var type = e.candidate.split(" ")[7];
if(type !== "host") return;

Biswas, Dipak

unread,
Feb 25, 2014, 12:53:11 PM2/25/14
to discuss...@googlegroups.com
I've tried that. What should be done for "else"? Return from the onicecandidate(), PC adds the candidate to the SDP.

I've also tried simply assigning null to the candidate;

//when I get a candidate
e.candidate = null;
return;

Didn't make a difference on either case.

Thanks,
Dipak


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/VlugOufGfU4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Thanks,
Dipak

Alexandre GOUAILLARD

unread,
Feb 25, 2014, 2:17:08 PM2/25/14
to discuss...@googlegroups.com
dear biswas,

In webRTC, no candidate => no streaming (in short). Are you sure this is what you want?

you could use some hacks to figure out the value of ports and IP to try to generate an "old school" SDP message with those infos in the c and m lines respectively. Those SDP might be compliant with the SDP and SDP O/A specs. But how are you going to send the actual stream? The peer connection API, which handles that part in webRTC requires the underlying ICE user agent to be in the right state before it starts streaming, as bryan mentioned.

I might have missed something, feel free to correct me if that's the case.

alex.



--
 
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Alex. Gouaillard, PhD, PhD, MBA
------------------------------------------------------------------------------------
CTO - Temasys Communications, S'pore / Mountain View
President - CoSMo Software, Cambridge, MA
------------------------------------------------------------------------------------

Biswas, Dipak

unread,
Feb 25, 2014, 2:49:51 PM2/25/14
to discuss...@googlegroups.com
I understand that ICE candidates are essential/mandatory for webRTC. So, I'm discarding this plan of mine of manipulating the SDP at the JsSIP script.

I'm going to handle this in my B2BUA.

I needed the ICE candidates removed as one of my native SIP clients doesn't like them in the offer SDP.

Thanks for all your suggestions.

Alexandre GOUAILLARD

unread,
Feb 25, 2014, 8:05:42 PM2/25/14
to discuss...@googlegroups.com
I think it's the right way to do it, your B2BUA/gateway can handle bridging between webrtc + sip signaling and legacy sip. You will most likely need more than that anyway (security, traanscoding ….) to be done there.
Reply all
Reply to author
Forward
0 new messages