From: Joshua Colp Date: Wed, 8 Oct 2014 18:45:19 +0000 (+0000) Subject: res_rtp_asterisk: Allow only UDP ICE candidates. X-Git-Tag: 12.7.0-rc1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0caedfa37eb1aab7a943cc7619d9af3108a6a591;p=thirdparty%2Fasterisk.git res_rtp_asterisk: Allow only UDP ICE candidates. The underlying library, pjnath, that res_rtp_asterisk uses for ICE support does not have support for ICE-TCP. As candidates are passed through directly to it this can cause error messages to occur when it receives something unexpected (such as a TCP candidate). This change merely ignores all non-UDP candidates so they never reach pjnath. ASTERISK-24326 #close Reported by: Joshua Colp ........ Merged revisions 424852 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@424853 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 5c5cfe5901..6a49556f6a 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -519,6 +519,11 @@ static void ast_rtp_ice_add_remote_candidate(struct ast_rtp_instance *instance, struct ast_rtp *rtp = ast_rtp_instance_get_data(instance); struct ast_rtp_engine_ice_candidate *remote_candidate; + /* ICE sessions only support UDP candidates */ + if (strcmp(candidate->transport, "UDP")) { + return; + } + if (!rtp->ice_proposed_remote_candidates && !(rtp->ice_proposed_remote_candidates = ao2_container_alloc(1, NULL, ice_candidate_cmp))) { return;