dpma

package
v0.0.0-...-eec0033 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Name       string `astconf:"-"`
	InfoHeader string `astconf:"alert_info"`
	RingType   string `astconf:"ring_type"`
	Ringtone   string `astconf:"ringtone"`
}

Alert is a DPMA alert definition.

func (*Alert) MarshalAsteriskPreamble

func (*Alert) MarshalAsteriskPreamble(e *astconf.Encoder) error

MarshalAsteriskPreamble marshals the type.

func (*Alert) SectionName

func (a *Alert) SectionName() string

SectionName returns the name of the ringtone section.

type Config

type Config struct {
	// Authentication
	ServerUUID   string `astconf:"server_uuid"`
	GlobalPIN    int    `astconf:"globalpin"`
	UserlistAuth string `astconf:"userlist_auth"` // "disabled", "globalpin"
	ConfigAuth   string `astconf:"config_auth"`   // "mac", "pin", "globalpin", "disabled"

	// mDNS Discovery
	MDNSAddr                string `astconf:"mdns_address"`
	MDNSPort                string `astconf:"mdns_port"`
	MDNSTransport           string `astconf:"mdns_transport"`
	ServiceName             string `astconf:"service_name"`
	ServiceDiscoveryEnabled bool   `astconf:"service_discovery_enabled"`

	// Files
	FileDirectory string `astconf:"file_directory"`

	// Other
	PJSIPMessageContext       string `astconf:"pjsip_message_context"`
	TransactionInitialThreads string `astconf:"transaction_initial_threads"`
	TransactionMaxThreads     string `astconf:"transaction_max_threads"`
}

Config holds general DPMA configuration settings.

func (*Config) SectionName

func (c *Config) SectionName() string

SectionName returns the asterisk configuration section name.

type Firmware

type Firmware struct {
}

Firmware is a DPMA firmware definition.

type Line

type Line struct {
	Name                      string         `astconf:"-"`
	Extension                 string         `astconf:"exten,omitempty"`
	DigitMap                  string         `astconf:"digit_map,omitempty"`
	Label                     string         `astconf:"line_label,omitempty"`
	Mailbox                   string         `astconf:"mailbox,omitempty"`
	VoicemailURI              string         `astconf:"voicemail_uri,omitempty"`
	OutboundProxyAddress      string         `astconf:"outboundproxy_address,omitempty"`
	OutboundProxyPort         string         `astconf:"outboundproxy_port,omitempty"`
	Transport                 string         `astconf:"transport,omitempty"`
	MediaEncryption           string         `astconf:"media_encryption,omitempty"`
	RegistrationTimeout       astval.Seconds `astconf:"reregistration_timeout"`
	RegistrationRetryInterval astval.Seconds `astconf:"registration_retry_interval"`
	RegistrationMaxRetries    astval.Int     `astconf:"registration_max_retries"`
	Secret                    string         `astconf:"secret,omitempty"`
	Context                   string         `astconf:"context,omitempty"`
	CallerID                  string         `astconf:"callerid,omitempty"`
	SubscribeContext          string         `astconf:"subscribecontext,omitempty"`
	PlarNumber                string         `astconf:"plar_number,omitempty"`
}

Line is a DPMA line definition.

func OverlayLines

func OverlayLines(lines ...Line) (overlayed Line)

OverlayLines returns the overlayed configuration of all the given lines, in order of priority from least to greatest.

func (*Line) MarshalAsteriskPreamble

func (line *Line) MarshalAsteriskPreamble(e *astconf.Encoder) error

MarshalAsteriskPreamble marshals the type.

func (*Line) SectionName

func (line *Line) SectionName() string

SectionName returns the name of the line section.

type LineMap

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

LineMap is an ordered map of dpma line entries, indexed by line name.

It should not be copied by value.

An empty line map is ready for use.

func (*LineMap) Add

func (m *LineMap) Add(line Line) bool

Add adds a line to the map. If the map already contains an entry with the line's name, the map is not changed.

Add returns true if the line was added to the map.

func (*LineMap) Contains

func (m *LineMap) Contains(name string) bool

Contains returns true if the map contains a line with the given name.

func (*LineMap) Line

func (m *LineMap) Line(name string) (line Line, ok bool)

Line returns the line entry with the given name.

func (*LineMap) Lines

func (m *LineMap) Lines() []Line

Lines returns a slice of all line entries in the map.

func (*LineMap) Overlay

func (m *LineMap) Overlay(line Line)

Overlay adds a line to the map. If the map already contains an entry with the line's name, the entries are overlayed, with priority given to the new entry.

type LogoFile

type LogoFile struct {
	Model string
	Path  string
}

LogoFile holds the path to a logo for a particular model of phone.

func (LogoFile) MarshalAsterisk

func (logo LogoFile) MarshalAsterisk(e *astconf.Encoder) error

MarshalAsterisk marshals the logo file as an asterisk setting.

type Multicastpage

type Multicastpage struct {
}

Multicastpage is a DPMA multicast paging definition.

type Network

type Network struct {
	Name                         astconf.SectionName
	Alias                        string         `astconf:"alias"`
	CIDR                         string         `astconf:"cidr"`
	RegistrationAddress          string         `astconf:"registration_address"`
	RegistrationPort             int            `astconf:"registration_port,omitempty"`
	Transport                    string         `astconf:"transport"` // "udp", "tcp", "tls"
	AlternateRegistrationAddress string         `astconf:"alternate_registration_address"`
	AlternateRegistrationPort    int            `astconf:"alternate_registration_port"`
	AlternateTransport           string         `astconf:"alternate_transport"`
	FileURLPrefix                string         `astconf:"file_url_prefix"`
	PublicFirmwareURLPrefix      string         `astconf:"public_firmware_url_prefix"`
	NTPServer                    string         `astconf:"ntp_server"`
	SyslogServer                 string         `astconf:"syslog_server"`
	SyslogPort                   int            `astconf:"syslog_port,omitempty"`
	SyslogLevel                  string         `astconf:"syslog_level"`                // "debug", "error", "warning", "information"
	NetworkVLANDiscoveryMode     string         `astconf:"network_vlan_discovery_mode"` // "NONE", "MANUAL", "LLDP"
	SIPQOS                       astval.Int     `astconf:"sip_qos"`
	RTPQOS                       astval.Int     `astconf:"rtp_qos"`
	NetworkVLANID                astval.Int     `astconf:"network_vlan_id"`
	PCVLANID                     astval.Int     `astconf:"pc_vlan_id"`
	PCQOS                        astval.Int     `astconf:"pc_qos"`
	SIPDSCP                      astval.Int     `astconf:"sip_dscp"`
	RTPDSCP                      astval.Int     `astconf:"rtp_dscp"`
	UDPKAInterval                astval.Seconds `astconf:"udp_ka_interval"` // Seconds
}

Network is a DPMA network definition.

func OverlayNetworks

func OverlayNetworks(networks ...*Network) (overlayed Network)

OverlayNetworks returns the overlayed configuration of all the given networks, in order of priority from least to greatest.

type Phone

type Phone struct {
	Username                 string           `astconf:"-"`
	Networks                 []string         `astconf:"network"`
	Firmware                 []string         `astconf:"firmware"`
	MAC                      string           `astconf:"mac,omitempty"`
	PIN                      string           `astconf:"pin,omitempty"`
	GroupPIN                 int              `astconf:"group_pin,omitempty"`
	Lines                    []string         `astconf:"line"` // First entry is primary line
	ExternalLine             string           `astconf:"external_line,omitempty"`
	Applications             []string         `astconf:"application"`
	ConfigFile               string           `astconf:"config_file,omitempty"`
	FullName                 string           `astconf:"full_name,omitempty"`
	Contacts                 []string         `astconf:"contact"`
	ContactsDisplayRules     string           `astconf:"contacts_display_rules,omitempty"`
	BLFContactGroup          string           `astconf:"blf_contact_group,omitempty"`
	BLFItems                 string           `astconf:"blf_items,omitempty"`
	BLFPageReturnTimeout     astval.Seconds   `astconf:"blf_page_return_timeout,omitempty"`
	ContactsMaxSubscriptions int              `astconf:"contacts_max_subscriptions,omitempty"`
	Timezone                 string           `astconf:"timezone,omitempty"`
	NTPResync                astval.Seconds   `astconf:"ntp_resync"`
	ParkingExtension         int              `astconf:"parking_exten,omitempty"`
	ParkingTransferType      string           `astconf:"parking_transfer_type,omitempty"` // "blind", "attended"
	ShowCallParking          astval.YesNoNone `astconf:"show_call_parking"`
	Ringtones                []string         `astconf:"ringtone"`
	ActiveRingtone           string           `astconf:"active_ringtone,omitempty"`
	WebUIEnabled             astval.YesNoNone `astconf:"web_ui_enabled"`
	RecordOwnCalls           astval.YesNoNone `astconf:"record_own_calls"`
	CanForwardCalls          astval.YesNoNone `astconf:"can_forward_calls"`
	ShowCallLog              astval.YesNoNone `astconf:"show_call_log"`
	LogOutEnabled            astval.YesNoNone `astconf:"logout_enabled"`
	Alerts                   []string         `astconf:"alert"`
	MulticastPage            []string         `astconf:"multicastpage"`
	BLFUnusedLineKeys        astval.YesNoNone `astconf:"blf_unused_linekeys"`
	SendToVoicemail          astval.YesNoNone `astconf:"send_to_vm"`
	UseLocalStorage          astval.YesNoNone `astconf:"use_local_storage"`
	LogoFiles                []LogoFile
	WallpaperFile            string           `astconf:"wallpaper_file,omitempty"`
	EHS                      string           `astconf:"ehs,omitempty"` // "auto", "plantronics", "jabra_iq"
	LockPreferences          astval.YesNoNone `astconf:"lock_preferences"`
	LoginPassword            int              `astconf:"login_password,omitempty"`
	AcceptLocalCalls         string           `astconf:"accept_local_calls,omitempty"` // "any", "host"
	DisplayMCNotification    astval.YesNoNone `astconf:"display_mc_notification"`
	IdleCompanyText          string           `astconf:"idle_company_text,omitempty"`
	SmallClock               astval.YesNoNone `astconf:"small_clock"`
	DefaultFontSize          int              `astconf:"default_fontsize,omitempty"`
	Brightness               astval.Int       `astconf:"brightness"`
	Contrast                 astval.Int       `astconf:"contrast"`
	DimBacklight             astval.YesNoNone `astconf:"dim_backlight"`
	BacklightTimeout         astval.Seconds   `astconf:"backlight_timeout"`
	BacklightDimLevel        astval.Int       `astconf:"backlight_dim_level"`
	ActiveLocale             string           `astconf:"active_locale,omitempty"`
	RingerVolume             astval.Int       `astconf:"ringer_volume"`
	SpeakerVolume            astval.Int       `astconf:"speaker_volume"`
	HandsetVolume            astval.Int       `astconf:"handset_volume"`
	HeadsetVolume            astval.Int       `astconf:"headset_volume"`
	CallWaitingTone          astval.YesNoNone `astconf:"call_waiting_tone"`
	HandsetSidetoneDB        astval.Int       `astconf:"handset_sidetone_db"`
	HeadsetSidetoneDB        astval.Int       `astconf:"headset_sidetone_db"`
	ResetCallVolume          astval.YesNoNone `astconf:"reset_call_volume"`
	HeadsetAnswer            astval.YesNoNone `astconf:"headset_answer"`
	RingHeadsetOnly          astval.YesNoNone `astconf:"ring_headset_only"`
	NameFormat               string           `astconf:"name_format,omitempty"`   // "first_last", "last_first"
	LanPortMode              string           `astconf:"lan_port_mode,omitempty"` // "auto", "10hd", "10fd", "100hd", "100fd", "1000fd"
	PCPortMode               string           `astconf:"pc_port_mode,omitempty"`  // "auto", "10hd", "10fd", "100hd", "100fd", "1000fd"
	EnableCheckSync          astval.YesNoNone `astconf:"enable_check_sync"`

	Codecs []string `astconf:"codecs"`

	TransportTLSAllowed astval.YesNoNone `astconf:"transport_tls_allowed"`
}

Phone is a DPMA phone definition.

func MergePhones

func MergePhones(phones ...Phone) (merged Phone)

MergePhones returns the merged configuration of all the given phones, in order of priority from least to greatest.

func OverlayPhones

func OverlayPhones(phones ...Phone) (overlayed Phone)

OverlayPhones returns the overlayed configuration of all the given phones, in order of priority from least to greatest.

func (*Phone) MarshalAsteriskPreamble

func (p *Phone) MarshalAsteriskPreamble(e *astconf.Encoder) error

MarshalAsteriskPreamble marshals the type.

func (*Phone) SectionName

func (p *Phone) SectionName() string

SectionName returns the name of the phone section.

type PhoneMap

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

PhoneMap is an ordered map of dpma phone entries, indexed by mac address.

It should not be copied by value.

An empty phone map is ready for use.

func (*PhoneMap) Add

func (m *PhoneMap) Add(phone Phone) bool

Add adds a phone to the map. If the map already contains an entry with the phone's mac address, the map is not changed.

Add returns true if the phone was added to the map.

func (*PhoneMap) Contains

func (m *PhoneMap) Contains(mac string) bool

Contains returns true if the map contains a phone with the given mac address.

func (*PhoneMap) Merge

func (m *PhoneMap) Merge(phone Phone)

Merge adds a phone to the map. If the map already contains an entry with the phone's mac address, the entries are merged.

func (*PhoneMap) Overlay

func (m *PhoneMap) Overlay(phone Phone)

Overlay adds a phone to the map. If the map already contains an entry with the phone's mac address, the entries are overlayed, with priority given to the new entry.

func (*PhoneMap) Phone

func (m *PhoneMap) Phone(mac string) (phone Phone, ok bool)

Phone returns the phone entry with the given mac address.

func (*PhoneMap) Phones

func (m *PhoneMap) Phones() []Phone

Phones returns a slice of all phone entries in the map.

type Ringtone

type Ringtone struct {
	Name     string `astconf:"-"`
	Alias    string `astconf:"alias"`
	Filename string `astconf:"filename"`
}

Ringtone is a DPMA ringtone definition.

func (*Ringtone) MarshalAsteriskPreamble

func (*Ringtone) MarshalAsteriskPreamble(e *astconf.Encoder) error

MarshalAsteriskPreamble marshals the type.

func (*Ringtone) SectionName

func (r *Ringtone) SectionName() string

SectionName returns the name of the ringtone section.

type Translation

type Translation struct {
}

Translation is a DPMA translation definition.

Jump to

Keyboard shortcuts

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