Documentation
¶
Index ¶
- func BuildSIPToken(apiKey, secret, roomName string, ...) (string, error)
- func DispatchRulePriority(info *livekit.SIPDispatchRuleInfo) int32
- func EvaluateDispatchRule(trunkID string, rule *livekit.SIPDispatchRuleInfo, ...) (*rpc.EvaluateSIPDispatchRulesResponse, error)
- func GetPinAndRoom(info *livekit.SIPDispatchRuleInfo) (room, pin string, err error)
- func MatchDispatchRule(trunk *livekit.SIPInboundTrunkInfo, rules []*livekit.SIPDispatchRuleInfo, ...) (*livekit.SIPDispatchRuleInfo, error)
- func MatchTrunk(trunks []*livekit.SIPInboundTrunkInfo, srcIP, calling, called string) (*livekit.SIPInboundTrunkInfo, error)
- func NewCallID() string
- func SelectDispatchRule(rules []*livekit.SIPDispatchRuleInfo, req *rpc.EvaluateSIPDispatchRulesRequest) (*livekit.SIPDispatchRuleInfo, error)
- func SortDispatchRules(rules []*livekit.SIPDispatchRuleInfo)
- func ValidateDispatchRules(rules []*livekit.SIPDispatchRuleInfo) error
- func ValidateTrunks(trunks []*livekit.SIPInboundTrunkInfo) error
- type ErrNoDispatchMatched
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSIPToken ¶ added in v1.9.4
func DispatchRulePriority ¶
func DispatchRulePriority(info *livekit.SIPDispatchRuleInfo) int32
DispatchRulePriority returns sorting priority for dispatch rules. Lower value means higher priority.
func EvaluateDispatchRule ¶
func EvaluateDispatchRule(trunkID string, rule *livekit.SIPDispatchRuleInfo, req *rpc.EvaluateSIPDispatchRulesRequest) (*rpc.EvaluateSIPDispatchRulesResponse, error)
EvaluateDispatchRule checks a selected Dispatch Rule against the provided request.
func GetPinAndRoom ¶
func GetPinAndRoom(info *livekit.SIPDispatchRuleInfo) (room, pin string, err error)
GetPinAndRoom returns a room name/prefix and the pin for a dispatch rule. Just a convenience wrapper.
func MatchDispatchRule ¶
func MatchDispatchRule(trunk *livekit.SIPInboundTrunkInfo, rules []*livekit.SIPDispatchRuleInfo, req *rpc.EvaluateSIPDispatchRulesRequest) (*livekit.SIPDispatchRuleInfo, error)
MatchDispatchRule finds the best dispatch rule matching the request parameters. Returns an error if no rule matched. Trunk parameter can be nil, in which case only wildcard dispatch rules will be effective (ones without Trunk IDs).
func MatchTrunk ¶
func MatchTrunk(trunks []*livekit.SIPInboundTrunkInfo, srcIP, calling, called string) (*livekit.SIPInboundTrunkInfo, error)
MatchTrunk finds a SIP Trunk definition matching the request. Returns nil if no rules matched or an error if there are conflicting definitions.
func SelectDispatchRule ¶
func SelectDispatchRule(rules []*livekit.SIPDispatchRuleInfo, req *rpc.EvaluateSIPDispatchRulesRequest) (*livekit.SIPDispatchRuleInfo, error)
SelectDispatchRule takes a list of dispatch rules, and takes the decision which one should be selected. It returns an error if there are conflicting rules. Returns nil if no rules match.
func SortDispatchRules ¶
func SortDispatchRules(rules []*livekit.SIPDispatchRuleInfo)
SortDispatchRules predictably sorts dispatch rules by priority (first one is highest).
func ValidateDispatchRules ¶ added in v1.10.1
func ValidateDispatchRules(rules []*livekit.SIPDispatchRuleInfo) error
ValidateDispatchRules checks a set of dispatch rules for conflicts.
func ValidateTrunks ¶ added in v1.10.1
func ValidateTrunks(trunks []*livekit.SIPInboundTrunkInfo) error
ValidateTrunks checks a set of trunks for conflicts.
Types ¶
type ErrNoDispatchMatched ¶ added in v1.9.9
func (*ErrNoDispatchMatched) Error ¶ added in v1.9.9
func (e *ErrNoDispatchMatched) Error() string