Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.spn.wtf/llms.txt

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

Prerequisites

  • Python 3.10 or newer
  • PostgreSQL, either local or Docker Compose
  • LiveKit Cloud project
  • Vobiz SIP trunk credentials
  • Sarvam API key for agent.py, or OpenAI API key for agent_realtime.py
  • Talking Shops API credentials if CRM push is enabled

1. Create The Environment

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt

2. Configure .env

Copy .env.example to .env and fill in the required values. Minimum local setup:
DATABASE_URL=postgresql://user:password@localhost:5432/ignitech

LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=your_livekit_api_key
LIVEKIT_API_SECRET=your_livekit_api_secret

VOBIZ_PHONE_NUMBER=+918071XXXXXX
VOBIZ_SIP_DOMAIN=your-trunk-id.sip.vobiz.ai
VOBIZ_SIP_USERNAME=your_vobiz_username
VOBIZ_SIP_PASSWORD=your_vobiz_password

LLM_PROVIDER=openai
OPENAI_API_KEY=your_openai_api_key
OPENAI_REALTIME_MODEL=gpt-4o-realtime-preview
For Sarvam mode:
LLM_PROVIDER=sarvam
SARVAM_API_KEY=your_sarvam_api_key
STT_LANGUAGE=en-IN
STT_MODEL=saarika:v2.5

3. Initialize The Database

The schema is safe to initialize repeatedly.
python db.py

4. Create LiveKit SIP Configuration

python sip_setup.py create
python sip_setup.py list
Copy the outbound trunk ID from the list output into:
LIVEKIT_SIP_TRUNK_ID=ST_xxxxxxxxxxxx

5. Run The App Locally

Open separate terminals. OpenAI Realtime agent:
python agent_realtime.py start
Scheduler:
python scheduler.py
Lead fetcher:
python lead_fetcher.py
Dashboard:
streamlit run streamlit_app.py
Token server for browser testing:
python token_server.py

6. Add A Test Lead

INSERT INTO leads (name, phone, source)
VALUES ('Test Lead', '<10-digit-mobile>', 'manual');
The scheduler normalizes Indian mobile numbers to E.164, so 98765XXXXX, 098765XXXXX, 9198765XXXXX, and +9198765XXXXX can all resolve to +9198765XXXXX if valid.

7. Make A Manual SIP Test Call

python sip_setup.py call +91XXXXXXXXXX
For a real lead room:
python sip_setup.py call +91XXXXXXXXXX 123
That joins room ignitech-lead-123 using participant identity sip-lead-123.