From e921a23c6061d6cbbba7dd42ff69b8bb2c19aab1 Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Mon, 4 Dec 2023 10:33:02 -0500 Subject: [PATCH] Add logging around inbound calls --- pkg/sip/inbound.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/sip/inbound.go b/pkg/sip/inbound.go index 4db16d93..74442881 100644 --- a/pkg/sip/inbound.go +++ b/pkg/sip/inbound.go @@ -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 } @@ -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 } @@ -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 }