|
| 1 | +## Overview |
| 2 | + |
| 3 | +**Telaius** gives an AI agent a telephone. A SIMCom SIM7600G-H modem hanging off a USB port |
| 4 | +places an ordinary outbound call with a regular SIM card, and the xAI Realtime voice API |
| 5 | +holds the conversation that follows. Nothing in the loop is a cloud telephony service: no |
| 6 | +Twilio, no SIP trunk, no rented number, and no microphone or speaker either, because the |
| 7 | +call's audio travels as raw PCM over one of the modem's own USB interfaces. The name is |
| 8 | +*telephone* plus *Aius Locutius*, the Roman disembodied voice that warned of the Gauls. |
| 9 | + |
| 10 | +## Why it exists |
| 11 | + |
| 12 | +Agents can read and write; they cannot ring a barbershop that only takes bookings by phone, |
| 13 | +or a private seller who will answer a call but never an email. The usual way to close that |
| 14 | +gap is a cloud telephony API, which means handing a third party every number you dial and |
| 15 | +every word of every call, and paying per minute for the privilege. |
| 16 | + |
| 17 | +The project's one load-bearing decision is to treat cellular telephony as **local hardware |
| 18 | +instead of a cloud API**. A modem, a SIM and a Raspberry Pi sit in the room; the calls are |
| 19 | +plain mobile calls from a plain number. That decision is also the hard part, because |
| 20 | +dialling and talking turn out to be different capabilities: an `ATD` command that reports a |
| 21 | +connected call proves nothing about whether audio can reach it. Most of the work so far has |
| 22 | +gone into proving the audio path on real hardware against a real carrier. |
| 23 | + |
| 24 | +## How it works |
| 25 | + |
| 26 | +A call runs through four pieces: the modem adapter driving AT commands, a digital audio |
| 27 | +bridge moving 20 ms PCM frames in both directions, a voice session talking to xAI, and an |
| 28 | +orchestrator that holds the lifecycle and writes the result. |
| 29 | + |
| 30 | +```bash |
| 31 | +# let the AI run a call with a goal, in Polish |
| 32 | +python -m telaius.voicebridge +48XXXXXXXXX --lang pl --audio relay \ |
| 33 | + --task "Book a haircut on Saturday after 12:00" \ |
| 34 | + --callee "Brzytwa barbershop" |
| 35 | +``` |
| 36 | + |
| 37 | +The modem exposes several USB interfaces and Telaius uses three of them: `if2` for AT |
| 38 | +commands, `if4` for call audio, `if5` for QMI, which is the only place IMS registration |
| 39 | +state is visible. Audio only switches to USB once the call is up - `AT+CPCMREG=1` is sent |
| 40 | +*after* `VOICE CALL: BEGIN`, and until it is, the far end hears the board's own microphone. |
| 41 | +On Linux the kernel's `option` and `qmi_wwan` drivers stay attached and the stable |
| 42 | +`/dev/serial/by-id/*SimTech*` links are used; on macOS, where no driver claims the device, a |
| 43 | +raw libusb path does the same job. |
| 44 | + |
| 45 | +Every call leaves a folder behind: `call.mp3` with both sides, a readable `transcript.txt`, |
| 46 | +and a `result.json` carrying the outcome (`done`, `partial`, `failed`, `no_task`, |
| 47 | +`unknown`), a summary written for the owner, and why the call ended - the bot said goodbye, |
| 48 | +the callee hung up, or the duration cap hit. The bot reports through an `end_call` tool it |
| 49 | +can invoke itself; if the callee hangs up first, it is asked for the result afterwards. |
| 50 | + |
| 51 | +What the bot says is configuration, not code. Each language is a TOML file under `prompts/` |
| 52 | +holding its introductions, task template, rules and recording disclosure, so adding |
| 53 | +`prompts/<lang>.toml` adds a language. Russian and Polish ship today. |
| 54 | + |
| 55 | +Telephony is a place where "it works on my unit" is the default failure, so the repo keeps |
| 56 | +what is proven separate from what is hardware-dependent. VoLTE is the clearest example: an |
| 57 | +unregistered IMS falls back to 2G CSFB, and carrying USB audio on a VoLTE call needed a |
| 58 | +specific SIMCom firmware before it worked reliably in both directions. Those findings live |
| 59 | +in the repo rather than in the code's assumptions. |
| 60 | + |
| 61 | +## Status |
| 62 | + |
| 63 | +M0 (a real call with simultaneous two-way USB audio, no microphone or speaker) and M1 (a |
| 64 | +live AI conversation in Russian and Polish, with barge-in and model-initiated hangup) work |
| 65 | +as CLI prototypes. M2, the MCP interface that will let another agent delegate a call and |
| 66 | +collect the report, is not started. Open items are listed honestly in the hardware notes: |
| 67 | +one carrier's VoLTE is still unresolved, long-term USB power margin is unproven, and a call |
| 68 | +cut by the duration cap ends abruptly rather than wrapping up. |
| 69 | + |
| 70 | +## Technical details |
| 71 | + |
| 72 | +| Aspect | Detail | |
| 73 | +| --- | --- | |
| 74 | +| Language | Python 3.11+, installed as a package (`pip install -e .`) | |
| 75 | +| Dependencies | `pyusb`, `websockets`; `ffmpeg` optional, for the MP3 of each call | |
| 76 | +| Hardware | DFRobot TEL0162 board carrying a SIMCom SIM7600G-H, USB `1e0e:9001`, plus a registered SIM | |
| 77 | +| Voice | xAI Realtime (`grok-voice-latest`), server-side VAD, ~0.6-0.9 s to first audio | |
| 78 | +| Host | Raspberry Pi or any Linux box (`dialout` group, a udev rule, ModemManager kept away); macOS via libusb | |
| 79 | +| Interface | CLI today (`telaius.at`, `telaius.qmi`, `telaius.calltest`, `telaius.voicebridge`); MCP planned | |
| 80 | +| Version | 0.1.0 | |
| 81 | + |
| 82 | +Calls, recordings and the `.env` holding the xAI key are all gitignored - none of it belongs |
| 83 | +in a repository. The project's own rule on use is short: only call numbers whose owners have |
| 84 | +agreed to be called by an AI assistant, and the bot introduces itself as one. |
| 85 | + |
| 86 | +## Links |
| 87 | + |
| 88 | +- [Repository](https://github.com/Flopsstuff/telaius) |
| 89 | +- [Concept and milestones](https://github.com/Flopsstuff/telaius/blob/main/docs/TELAIUS_CONCEPT.md) |
| 90 | +- [Hardware notes: proven vs. open](https://github.com/Flopsstuff/telaius/blob/main/docs/HARDWARE_NOTES.md) |
| 91 | +- [VoLTE and IMS findings](https://github.com/Flopsstuff/telaius/blob/main/docs/VOLTE_NOTES.md) |
| 92 | +- [SIM7600X-H module (SIMCom)](https://www.simcom.com/product/SIM7600X-H.html) |
| 93 | +- [TEL0162 carrier board (DFRobot wiki)](https://wiki.dfrobot.com/tel0162/) |
0 commit comments