You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If recv a register request, but server did not found handler by method, this tx will be blocked, and server routinue blocked.
The next response will not be reponsed.
`func (srv *Server) handleRequest(req *sip.Request, tx sip.ServerTransaction) {
for _, mid := range srv.requestMiddlewares {
mid(req)
}
handler := srv.getHandler(req.Method)
if handler == nil {
srv.log.Warn().Msg("SIP request handler not found")
res := sip.NewResponseFromRequest(req, 405, "Method Not Allowed", nil)
if err := srv.WriteResponse(res); err != nil {
srv.log.Error().Msgf("respond '405 Method Not Allowed' failed: %s", err)
}
//. no timer trigger. or we shoud destroy this tx.
for {
select {
case <-tx.Done():
srv.log.Warn().Msgf("recv tx.Done() tx:%s", tx)
return
case err, ok := <-tx.Errors():
srv.log.Warn().Msgf("recv tx.Errors() tx:%s, err:%s", tx, err)
if !ok {
return
}
srv.log.Warn().Msgf("error from SIP server transaction %s: %s", tx, err)
}
}
}
handler(req, tx)
if tx != nil {
// Must be called to prevent any transaction leaks
tx.Terminate()
}
}`
The text was updated successfully, but these errors were encountered:
Hi @yushimeng
Thanks for reporting. This code was some leftover but never looked too much.
Anyway added a fix. We will terminate transaction. Also I am thinking this to be exported but for now leaving internally.
Check commit a3cde53
If recv a register request, but server did not found handler by method, this tx will be blocked, and server routinue blocked.
The next response will not be reponsed.
`func (srv *Server) handleRequest(req *sip.Request, tx sip.ServerTransaction) {
for _, mid := range srv.requestMiddlewares {
mid(req)
}
}`
The text was updated successfully, but these errors were encountered: