From 0a2a3cbf1e7d70000e8ee30fc9077e9cdc59fee7 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 13 Sep 2016 12:55:07 -0400 Subject: [PATCH] fix candidates being inserted after a=end-of-candidates fixes #271 Change-Id: I8a76f2d9c82154d4fac76edb9076c80be257c3c9 --- daemon/sdp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/daemon/sdp.c b/daemon/sdp.c index d9f1de447..75a609705 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -192,6 +192,7 @@ struct sdp_attribute { ATTR_SETUP, ATTR_RTPMAP, ATTR_IGNORE, + ATTR_END_OF_CANDIDATES, } attr; union { @@ -829,6 +830,8 @@ static int parse_attribute(struct sdp_attribute *a) { case 17: if (!str_cmp(&a->name, "remote-candidates")) a->attr = ATTR_ICE; + else if (!str_cmp(&a->name, "end-of-candidates")) + a->attr = ATTR_END_OF_CANDIDATES; break; } @@ -1610,6 +1613,7 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media * case ATTR_RECVONLY: case ATTR_SENDRECV: case ATTR_IGNORE: + case ATTR_END_OF_CANDIDATES: // we strip it here and re-insert it later goto strip; case ATTR_EXTMAP: @@ -2004,6 +2008,9 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu insert_candidates(chop, ps, ps_rtcp, flags, sdp_media); next: + if (attr_get_by_id(&sdp_media->attributes, ATTR_END_OF_CANDIDATES)) + chopper_append_c(chop, "a=end-of-candidates\r\n"); + media_index++; m = m->next; }