sip

package
v1.31.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 17 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSIPToken added in v1.9.4

func BuildSIPToken(params SIPTokenParams) (string, error)

func DispatchRulePriority

func DispatchRulePriority(info *livekit.SIPDispatchRuleInfo) int32

DispatchRulePriority returns sorting priority for dispatch rules. Lower value means higher priority.

func EvaluateDispatchRule

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

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 netip.Addr, 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 NewCallID added in v1.15.0

func NewCallID() string

func SelectDispatchRule

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

type ErrNoDispatchMatched struct {
	NoRules      bool
	NoTrunks     bool
	CalledNumber string
}

func (*ErrNoDispatchMatched) Error added in v1.9.9

func (e *ErrNoDispatchMatched) Error() string

type SIPTokenParams added in v1.31.0

type SIPTokenParams struct {
	APIKey                string
	APISecret             string
	RoomName              string
	ParticipantIdentity   string
	ParticipantName       string
	ParticipantMetadata   string
	ParticipantAttributes map[string]string
	RoomPreset            string
	RoomConfig            *livekit.RoomConfiguration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL