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

# Call Routing & Escalation

> Route calls to the right people and handle escalations gracefully

# Call Routing & Escalation

Call routing determines how and when calls are transferred from AI agents to human operators. Effective routing ensures callers reach the right person while maximizing AI resolution rates.

## Routing Types

### Cold Transfer

Immediately transfer the call without context:

```json theme={null}
{
  "type": "cold_transfer",
  "destination": "+14155551234"
}
```

The caller is connected directly. The recipient has no context about the call.

**Use when:**

* Caller explicitly requests a specific person
* Emergency situations requiring immediate human contact
* Simple routing (e.g., "Press 1 for sales")

### Warm Transfer

Agent briefs the recipient before connecting:

```json theme={null}
{
  "type": "warm_transfer",
  "destination": "+14155551234",
  "brief": "Connecting a patient who needs to reschedule their appointment for tomorrow."
}
```

The AI:

1. Places caller on hold
2. Calls the destination
3. Provides context to the recipient
4. Connects both parties

**Use when:**

* Complex situations requiring context
* Caller has already explained their issue
* Recipient needs preparation

### Announced Transfer

Similar to warm transfer, but the caller hears the announcement:

```json theme={null}
{
  "type": "announced_transfer",
  "destination": "+14155551234",
  "announcement": "I'm transferring you to our billing department. They'll be able to help with your invoice question."
}
```

### Queue Transfer

Route to a call queue or ring group:

```json theme={null}
{
  "type": "queue_transfer",
  "queue_id": "queue_support",
  "priority": "high",
  "wait_message": "Please hold while I connect you to an available representative."
}
```

## Routing Rules

Configure conditions that trigger routing:

### Intent-Based Routing

```json theme={null}
{
  "routing_rules": [
    {
      "condition": "intent == 'billing_dispute'",
      "action": {
        "type": "warm_transfer",
        "destination": "+14155551111"
      }
    },
    {
      "condition": "intent == 'technical_support'",
      "action": {
        "type": "queue_transfer",
        "queue_id": "queue_tech"
      }
    }
  ]
}
```

### Keyword-Based Routing

```json theme={null}
{
  "routing_rules": [
    {
      "condition": "keywords_detected(['emergency', 'urgent', 'critical'])",
      "action": {
        "type": "cold_transfer",
        "destination": "+14155559999",
        "priority": "immediate"
      }
    }
  ]
}
```

### Caller-Based Routing

```json theme={null}
{
  "routing_rules": [
    {
      "condition": "caller.account_tier == 'enterprise'",
      "action": {
        "type": "queue_transfer",
        "queue_id": "queue_enterprise"
      }
    },
    {
      "condition": "caller.assigned_rep != null",
      "action": {
        "type": "warm_transfer",
        "destination": "{{caller.assigned_rep.phone}}"
      }
    }
  ]
}
```

### Time-Based Routing

```json theme={null}
{
  "routing_rules": [
    {
      "condition": "is_business_hours == false",
      "action": {
        "type": "voicemail",
        "mailbox_id": "after_hours"
      }
    }
  ]
}
```

## Escalation Triggers

Define when the AI should escalate to humans:

### Automatic Triggers

| Trigger              | Description                           |
| -------------------- | ------------------------------------- |
| `max_turns_exceeded` | Conversation exceeds turn limit       |
| `low_confidence`     | AI confidence drops below threshold   |
| `sentiment_negative` | Caller becomes frustrated             |
| `repeated_failure`   | AI fails to understand multiple times |
| `explicit_request`   | Caller asks for a human               |

### Configuration

```json theme={null}
{
  "escalation": {
    "triggers": {
      "max_turns": 10,
      "confidence_threshold": 0.6,
      "sentiment_threshold": -0.5,
      "failure_count": 3
    },
    "default_action": {
      "type": "warm_transfer",
      "destination": "+14155551234"
    }
  }
}
```

## Destination Types

### Phone Numbers

Direct transfer to a phone number:

```json theme={null}
{
  "destination": "+14155551234"
}
```

### Extensions

Transfer to an internal extension:

```json theme={null}
{
  "destination": "ext:1234"
}
```

### SIP Addresses

Transfer via SIP:

```json theme={null}
{
  "destination": "sip:user@domain.com"
}
```

### Queues

Route to a call queue:

```json theme={null}
{
  "destination": "queue:support",
  "queue_options": {
    "max_wait_time": 300,
    "position_announcement": true
  }
}
```

### Ring Groups

Ring multiple numbers simultaneously:

```json theme={null}
{
  "destination": "ring_group:sales",
  "ring_strategy": "simultaneous",
  "ring_time": 30
}
```

## Fallback Handling

Configure behavior when routing fails:

```json theme={null}
{
  "routing": {
    "destination": "+14155551234",
    "fallback": {
      "on_no_answer": {
        "action": "try_alternate",
        "destination": "+14155555678",
        "timeout": 30
      },
      "on_busy": {
        "action": "voicemail",
        "mailbox_id": "general"
      },
      "on_failure": {
        "action": "collect_callback",
        "message": "I'm unable to connect you right now. Can I have someone call you back?"
      }
    }
  }
}
```

## Transfer Context

Pass information to the receiving party:

### Screen Pop Data

```json theme={null}
{
  "transfer_context": {
    "screen_pop": {
      "caller_name": "{{caller.name}}",
      "caller_phone": "{{caller.phone}}",
      "account_id": "{{caller.account_id}}",
      "call_summary": "{{conversation.summary}}",
      "intent": "{{detected_intent}}"
    }
  }
}
```

### Whisper Message

Play a message to the recipient before connecting:

```json theme={null}
{
  "transfer_context": {
    "whisper": "Incoming call from {{caller.name}} regarding {{detected_intent}}."
  }
}
```

## Analytics

Track routing effectiveness:

| Metric                        | Description                               |
| ----------------------------- | ----------------------------------------- |
| **Transfer Rate**             | Percentage of calls transferred           |
| **Escalation Rate**           | Percentage escalated due to triggers      |
| **Transfer Success**          | Successful vs. failed transfers           |
| **Hold Time**                 | Average time callers wait during transfer |
| **Resolution After Transfer** | First-call resolution post-transfer       |

## Best Practices

<AccordionGroup>
  <Accordion title="Minimize cold transfers">
    Warm transfers provide better caller experience and equip recipients with context.
  </Accordion>

  <Accordion title="Set appropriate timeouts">
    Don't leave callers on hold too long. 30 seconds is a good maximum before fallback.
  </Accordion>

  <Accordion title="Always have a fallback">
    Every routing path should have a fallback for when the destination is unavailable.
  </Accordion>

  <Accordion title="Monitor escalation rates">
    High escalation rates indicate the AI needs better training or knowledge.
  </Accordion>

  <Accordion title="Test routing paths">
    Regularly test all routing scenarios to ensure they work as expected.
  </Accordion>
</AccordionGroup>

## Next Steps

* [Warm Transfers](/voice/warm-transfers) — Detailed warm transfer configuration
* [Live Transcription](/voice/live-transcription) — Provide real-time context to agents
* [Webhooks](/integrations/webhooks) — Trigger actions on transfer events
