You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`maxDurationSeconds`| Hard wall-clock cutoff — call ends immediately when reached | Assistant setting |
15
+
|`call.timeElapsed` hook | Fires once at a specific second mark from call start | Hook (deterministic) |
16
+
|`endCall` tool | LLM decides to end the call | Tool (probabilistic) |
17
+
16
18
17
19
**Key distinction:** Hooks are deterministic (guaranteed to fire). Tools are probabilistic (the LLM chooses when to invoke them). For call discipline, use hooks as the enforcement layer and tools as the courtesy layer.
18
20
@@ -138,14 +140,16 @@ hooks:
138
140
139
141
## Hooks vs Tools vs System Prompt — When to Use Which
140
142
141
-
| Approach | Reliability | Use when |
142
-
|----------|-------------|----------|
143
-
| `call.timeElapsed` hook with `say` | Guaranteed | You need a deterministic spoken warning at a fixed time |
144
-
| `call.timeElapsed` hook with `message.add` | Guaranteed delivery, LLM interprets | You want the LLM to organically wrap up the conversation |
145
-
| `call.timeElapsed` hook with `endCall` tool | Guaranteed | You need a hard graceful end (with goodbye) at a fixed time |
146
-
| `maxDurationSeconds` | Guaranteed | Last-resort hard cutoff — no goodbye, call just drops |
147
-
| `endCall` tool (LLM-invoked) | Probabilistic | You want the LLM to decide when to end based on conversation context |
148
-
| System prompt instruction ("end after 10 min") | Unreliable | Don't rely on this alone — the LLM may not track time accurately |
| `customer.speech.timeout` hook | Fires action when customer is silent for N seconds | 7.5s, up to 3 times |
167
+
| `messagePlan.idleTimeoutSeconds` | Speaks an idle message when conversation stalls | 10s |
168
+
| `customerJoinTimeoutSeconds` | Ends call if customer never sends audio | 15s |
169
+
164
170
165
171
**`silenceTimeoutSeconds` vs `customer.speech.timeout`:** The timeout **ends the call**. The hook **performs an action** (say, tool, message.add). They are independent — configure them separately. See [assistants.md](assistants.md) for the hook events list.
166
172
@@ -184,4 +190,4 @@ The `maxDurationSeconds` timer starts when the first audio chunk is processed. `
184
190
185
191
### Lambda workers reject long calls
186
192
187
-
If `maxDurationSeconds >= 15 minutes` (900s), the call is rejected when routed to a Lambda-based worker (reason: `lambda-longcalls-not-accepted`). Long calls require non-Lambda workers.
193
+
If `maxDurationSeconds >= 15 minutes` (900s), the call is rejected when routed to a Lambda-based worker (reason: `lambda-longcalls-not-accepted`). Long calls require non-Lambda workers.
0 commit comments