On 18/08/2026 05.44, Daniel Donoghue wrote:
> However, I did find one class of renegotiation where that doesnt seem
> to work and I dont think it can be fixed client-side: if the failed
> offer renegotiated ICE, replaying the previously accepted offer isnt
> just incomplete - it can make matters worse since ice_is_restart()
> compares the incoming credentials against the stored remote ones which
> the rejected offer has already replaced. It might also be possible
> (though I've never observed it) that it could also break SDES in a
> similar way if the failed renegotiation changed the suite selection,
> transport or media type.
That is very true. SDES I think should be fine (except for some
intermittent loss of media), but DTLS would probably be in the same boat
as ICE.
ICE might be able to recover, as a full renegotiation should(?) be
possible at any time, but DTLS could get permanently broken.
There are some conceivable workarounds, e.g. instead of simply resetting
the ICE/DTLS/SDES states, keep multiple working states alive at the same
time, and attempt to guess which one is the one currently considered the
active one by the peer, but this would be far from optimal, and for DTLS
especially would be very difficult to even do.
> I would like to propose adding a new "rollback" message to the NG
> protocol. this would include the call-id, from-tag, to-tag and,
> optionally, the via-branch and a generation; it would restore the
> media state to the last completed offer/answer exchange without
> deleting the call. This would be optional, per-call, via flag on the
> offer so it doesnt add an additional cost for calls that dont use it.
> An offer would snapshot before applying and a successful answer
> commits and then discards the snapshot. This would be a no-op if
> there's nothing outstanding so it's fail-safe without a client needing
> to track anything. This has the appeal, for me, that rtpengine can
> restore the things a replay can't, such as ICE agent and DTLS
> associations and not just what the SDP happens to describe and nothing
> sensitive, such as crypto keys, leave the daemon to make it work.
>
> I have been working in a branch, with a view to creating a PR, if
> that's something you'd be interested in?
That sounds like a very good addition to the project, and I'm sure lots
of users would appreciate this feature.
Looking forward to the PR!
Cheers