Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entity ¶
type Entity struct { Username string `astconf:"-"` Templates []string `astconf:"-"` Type Type `astconf:"type"` AccountCode string `astconf:"accountcode,omitempty"` Disallow []string `astconf:"disallow,omitempty"` Allow []string `astconf:"allow,omitempty"` AllowGuest astval.YesNoNone `astconf:"allowguest,omitempty"` AccountingFlags string `astconf:"amaflags,omitempty"` AsteriskDB string `astconf:"astdb,omitempty"` Auth string `astconf:"auth,omitempty"` BusyLevel int `astconf:"busylevel,omitempty"` CallLimit int `astconf:"call-limit,omitempty"` CallGroup string `astconf:"callgroup,omitempty"` // FIXME: Use a slice of something? CallerID string `astconf:"callerid,omitempty"` CallerPresentation string `astconf:"callingpres,omitempty"` DirectMedia string `astconf:"directmedia,omitempty"` DirectMediaPermit []string `astconf:"directmediapermit,omitempty"` DirectMediaDeny []string `astconf:"directmediadeny,omitempty"` Context string `astconf:"context,omitempty"` Host string `astconf:"host,omitempty"` Transport []string `astconf:"transport,commaseparated,omitempty"` Mailbox string `astconf:"mailbox,omitempty"` Secret string `astconf:"secret,omitempty"` Variables []astval.Var `astconf:"setvar,omitempty"` }
Entity is a sip entity.
TODO: Add the rest of the possible fields.
func MergeEntities ¶
MergeEntities returns the merged configuration of all the given entities, in order of priority from least to greatest.
func OverlayEntities ¶
OverlayEntities returns the overlayed configuration of all the given entities, in order of priority from least to greatest.
func (*Entity) SectionName ¶
SectionName returns the name of the section that the entity belongs to.
func (*Entity) SectionTemplates ¶
SectionTemplates returns the section templates used by an entity.
type EntityMap ¶
type EntityMap struct {
// contains filtered or unexported fields
}
EntityMap is an ordered map of entities, indexed by entity username.
It should not be copied by value.
An empty entity map is ready for use.
func (*EntityMap) Add ¶
Add adds an entity to the map. If the map already contains an entry with the entity's username, the map is not changed.
Add returns true if the entity was added to the map.
func (*EntityMap) Contains ¶
Contains returns true if the map contains an entity with the given username.
type Type ¶
type Type int
Type is a sip entity type.
The zero value of Type is a valid Default value that is equivalent to Peer. The only difference between Default and Peer is that Default values will not take precedence when types are overlayed.
func (Type) MarshalText ¶
MarshalText returns a string representation of t marshaled as utf-8 bytes. It never returns an error.