# Inbound Calling

> Let your voice agent answer calls to your phone numbers

URL: https://docs.lemuai.com/integrations/telephony/inbound

## Overview

Lemu AI can answer inbound calls with Twilio, Plivo, Cloudonix, Vobiz and Asterisk ARI. When someone calls your configured phone number, your voice agent automatically answers and handles the interaction. The inbound calling configuration in Lemu AI uses the same telephony settings as outbound calling.

## Supported Providers for Inbound Calls

  - [Twilio](https://docs.lemuai.com/integrations/telephony/twilio): Industry-leading platform with robust inbound call handling
  - [Cloudonix](https://docs.lemuai.com/integrations/telephony/cloudonix): SIP-based inbound calling with flexible trunk configuration
  - [Vobiz](https://docs.lemuai.com/integrations/telephony/vobiz): Cloud-based telephony with global reach and competitive pricing
  - [Plivo](https://docs.lemuai.com/integrations/telephony/plivo): Plivo numbers routed to your agent through a Plivo application
  - [Asterisk ARI](https://docs.lemuai.com/integrations/telephony/asterisk-ari): Connect to your own Asterisk PBX via the Asterisk REST Interface

**Note:** **Vonage** is supported for outbound calls only. For **Exotel** inbound calls, contact us at hello@lemuai.com and we will help you route your Exotel number to your agent.

## How Inbound Calling Works

When someone calls your configured phone number:

1. **Call Received**: The telephony provider receives the incoming call
2. **Webhook Triggered**: The provider sends a webhook to Lemu AI
3. **Agent Activated**: Lemu AI activates your configured voice agent workflow
4. **Audio Streaming**: Real-time audio streams between caller and agent via WebSocket
5. **Conversation Handled**: Your voice agent manages the entire conversation

## Configuration in Lemu AI

Setting up inbound calling requires three simple steps:

### Step 1: Configure Telephony Provider

The telephony configuration for inbound calling is **identical** to outbound calling. Follow the **Configuration** section in your provider's documentation page:

- [Twilio Configuration](https://docs.lemuai.com/integrations/telephony/twilio#configuration)
- [Plivo Configuration](https://docs.lemuai.com/integrations/telephony/plivo#configuration)
- [Cloudonix Configuration](https://docs.lemuai.com/integrations/telephony/cloudonix#configuration)
- [Vobiz Configuration](https://docs.lemuai.com/integrations/telephony/vobiz#configuration)
- [Asterisk ARI Configuration](https://docs.lemuai.com/integrations/telephony/asterisk-ari#configuration-in-lemu)

### Step 2: Get Your Workflow Webhook URL

1. **Find Your Workflow ID**: 
   - Navigate to your workflow page (e.g., `https://app.lemuai.com/workflow/3`)
   - Note the workflow ID from the URL (in this example: `3`)

2. **Construct Webhook URL**:
```
   https://app.lemuai.com/api/v1/telephony/inbound/{workflow_id}
```
   
   For example, if your workflow ID is `3`:
```
   https://app.lemuai.com/api/v1/telephony/inbound/3
```

### Step 3: Configure Provider-Specific Inbound Settings

Each telephony provider requires additional configuration to route incoming calls to your Lemu AI webhook. Follow the provider-specific inbound setup instructions:

- [Twilio Inbound Setup](https://docs.lemuai.com/integrations/telephony/twilio#inbound-calling-setup)
- [Plivo Inbound Setup](https://docs.lemuai.com/integrations/telephony/plivo#inbound-calling-setup)
- [Cloudonix Inbound Setup](https://docs.lemuai.com/integrations/telephony/cloudonix#inbound-calling-setup)
- [Vobiz Inbound Setup](https://docs.lemuai.com/integrations/telephony/vobiz#inbound-calling-setup)
- [Asterisk ARI Inbound Setup](https://docs.lemuai.com/integrations/telephony/asterisk-ari#inbound-calling)

## Testing Inbound Calls

After completing both the Lemu AI configuration and provider-specific setup:

1. **Test Call**: Call your configured phone number from another phone
2. **Verify Connection**: Ensure your voice agent answers and responds appropriately
3. **Check Logs**: Monitor call logs in both Lemu AI and your provider's dashboard
4. **Audio Quality**: Verify clear two-way audio communication

## Troubleshooting Common Issues

  **Calls go to voicemail instead of agent**

  - Verify webhook URLs are correctly configured at your provider
  - Check the webhook URL was pasted exactly, including the workflow ID
  - Ensure phone numbers are properly linked to your application
  
  
  **Agent doesn't respond to incoming calls**

  - Confirm your voice agent workflow is properly configured
  - Check webhook signature validation is working
  - Verify WebSocket connections are established successfully
  
  
  **Provider mismatch error**

  - **Error**: "Configuration error: This phone number is configured for a different telephony provider"
  - **Solution**: Check your dashboard settings and update your webhook URL configuration to match the correct provider
  - Ensure the phone number is configured for the same provider in both Lemu AI and your telephony console
  
  
  **Workflow not found error**

  - **Error**: "Workflow not found"
  - **Solution**: Verify the workflow ID in your webhook URL is correct and the workflow exists in your dashboard
  - Double-check the webhook URL format: `https://app.lemuai.com/api/v1/telephony/inbound/{workflow_id}`
  
  
  **Account validation failed**

  - **Error**: "Authentication error: Account credentials do not match"
  - **Solution**: Verify your account SID/credentials configuration in Lemu AI matches your telephony provider settings
  - Re-enter your provider credentials in the telephony configuration page
  
  
  **Phone number not configured**

  - **Error**: "Phone number not configured: This number is not set up for inbound calls"
  - **Solution**: Add this phone number to your telephony configuration in Lemu AI
  - Ensure the phone number is properly linked to your provider account
  
  
  **Signature validation failed**

  - **Error**: "Security error: Webhook signature validation failed"
  - **Solution**: Verify your auth token configuration in Lemu AI matches your provider settings
  - Ensure webhook requests are coming from your telephony provider's verified IP ranges
  - Check that your webhook URL is accessible and responding correctly
  
  
  **Quota exceeded error**

  - **Error**: "Service temporarily unavailable: Your account has exceeded usage limits"
  - **Solution**: Contact your administrator or upgrade your plan to continue receiving calls
  - Check your provider account billing and usage limits
  
  
  **General authentication failed**

  - **Error**: "Authentication failed"
  - **Solution**: Check your webhook URL configuration and ensure your telephony provider settings match your dashboard configuration
  - Verify all credentials are entered correctly and haven't expired
  
  
  **Poor audio quality on inbound calls**

  - Check network bandwidth and latency from provider to Lemu AI
  - Verify audio pipeline configuration matches provider requirements
  - Review WebSocket connection stability
  

## Best Practices

- **Single Configuration**: Use the same telephony configuration for both inbound and outbound calls
- **Testing**: Always test inbound calling after configuration changes
- **Monitoring**: Monitor both Lemu AI logs and provider dashboards for call analytics
- **Backup Numbers**: Configure multiple phone numbers for redundancy
- **Security**: Ensure webhook signature verification is enabled for security

## Next Steps

1. Choose your telephony provider and complete the basic configuration
2. Follow the inbound setup steps on your provider's page
3. Test your inbound calling setup
4. Configure your voice agent workflow for optimal caller experience
