> ## Documentation Index
> Fetch the complete documentation index at: https://blackbox.dasha.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Automatic Time Limits for Calls

> Set automatic time limits for Dasha BlackBox voice agent calls to control costs and prevent stuck calls from running indefinitely. When a call reaches the limit, your agent gracefully ends the conversation. Configure different limits for normal and transferred calls.

Control costs with automatic time limits. Set maximum durations for calls — when reached, your agent ends the conversation gracefully instead of running indefinitely.

**What you'll learn:** Duration configuration, separate limits for normal vs. transferred calls, and cost control strategies.

## Why Use Maximum Call Duration?

### Cost Control

Voice conversations incur per-minute costs for telephony, speech processing, and language model usage. Time limits prevent unexpectedly expensive calls from eroding your budget.

### Resource Management

Long-running calls consume system resources. Time limits ensure resources are available for other calls, particularly important for high-volume operations.

### Prevents Stuck Calls

Technical issues can occasionally cause calls to remain connected indefinitely. Maximum duration acts as a safety net, automatically ending problematic calls.

### Operational Efficiency

Most legitimate conversations complete within predictable timeframes. Time limits help identify and terminate anomalous calls that may indicate problems.

## How to Configure Maximum Call Duration

### Step 1: Enable Maximum Call Duration

1. Open your agent's configuration
2. Navigate to the **Features** tab
3. Find **Maximum Call Duration** and toggle it on

### Step 2: Set Time Limits

Configure duration limits in seconds:

**maxDurationSeconds** (Normal Calls)

* Default: 3600 seconds (1 hour)
* Applies to standard agent conversations

**maxDurationInTransferSeconds** (During Transfer)

* Default: 7200 seconds (2 hours)
* Applies while a call is in transfer state (connected to human operator)

**Why different limits?**

* Normal agent calls typically resolve quickly (5-15 minutes)
* Calls in transfer state may involve complex troubleshooting requiring more time
* Human-to-human conversations naturally run longer than agent interactions

### Step 3: Test Time Limits

Before deploying to production:

1. Make test calls that approach the time limit
2. Verify the agent ends calls gracefully
3. Ensure callers receive appropriate closing messages
4. Adjust limits based on actual conversation durations

## Configuration Examples

This shows the `config.features.maxDuration` object structure:

<Accordion title="Example: Customer Support (Conservative)">
  ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "isEnabled": true,
    "maxDurationSeconds": 1800,
    "maxDurationInTransferSeconds": 3600
  }
  ```

  **Rationale:** Most support calls resolve in 10-20 minutes. Generous buffer allows complex issues while preventing extreme outliers.
</Accordion>

<Accordion title="Example: Sales Qualification (Tight Control)">
  ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "isEnabled": true,
    "maxDurationSeconds": 900,
    "maxDurationInTransferSeconds": 2400
  }
  ```

  **Rationale:** Qualification calls should be brief. Tight limits maintain efficiency and prevent rambling conversations.
</Accordion>

<Accordion title="Example: Technical Support (Generous)">
  ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "isEnabled": true,
    "maxDurationSeconds": 2400,
    "maxDurationInTransferSeconds": 7200
  }
  ```

  **Rationale:** Technical troubleshooting takes time. Generous limits accommodate complex diagnostic processes.
</Accordion>

<Accordion title="Example: Survey Collection (Very Short)">
  ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "isEnabled": true,
    "maxDurationSeconds": 600,
    "maxDurationInTransferSeconds": 1800
  }
  ```

  **Rationale:** Surveys should be brief and focused. Short limits respect respondent time and maintain survey quality.
</Accordion>

## Common Use Cases

### High-Volume Outbound Campaigns

* **Configuration:** 10-15 minute limit for normal calls
* **Why:** Cost control at scale. Brief, focused conversations keep campaign costs predictable.

### Customer Support with Escalation

* **Configuration:** 30 minutes normal, 1-2 hours transferred
* **Why:** Agent handles routine issues quickly; complex issues get adequate human time after transfer.

### Appointment Reminders

* **Configuration:** 5-10 minute limit
* **Why:** Reminders should be brief confirmations, not extended conversations.

### Lead Qualification

* **Configuration:** 15-20 minute limit
* **Why:** Qualification should be efficient. Long calls often indicate poor fit or lack of interest.

### Technical Support Triage

* **Configuration:** 20-30 minutes normal, 2+ hours transferred
* **Why:** Agent triages issues quickly; deep troubleshooting happens after transfer with adequate time.

## Monitoring and Optimization

### Key Metrics

Track these metrics to optimize time limits:

* **Average call duration** - What's typical for your use case?
* **Calls hitting limit** - What percentage reach maximum duration?
* **Duration distribution** - What's the 90th percentile call length?
* **Limit-hit outcomes** - Were these legitimate long calls or stuck calls?

### Optimization Process

1. **Baseline**: Set initial limits based on expected durations
2. **Collect data**: Monitor actual call durations for 1-2 weeks
3. **Analyze**: Review calls hitting limits—were they legitimate or stuck?
4. **Adjust**: Increase limits if legitimate calls are cut short; decrease if limits aren't catching outliers
5. **Repeat**: Continuously monitor and refine

### Warning Signs

**Too many calls hitting limits** (>5% of total)

* Limits may be too restrictive
* Complex issues may need more time
* Consider increasing limits by 25-50%

**No calls ever hit limits**

* Limits may be too generous
* Not providing cost protection
* Consider reducing limits to find optimal threshold

**Caller complaints about abrupt endings**

* Limits too short for your use case
* Improve graceful ending messages
* Increase limits to provide adequate time

## Technical Considerations

### Timer Precision

Duration tracking is accurate to within 1-2 seconds. Calls terminate as soon as the limit is reached.

### Transfer Timing

When a call is transferred:

* Normal call timer stops
* Transferred call timer starts
* Only transferred call limit applies after transfer
* Pre-transfer duration doesn't count toward transferred limit

### Multiple Transfers

If a call is transferred multiple times:

* Transferred call limit applies to total post-transfer time
* Timer doesn't reset between transfers

### Compatibility

Maximum call duration works across:

* ✅ Outbound phone calls
* ✅ Inbound phone calls
* ✅ Web-based voice calls
* ✅ All call types and scenarios

## Troubleshooting

### Problem: Legitimate Calls Being Cut Short

**Solution:** Increase maximum duration by 25-50%. Review calls hitting limits to understand why they run long. Consider if agent needs better training to resolve issues more efficiently.

### Problem: Stuck Calls Not Being Caught

**Solution:** Reduce maximum duration. Verify time limits are enabled. Check for technical issues causing calls to hang without triggering duration tracking.

### Problem: Callers Frustrated by Time Limits

**Solution:** Implement warning system so agent can notify callers when time is running out. Offer to schedule follow-up calls for complex issues. Increase limits if consistently insufficient.

### Problem: High Costs Despite Time Limits

**Solution:** Review actual call duration distribution. Consider whether limits need to be more aggressive. Analyze calls to identify opportunities for agent efficiency improvements.

### Problem: Different Limits Needed for Different Scenarios

**Solution:** Create separate agents for different use cases, each with appropriate time limits. Use agent selection logic to route calls to correctly-configured agents.

## Cost Impact Example

**Scenario:** 10,000 calls per month

**Without time limits:**

* Average duration: 15 minutes
* Outliers (2%): 90 minutes average
* Total minutes: 153,600
* Cost at $0.05/min: $7,680

**With 30-minute limit:**

* Average duration: 15 minutes (unchanged)
* Limited outliers (2%): 30 minutes max
* Total minutes: 150,600
* Cost at $0.05/min: $7,530
* **Savings: \$150/month (2%)**

Even small percentages of outlier calls can significantly impact costs at scale.

## Next steps

<CardGroup cols={2}>
  <Card title="Silence Management" icon="volume-xmark" href="/docs/advanced-features/silence-management">
    Handle inactive calls before time limit
  </Card>

  <Card title="Call Transfers" icon="phone-arrow-right" href="/docs/advanced-features/call-transfers">
    Configure separate limits for transferred calls
  </Card>

  <Card title="Webhooks" icon="webhook" href="/docs/webhooks-and-events/webhooks-overview">
    Receive notifications when calls hit limits
  </Card>

  <Card title="Call History" icon="chart-mixed" href="/docs/monitor/call-history">
    Monitor call duration metrics
  </Card>
</CardGroup>
