REL-29: downgrade error after invite to avoid retry#736
Conversation
1bb22cf to
4f331a3
Compare
| if !c.sigTs.InviteTime.IsZero() { | ||
| // INVITE sent: a call may exist, so don't surface a retryable 5xx. | ||
| res = res.afterInvite() | ||
| } |
There was a problem hiding this comment.
🔍 InviteTime is set before the INVITE is actually transmitted, making afterInvite() conservatively broad
The InviteTime timestamp is set at pkg/sip/outbound.go:642 (inside sipSignal) before c.cc.Invite() is called at line 645. This means if the INVITE fails during transport setup (e.g., TransactionRequest at pkg/sip/outbound.go:1108 returns an error before the packet leaves the host), InviteTime is already non-zero and afterInvite() will still fire at pkg/sip/outbound.go:423-425. This is a conservative choice — treating any attempted send as potentially received — which is reasonable for SIP (you can't be certain a UDP packet wasn't delivered), but it means some purely local failures (e.g., socket creation errors) will be unnecessarily made non-retryable.
Was this helpful? React with 👍 or 👎 to provide feedback.
to make sure retry won't happen after invite is sent