# About Connecting Chat with Operator Through Operator Panel

Connecting chat with an operator allows users to connect with live operators through the ConnectiveOne operator panel. This provides the ability to offer personalized support and resolve complex issues that require human intervention.

---

## Context and Problem

In many cases, automation cannot solve all client questions:
- Complex questions require human intervention
- Personalized support for important clients
- Escalation of problems from automation to operators
- Need for emotional support and empathy

Connecting chat with an operator solves this task by allowing users to connect with live operators for help.

---

## Key Concepts

### Basic Connection

The simplest way to connect a user to an operator is to use the action `operator_panel__connect_to_operator_with_msg` with the `subject_alias` parameter, which specifies the dialog topic.

### Automatic Connection

You can configure automatic connection of a free operator to a new dialog through the `auto_connect_operator: true` parameter. This allows the system to automatically distribute dialogs to free operators.

### Auto-Distribution of Dialogs

The system can automatically distribute dialogs to operators by various criteria (load, skills, topics), ensuring fair load distribution and efficient use of resources.

---

## Approach Options

### Manual Connection vs Automatic Connection

**Manual Connection:**
- ✅ Pros: Control over operator selection
- ❌ Cons: Requires manual intervention

**Automatic Connection:**
- ✅ Pros: Speed, automation, fair distribution
- ❌ Cons: Less control over operator selection

**Why We Use Automatic Connection:**
Automatic connection ensures quick response to client requests and efficient use of operator resources.

### Chat Redistribution

If an operator cannot process dialogs (technical problems, connection loss), chats can be automatically redistributed to other operators through the redistribution process.

---

## Adopted Solutions

### Additional Capabilities

Connection to operator supports many additional capabilities:
- Dialog topic settings
- Adding tags to dialogs
- Sending custom messages to operator
- Configuring alias when closing dialog
- Webhook for events from operator panel

### Handling Situations Without Free Operators

To handle situations when there are no free operators, you can use:
- `limit` event to redirect the user
- Waiting queue through `status: "queue"` parameter
- Waiting message

---

## Implications for Users and Implementation

### For Integrators

When configuring connection to operator, it's important to:

1. **Determine connection type** — manual or automatic
2. **Configure dialog topics** — for organization and filtering
3. **Handle situations without operators** — add `limit` event or queue
4. **Configure additional capabilities** — tags, messages, alias

### Common Errors

**Error:** User cannot connect to operator  
**Problem:** Action `operator_panel__connect_to_operator_with_msg` is not configured  
**Solution:** Add action block with correct configuration

**Error:** Dialogs are not distributed automatically  
**Problem:** `auto_connect_operator: true` is not specified or settings are not activated  
**Solution:** Check JSON configuration and settings in operator panel

**Error:** User does not receive message when operators are unavailable  
**Problem:** `limit` event is not added to handle the situation  
**Solution:** Add `limit` event with message or sending to queue

---

## Usage Examples

### Basic Connection

```json
{
  "subject_alias": "support"
}
```

### Automatic Connection

```json
{
  "auto_connect_operator": true,
  "subject_alias": "support"
}
```

### With Waiting Queue

```json
{
  "auto_connect_operator": true,
  "subject_alias": "support",
  "status": "queue"
}
```

---

## Related Documents

- **Explanation:** [Automatic Connection of Free Operator](/en/operatorline/explanation/auto-connect-free-operator.md) — configuring automatic connection
- **Explanation:** [Auto-Distribution of Dialogs](/en/operatorline/explanation/auto-distribute-dialogs.md) — detailed information about auto-distribution
- **Explanation:** [Redistribution of Chats from Operator](/en/operatorline/explanation/redistribute-chats-from-operator.md) — redistribution in case of problems
- **Explanation:** [Configuring Alias for Outgoing Dialog](/en/scenariodialog/explanation/outgoing-dialog-aliases.md) — configuring alias when closing

