Commit Graph
41 Commits
Author SHA1 Message Date
Dave HortonandClaude Fable 5.1 b51362ac04 fix: shared-roster expiry and sbc_addresses keepalive (two-SBC cutover bugs) (#153)
* fix: expire FS/RTP roster members on shared last-seen, not one SBC's local view

The active-fs, fs-service-url and active-rtp redis sets are shared by every
SBC in the cluster, but the expiry sweep in lib/options.js removed members
based solely on when THIS sidecar last received an OPTIONS ping from them.
An SBC that was taken out of active-sip (so FS/RTP servers stopped pinging
it) therefore deleted every feature server and rtpengine from the shared
rosters 60s later, rejecting all inbound calls until the other SBC re-added
them on its next ping cycle.

Each SBC now records the last ping it received per member in a shared redis
hash (<setName>:lastseen, member -> epoch ms) and the sweep removes a member
only when that shared timestamp is older than EXPIRES_INTERVAL. Members with
no shared timestamp are never expired by the sweep, so a parked or
mixed-version SBC cannot remove members the others are still hearing from.

Adds a unit test that reproduces the failure against the old code.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix: make sbc_addresses keepalive recurring instead of a single setTimeout

addSbcAddress() refreshes the row's last_updated and cleanSbcAddresses()
deletes rows older than DEAD_SBC_IN_SECOND (default 3600s), but app.js only
re-called addSbcAddress once, 15 minutes after connecting. The row then
went stale, and the next sidecar to start anywhere in the cluster deleted
the healthy SBC's row, so new sip realms were provisioned with one SBC IP
instead of two.

Run one recurring timer (SBC_PUBLIC_ADDRESS_KEEP_ALIVE_IN_MILISECOND, default
15 min) that refreshes this SBC's rows and only then reaps stale ones, so the
cleaner never runs ahead of this process's own keepalive. The timer is
unref'd and replaced (not stacked) on drachtio reconnect.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 10:58:05 -04:00
Dave HortonandClaude Fable 5.1 9f00a513f8 feat: include jambonz and drachtio versions in X-Jambonz-Discover response (#152)
- jambonzVersion is read from the schema_version table via the existing
  db-helpers pool (now exposed on srf.locals); a DB error yields null
  rather than failing discovery
- drachtioVersion is captured from the drachtio connect handshake and
  stored on srf.locals
- README example updated

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-15 12:23:59 -04:00
Sam Machin ce05d91e6d restart regbots on drachtio reconnect (#151)
* restart regbots on drachtio reconnect

* PR feedback

* add check for multiple regbot instances
2026-09-09 15:02:23 +01:00
Sam Machin 3122de4316 Feat/auth trunk register (#141)
* allow REGISTER for auth trunks

* use db-helpers

* bump db-helpers
2026-07-14 09:17:31 -04:00
Sam Machin c61eb8523d only accept fs/rtp options from internal CIDR (#140) 2026-07-07 08:20:09 -04:00
Dave Horton e6a691d366 fix support for using writer/reader nodes properly (#126) 2026-01-15 08:48:06 -05:00
Dave Horton c4278be34d when running under K8S set JAMBONES_NETWORK_CIDR as private ip address space 2025-11-24 11:25:43 -06:00
Hoan Luu Huu 55ace7820f Feat/cli remove fs (#116)
* support draining feature server manually

* support draining feature server manually

* support CLI to add or remove feature server

* wip

* wip

* wip

* add redis key for feature server and integration test

* wip
2025-10-28 19:26:24 -04:00
Hoan Luu Huu 658cb6ae7d remove empheral gateways if regbot is stopped (#115)
* remove empheral gateways if regbot is stopped

* wip

* wip

* update realtime db version
2025-10-28 08:02:43 -04:00
Dave Horton e94ae431d8 add support for registration trunks which result in a set of ephemera… (#112)
* add support for registration trunks which result in a set of ephemeral sip gateways to be stored in redis

* wip

* refactor createEphemeralGateways into realtime dbhelpers

* minor

* update eslint
2025-10-21 07:32:06 -04:00
Sam Machin 52e1fc78b9 Store the private IP in redis when a client registers (#113)
* add srf.locals.privateSipAddress

* add private SBC address in client redis data

* lint
2025-10-04 20:08:42 -04:00
Hoan Luu Huu 3cfa0a94aa support trunk register with account sip realm if available (#107)
* support trunk register with account sip realm if available

* wip

* wip

* wip

* wip
2025-06-23 08:34:39 -04:00
Sam Machin a22ab38aab Disable Options and Registration on certain failures (#90)
* disable options ping on defined errors

* correct sid

* disable reg on error

* fix path

* fixes from testing

* fixes from testing

* lint

* update dbhelpers dep

* remove whitespace in CONFIG strings

* lint

* this seems like a better way of convering and matching status codes
2025-04-02 08:22:52 -04:00
Dave Horton 3c498b2624 use system_information.sip_domain_name in the Contact header, if available (#71) 2024-06-26 13:15:23 -04:00
Dave Horton 8f59ecbe4a fix #61, contact header should have port 5061 when registering over tls (#69) 2024-06-24 09:36:50 -04:00
Dave Horton 0ff39724e4 when registering over tls contact header should have appropriate sip … (#62)
* rebase

* update gh workflow
2024-06-19 12:24:08 +01:00
Hoan Luu Huu d04337504a send options ping (#48)
* send options ping

* wip

* wip

* wip

* wip

* update blacklist sip gateway to redis

* wip
2024-03-30 09:18:31 -04:00
p.souza dcebadd63a centralize envs 2023-12-26 11:12:15 +01:00
Quan HL c80401c907 let realtimedb-help build configuraiton from env vars 2023-11-10 11:13:19 +07:00
Quan HL 50dcb8042c add sentinelPassword option 2023-10-05 06:07:21 +07:00
Dave Horton fe0b3e34c5 only add public IPs to the sbc_addresses table when listening on multiple interfaces 2023-07-24 13:45:20 -04:00
Quan HL 76c38ad6ce use digest-utils 2023-06-15 18:19:14 +07:00
Quan HL 7767249271 feat: register client 2023-06-14 18:41:31 +07:00
Quan HL 2e84efb6ad update review comment 2023-06-07 21:16:29 +07:00
Quan HL d1e46a805a feat: sentinel configuration 2023-06-07 16:39:40 +07:00
Quan HL 34575edf4c feat: sentinel configuration 2023-06-07 16:06:05 +07:00
Quan HL 8244288585 feat: sentinel configuration 2023-06-07 16:03:37 +07:00
Quan HL 946aa25448 feat: sentinel configuration 2023-06-07 15:48:40 +07:00
Quan HL 67b36d3207 feat: update tls and wss port for sbc-addresses 2023-05-04 13:40:33 +07:00
Quan HL f34e0bf241 feat: update tls and wss port for sbc-addresses 2023-05-04 13:37:12 +07:00
Anton Voylenko 5f6a187826 validate at startup and add JAMBONES_MYSQL_PORT 2023-04-07 21:22:47 +03:00
Dave Horton c361a96baf clean sbc addresses at startup 2023-04-06 12:12:23 -04:00
Quan HL 9d5ca4b856 feat: keep alive and clean up dead sbc 2023-04-06 12:42:27 +07:00
Quan HL 5e15a622de feat: update voip carriers register status 2023-04-02 14:44:13 +07:00
Dave Horton fc43de3b89 #9 - handle short expires in register requests 2023-01-05 13:00:31 -05:00
Dave Horton c5ac53ce37 revamp algorithm to determine whether to become the active regbot in a cluster 2022-10-20 23:02:53 -04:00
Quan Luu 95f863295b feat: Outbound register use sbc public IP address 2022-09-14 21:03:07 +07:00
Quan Luu 572fac7963 fix: should not use Array.at function, use square brackets instead 2022-09-13 15:18:58 +07:00
Quan Luu da57ab4212 feat: merge sip-registra and sip-options-handler 2022-09-09 16:26:14 +07:00
Quan Luu 489f20a2cd fix: timeout issue 2022-09-01 08:06:09 +07:00
Quan Luu 933059f262 first version 2022-09-01 07:36:35 +07:00