[asterisk-dev] limiting local ICE candidates?

Matthew Jordan mjordan at digium.com
Mon Feb 10 20:45:47 CST 2014

On Fri, Feb 7, 2014 at 1:21 PM, Daniel Pocock <daniel at pocock.com.au> wrote:
> Where would I find the code for finding local ICE candidates?  Would
> anybody be interested in a patch for limiting ICE to a subset of local IPs?
> For example, if a machine has 5 IP addresses and I only want 2 of them
> to be considered as local candidates, I'd like to create some
> configuration option in rtp.conf to whitelist those addresses and make
> sure the other 3 never appear as candidates in the SDP.

Just to answer this question, all of the code that interacts with
PJSIP's pj_ice_* routines is in res_rtp_asterisk. The local ICE
candidates are stored in an ao2_container on an instance of ast_rtp
(see local_candidates). If you wanted to whitelist/blacklist local
candidates, you could do so in ast_rtp_ice_add_cand, which is where
the candidate is added to the PJSIP ICE session as well as the
local_candidates container.


Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

More information about the asterisk-dev mailing list