This app is a Next.js project that integrates Vapi AI for voice conversations (web and phone) with multilingual support (Kannada default, plus English, Tamil, Telugu, Punjabi). It supports:
- Web conversations via the browser microphone
- Outbound phone calls via Vapi transport
- Outbound phone calls via Exotel Connect API (India-friendly)
- Inbound phone calls by forwarding your Exotel number to your Vapi-managed number
Create .env.local with the following keys:
- Client
NEXT_PUBLIC_VAPI_PUBLIC_KEYNEXT_PUBLIC_VAPI_ASSISTANT_ID
- Server
VAPI_API_KEY(private key)VAPI_PHONE_NUMBER_ID(your Vapi phone number id)TWILIO_PHONE_NUMBER(your Vapi-managed public number)NEXT_PUBLIC_BASE_URL(e.g., https://your-app.vercel.app)- Exotel
EXOTEL_ACCOUNT_SIDEXOTEL_API_KEYEXOTEL_API_TOKENEXOTEL_SUBDOMAIN(e.g., api.exotel.com)EXOTEL_CALLER_ID(your Exophone)
Endpoint: POST /api/exotel/call/outbound
Body:
{ "customerPhone": "+91XXXXXXXXXX", "customerName": "Optional" }
Behavior: Exotel dials the customer first (From), shows your Exophone as caller ID, then bridges to your Vapi public number (To) so the AI assistant handles the call.
To receive inbound calls on your Exotel number with the AI assistant:
- In Exotel dashboard, set your Exophone call flow to “Connect” to external number
- Use your Vapi-managed public number (e.g., +1 765 945 2629) as the destination
- Ensure the Vapi number is linked to your assistant in the Vapi dashboard
- Save and test by calling your Exophone
Notes:
- If your Exotel account restricts international dialing/forwarding, contact Exotel support or use a Vapi-supported provider (e.g., Vonage) for the public number in the same region as your callers.
- For trial accounts, you might need to verify destination numbers.
Visit /call-center and use the “Test via Browser” card to start/stop a web session with the assistant.
Server events and captured leads are stored in MongoDB via app/api/vapi/webhook/route.ts. Update lib/db.ts with your connection string.