api

package
v0.0.0-...-0d5d430 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectionIn  = "in"
	DirectionOut = "out"
)
View Source
const (
	// stream content types (media/control)
	StreamContentTypeMedia   = 0
	StreamContentTypeControl = 1

	// media codec types
	PayloadTypeOpus = 1

	// control message types
	StreamContentControlTypeAck = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Acknowledgement

type Acknowledgement struct {
	Type        StreamContentType //media/control
	ControlType StreamContentControlType
	Direction   string
	SourceId    uint8
	SinkId      uint8
}
type Advertisement string

func (Advertisement) Parse

func (ad Advertisement) Parse() (AdvertisementInfo, error)

Crude parse function. Needs to be revisited once ABNF is defined

type AdvertisementInfo

type AdvertisementInfo struct {
	Caps []Capability
}

type CallRequest

type CallRequest struct {
	HandlerUri  string `json:"uri"`
	Destination string `json:"destination"`
}

type CallResponse

type CallResponse struct {
	CallUri         string    `json:"uri"`
	ClientDirective Directive `json:"clientDirectives"`
	ServerDirective Directive `json:"serverDirectives"`
}

type CallsMessage

type CallsMessage struct {
	Request  CallRequest
	Response CallResponse
}

type Capability

type Capability struct {
	Id        uint8
	Direction string
	Codecs    []CodecInfo
}

type CodecInfo

type CodecInfo struct {
	Codec string
}

todo: support codec params

func (CodecInfo) Match

func (ci CodecInfo) Match(other CodecInfo) bool

type Directive

type Directive string

func (Directive) Parse

func (d Directive) Parse() (DirectiveInfo, error)

type DirectiveInfo

type DirectiveInfo struct {
	SourceId uint8
	SinkId   uint8
	Codec    CodecInfo
}

func (DirectiveInfo) GenClientDirectives

func (di DirectiveInfo) GenClientDirectives() Directive

func (DirectiveInfo) GenServerDirectives

func (di DirectiveInfo) GenServerDirectives() Directive

type FaceName

type FaceName string

type HandlerInfo

type HandlerInfo struct {
	Id            string
	Advertisement Advertisement
	Uri           string
}

/// Handler Definition //

type HandlerRequest

type HandlerRequest struct {
	HandlerId     string `json:"handler-id"`
	Advertisement string `json:"advertisement"`
}

type HandlerResponse

type HandlerResponse struct {
	Uri string `json:"uri"`
}

type Packet

type Packet struct {
	Type               PacketType
	RegisterHandler    RegisterHandlerMessage
	TrunkGroupsInfo    TrunkGroupsInfoMessage
	Calls              CallsMessage
	StreamMedia        StreamContentMedia
	StreamMediaAck     Acknowledgement
	StreamMediaRequest StreamContentRequest
}

type PacketEvent

type PacketEvent struct {
	Sender FaceName
	TgId   string
	CallId string
	Packet Packet
}

type PacketType

type PacketType byte
const (
	TrunkGroupDiscoveryPacket PacketType = 1
	RegisterHandlerPacket     PacketType = 2
	CallsPacket               PacketType = 3
	StreamMediaPacket         PacketType = 5
	StreamMediaAckPacket      PacketType = 6
	StreamMediaRequestPacket  PacketType = 7
)

type RegisterHandlerMessage

type RegisterHandlerMessage struct {
	HandlerRequest  HandlerRequest
	HandlerResponse HandlerResponse
}

type StreamContentControlType

type StreamContentControlType int16

type StreamContentMedia

type StreamContentMedia struct {
	Type        StreamContentType
	SeqNo       uint64
	Timestamp   uint64
	PayloadType uint32
	SourceId    uint8
	SinkId      uint8
	Media       []byte `tls:"head=varint"`
}

type StreamContentRequest

type StreamContentRequest struct {
}

type StreamContentType

type StreamContentType uint8

type TrunkGroupInfo

type TrunkGroupInfo struct {
	Uri string
}

type TrunkGroupsInfoMessage

type TrunkGroupsInfoMessage struct {
	TrunkGroups []TrunkGroupInfo
}

Jump to

Keyboard shortcuts

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