Enable Auto-Hangup for Agentforce Voice

Set up your voice-enabled agent to end a call automatically when it has fully addressed the caller's request. Enable this behavior per agent with Agentforce Script. If you use partner telephony, also turn on a setting that returns the call to your telephony vendor, and prepare your interactive voice response (IVR) flow to read the disconnect reason and route the returned call.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Unlimited, and Developer Editions with Foundations or Agentforce 1 Editions, and Salesforce Voice add-ons.
Available in: Lightning Experience
Available in: Enterprise, Unlimited, and Developer Editions with Foundations or Agentforce 1 Editions, and Agentforce Contact Center add-ons.
User Permissions Needed
To configure Auto-Hangup and Auto Disconnect:

Manage Agentforce Service Agents AND Manage AI Agents

AND Customize Application

AND Manage Flows

  • Your org has Agentforce Voice with Telephony set up and active.
  • You created your agent with the new Agentforce Builder, or you migrated it to the new builder.
  • For partner telephony: your telephony vendor can query Salesforce using Salesforce REST API.

Agentforce Voice ends a call in three situations: the caller stops responding, the call reaches its maximum duration (60 minutes), or the agent determines that it has fully addressed the caller's request. The first two happen by default. The third happens only when you turn on Auto-Hangup for the agent. Auto-Hangup applies to Agentforce Voice calls through Telephony connections. It doesn't apply to Enhanced Chat v2 (ECv2), which uses its own timeout settings for text and voice modes.

These controls determine when a voice agent ends a call and what happens next:

Setting Where You Set It What It Controls Default Scope
Auto-Hangup (auto_hangup) Agentforce Script, on the agent's Telephony connection Whether the agent ends the call when it determines the caller's request is fully addressed (a semantic call end) Off (False) Per agent, at the connection level
Auto Disconnect Agentforce Voice Setup Whether Salesforce returns the call to your IVR flow, or keeps the call open until the caller hangs up Off Org-wide, partner telephony only
Caller stops responding Agentforce Script (optional): speak_up_config under additional_configs The agent asks "Are you still there?" and ends the call if the caller doesn't respond On All voice agents on Telephony connections
Maximum call duration Set by Salesforce The agent ends the call after 60 minutes On (60 minutes) All voice agents on Telephony connections
Note
Note The two settings use similar names, Auto-Hangup and Auto Disconnect, but they're distinct controls. Auto-Hangup governs the agent's behavior in one scenario: a fully addressed request. Auto Disconnect governs what happens to the call across all agent-ended scenarios when you use partner telephony.
Important
Important The two settings work together on partner telephony. If you set auto_hangup to True but leave Auto Disconnect off, the agent ends its side of the call, but the call stays connected until the caller hangs up. To end resolved calls cleanly, turn on both.

The first two tasks apply to all Agentforce Voice agents. The last two tasks apply to partner telephony only.

Enable Auto-Hangup on the Agent with Agentforce Script

Turn on Auto-Hangup for the agent so that it ends the call when it has fully addressed the caller's request. This step applies to all Agentforce Voice agents. Agentforce Contact Center customers start here.

With Agentforce Contact Center, Salesforce owns the call end to end and terminates it directly, whichever of the three situations ended it. You don't need any other setup. The caller-stops-responding and maximum-duration endings are on by default.

  1. From the App Launcher, find and open Agentforce Studio.
  2. Select the agent that you want to configure.
  3. Open the Telephony connection for the agent, and then switch to script mode.
    The Telephony connection in Agentforce Studio switched to script mode.
  4. In the telephony code block, set the auto_hangup boolean parameter to True.

    The value is False by default. When the value is False, the agent doesn't end the call when it determines that the caller's request is fully addressed. When the value is True, the agent ends the call when it determines that the caller's request is fully addressed.

    The auto_hangup parameter set to True in the telephony code block.

The agent ends the call when it determines that the caller's request is fully addressed.

Important
Important For partner telephony, also turn on Auto Disconnect (Turn On Auto Disconnect). Without it, the agent ends its side of the call, but the call stays connected until the caller hangs up.

Customize the Prompts for a Caller Who Stops Responding

Change the message and wait times that the agent uses before it ends a call with a caller who stops responding. This step is optional.

When a caller stops responding, the agent asks "Are you still there?", and then ends its side of the call after the caller doesn't respond to three prompts. This behavior is on by default. With the default values, the agent ends the call after about 75 seconds of silence. If the caller says anything, the count of prompts resets.

In your agent's voice modality code block, change the values in the speak_up_config block under additional_configs.
  • speak_up_first_wait_time_ms: How long to wait after the caller's last utterance before the first prompt. Default: 15,000 ms.
  • speak_up_follow_up_wait_time_ms: How long to wait before each later prompt, and before the agent ends the call after the third prompt. Each wait is measured from when the previous prompt starts. Default: 20,000 ms.
  • speak_up_message: What the agent says. The agent uses this message for all three prompts. You can't change the number of prompts. If you don't set it, the agent uses a default message in the caller's language.

Configure Your IVR to Read the Disconnect Reason

Configure your IVR to read the disconnect reason on the VoiceCall record and route the call accordingly when control of the call returns to your vendor. This step applies to partner telephony.

Configure your IVR to call Salesforce REST API, read the DisconnectReason field on the VoiceCall record, and route accordingly when control of the call returns to your vendor.

First set up your telephony system to resume the call after the agent disconnects, as described in Configure Call Escalation in the Telephony System. Then, before the step that transfers the resumed call to a rep, add a query for the disconnect reason so that your IVR releases clean disconnects instead of escalating them.

Configure your IVR to route based on the disconnect reason.
  • Bot Terminated, Customer Intent Fulfilled, Customer Unresponsive, or Maximum Duration Reached: The agent ended the call. Bot Terminated means that the agent terminated the session. Terminate the call with a terminate or end-call node in your IVR flow, or play a closing message.
  • Any other value: Route the call to a customer service rep queue, for example when the caller hung up, the call was transferred, or a system error occurred.

For a full list of disconnect reasons, see the VoiceCall and VoiceCallSessionData reference pages.

The specific steps depend on your IVR platform. Refer to your IVR vendor's documentation for Salesforce REST API integration.

Turn On Auto Disconnect

Turn on the Auto Disconnect setting so that Salesforce returns control of the call to your telephony vendor when the agent ends the call. This step applies to partner telephony.

On partner telephony, Salesforce can't terminate the call directly. Before you turn on Auto Disconnect, prepare your IVR so that your vendor can route the returned call correctly (Configure Your IVR to Read the Disconnect Reason).

When Auto Disconnect is on, Salesforce returns control of the call to your telephony vendor whenever the agent ends the call, whether the agent addressed the caller's request, the caller stopped responding, or the call reached its maximum duration. Your vendor then reads the VoiceCall record to route or release the call. When the setting is off, the call stays connected and waits for the caller to hang up. This setting is off by default and applies org-wide to all partner telephony connections. It doesn't affect Agentforce Contact Center.

  1. From Setup, in the Quick Find box, enter Agentforce Voice, and then select Agentforce Voice Setup.
    For more information about this page, see Launch Agentforce Voice Setup.
  2. Turn on Auto Disconnect.
    The Auto Disconnect setting in Agentforce Voice Setup.

When the agent ends a call, Salesforce returns control of the call to your telephony vendor.