Maksim Totmin
0d8a56e73f
fix: build system — findWebDir order, auto-copy web static to bin
...
* findWebDir: CWD and project root checked before binary-adjacent path,
so dev always serves fresh web/build/ over stale bin/web/build/
* build-go: auto-copies web/build/ to bin/web/ before Go compile
* build-prod: same auto-copy for production builds
* Proper refresh of frontend static on every make build
2026-06-25 19:30:49 +07:00
Maksim Totmin
78e53f42bf
fix: SvelteKit UI reactivity with Svelte 5 runes
...
* / replaces legacy $: syntax
* Active menu highlight via .url.pathname (/stores)
* Logout navigates to /login via goto()
* Token/user footer updates reactively via
2026-06-25 19:30:42 +07:00
Maksim Totmin
cc9da3ad7d
refactor: common util package, ESL/AMI/security fixes, Prometheus metrics
...
Backend stability and security improvements:
* internal/util/ — common RandomHex helper, removed 3 duplicates
* ESL: deduplicated readMessage (locked/unlocked), net.JoinHostPort for IPv6
* AMI: synchronous reconnect() in readEventsLoop, net.JoinHostPort for IPv6
* Auth: /api/auth/refresh accepts Authorization header only (no ?token=)
* decodeJSON: http.MaxBytesReader(1<<20) body limit
* Trunks: gatewayParams() uses configured ESL.GatewayPrefix
* Config: jwt_secret_env env-var fallback
* FSCollector: time.After → time.NewTimer with defer Stop
* Monitoring: Prometheus counters (route_requests, nodes_total/healthy, uptime)
* go fmt pass across all internal/ packages
2026-06-25 19:30:36 +07:00
Maksim Totmin
e66ac27dd9
docs: fix 12 documentation inaccuracies in README.md and AGENTS.md
...
README.md fixes:
- Architecture diagram now shows pulse-lets-go-agent layer
- Features list: added agent, auto-trunk, WS gateway, user-01 protection
- route.lua example: replaced fake curl.fetch() with real api:execute()
- systemd unit: Wants=nats.service removed (NATS on separate host)
- Gateway mapping: removed grep 'pulse-' filter (misses existing gateways)
- Production deployment: added agent deployment step (between NATS and route.lua)
- Makefile commands: added build-agent, build-siptest, siptest-*, emulate-*
AGENTS.md fixes:
- Structure: added missing cmd/emulator, cmd/siptest, cmd/pulse-lets-go-agent, esl/, ami/, contrib/
- NATS model: added sip_gateway field
- config.json: added nats_user, nats_password, tls, rate_limit, log, esl blocks
- Internal packages: added esl/ and ami/
- route.lua name: route_call → pulse_route (matches production)
2026-06-25 17:16:03 +07:00
Maksim Totmin
13c88c1586
fix: agent systemd unit remove nats dependency
...
Agent connects to NATS remotely, not locally. After=network only.
2026-06-25 16:59:39 +07:00
Maksim Totmin
95ac4164dd
chore: emulator sip_gateway, Makefile targets, full README documentation
...
- Emulator: add sip_gateway field to all scenarios (auto-trunk creation)
- Makefile: build-agent, build-siptest, emulate-*, siptest-* targets
- README: full documentation with agent section, production deployment
- Project structure update with all components
2026-06-25 16:59:17 +07:00
Maksim Totmin
1e6f432230
feat: metrics agent for FreeSWITCH and Asterisk nodes
...
- pulse-lets-go-agent: collects metrics from PBX nodes via ESL (FreeSWITCH) or AMI (Asterisk)
- AMI client (raw TCP) for Asterisk Manager Interface
- Collector interface: collect, connect, subscribe hangup events, close
- FreeSWITCH collector: show channels, max_sessions, idle_cpu
- Asterisk collector: CoreShowChannels, CoreSettings
- System collector: /proc/loadavg, /proc/stat (CPU idle)
- Failure tracker: sliding window for call_failure_rate
- NATS publisher: pulse.metrics.<node_id> every 5 seconds
- Graceful shutdown, retry logic (5 failures → status=down)
- Template configs for UC nodes (Asterisk) and ses-sip (FreeSWITCH)
2026-06-25 16:59:10 +07:00
Maksim Totmin
3c698a8bdb
feat: SIP load testing tool
...
- SIP UAC mode (call FreeSWITCH, rate/configurable CPS)
- SIP UAS mode (respond 200 OK as PBX node)
- Configurable: rate, concurrency, total calls, caller/dest numbers
2026-06-25 16:59:02 +07:00
Maksim Totmin
f25f8e4d01
feat: auto-trunk creation, SIP gateway in metrics, gateway WS broadcast
...
- SIPGateway field in NodeMetric model
- HasNode() engine method
- OnNewNode callback in NATS subscriber
- Auto-create balance trunk from new node metric
- BroadcastGatewayEvent on WS hub
- Gateway status indicators in trunks UI (green/red/gray)
- SPA fallback for frontend routing
2026-06-25 16:56:49 +07:00
Maksim Totmin
533a1fba49
feat: ESL client, gateway management, event subscription
...
- Raw TCP ESL client with reconnect
- GatewayAdd/GatewayDelete/GatewaySyncAll
- SOFIA::gateway_* event processing
- SendAsync for deadlock-free bgapi commands
2026-06-25 16:56:42 +07:00
Maksim Totmin
44f5fa88e5
first commit
2026-06-25 14:27:41 +07:00