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

# How to handle barge-in, pauses, and unclear audio

[Back to how-to guides](https://koreai.mintlify.site/agent-platform/abl/how-to/overview.md#voice-and-realtime-conversations)

Use this pattern when callers interrupt the agent, pause mid-answer, go silent, or speak unclearly on a voice call.

## Concept

A phone call has no screen and no send button. The platform must decide when the caller has finished, whether to stop talking when the caller starts, and what to do with silence or noise. Each decision has its own setting.

| The caller | You decide | Setting |
| - | - | - |
| Talks over the agent | Stop or keep talking | `barge_in` on the agent. `BARGE_IN` on a step, reply, or field. |
| Says "uh-huh" over the agent | Ignore it | `on_caller_backchannel` |
| Pauses mid-answer | How long to wait | `on_pause`, `END_OF_SPEECH_TURN_TYPE`, `TURN_DETECTION` |
| Says "hold on" | Wait longer, or stay quiet | `on_hold` |
| Says nothing | Reprompt, then act | `on_no_input` |
| Speaks unclearly | Discard, re-ask, or confirm | `sttMinConfidence`, `on_unclear_audio`, `interaction.repair`, `ASR:` |

These settings apply to KoreVG pipeline voice: speech-to-text, then the agent, then text-to-speech. On realtime speech-to-speech calls, the model provider owns most turn decisions. See [Realtime voice](#realtime-voice).

## Minimal working example

`Table_Booking` lets callers interrupt, waits a short time after each pause, and ends the call after two unanswered reprompts.

```abl theme={null}
AGENT: Table_Booking

GOAL: "Book a table by phone."

PERSONA: "You are a concise phone assistant for a restaurant."

CONVERSATION:
  listening:
    barge_in: allow
    on_pause: wait_briefly
    on_no_input:
      enabled: true
      mode: static
      timeout_ms: 5000
      max_retries: 2
      on_exhausted: hangup
      exhausted_message: "I cannot hear you, so I will end the call. Goodbye."
      messages:
        - text: "Are you still there?"

GATHER:
  party_size:
    prompt: "How many people?"
    type: integer
    required: true

COMPLETE:
  - WHEN: party_size IS SET
    RESPOND: "Booked a table for {{party_size}}."
```

Variable sources:

* `party_size` is a `GATHER` field. The caller supplies it.
* `COMPLETE` reads `party_size` in its condition and its reply.

## How it works

### Listening mode

The listening mode is fixed for the whole call. Barge-in and streaming are decided for each spoken output inside that mode.

| Mode | The platform | Use when |
| - | - | - |
| `background` | Listens while the agent speaks and after. | Callers interrupt often. |
| `turn_taking` | Listens only after each agent turn. | Callers must hear every turn. |

The mode resolves in this order:

1. The channel's `listeningMode`.
2. The entry agent's `CONVERSATION.listening.mode`.
3. A derived mode: `background` when barge-in is allowed, otherwise `turn_taking`.

A handoff, step, reply, or tool cannot change the mode. A `LISTENING` key in a `VOICE` block is a compile error. Back-channel phrases and barge-in continuation work only in `background` mode.

### Barge-in

Barge-in decides whether the agent stops when the caller speaks. The narrowest setting wins:

1. The reply's own `VOICE` block, or its template.
2. A `GATHER` field `VOICE` block (FLOW steps only).
3. The tool reply policy.
4. The FLOW step.
5. The agent's `listening.barge_in`, or `listening.on_overlap` when `barge_in` is not set.
6. The channel setting.

An explicit `allow` beats a wider `disallow`. Use `disallow` for a disclosure or a one-time code the caller must hear in full.

| Key | Values that allow interruption | Values that block it |
| - | - | - |
| `barge_in` | `allow` | `disallow` |
| `on_overlap` | `stop_and_listen`, `listen`, `yield`, `yield_to_user` | `ignore_overlap`, `continue`, `talk_over` |

Older spellings such as `enabled`, `off`, and `deny` still work in `barge_in`. They compile with a warning. A value the platform does not know is ignored, and the call takes the channel default.

### Pauses

The platform ends the caller's turn after a silence. Three settings control how long.

* **`on_pause`** sets the silence for the agent's turns. `wait_briefly`, `brief`, `short`, and `respond_quickly` give 800 ms. `wait_longer`, `long`, and `patient` give 2500 ms. Any other text gives 1500 ms.
* **`END_OF_SPEECH_TURN_TYPE`** sets the silence for one question. It names the expected answer, and the platform picks a timeout.
* **`TURN_DETECTION`** lets the voice gateway decide when the caller has finished. It replaces the silence timer.

| `END_OF_SPEECH_TURN_TYPE` | Timeout | Use for |
| - | - | - |
| `simple_confirmation` | 650 ms | Yes or no. |
| `anything_else` | 850 ms | Any other answer. |
| `structured_value` | 1000 ms | An account number or a date. |
| `open_ended_question` | 1250 ms | A free-form answer. |
| `complex_explanation` | 1600 ms | A long explanation. |

`END_OF_SPEECH_TIMEOUT_MS` sets an exact value from 100 to 5000 ms. A value outside that range is ignored.

`TURN_DETECTION` takes `enabled` and an optional `eou_threshold` from 0.3 to 0.9 in steps of 0.1. The default is 0.5. A higher value waits longer. Use 0.8 for long digit strings and 0.9 for spelling. While turn detection is on, the gateway ignores end-of-speech timeouts, so the compiler warns when one block sets both.

### Silence

`on_no_input` handles a caller who says nothing.

| Key | Values |
| - | - |
| `enabled`, `mode` | `static` plays your `messages`. `dynamic` generates reprompts (pipeline voice only). |
| `timeout_ms` | Whole milliseconds, 1 to 60000. |
| `max_retries` | Integer 0 to 20. The default is 3. |
| `on_exhausted` | `hangup`, `transfer`, `custom`, or `hook`. |
| `messages`, `exhausted_message` | The reprompts and the final line. |

* Recognized speech or accepted keypad input resets the retry count.
* Input the platform accepted but has not run is not silence. The window waits.
* After the window ends, the platform waits one more second for late speech before it reprompts.
* A FLOW step can override the policy with `VOICE: ON_NO_INPUT:`. Step message N plays after agent message N as one utterance.
* `on_exhausted: hook` runs the `on_no_input_exhausted` hook. The hook can hold `CALL`, `SET`, `HANDOFF`, and `CRITICAL`. It cannot hold `RESPOND`. Put the last words in `exhausted_message`.

A project default sets what happens when retries run out for every agent that sets no `on_exhausted`. An agent, profile, or step value replaces it.

### Back-channel, hold, and continuation

* **`on_caller_backchannel`** ignores short acknowledgements while the agent speaks. The platform matches the whole utterance against your `phrases`. "Okay" is ignored. "Okay but stop" is a normal turn.
* **`on_hold`** recognizes "hold on". After a hold phrase, the silence window becomes `grace_ms` (30000 ms by default), up to `max_holds` times (2 by default). With `suppress_response: true`, the agent stays silent instead of replying.
* **`barge_in_continuation`** merges phrases the recognizer split from one interruption. It is on by default. `window_ms` takes 300 to 2000, `max_hold_ms` 500 to 8000, `max_merges` 1 to 20, and `max_chars` 1 to 20000.

The platform ships no default phrases. A block with `enabled: true` and no phrases does nothing, and the compiler warns. A phrase in both lists is a compile error.

A phone network hold is a different event. When the network signals a hold, the agent stays silent and stops listening. The project `callerHold` setting limits it. See [Define fallback behavior for voice failures](https://koreai.mintlify.site/agent-platform/abl/how-to/define-voice-fallbacks).

### Unclear audio

Four layers handle audio the platform cannot use.

| Layer | What happens |
| - | - |
| `sttMinConfidence` | Pipeline voice discards a final speech result scored below the threshold (0 to 1). The call treats it as no input and reprompts. Set it on the channel or in the project runtime config. The channel value wins. `0` at channel level turns it off. |
| Field `ASR:` | Tunes recognition for one question with a word list, a language, or a silence wait. |
| Field type and `validate` | A value that fails the check is dropped, and the agent asks again. |
| `on_unclear_audio`, `on_self_correction`, `interaction.repair` | Adds a guidance line to the model prompt. |

* A result at the threshold passes. Keypad input is never gated. A provider that reports no confidence is never gated.
* The guidance values are free text. The platform turns underscores into spaces and adds them to the prompt, for example "If audio is unclear, ask to repeat or confirm." The compiler does not check them.
* Guidance lines shape what a reasoning agent says. A `REASONING: false` step speaks its authored prompt.

### Realtime voice

| Setting | Realtime speech-to-speech |
| - | - |
| Listening mode, `TURN_DETECTION`, `sttMinConfidence`, `ASR:` | Not applied. The provider owns turn detection. |
| Agent `barge_in` | Does not turn off interruption on OpenAI realtime. Use the realtime channel setting. |
| `BARGE_IN: disallow` on a reply | OpenAI realtime holds a no-interrupt window for an authored `disallow` greeting. Support for later replies is not confirmed. |
| `END_OF_SPEECH_*` on a question | OpenAI realtime with server voice detection sets the silence for that question. Semantic detection ignores it. |
| `on_no_input` | Static reprompts only. Dynamic mode is not supported. |

Test every realtime setting on your provider. Support differs by provider.

## Common variations

### Protect a disclosure and a one-time code

`Account_Verifier` blocks interruption on the recording notice and on the code prompt. Everything else stays interruptible.

`verify_account` is a project-local tool. Replace it with your own verification tool.

```abl theme={null}
AGENT: Account_Verifier

GOAL: "Verify a caller by account number and one-time code."

PERSONA: "You are a concise phone assistant for a bank."

TOOLS:
  verify_account(account_number: string = null, otp_code: string = null) -> {verified: boolean}
    description: "Checks the account number and one-time code against the bank system."
    confirm: never

CONVERSATION:
  listening:
    barge_in: allow

FLOW:
  entry_point: disclosure
  steps:
    - disclosure
    - ask_account
    - ask_code
    - check
    - done
    - denied

  disclosure:
    REASONING: false
    BARGE_IN: disallow
    RESPOND: "This call may be recorded for quality and security."
    THEN: ask_account

  ask_account:
    REASONING: false
    GATHER:
      - account_number: required
        type: string
        prompt: "What is your account number?"
    THEN: ask_code

  ask_code:
    REASONING: false
    GATHER:
      - otp_code: required
        type: string
        prompt: "Please say or enter the six digit code we sent you."
        VOICE:
          BARGE_IN: disallow
    THEN: check

  check:
    REASONING: false
    CALL: verify_account
      WITH:
        account_number: account_number
        otp_code: otp_code
      AS: verify_result
    ON_RESULT:
      - IF: verify_result.verified == true
        THEN: done
      - ELSE:
        THEN: denied

  done:
    REASONING: false
    RESPOND: "Thank you. You are verified."
    THEN: COMPLETE

  denied:
    REASONING: false
    RESPOND: "I could not verify those details."
    THEN: COMPLETE
```

Variable sources: `account_number` and `otp_code` come from `GATHER` fields. `verify_result` is the tool output.

### Give slow speakers more time

`Claim_Intake` waits longer on every pause. The first question also expects a long explanation. `open_claim` is a project-local tool.

```abl theme={null}
AGENT: Claim_Intake

GOAL: "Collect a claim description and a policy number by phone."

PERSONA: "You are a patient phone assistant for an insurer."

TOOLS:
  open_claim(policy_number: string = null, description: string = null) -> {claim_id: string}
    description: "Opens a claim in the claims system."
    confirm: never

CONVERSATION:
  listening:
    barge_in: allow
    on_pause: wait_longer

FLOW:
  entry_point: ask_description
  steps:
    - ask_description
    - ask_policy
    - open
    - done

  ask_description:
    REASONING: false
    VOICE:
      END_OF_SPEECH_TURN_TYPE: complex_explanation
    GATHER:
      - description: required
        type: string
        prompt: "Tell me what happened."
    THEN: ask_policy

  ask_policy:
    REASONING: false
    VOICE:
      TURN_DETECTION:
        enabled: true
        eou_threshold: 0.8
    GATHER:
      - policy_number: required
        type: string
        prompt: "What is your policy number?"
    THEN: open

  open:
    REASONING: false
    CALL: open_claim
      WITH:
        policy_number: policy_number
        description: description
      AS: claim
    THEN: done

  done:
    REASONING: false
    RESPOND: "Your claim number is {{claim.claim_id}}."
    THEN: COMPLETE
```

Variable sources: `description` and `policy_number` come from `GATHER` fields. `claim` is the tool output.

### Reprompt, then hand off a silent caller

`Card_Support` reprompts twice. A step gives a longer wait while the caller finds the card. When retries run out, the hook records the silence and hands off.

`record_silence` is a project-local tool. `Transfer_Desk` is a separate agent that you define.

```abl theme={null}
AGENT: Card_Support

GOAL: "Help the caller replace a lost card."

PERSONA: "You are a concise phone assistant for a card issuer."

TOOLS:
  record_silence(reason: string = null) -> {recorded: boolean}
    description: "Records that the caller went silent."
    confirm: never

MEMORY:
  session:
    - transfer_reason
      TYPE: string
      DESCRIPTION: "Why the call moves to the transfer desk."

CONVERSATION:
  listening:
    barge_in: allow
    on_no_input:
      enabled: true
      mode: static
      timeout_ms: 6000
      max_retries: 2
      on_exhausted: hook
      exhausted_message: "I still cannot hear you. I will connect you to a colleague."
      messages:
        - text: "Are you still there?"
        - text: "I am still here. Take your time."

HANDOFF:
  - TO: Transfer_Desk
    WHEN: transfer_reason IS SET
    CONTEXT:
      pass: [transfer_reason]
      summary: "Caller went silent during card replacement."
    EXPECT_RETURN: false

HOOKS:
  on_no_input_exhausted:
    CALL: record_silence
      WITH:
        reason: "caller_silent"
    SET: transfer_reason = "Caller went silent"
    HANDOFF: Transfer_Desk

FLOW:
  entry_point: ask_last4
  steps:
    - ask_last4
    - done

  ask_last4:
    REASONING: false
    VOICE:
      ON_NO_INPUT:
        timeout_ms: 10000
        messages:
          - text: "Take your time finding the card."
    GATHER:
      - last4: required
        type: string
        prompt: "What are the last four digits of the lost card?"
    THEN: done

  done:
    REASONING: false
    RESPOND: "I have ordered a replacement for the card ending {{last4}}."
    THEN: COMPLETE
```

Variable sources: `last4` comes from a `GATHER` field. `transfer_reason` is a session value set by the hook.

The target agent can be as small as this:

```abl theme={null}
AGENT: Transfer_Desk

GOAL: "Receive callers who went silent and connect them to a colleague."

PERSONA: "You are a concise phone assistant."

ON_START:
  RESPOND: "Connecting you to a colleague now."
```

### Ignore acknowledgements and honor "hold on"

`Loan_Terms_Agent` ignores "uh-huh" and stays silent after "hold on".

```abl theme={null}
AGENT: Loan_Terms_Agent

GOAL: "Explain loan terms by phone and take a change request."

PERSONA: "You are a concise phone assistant for a lender."

CONVERSATION:
  listening:
    mode: background
    barge_in: allow
    on_caller_backchannel:
      enabled: true
      phrases: ["uh-huh", "okay", "go on"]
    on_hold:
      enabled: true
      phrases: ["hold on", "give me a second"]
      grace_ms: 20000
      max_holds: 2
      suppress_response: true
    barge_in_continuation:
      enabled: true
      window_ms: 700
      max_hold_ms: 4000
      max_merges: 4
      max_chars: 2000

GATHER:
  new_term_months:
    prompt: "How many months would you like?"
    type: integer
    required: true

COMPLETE:
  - WHEN: new_term_months IS SET
    RESPOND: "I will recalculate your loan for {{new_term_months}} months."
```

Add `phrases_by_locale` under `on_hold` to match hold phrases by the caller's language. The phrases join the base list.

### Recover from unclear audio

`Dig_Site_Locator` limits recognition to three county names for one question. It also tells the model how to handle mishearing. `create_ticket` is a project-local tool.

```abl theme={null}
AGENT: Dig_Site_Locator

GOAL: "Record the county and street of a dig site by phone."

PERSONA: "You are a concise phone assistant for a utility locating service."

CONVERSATION:
  listening:
    barge_in: allow
    on_unclear_audio: ask_to_repeat_or_confirm
    on_self_correction: use_latest_value
  interaction:
    repair:
      on_misheard: confirm_what_you_heard
      max_attempts: 2

TOOLS:
  create_ticket(county: string = null, street: string = null) -> {ticket_id: string}
    description: "Creates a locate ticket."
    confirm: never

FLOW:
  entry_point: get_county
  steps:
    - get_county
    - get_street
    - ticket
    - done

  get_county:
    REASONING: false
    GATHER:
      - county: required
        type: string
        prompt: "Which county is the dig site in?"
        ASR:
          vocabulary:
            mode: replace
            terms: [Guilford, Mecklenburg, Wake]
          no_input_timeout_ms: 8000
    THEN: get_street

  get_street:
    REASONING: false
    GATHER:
      - street: required
        type: string
        prompt: "What is the street name?"
    THEN: ticket

  ticket:
    REASONING: false
    CALL: create_ticket
      WITH:
        county: county
        street: street
      AS: ticket_result
    THEN: done

  done:
    REASONING: false
    RESPOND: "Your ticket number is {{ticket_result.ticket_id}}."
    THEN: COMPLETE
```

Variable sources: `county` and `street` come from `GATHER` fields. `ticket_result` is the tool output.

`ASR:` works in FLOW steps only. The field must be the only field in its step. A setting the platform cannot apply falls back to the call's normal settings.

### Never let the caller interrupt a turn

Set `mode: turn_taking` when every turn must play in full. Do not set back-channel or continuation in this mode.

```abl theme={null}
AGENT: Terms_Reader

GOAL: "Read the loan terms and ask the caller to accept them."

PERSONA: "You are a concise phone assistant for a lender."

CONVERSATION:
  listening:
    mode: turn_taking
    barge_in: allow

GATHER:
  accepted:
    prompt: "Do you accept these terms?"
    type: boolean
    required: true

COMPLETE:
  - WHEN: accepted == true
    RESPOND: "Thank you. The terms are accepted."
  - WHEN: accepted == false
    RESPOND: "Understood. No changes were made."
```

Variable source: `accepted` is a `GATHER` field.

## Verification

1. Run each example through project validation. Fix every error. Read every warning.
2. Place a test call. Speak over the first prompt. The agent stops when barge-in is allowed. It finishes the prompt when barge-in is blocked.
3. Pause for 2 seconds mid-answer. The agent waits when the pause is shorter than your setting. It answers when the pause is longer.
4. Stay silent. Count the reprompts. They match `max_retries`. After the last one, the call follows `on_exhausted`.
5. Say "okay" over the agent, then say "hold on". Check that the agent behaves as you configured.
6. Mumble an answer on a channel with `sttMinConfidence` set. Expect a reprompt, not a wrong answer.
7. Open the session trace. Look for `voice_listening_mode_resolved`, `voice_no_input_armed`, `voice_no_input_exhausted`, `voice_hold_detected`, and `voice_stt_below_confidence`. Each shows which setting acted and why.

## Production readiness checklist

* Every `on_exhausted: hook` agent has an `on_no_input_exhausted` hook. The hook has no `RESPOND`.
* Every handoff target named in a hook or in a project silence default exists. The current agent declares a route to it.
* Back-channel and hold phrases are authored. The two lists do not overlap.
* Disclosures and one-time codes use `BARGE_IN: disallow`.
* Each runtime that serves the agent supports the voice listening features it uses. An older runtime refuses to publish the agent.
* You tested a silent call, a mumbled answer, a slow speaker, and an interruption on the channel you ship.
* The trace shows the expected silence and hold events for each test.

## Common mistakes

| Mistake | Why it happens | How to avoid it |
| - | - | - |
| Authoring `backchannels` or `use_audio_cues` | They appear in older lists of listening keys. | Both are compile errors. Use `on_caller_backchannel`. |
| Writing `on_pause: brooding_silence` | The value looks free-form. | Any unknown text gives 1500 ms. Use a listed word. |
| Setting `mode: background` with `barge_in: disallow` | The two settings conflict. | The call runs as slower turn-taking. Set `turn_taking` or allow barge-in. |
| Adding back-channel phrases with `mode: turn_taking` | The mode is easy to overlook. | The phrases stay inactive. Use `background`. |
| Setting `max_duration_ms` on `on_caller_backchannel` | It looks like a duration cap. | The gateway cannot enforce it. The compiler warns. Remove it. |
| Listing one phrase in both `on_caller_backchannel` and `on_hold` | The two lists look alike. | The compiler reports an error. A phrase belongs to one list. |
| Putting `ON_NO_INPUT` under a field or a reply | It reads like a field setting. | It is valid only in a FLOW step's own `VOICE` block. |
| Setting `END_OF_SPEECH_TIMEOUT_MS: 9000` | The value looks reasonable. | The platform ignores it, with no diagnostic. Stay within 100 to 5000. |
| Setting `on_overlap: deny` | `deny` works in `barge_in`. | `on_overlap` ignores it, with no diagnostic. Use `continue`. |
| Writing `BARGE_IN: sometimes` as a bare step key | The value is a free-form word. | The bare form raises no diagnostic. Write `allow` or `disallow`. |
| Setting turn detection and an end-of-speech hint together | Both tune the pause. | The gateway ignores the hint. Pick one per step. |

## Troubleshooting

| Symptom | Likely cause | What to check |
| - | - | - |
| The agent keeps talking when the caller interrupts | The reply, field, step, or agent blocks barge-in. The channel option is off. | The narrowest `BARGE_IN` on that output. Then the agent `barge_in`, then the channel. |
| The agent cuts the caller off mid-sentence | The pause is short. | `on_pause`, the question's `END_OF_SPEECH_TURN_TYPE`, or a higher `eou_threshold`. |
| A long wait follows every answer | The pause is long. | `on_pause` and `END_OF_SPEECH_TIMEOUT_MS`. |
| "Okay" makes the agent restart | No back-channel phrase matches, or the mode is `turn_taking`. | `on_caller_backchannel.phrases` and `listening.mode`. |
| "Hold on" ends the call | No hold phrase matches, or `max_holds` ran out. | `on_hold.phrases`, `max_holds`, and `voice_hold_*` trace events. |
| The call ends after a quiet moment | `on_exhausted` is `hangup`. | `max_retries`, `on_exhausted`, and the project silence default. |
| A step's silence wording never plays | The block is not in the step's own `VOICE` block. | The compiler error `VOICE_NO_INPUT_ILLEGAL_PLACEMENT`. |
| The agent re-asks a clear answer | `sttMinConfidence` is too high. | The `voice_stt_below_confidence` event. It shows the score and the threshold. |
| Publish fails after you add a listening key | The runtime does not support the feature. | Upgrade every runtime, then publish again. |

## Related HowTos

* [Write voice-friendly agent responses](https://koreai.mintlify.site/agent-platform/abl/how-to/write-voice-friendly-responses)
* [Read back numbers, codes, and critical details](https://koreai.mintlify.site/agent-platform/abl/how-to/read-back-critical-details)
* [Phrase handoffs in a voice conversation](https://koreai.mintlify.site/agent-platform/abl/how-to/phrase-voice-handoffs)
* [Design low-latency voice flows](https://koreai.mintlify.site/agent-platform/abl/how-to/design-low-latency-voice-flows)
* [Define fallback behavior for voice failures](https://koreai.mintlify.site/agent-platform/abl/how-to/define-voice-fallbacks)
* [Observe and troubleshoot realtime voice behavior](https://koreai.mintlify.site/agent-platform/abl/how-to/troubleshoot-realtime-voice)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.