stats

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Inbound  = CallDir(false)
	Outbound = CallDir(true)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CallDir

type CallDir bool

func (CallDir) String

func (d CallDir) String() string

type CallMonitor

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

func (*CallMonitor) CallDur

func (c *CallMonitor) CallDur() func() time.Duration

func (*CallMonitor) CallEnd

func (c *CallMonitor) CallEnd()

func (*CallMonitor) CallStart

func (c *CallMonitor) CallStart()

func (*CallMonitor) CallTerminate

func (c *CallMonitor) CallTerminate(t Termination)

func (*CallMonitor) CallTerminationFailure added in v1.3.0

func (c *CallMonitor) CallTerminationFailure()

func (*CallMonitor) CheckDur

func (c *CallMonitor) CheckDur() func(dt time.Duration)

func (*CallMonitor) InviteAccept

func (c *CallMonitor) InviteAccept()

func (*CallMonitor) InviteError

func (c *CallMonitor) InviteError(reason string)

InviteError records a SIP INVITE rejection after the trunk is known. Used by outbound INVITE failure paths where CallTerminate also fires for the same call, so this only writes to the legacy invite_error counter.

func (*CallMonitor) InviteErrorShort

func (c *CallMonitor) InviteErrorShort(t Termination)

InviteErrorShort records a SIP INVITE rejection that occurred before a call object existed (no validated trunk). Writes to the legacy invite_error counter (kept for back-compat) and routes through CallTerminate so the unified calls_terminated counter has consistent classification.

func (*CallMonitor) InviteReq

func (c *CallMonitor) InviteReq()

func (*CallMonitor) JoinDur

func (c *CallMonitor) JoinDur() func() time.Duration

func (*CallMonitor) RTPPacketRecv

func (c *CallMonitor) RTPPacketRecv(payloadType string)

func (*CallMonitor) RTPPacketSend

func (c *CallMonitor) RTPPacketSend(payloadType string)

func (*CallMonitor) SDPSize

func (c *CallMonitor) SDPSize(sz int, isOffer bool)

func (*CallMonitor) SessionDur

func (c *CallMonitor) SessionDur() func() time.Duration

func (*CallMonitor) StageDur added in v1.3.0

func (c *CallMonitor) StageDur(stage string) prometheus.Observer

func (*CallMonitor) StageDurTimer added in v1.3.0

func (c *CallMonitor) StageDurTimer(stage string) func() time.Duration

type HealthStatus

type HealthStatus int
const (
	HealthOK HealthStatus = iota
	HealthNotStarted
	HealthStopped
	HealthUnderLoad
	HealthDisabled
)

func (HealthStatus) String

func (i HealthStatus) String() string

type Monitor

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

func NewMonitor

func NewMonitor(conf *config.Config) (*Monitor, error)

func (*Monitor) Health

func (m *Monitor) Health() HealthStatus

func (*Monitor) IdleCPU

func (m *Monitor) IdleCPU() float64

func (*Monitor) InviteReqRaw

func (m *Monitor) InviteReqRaw(dir CallDir)

func (*Monitor) NewCall

func (m *Monitor) NewCall(dir CallDir, fromHost, toHost string) *CallMonitor

func (*Monitor) Shutdown

func (m *Monitor) Shutdown()

func (*Monitor) Start

func (m *Monitor) Start(conf *config.Config) error

func (*Monitor) Stop

func (m *Monitor) Stop()

func (*Monitor) TransferFailed

func (m *Monitor) TransferFailed(dir CallDir, reason string, changeActive bool)

func (*Monitor) TransferStarted

func (m *Monitor) TransferStarted(dir CallDir)

func (*Monitor) TransferSucceeded

func (m *Monitor) TransferSucceeded(dir CallDir)

type Termination added in v1.3.1

type Termination struct {
	Result TerminationResult
	Reason string
}

func ClientError added in v1.3.1

func ClientError(reason string) Termination

func ServerError added in v1.3.1

func ServerError(reason string) Termination

func Success added in v1.3.1

func Success(reason string) Termination

type TerminationResult added in v1.3.1

type TerminationResult string
const (
	ResultSuccess     TerminationResult = "success"
	ResultServerError TerminationResult = "server_error"
	ResultClientError TerminationResult = "client_error"
)

Jump to

Keyboard shortcuts

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