Interactive Connectivity Establishment (ICE)

Last modified by Simon Morlat on 2019/01/15 21:17

 ICE (Interactive Connectivity Establishment)  RFC 5245 is built in the linphone library.

However you need to activate it in your application by setting the appropriate nat policy. To do so call the linphone_core_set_nat_policy() function passing a LinphoneNatPolicy object in which ICE is enabled. You also need to define a STUN server that will be used to discover the public addresses. with linphone_nat_policy_set_stun_server() function.


The implementation of ICE in liblinphone is known to be interoperable with the one from WebRTC.

Relay service

The relay service can be done in two ways:

  • with a SIP server supporting adding relay candidates, for example flexisip (out of the box) or kamailio with rtpengine, in which case rtpengine needs to be configured to use the ICE=force-relay flag in the rtpengine_offer() function for it to add the relay candidates in the SDP (see the corresponding rtpengine documentation ).
  • thanks to a TURN server. In such case TURN is to be enabled in the LinphoneNatPolicy.

The relay is not mandatory, however it is strongly recommended as ICE can never guarantee that a direct path will work between two NAT'd clients.

Created by SandrineAvakian on 2017/01/12 10:21