01The problem
First-touch qualification calls were repetitive and ate hours of sales time each week.
02What I did
Built a Python agent that places real calls over SIP/VoIP, transcribes the other person in real time with faster-whisper, decides what to say with an LLM (Groq while testing, a local Ollama model in production) and answers in a natural voice with Piper or voice-cloned F5-TTS. A scheduler only dials within calling hours, and Google Sheets holds the contacts and the call log.
03Making a phone line talk to an AI
Phone audio is nothing like a microphone recording: it arrives as 8 kHz G.711 μ-law in 20-millisecond packets. The agent upsamples it to 16 kHz for Whisper, and the 24 kHz speech it generates is brought back down to 8 kHz and sent out at real-time pace, otherwise the other end hears it garbled or rushed.
Transcription runs on faster-whisper on the CPU, the reply comes from Llama 3.1 8B (on Groq while testing, on a local Ollama server in production), and the voice is either Piper or F5-TTS cloned from a 10 to 15 second sample. It waits for 1.8 seconds of silence before answering, keeps replies short, and if the line goes quiet for too long it asks a gentle follow-up question.
04A script, not just a chatbot
A sales call needs structure, so the conversation runs through eight states: greeting, pitch, qualify, handle an objection, collect details, schedule a follow-up, close, done. Moving between them uses simple keyword rules rather than the model, because they are faster and behave the same way every time. The model writes the words; the script decides where the call goes.
Calls are capped at five minutes, it rings for at most 25 seconds and pauses 30 seconds between calls. The scheduler knows the preferred calling hours for 11 UK regions, works in UK time wherever the server is, and waits rather than dialling outside them.
05What happens after the call
Each call ends with a summary of 25 words or fewer and one of ten outcomes, such as "call back", "send an email", "voicemail" or "do not call", written straight back to the Google Sheet. A dry-run mode lets me play the prospect by typing, to test the script without dialling anyone. It was tested on a free Oracle Cloud ARM server and runs as a service that starts on boot.
06The outcome
Routine opening calls can run unattended, with every outcome written back for the team to follow up.
07Tools & skills
- Python
- Speech-to-Text (Whisper)
- Text-to-Speech (F5-TTS)
- LLM Integration
- Conversational AI
- SIP / Telephony
- Google Sheets API
- Workflow Automation
- Google Cloud (GCP)
- OAuth & Service Accounts
- Git