Skip to content

Generated 100 Trying uses only request source instead of Via header as destination #267

@bv-ngv

Description

@bv-ngv

For SIP INVITEs, sipgo's server transaction automatically generates and sends a 100 Trying provisional response after the transaction's timer_1xx expires:

tx.timer_1xx = time.AfterFunc(Timer_1xx, func() {
trying := NewResponseFromRequest(
tx.Origin(),
100,
"Trying",
nil,
)
// tx.Log().Trace("timer_1xx fired")
if err := tx.Respond(trying); err != nil {
tx.log.Error("send '100 Trying' response failed", "error", err, "tx", tx.Key())
}
})

However, this happens (in NewResponseFromRequest) solely based on the request's source address and does not take its Via header into account:

res.SetDestination(req.Source())

Thus, the request's sender may not receive the 100 Trying at all if they are not reachable or ready to receive responses at the request's source address. Correct me if I'm wrong, but as far as I understand, all responses (including provisional ones) should use the Via header for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions