Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vobiz.ai/llms.txt

Use this file to discover all available pages before exploring further.

Collect a caller’s phone number via keypad (DTMF + # terminator) with validation and duplicate detection. XML elements used: <Speak>, <Gather inputType=dtmf finishOnKey=#>, <Redirect>, <Hangup>

View on GitHub

Clone and run the full working example

Getting started

git clone https://github.com/vobiz-ai/Vobiz-Number-Capture-XML-Python.git
cd Vobiz-Number-Capture-XML-Python
cp .env.example .env
pip install -r requirements.txt
python server.py

Overview

The caller is prompted to enter a phone number using their keypad, followed by #. The server validates the digits, reads them back one at a time for confirmation, and stores the number with deduplication. Captured numbers are accessible via API for CRM import or lead management.

Call flow

Caller dials in
  └── /answer  → "Please enter your phone number followed by #"
        └── /number-received  → Validates digits, reads back digit by digit
              └── /number-confirm  → "Press 1 to confirm, 2 to re-enter, 3 to cancel"
                    ├── 1 → Saved to leads store → Hangup
                    ├── 2 → Back to /answer
                    └── 3 → "Cancelled." → Hangup

  └── GET /leads/export.csv   → CRM import
  └── GET /leads/analytics    → {total: 234, unique: 198, duplicates: 36, today: 12}

Vobiz webhooks

Set /answer as the Answer URL in your Vobiz application.
MethodPathDescription
POST/answerPrompts for number + #
POST/number-receivedValidates + reads back digit by digit
POST/number-confirm1=confirm / 2=re-enter / 3=cancel
POST/number-received-repeatRe-reads number on invalid key press
POST/hangupCleanup

App API

MethodPathDescription
GET/leadsList all captured numbers
GET/leads/export.csvDownload as CSV
GET/leads/analyticsTotal, unique, duplicates, today count
GET/leads/{id}Single lead detail
DELETE/leads/{id}Remove a lead

Environment variables

VariableRequiredDescription
HTTP_PORTNoServer port (default: 8000)
PUBLIC_URLNoProduction URL - skips ngrok if set
NGROK_AUTH_TOKENNongrok auth token for local dev