bridge

package
v0.0.0-...-2ec00d9 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge interface {

	// Create creates a bridge
	Create(key *key.Key, btype string, name string) (*BridgeHandle, error)

	// StageCreate creates a new bridge handle, staged with a bridge `Create` operation.
	StageCreate(key *key.Key, btype string, name string) (*BridgeHandle, error)

	// Get gets the BridgeHandle
	Get(key *key.Key) *BridgeHandle

	// Data gets the bridge data
	Data(key *key.Key) (*BridgeData, error)

	// AddChannel adds a channel to the bridge
	AddChannel(key *key.Key, channelID string) error

	// AddChannelWithOptions adds a channel to a bridge, specifying additional options to be applied to that channel
	AddChannelWithOptions(key *key.Key, channelID string, options *BridgeAddChannelOptions) error

	// RemoveChannel removes a channel from the bridge
	RemoveChannel(key *key.Key, channelID string) error

	// Delete deletes the bridge
	Delete(key *key.Key) error

	// MOH plays music on hold
	MOH(key *key.Key, moh string) error

	// StopMOH stops music on hold
	StopMOH(key *key.Key) error

	// VideoSource add Channel as Video-Source-ID at bridge
	VideoSource(key *key.Key, channelID string) error

	// VideoSourceDelete delete Video-Source-ID from bridge
	VideoSourceDelete(key *key.Key) error
}

Bridge represents a communication path to an Asterisk server for working with bridge resources

type BridgeAddChannelOptions

type BridgeAddChannelOptions struct {

	// AbsorbDTMF indicates that DTMF coming from this channel will not be passed through to the bridge
	AbsorbDTMF bool

	// Mute indicates that the channel should be muted, preventing audio from it passing through to the bridge
	Mute bool

	// Role indicates the channel's role in the bridge
	Role string
}

BridgeAddChannelOptions describes additional options to be applied to a channel when it is joined to a bridge

type BridgeData

type BridgeData struct {
	// Key is the cluster-unique identifier for this bridge
	Key *key.Key `json:"key"`

	ID         string   `json:"id"`           // Unique Id for this bridge
	Class      string   `json:"bridge_class"` // Class of the bridge
	Type       string   `json:"bridge_type"`  // Type of bridge (mixing, holding, dtmf_events, proxy_media)
	ChannelIDs []string `json:"channels"`     // List of pariticipating channel ids
	Creator    string   `json:"creator"`      // Creating entity of the bridge
	Name       string   `json:"name"`         // The name of the bridge
	Technology string   `json:"technology"`   // Name of the bridging technology
}

BridgeData describes an Asterisk Bridge, the entity which merges media from one or more channels into a common audio output

func (*BridgeData) Channels

func (b *BridgeData) Channels() (list []*key.Key)

Channels returns the list of channels found in the bridge

type BridgeHandle

type BridgeHandle struct {
	// contains filtered or unexported fields
}

BridgeHandle is the handle to a bridge for performing operations

func NewBridgeHandle

func NewBridgeHandle(key *key.Key, b Bridge, exec func(bh *BridgeHandle) error) *BridgeHandle

NewBridgeHandle creates a new bridge handle

func (*BridgeHandle) AddChannel

func (bh *BridgeHandle) AddChannel(channelID string) error

AddChannel adds a channel to the bridge

func (*BridgeHandle) AddChannelWithOptions

func (bh *BridgeHandle) AddChannelWithOptions(channelID string, options *BridgeAddChannelOptions) error

AddChannelWithOptions adds a channel to the bridge, specifying additional options

func (*BridgeHandle) Data

func (bh *BridgeHandle) Data() (*BridgeData, error)

Data gets the bridge data

func (*BridgeHandle) Delete

func (bh *BridgeHandle) Delete() (err error)

Delete deletes the bridge

func (*BridgeHandle) Exec

func (bh *BridgeHandle) Exec() error

Exec executes any staged operations attached on the bridge handle

func (*BridgeHandle) ID

func (bh *BridgeHandle) ID() string

ID returns the identifier for the bridge

func (*BridgeHandle) Key

func (bh *BridgeHandle) Key() *key.Key

Key returns the Key of the bridge

func (*BridgeHandle) RemoveChannel

func (bh *BridgeHandle) RemoveChannel(channelID string) error

RemoveChannel removes a channel from the bridge

Jump to

Keyboard shortcuts

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