Categorygithub.com/intuitivelabs/calltr
modulepackage
1.1.13
Repository: https://github.com/intuitivelabs/calltr.git
Documentation: pkg.go.dev

# README

calltr

The calltr package provides SIP call tracking and event generation support.

It will try to reconstruct dialog and registration state even if messages are missing.

Events

An event callback can be set, that will be called for each call-state related event.

See sipcmbeat for the list of the supported events.

Dependencies

calltr depends on sipsp.

# Functions

AllocCallEntry allocates a CallEntry and the CallEntry.Key.buf.
AllocEvRateEntry allocates an EvRateEntry.
AllocRegEntry allocates a RegEntry and the RegEntry.buf.
BUG is a shorthand for logging a bug message.
No description provided by the author
DBG is a shorthand for logging a debug message.
DBGon() is a shorthand for checking if generic debug logging is enabled.
ERR is a shorthand for logging an error message.
maximum size of an event data buffer.
helper function: fills src array with corresp.
FillEvRateInfo fills a EvRateInfo structure from an EvExcInfo, current rate, max rate, the rate interval and a custom diff exceeded count diff since last report.
ForceAllTimeout forces quick expire for all the call entries in the hash table (use on controlled shutdown only).
FreeCallEntry frees a CallEntry allocated with NewCallEntry.
FreeEvRateEntry frees a EvRateEntry allocated with NeEvRateEntry.
FreeRegEntry frees a RegEntry allocated with NewRegEntry.
GetCfg returns a pointer to the current calltr config.
GetHash is a fast hash function optimized for strings.
GetHash2 is similar to GetHash1 but a bit slower and with better distribution for number.
InitRateMaxes initialises an EvRateMaxes array based on an array of max values and an array of time intervals on which the rate values should be calculated.
LockCallEntry try to lock a CallEntry.
MinTimeout returns the minimum timeout value for a call entry.
No description provided by the author
PDBG is a shorthand for logging a parser / processing debug message.
PDBGon() is a shorthand for checking if parser debug logging is enabled.
PERR is a shorthand for logging a parser / processing error message.
No description provided by the author
No description provided by the author
No description provided by the author
ProcessMsg tries to match a sip msg against stored call state.
No description provided by the author
RegisterCEvHandler registers a callback for events based on calls.
SetCfg sets a new global config for calltr.
SetForceGCMatchC changes the matching conditions for entries that should be removed during forced GC.
SetForceGCrunL changes the maximum run times for each of the forced GC runs (each run uses a different match condition, set by SetForceGCMatchC above).
SetGCtriggers sets the garbage collections trigger and target values.
SetLighGCparams set the internal parameters for the light GC: the entry life "expire" ime and the running limit for the GC.
StateTimeoutDefault returns the default CallState timeout for s or 0 on error (invalid call state).
StateTimeoutRange returns the valid timeout range (in seconds) for the corresponding call state s.
StateTimeoutSet sets the timeout (in seconds) for the CallState s.
StateTimeoutValid returns true if the corresponding timeout (seconds) looks like a valid value for the state s.
No description provided by the author
UnlockCallEntry unlocks a CallEntry, previously locked with LockCallEntry.
WARN is a shorthand for logging a warning message.
WARNon() is a shorthand for checking if logging at LWARN level is enabled.

# Constants

how many allocs for a CallEntry+buf.
struct & buf in one block.
separate struct & buf, but use pools.
one block, but outside go GC.
No description provided by the author
simple.
build time alloc type.
alloc type as string.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
only CallID matched.
error, e.g.: invalid message.
No description provided by the author
No description provided by the author
CallID.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
first invite.
first non-invite.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
number of states (invalid as state value).
new if missing.
no alloc/forking.
update matching.
call terminated by callee.
CANCEL seen.
terminated due to forced timeout.
No description provided by the author
No description provided by the author
No description provided by the author
fin reply recv on some branch: internal cancel.
No description provided by the author
dbg: reg binding already in the cache -> steal it.
dbg: associated reg cache binding stolen by new reg.
generate a "delayed" reg-del on timeout.
No description provided by the author
REGISTER re-use hack.
entry re-use instead of forking.
timeout.
No description provided by the author
if contact not known yet, reserve...
No description provided by the author
No description provided by the author
if 1st PAI not known yet.
if 2nd PAI not known yet.
if reason not known yet, reserve ...
space reserved for totag.
No description provided by the author
No description provided by the author
No description provided by the author
in case an uri size is not yet known, reserve...
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
non sip probe.
No description provided by the author
other case, not covered above, with neg.
No description provided by the author
same as above, success (e.g OPTIONS out of call).
No description provided by the author
same as above for timeout.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
max space for saving contacts.
max space for saving method.
max space for saving 1st P-Asserted-Identity.
max space for saving 2nd P-Asserted-Identity.
max space for saving a reply reason.
maximum space reserved for callid + fromtag + totag.
max sace for saving UA (from UAC or UAS).
max uri size for saving to-uri, from-uri and r-uri.
No description provided by the author
No description provided by the author
minimum space reserved for tags.
match Exceeded state.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ignore, always true.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
number of event rate intervals.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
sip over websocket.
sip over secure websocket.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DefaultForceGCRunL.
EvRateDefaultIntvls holds the default time intervals for which event rates are computed.
No description provided by the author
Log is the generic log.
Plog is the log used when parsing and processing messages.
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
CallEntry holds dialog or call state information in a compact form.
No description provided by the author
No description provided by the author
CallInfo contains extra call information for event generation.
No description provided by the author
No description provided by the author
No description provided by the author
EvExcInfo holds information/state about the EvRate state (exceeded or not).
EvRate holds an event rate for a specific interval.
EvRateEntry holds the rate at which an event from a source is generated.
EvRateEntryLst holds a list of EvRateEntry.
EvRateGCcfg holds the configuration for the entries/memory limits for EvRateHash and the garabge collection criterias/targets.
EvRateHash holds the EvRate hash table.
EvRateInfo holds the event rate generation and blacklist status.
EvRateMax holds the maximum rate and the interval on which to compute it.
No description provided by the author
MatchEvRD holds the criteria for matching EvRateEntry-es based on the exceeded state and time offsets from a reference time.
MatchEvRTS holds the criteria for matching EvRateEntry-es based on the exceeded state and the various time stamps.
MemConfig holds the memory limits for the various state that is kept.
records a message "backtrace" (method type/repl status, direction, isRetr) TODO: move it in a separate file and conditional compile.
No description provided by the author
RegEntry holds minimal binding information (from REGISTER replies) WARNING: since a custom mem.
hash table for reg entries (aor uri indexed).
No description provided by the author
debugging received msg "backtrace" TODO: move it in a separate file and conditional compile.
timers and timer related functions.

# Type aliases

CallAttrF contains flags correpding to CallAttrIdx values.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
EvRateMaxes is an array of EvRateMax that holds all the rates that should be checked.
HandleEvF is a function callback that should handle a new CallEvent.
HandleNewCev is a function callback that is called every time a new call based event appears.
No description provided by the author
record message type and direction TODO: move it in a separate file and conditional compile format: last bit (15) -> direction, 0 caller -callee or 1 (reverse) bit 14 -> type: 0 request, 1 reply bit 13-10 -> retransmission no.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author