Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultSIPPort int = 5060 DefaultSIPPortTLS int = 5061 )
Variables ¶
View Source
var (
DefaultRTPPortRange = rtcconfig.PortRange{Start: 10000, End: 20000}
)
Functions ¶
func GetLocalIP ¶
Types ¶
type Config ¶
type Config struct {
Redis *redis.RedisConfig `yaml:"redis"` // required
ApiKey string `yaml:"api_key"` // required (env LIVEKIT_API_KEY)
ApiSecret string `yaml:"api_secret"` // required (env LIVEKIT_API_SECRET)
WsUrl string `yaml:"ws_url"` // required (env LIVEKIT_WS_URL)
HealthPort int `yaml:"health_port"`
PrometheusPort int `yaml:"prometheus_port"`
PProfPort int `yaml:"pprof_port"`
SIPPort int `yaml:"sip_port"` // announced SIP signaling port
SIPPortListen int `yaml:"sip_port_listen"` // SIP signaling port to listen on
SIPHostname string `yaml:"sip_hostname"`
SIPRingingInterval time.Duration `yaml:"sip_ringing_interval"` // from 1 sec up to 60 (default '1s')
TLS *TLSConfig `yaml:"tls"`
RTPPort rtcconfig.PortRange `yaml:"rtp_port"`
Logging logger.Config `yaml:"logging"`
ClusterID string `yaml:"cluster_id"` // cluster this instance belongs to
MaxCpuUtilization float64 `yaml:"max_cpu_utilization"`
UseExternalIP bool `yaml:"use_external_ip"`
LocalNet string `yaml:"local_net"` // local IP net to use, e.g. 192.168.0.0/24
NAT1To1IP string `yaml:"nat_1_to_1_ip"`
ListenIP string `yaml:"listen_ip"`
// if different from signaling IP
MediaUseExternalIP bool `yaml:"media_use_external_ip"`
MediaNAT1To1IP string `yaml:"media_nat_1_to_1_ip"`
MediaTimeout time.Duration `yaml:"media_timeout"`
MediaTimeoutInitial time.Duration `yaml:"media_timeout_initial"`
Codecs map[string]bool `yaml:"codecs"`
// HideInboundPort controls how SIP endpoint responds to unverified inbound requests.
// Setting it to true makes SIP server silently drop INVITE requests if it gets a negative Auth or Dispatch response.
// Doing so hides our SIP endpoint from (a low effort) port scanners.
HideInboundPort bool `yaml:"hide_inbound_port"`
// AddRecordRoute forces SIP to add Record-Route headers to the responses.
AddRecordRoute bool `yaml:"add_record_route"`
// AudioDTMF forces SIP to generate audio DTMF tones in addition to digital.
AudioDTMF bool `yaml:"audio_dtmf"`
EnableJitterBuffer bool `yaml:"enable_jitter_buffer"`
EnableJitterBufferProb float64 `yaml:"enable_jitter_buffer_prob"`
// internal
ServiceName string `yaml:"-"`
NodeID string // Do not provide, will be overwritten
// Experimental, these option might go away without notice.
Experimental struct {
// InboundWaitACK forces SIP to wait for an ACK to 200 OK before proceeding with the call.
InboundWaitACK bool `yaml:"inbound_wait_ack"`
} `yaml:"experimental"`
}
func (*Config) GetLoggerFields ¶
To use with logrus
func (*Config) GetLoggerValues ¶
func (c *Config) GetLoggerValues() []interface{}
To use with zap logger
func (*Config) InitLogger ¶
Click to show internal directories.
Click to hide internal directories.