<aside> ๐Ÿ’ต

At a glance. All prices were checked on Sep 29, 2026. They don't include sales tax or shipping.

<aside> โš ๏ธ

Three changes to our earlier plan (found while checking sources today)

  1. FreePBX 17 won't install on a Raspberry Pi. Its official installer only runs on Debian 12 on a regular 64-bit Intel/AMD computer (amd64), and it refuses to run on ARM. So on the Pi we use plain Asterisk. FreePBX 17 is still a good choice if you use a spare PC with Debian 12.
  2. Asterisk isn't in the normal Debian 12 or 13 package lists. Debian only carries it for old Debian 11 (version 16) and for its test branches (version 22). So on the Pi we build Asterisk 22 from its official source code.
  3. xAI's SIP route needs a public web address. When a call reaches sip.voice.x.ai, xAI sends a webhook to your server, and that server must be reachable from the internet. That breaks our "no public server" rule. xAI also expects a number you own, and magicJack says its numbers stay theirs. So the main plan uses Asterisk AudioSocket plus a small bridge script on the Pi. The script opens an outgoing WebSocket to xAI, and no ports are opened inbound. </aside>

1. Overview

Right now your magicJack turns internet calls into an ordinary phone line for your desk phone. This plan adds three small pieces so an AI assistant can answer that same number, while your desk phone keeps working.

Everything sits behind your router. The Pi only makes outgoing connections: to xAI, and later to Salesforce. Nobody on the internet can reach your phone system directly.

Diagram

flowchart LR
  Caller["Caller (any phone)"] -->|"phone network"| MJ["magicJack<br>(stays on the router)"]
  MJ -->|"RJ11 phone cord"| FXO["HT813 FXO port"]
  Desk["Desk phone"] -->|"RJ11"| FXS["HT813 FXS port"]
  FXO --- HT["Grandstream HT813"]
  FXS --- HT
  HT -->|"SIP over office network"| AST["Asterisk on Raspberry Pi"]
  AST -->|"AudioSocket (inside the Pi)"| BR["Bridge script"]
  BR -->|"outgoing secure WebSocket"| XAI["xAI Grok Voice"]
  BR -.->|"optional, outgoing HTTPS"| SF["Salesforce"]

The same thing as a text flow: Caller โ†’ phone network โ†’ magicJack (on the router) โ†’ phone cord โ†’ HT813 FXO port โ†’ office network (SIP) โ†’ Asterisk on the Pi โ†’ AudioSocket โ†’ bridge script โ†’ outgoing secure WebSocket โ†’ xAI Grok Voice. The desk phone plugs into the HT813 FXS port and becomes extension "desk" on Asterisk.

Outbound calls go the other way: the AI asks the bridge script to place a call โ†’ Asterisk โ†’ HT813 FXO โ†’ magicJack โ†’ the person's phone.

Why this design is good

Limits to know up front