Skip to content

Commit

Permalink
Add logging around inbound calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean-Der committed Dec 4, 2023
1 parent ff189f7 commit e921a23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/sip/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func (s *Server) handleInviteAuth(req *sip.Request, tx sip.ServerTransaction, fr
}

if cred.Response != digCred.Response {
// fmt.Println(cred.Response, digCred.Response)
logOnError(tx.Respond(sip.NewResponseFromRequest(req, 401, "Unauthorized", nil)))
return false
}
Expand Down Expand Up @@ -114,6 +113,7 @@ func (s *Server) onInvite(req *sip.Request, tx sip.ServerTransaction) {

username, password, err := s.authHandler(from.Address.User, to.Address.User, src)
if err != nil {
log.Printf("Rejecting inbound call, doesn't match any Trunks %q %q %q\n", from.Address.User, to.Address.User, src)
sipErrorResponse(tx, req)
return
}
Expand Down Expand Up @@ -156,6 +156,7 @@ func (c *inboundCall) handleInvite(req *sip.Request, tx sip.ServerTransaction, c
// Otherwise, we could even learn that this number is not allowed and reject the call, or ask for pin if required.
roomName, identity, requirePin, rejectInvite := c.s.dispatchRuleHandler(c.from.Address.User, c.to.Address.User, c.src, "", false)
if rejectInvite {
log.Printf("Rejecting inbound call, doesn't match any Dispatch Rules %q %q %q\n", c.from.Address.User, c.to.Address.User, c.src)
sipErrorResponse(tx, req)
return
}
Expand Down

0 comments on commit e921a23

Please sign in to comment.