---
title: "Check In When the User Stays Silent, Then Hang Up | Micdrop"
description: "idleTimeout() asks \"Are you still there?\" when the user stays silent, and ends the call after the prompts go unanswered. Works on a phone line and in the browser."
url: "https://micdrop.dev/docs/server/idle-timeout"
---

# Check In When the User Stays Silent, Then Hang Up

A caller who walked away, a line that dropped on their side, a browser tab left open: without a check, the call stays open and waits. `idleTimeout()` asks the user whether they are still there after a silence, and ends the call once its prompts went unanswered.

```typescript
import { idleTimeout, MicdropServer } from '@micdrop/server'

const server = new MicdropServer(transport, { agent, stt, tts })

idleTimeout(server, {
  timeout: 10000,
  prompts: ['Are you still there?', 'Hello? Can you hear me?'],
  goodbye: 'It seems you are no longer there. Goodbye!',
})
```

The silence counts from the moment the assistant is done: its answer written, spoken and played to the user, so a long answer never counts as silence. Any turn of the user starts the count again and brings the prompts back to the first one. An answer that takes long to come, a slow tool for instance, does not count either.

Each prompt is spoken and added to the conversation, so the agent knows it asked. Once the last one went unanswered, the assistant says the goodbye and the call ends as with [`endCallTool()`](/docs/server/auto-end-call): a phone line hangs up once the goodbye has been played, a client receives `EndCall`.

## Options

Option

Default

Description

`timeout`

`10000`

Silence before each prompt, in ms

`prompts`

`['Are you still there?']`

What the assistant says, one per attempt. `{ generate: true }` lets the agent word it

`attempts`

`1`

How many generated prompts, with `prompts: { generate: true }`

`goodbye`

`'It seems you are no longer there. Goodbye!'`

Said before hanging up, `false` to hang up without a word

`endCall`

`true`

Ends the call after the last prompt. Off, the call goes on and `onIdle` keeps being called

`onIdle`

Called with the number of the attempt, from 1. Returning `false` skips what the helper would do for it

## Prompts worded by the agent

With `prompts: { generate: true }`, a note goes into the conversation and the agent answers it, in the language and the tone of the call:

```typescript
idleTimeout(server, { prompts: { generate: true }, attempts: 2 })
```

## Acting on the silence yourself

`onIdle` hears each attempt first. Return `false` to replace what the helper does, for instance to send the caller a text message instead of hanging up:

```typescript
idleTimeout(server, {
  onIdle: (attempt) => {
    if (attempt < 2) return
    sendSms(caller, 'We lost you, reply to this message to pick up again.')
    server.close()
    return false
  },
})
```

`idleTimeout()` returns a function that stops it. It also stops on its own when the call ends.
