config

package
v0.0.0-...-48d1953 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2013 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DISABLED = "disabled"
	INTERNAL = "internal"
	JSON     = "json"
	GOB      = "gob"
	POSTGRES = "postgres"
	MONGO    = "mongo"
	REDIS    = "redis"
	SAME     = "same"
	FS       = "freeswitch"
)

Variables

This section is empty.

Functions

func ConfigSlice

func ConfigSlice(c *conf.ConfigFile, section, valName string) ([]string, error)

Adds support for slice values in config

Types

type CGRConfig

type CGRConfig struct {
	DataDBType               string
	DataDBHost               string // The host to connect to. Values that start with / are for UNIX domain sockets.
	DataDBPort               string // The port to bind to.
	DataDBName               string // The name of the database to connect to.
	DataDBUser               string // The user to sign in as.
	DataDBPass               string // The user's password.
	StorDBType               string // Should reflect the database type used to store logs
	StorDBHost               string // The host to connect to. Values that start with / are for UNIX domain sockets.
	StorDBPort               string // The port to bind to.
	StorDBName               string // The name of the database to connect to.
	StorDBUser               string // The user to sign in as.
	StorDBPass               string // The user's password.
	RPCEncoding              string // RPC encoding used on APIs: <gob|json>.
	DefaultReqType           string // Use this request type if not defined on top
	DefaultTOR               string // set default type of record
	DefaultTenant            string // set default tenant
	DefaultSubject           string // set default rating subject, useful in case of fallback
	RoundingMethod           string // Rounding method for the end price: <*up|*middle|*down>
	RoundingDecimals         int    // Number of decimals to round end prices at
	RaterEnabled             bool   // start standalone server (no balancer)
	RaterBalancer            string // balancer address host:port
	RaterListen              string // listening address host:port
	BalancerEnabled          bool
	BalancerListen           string // Json RPC server address
	SchedulerEnabled         bool
	CDRSEnabled              bool     // Enable CDR Server service
	CDRSListen               string   // CDRS's listening interface: <x.y.z.y:1234>.
	CDRSExtraFields          []string //Extra fields to store in CDRs
	CDRSMediator             string   // Address where to reach the Mediator. Empty for disabling mediation. <""|internal>
	SMEnabled                bool
	SMSwitchType             string
	SMRater                  string   // address where to access rater. Can be internal, direct rater address or the address of a balancer
	SMRaterReconnects        int      // Number of reconnect attempts to rater
	SMDebitInterval          int      // the period to be debited in advanced during a call (in seconds)
	MediatorEnabled          bool     // Starts Mediator service: <true|false>.
	MediatorListen           string   // Mediator's listening interface: <internal>.
	MediatorRater            string   // Address where to reach the Rater: <internal|x.y.z.y:1234>
	MediatorRaterReconnects  int      // Number of reconnects to rater before giving up.
	MediatorCDRType          string   // CDR type <freeswitch_http_json|freeswitch_file_csv>.
	MediatorAccIdField       string   // Name of field identifying accounting id used during mediation. Use index number in case of .csv cdrs.
	MediatorSubjectFields    []string // Name of subject fields to be used during mediation. Use index numbers in case of .csv cdrs.
	MediatorReqTypeFields    []string // Name of request type fields to be used during mediation. Use index number in case of .csv cdrs.
	MediatorDirectionFields  []string // Name of direction fields to be used during mediation. Use index numbers in case of .csv cdrs.
	MediatorTenantFields     []string // Name of tenant fields to be used during mediation. Use index numbers in case of .csv cdrs.
	MediatorTORFields        []string // Name of tor fields to be used during mediation. Use index numbers in case of .csv cdrs.
	MediatorAccountFields    []string // Name of account fields to be used during mediation. Use index numbers in case of .csv cdrs.
	MediatorDestFields       []string // Name of destination fields to be used during mediation. Use index numbers in case of .csv cdrs.
	MediatorTimeAnswerFields []string // Name of time_start fields to be used during mediation. Use index numbers in case of .csv cdrs.
	MediatorDurationFields   []string // Name of duration fields to be used during mediation. Use index numbers in case of .csv cdrs.
	MediatorCDRInDir         string   // Absolute path towards the directory where the CDRs are kept (file stored CDRs).
	MediatorCDROutDir        string   // Absolute path towards the directory where processed CDRs will be exported (file stored CDRs).
	FreeswitchServer         string   // freeswitch address host:port
	FreeswitchPass           string   // FS socket password
	FreeswitchReconnects     int      // number of times to attempt reconnect after connect fails
	HistoryAgentEnabled      bool     // Starts History as an agent: <true|false>.
	HistoryServerEnabled     bool     // Starts History as server: <true|false>.
	HistoryServer            string   // Address where to reach the master history server: <internal|x.y.z.y:1234>
	HistoryListen            string   // History server listening interface: <internal|x.y.z.y:1234>
	HistoryPath              string   // Location on disk where to store history files.
}

Holds system configuration, defaults are overwritten with values from config file if found

func NewCGRConfig

func NewCGRConfig(cfgPath *string) (*CGRConfig, error)

Instantiate a new CGRConfig setting defaults or reading from file

func NewCGRConfigBytes

func NewCGRConfigBytes(data []byte) (*CGRConfig, error)

func NewDefaultCGRConfig

func NewDefaultCGRConfig() (*CGRConfig, error)

Jump to

Keyboard shortcuts

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