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.

Local Run Commands

Database initialization:
python db.py
OpenAI Realtime agent:
python agent_realtime.py start
Sarvam agent:
python agent.py start
Scheduler:
python scheduler.py
Lead fetcher:
python lead_fetcher.py
Dashboard:
streamlit run streamlit_app.py

Docker Compose

docker compose up --build
Dashboard:
http://127.0.0.1:8502

Adding A Lead Manually

INSERT INTO leads (name, phone, source, product_name, city, state)
VALUES ('Rahul Sharma', '<10-digit-mobile>', 'manual', 'carbon cleaning', 'Kolkata', 'West Bengal');

Checking Queue State

Ready leads:
SELECT id, name, phone, source, retry_after, retry_count
FROM leads
WHERE status='new'
ORDER BY created_at ASC;
Active calls:
SELECT id, lead_id, phone, call_room, created_at
FROM calls
WHERE status='calling';
Qualified but not pushed:
SELECT id, lead_id, phone, qualification
FROM calls
WHERE status='called'
ORDER BY created_at ASC;

Manual Call Test

python sip_setup.py call +91XXXXXXXXXX
For a specific lead:
python sip_setup.py call +91XXXXXXXXXX 123

Monitoring Logs

Watch for:
  • Scheduler started with the expected timezone and calling window
  • Lead selected and phone normalized
  • SIP participant creation success
  • Agent joins the correct ignitech-lead-{id} room
  • Qualification extraction and DB save
  • Talking Shops push success or failure
  • Stale calls being cleaned
  • Retry scheduling

Common Status Interpretation

WhereStatusMeaning
leadsnewWaiting for scheduler or retry time
leadsdispatchedAt least one call attempt started
leadsfailedInvalid or retry limit reached
callscallingCurrent or stuck attempt
callscalledQualified, ready for CRM push
callspushedCRM handoff complete
callsfailedAttempt failed

Dashboard Usage

The main Streamlit app shows:
  • Total leads
  • Awaiting calls
  • Dispatched leads
  • Qualified calls
  • Pushed calls
  • Failed numbers
  • Max retries reached
  • CSV import
  • Lead and call tables
  • Qualification JSON viewer
The /minutes page shows successful call minutes and supports optional password protection:
MINUTES_DASHBOARD_PASSWORD=your_password