pub async fn ring_early(
endpoint: &Handle,
incoming: &Incoming,
status: u16,
reason: &'static str,
media_address: IpAddr,
) -> Result<Ringing>Expand description
Ring, and answer the INVITE’s offer in the provisional (RFC 3262 §5 + RFC 3311 §4).
This is what makes an early dialog renegotiable. RFC 3311 §5.1 will not let an UPDATE carry an offer while an offer/answer exchange is open, so a session described in the INVITE cannot be changed before the 200 unless its answer has already gone back — and before the 200 there is exactly one place to put an answer: a reliable provisional response.
100rel is therefore not optional here and there is no flag to switch it off. RFC 3262 §5
forbids an answer in an unreliable provisional outright, and one sent anyway can be lost
without either side noticing, leaving them disagreeing about which description is in force.
A caller that did not offer 100rel gets an error and should fall back to ring.
The media port is bound now, and the Call that
answer_early builds takes it over: the answer has already told the
far end where to send, and binding a second port would make the 200 contradict the 183.
Answers from the default codec set, Codecs::G711. ring_early_with takes a selection,
and it has to be made here rather than at crate::answer_early: the answer goes out in
this provisional, so by the time the 200 is built the codec has been agreed for some time.