Support new SIP protocol. (#2474)

This commit is contained in:
Denys Smirnov
2024-02-12 18:52:21 +02:00
committed by GitHub
parent 49fd332e91
commit 3674217d64
3 changed files with 19 additions and 21 deletions
+4
View File
@@ -16,6 +16,7 @@ package service
import (
"context"
"errors"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
@@ -57,6 +58,9 @@ func (s *IOInfoService) EvaluateSIPDispatchRules(ctx context.Context, req *rpc.E
}
best, err := s.matchSIPDispatchRule(ctx, trunk, req)
if err != nil {
if e := (*sip.ErrNoDispatchMatched)(nil); errors.As(err, &e) {
return &rpc.EvaluateSIPDispatchRulesResponse{Result: rpc.SIPDispatchResult_DROP}, nil
}
return nil, err
}
logger.Debugw("SIP dispatch rule matched", "dispatchRule", best.SipDispatchRuleId, "called", req.CalledNumber, "calling", req.CallingNumber)