How sipcapture/heplify-server works
Project type and purpose
• heplify-server is a stand-alone, single-binary Go backend service.
• Purpose: listen for HEP-encapsulated SIP/RTCP packets over UDP/TCP/TLS/WebSocket, decode them, persist into a Homer-compatible database (MySQL or PostgreSQL, H5 or H7 schema), rotate tables, expose Prometheus metrics, and optionally ship logs to remote backends.
File structure
• Top-level “cmd/heplify-server”: entry-point main.go.
• “server/”: network listeners for UDP, TCP, TLS, WS.
• “decoder/”: HEP parsing, SIP parsing (“sipparser/”), scripting engines (Lua, expr).
• “database/”: adapters for MySQL/Postgres, table management, mock/test.
• “rotator/”: timed/size-based database table rotation.
• “metric/”: metric definition, Prometheus exporter, reload functionality.
• “remotelog/”: remote log shippers (Elasticsearch, Loki, lineproto).
• “config/”: loading CLI, env, file, and HTTP/web form configuration.
• “scripts/” and “example/”: helper scripts and sample configs.
• “docker/”: several compose stacks tying heplify-server with Homer UI, Prometheus, Grafana, Alertmanager, Loki, Caddy, Influx.
README for additional insights
• Single binary optimized for speed/simplicity, no external SIP proxy required.
• Supports hot reload of Prometheus target settings via SIGHUP.
• Deployed stand-alone or via Docker Compose stacks (hom5, hom7, prom/graf, prom/loki/graf, etc.).
Detail
• Sub-modules (e.g., separate out lua vs. expr engines) if space permits.
• Call out hot-reload SIGHUP path from config file to Metrics/RemoteLog modules.