diff --git a/README.md b/README.md index fa0129a88..dc48fbb50 100644 --- a/README.md +++ b/README.md @@ -662,6 +662,17 @@ Optionally included keys are: this opens a security hole and potentially allows RTP streams to be hijacked, either partly or in whole. + - `reset` + + This causes *rtpengine* to un-learn certain aspects of the RTP endpoints involved, such as + support for ICE or support for SRTP. For example, if `ICE=force` is given, then *rtpengine* + will initially offer ICE to the remote endpoint. However, if a subsequent answer from that + same endpoint indicates that it doesn't support ICE, then no more ICE offers will be made + towards that endpoint, even if `ICE=force` is still specified. With the `reset` flag given, + this aspect will be un-learned and *rtpengine* will again offer ICE to this endpoint. + This flag is valid only in an `offer` message and is useful when the call has been + transferred to a new endpoint without change of `From` or `To` tags. + * `replace` Similar to the `flags` list. Controls which parts of the SDP body should be rewritten. diff --git a/daemon/call.c b/daemon/call.c index a6954724e..102b8493f 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2447,6 +2447,11 @@ int monologue_offer_answer(struct call_monologue *other_ml, GQueue *streams, * THIS side (recipient) before, then the structs will be populated with * details already. */ + if (flags && flags->opmode == OP_OFFER && flags->reset) { + MEDIA_CLEAR(media, INITIALIZED); + MEDIA_CLEAR(other_media, INITIALIZED); + } + /* deduct protocol from stream parameters received */ if (other_media->protocol != sp->protocol) { other_media->protocol = sp->protocol; diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 0aa88782c..a2d6bfbf1 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -521,6 +521,8 @@ static void call_ng_process_flags(struct sdp_ng_flags *out, bencode_item_t *inpu out->strict_source = 1; else if (!bencode_strcmp(it, "media-handover")) out->media_handover = 1; + else if (!bencode_strcmp(it, "reset")) + out->reset = 1; else ilog(LOG_WARN, "Unknown flag encountered: '"BENCODE_FORMAT"'", BENCODE_FMT(it)); diff --git a/daemon/sdp.h b/daemon/sdp.h index 5d20f7ec6..525691c22 100644 --- a/daemon/sdp.h +++ b/daemon/sdp.h @@ -32,6 +32,7 @@ struct sdp_ng_flags { rtcp_mux_reject:1, strict_source:1, media_handover:1, + reset:1, dtls_passive:1; };