Documentation
¶
Index ¶
- func BuildSIPToken(params SIPTokenParams) (string, error)
- func DispatchRulePriority(info *wirtual.SIPDispatchRuleInfo) int32
- func EvaluateDispatchRule(projectID string, trunk *wirtual.SIPInboundTrunkInfo, ...) (*rpc.EvaluateSIPDispatchRulesResponse, error)
- func GetPinAndRoom(info *wirtual.SIPDispatchRuleInfo) (room, pin string, err error)
- func MatchDispatchRule(trunk *wirtual.SIPInboundTrunkInfo, rules []*wirtual.SIPDispatchRuleInfo, ...) (*wirtual.SIPDispatchRuleInfo, error)
- func MatchTrunk(trunks []*wirtual.SIPInboundTrunkInfo, srcIP netip.Addr, ...) (*wirtual.SIPInboundTrunkInfo, error)
- func NewCallID() string
- func SelectDispatchRule(rules []*wirtual.SIPDispatchRuleInfo, req *rpc.EvaluateSIPDispatchRulesRequest) (*wirtual.SIPDispatchRuleInfo, error)
- func SortDispatchRules(rules []*wirtual.SIPDispatchRuleInfo)
- func ValidateDispatchRules(rules []*wirtual.SIPDispatchRuleInfo) error
- func ValidateTrunks(trunks []*wirtual.SIPInboundTrunkInfo) error
- type ErrNoDispatchMatched
- type SIPTokenParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSIPToken ¶
func BuildSIPToken(params SIPTokenParams) (string, error)
func DispatchRulePriority ¶
func DispatchRulePriority(info *wirtual.SIPDispatchRuleInfo) int32
DispatchRulePriority returns sorting priority for dispatch rules. Lower value means higher priority.
func EvaluateDispatchRule ¶
func EvaluateDispatchRule(projectID string, trunk *wirtual.SIPInboundTrunkInfo, rule *wirtual.SIPDispatchRuleInfo, req *rpc.EvaluateSIPDispatchRulesRequest) (*rpc.EvaluateSIPDispatchRulesResponse, error)
EvaluateDispatchRule checks a selected Dispatch Rule against the provided request.
func GetPinAndRoom ¶
func GetPinAndRoom(info *wirtual.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 *wirtual.SIPInboundTrunkInfo, rules []*wirtual.SIPDispatchRuleInfo, req *rpc.EvaluateSIPDispatchRulesRequest) (*wirtual.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 []*wirtual.SIPInboundTrunkInfo, srcIP netip.Addr, calling, called string) (*wirtual.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 []*wirtual.SIPDispatchRuleInfo, req *rpc.EvaluateSIPDispatchRulesRequest) (*wirtual.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 []*wirtual.SIPDispatchRuleInfo)
SortDispatchRules predictably sorts dispatch rules by priority (first one is highest).
func ValidateDispatchRules ¶
func ValidateDispatchRules(rules []*wirtual.SIPDispatchRuleInfo) error
ValidateDispatchRules checks a set of dispatch rules for conflicts.
func ValidateTrunks ¶
func ValidateTrunks(trunks []*wirtual.SIPInboundTrunkInfo) error
ValidateTrunks checks a set of trunks for conflicts.
Types ¶
type ErrNoDispatchMatched ¶
func (*ErrNoDispatchMatched) Error ¶
func (e *ErrNoDispatchMatched) Error() string