Repository navigation
feat!: take lines and calls from the server and dial outside calls - #1
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.allowOutsideis set.owner,lines,controlandcall.callNoteare removed.crumble.tokenEnvis required, and SIP accounts move tosip.accounts; seecrumble-voice.example.json. The local control server andPOST /v1/callsare gone, because bots place calls through the server.speech.turnDetection,speech.eagerness,speech.silenceDuration).call.allowOutside, anoutsidecall 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 includeinternal/sipline/outside_test.gofor 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.allowOutsideand the line'scallsOthersare on.