Skip to content

feat!: take lines and calls from the server and dial outside calls - #1

Merged
cheetahbyte merged 2 commits into
mainfrom
voice-gateway
Nov 10, 2026
Merged

cheetahbyte merged 2 commits into
mainfrom
voice-gateway

Conversation

@cheetahbyte

Copy link
Copy Markdown
Contributor

Summary

The gateway now gets its lines, the owner's numbers and its calls from the Crumble server over a voice gateway token. It no longer reads them from its own config. It also dials outside calls when call.allowOutside is set.

  • Breaking config change: owner, lines, control and call.callNote are removed. crumble.tokenEnv is required, and SIP accounts move to sip.accounts; see crumble-voice.example.json. The local control server and POST /v1/calls are gone, because bots place calls through the server.
  • Call reporting: the gateway reports each call's start before the greeting and its end with a reason, re-sends both after a reconnect, and hangs up when the server or the bot ends the call.
  • Turn detection: turn ends are detected semantically by default (speech.turnDetection, speech.eagerness, speech.silenceDuration).
  • Outside calls: these are off by default. With call.allowOutside, an outside call is dialed only to a number that passes the gateway's own rules: 5 to 15 digits, no premium, service or satellite prefixes, and not one of the owner's numbers.

Server side: crumble-project/bot#133.

Evidence

CI passed on b63f141. The tests include internal/sipline/outside_test.go for the outside-number rules.

Risk and rollback

Reversibility: Requires migration. The config format changed, so rolling back means restoring the old config file and an older server.

Blast radius: Every gateway deployment. It needs a server with crumble-project/bot#133 and a new config. Outside calls stay disabled unless both call.allowOutside and the line's callsOthers are on.

The gateway now authenticates with a voice gateway token and gets its
lines and the owner's numbers from the server's event stream, so the
config file keeps only what belongs to the machine: SIP accounts and
speech settings. The local control server and its POST /v1/calls are
gone; bots place calls through the server.

- Report each call's start before the greeting and its end with a
  reason, and re-send both after a reconnect.
- Mark spoken messages with the call ID and hang up when the server
  ended the call.
- Hang up when the bot asks to, once its goodbye was said.
- Detect the end of a turn semantically by default
  (speech.turnDetection, speech.eagerness, speech.silenceDuration).
- Admit inbound calls atomically with config changes and shutdown.

BREAKING CHANGE: the config drops owner, lines, control, and
call.callNote; crumble needs tokenEnv, and SIP accounts move to
sip.accounts. See crumble-voice.example.json.
With call.allowOutside, off by default, the gateway dials a call event
whose party is "outside" to a number that is not the owner's. It applies
its own number rules first: digits only, 5 to 15 digits, no premium,
service, or satellite prefixes, and not one of the owner's numbers.
Without the setting, such a call fails and nothing is dialed.

- Accept the server's "outside-call:" request ID for a callee's message.
- Ignore what the caller says once the bot hung up, so the goodbye
  plays and the line drops.
- Log dialing, the telephone system's responses, and unanswered calls.
- Free the line before the next bridge test dials from it.
@cheetahbyte
cheetahbyte merged commit c28abd9 into main Nov 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant