Documentation
¶
Index ¶
- type Bridge
- type BridgeAddChannelOptions
- type BridgeData
- type BridgeHandle
- func (bh *BridgeHandle) AddChannel(channelID string) error
- func (bh *BridgeHandle) AddChannelWithOptions(channelID string, options *BridgeAddChannelOptions) error
- func (bh *BridgeHandle) Data() (*BridgeData, error)
- func (bh *BridgeHandle) Delete() (err error)
- func (bh *BridgeHandle) Exec() error
- func (bh *BridgeHandle) ID() string
- func (bh *BridgeHandle) Key() *key.Key
- func (bh *BridgeHandle) RemoveChannel(channelID string) error
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) RemoveChannel ¶
func (bh *BridgeHandle) RemoveChannel(channelID string) error
RemoveChannel removes a channel from the bridge