> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# 留守番電話検出

## 概要

**留守番電話検出**ツールを使うと、ElevenLabsエージェントは通話に人間ではなく留守番電話システムが応答したことを自動的に識別できます。このシステムツールにより、事前設定したメッセージを残すか、すぐに通話を終了することで、エージェントは自動留守番電話のシナリオに適切に対応できます。

## 機能

* **自動検出**：LLMが自動音声のあいさつや案内に基づいて会話パターンを分析し、留守番電話システムを識別します
* **設定可能な対応**：留守番電話が検出されたときに、カスタムの留守番電話メッセージを残すか、すぐに通話を終了するかを選択できます
* **通話終了**：検出後、必要に応じてメッセージを送信すると、通話は自動的に終了します
* **ステータス追跡**：留守番電話検出イベントはログに記録され、会話履歴や一括通話結果で確認できます

**パラメータ**：

* `reason`（文字列、必須）：留守番電話を検出した理由（例：「自動応答メッセージを検出」、「人間からの応答なし」）

**関数呼び出し形式**：

```json
{
  "type": "function",
  "function": {
    "name": "voicemail_detection",
    "arguments": "{\"reason\": \"Automated greeting detected with request to leave message\"}"
  }
}
```

## 設定オプション

留守番電話検出ツールでは、次のオプションを設定できます。

![留守番電話検出の設定
インターフェース](/docs/_fern-img/f2f9a87e27ce0d5f631d2d294163e8df39e6dee5b3a98aaba692589c66364550.webp)

* **留守番電話メッセージ**：留守番電話が検出されたときに再生する、任意のカスタムメッセージを設定できます。このメッセージは[動的変数](/docs/ja/eleven-agents/customization/personalization/dynamic-variables)に対応しており、`{{user_name}}`や`{{appointment_time}}`などの実行時の値を使って留守番電話メッセージをパーソナライズできます

## API実装

API経由でエージェントを作成する場合、エージェント設定に留守番電話検出ツールを追加できます。システムツールとして定義する必要があります。

```python
from elevenlabs import AgentConfig, ConversationalConfig, ElevenLabs

elevenlabs = ElevenLabs(api_key="YOUR_API_KEY")

response = elevenlabs.conversational_ai.agents.create(
    conversation_config=ConversationalConfig(
        agent=AgentConfig(
            prompt={
                "built_in_tools": {
                    "voicemail_detection": {
                        "type": "system",
                        "name": "voicemail_detection",
                        # Optional: customize when the tool should be triggered
                        "description": "",
                        "params": {
                            "system_tool_type": "voicemail_detection",
                            # Optional: message left when voicemail is detected
                            "voicemail_message": "Sorry I missed you. I'll call back later.",
                        },
                    }
                }
            },
        ),
    ),
)
```

```javascript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

const elevenlabs = new ElevenLabsClient({
  apiKey: "YOUR_API_KEY",
});

await elevenlabs.conversationalAi.agents.create({
  conversationConfig: {
    agent: {
      prompt: {
        builtInTools: {
          voicemailDetection: {
            type: "system",
            name: "voicemail_detection",
            description: "", // Optional: Customize when the tool should be triggered
            params: {
              systemToolType: "voicemail_detection",
              // Optional: message left when voicemail is detected
              voicemailMessage: "Sorry I missed you. I'll call back later.",
            },
          },
        },
      },
    },
  },
});
```