Loading
Prepare for Email to Become the Default Login ExperienceRead More
Agentforce and Einstein Generative AI
Include Custom SIP Headers and REFER Support

Include Custom SIP Headers and REFER Support

Increase the amount of information passed with SIP requests with custom SIP X-headers and handle disconnects more gracefully with SIP REFER.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Unlimited, and Developer Editions with Foundations or Agentforce 1 Editions, and Salesforce Voice add-ons.
User Permissions Needed
To open, edit, or create a flow in Flow Builder: Manage Flow

Before you begin, work with your SIP partner to make sure that their SIP requests include X-headers or custom headers that you can reference in your flows. To use SIP REFER, check that your partner supports this protocol for disconnects.

To start, turn on a setting to capture custom SIP headers on inbound calls and pass rich contextual data such as customer intent, language preference, or authentication information to Agentforce Voice. To handle disconnects when escalating to a rep, set the disconnect method to SIP REFER in the escalation flow. To handle any other type of non-escalation disconnects, such as agent auto hangup or agent session termination due to no customer response, set the disconnect method to SIP REFER in the fallback flow. In both disconnect scenarios, the Session Border Controller (SBC) or telephony platform redirects the call to a URI using the Refer To URI response header. You can also choose to set the disconnect method to SIP BYE if needed.

Custom Headers and SIP REFER Considerations

  • Custom X-header values have a maximum length of 255. This limit doesn’t apply to X-SF headers such as X-SF-Token.
  • Salesforce receives header values that are sent in a SIP INVITE and returns them in a response. You can update a header value in a flow so the response value differs. To not return a header, set the field value to null.
  • If you use SIP REFER, you must set a Refer to URI value in the VoiceCallSessionData object.

Turn on the Include Custom SIP Headers and REFER Support Setting

Tip
Tip Because returning inbound headers changes system behavior, configure and test this feature in a sandbox environment before enabling this setting in production.
  1. From Setup, in the Quick Find box, enter Agentforce Voice, and then select Agentforce Voice Setup.
  2. Under Setup Steps in the Agentforce Voice Setup page, select the SIP / Dynamic Routing tab.
  3. Turn on Include Custom SIP Headers and REFER Support.
    The setting takes effect within five to ten minutes.

Edit the Escalation Flow

Edit the outbound Omni-Channel flow that routes your agent’s conversations to another destination, such as a service rep, queue, or different agent. Use this flow to select the protocol for disconnects and any custom headers you want to send with SIP requests.

  1. From Setup, in the Quick Find box, enter Flows, and then select Flows.
  2. To open your escalation flow in Flow Builder, select it.
  3. Make sure that the flow has a recordId input variable that stores the Voice call record ID. The data type is Text, and the variable is Available for input. Create this variable if it doesn’t exist.
  4. Optionally, add a Get Records element to get data from Voice Call records for use in a SIP REFER request in the next step.
    For example, store the To Phone Number value in a variable for use in the SIP Referred By Info value.
  5. To update fields in the session’s Voice Call Session Data record, add an Update Records element. Each Voice Call Session Data record temporarily stores session metadata, including custom SIP headers.
    1. For How to Find Records to Update and Set Their Values, select Specify conditions to identify records, and set fields individually.
    2. For Object, select Voice Call Session Data.
    3. For Condition Requirements to Update Records, specify All Conditions are Met (AND) Voice Call ID Equals recordId.
    4. To handle disconnects using SIP REFER for situations where an escalation from an agent to another destination fails, set the SIP Disconnect Method field to SIP_REFER. Set the SIP Refer to URI field to your preferred SIP refer URI value, where the call should be sent. We also recommend setting the SIP Referred By Info field to identify the user or entity that initiated the call transfer. To handle disconnects during an escalation with SIP BYE instead, leave SIP Disconnect Method to its default value, SIP_BYE.
      For more information about available fields, see VoiceCallSessionData.
    5. Optionally, set custom headers or update header values to send information back to the SBC or telephony platform in the REFER or BYE request.
      Salesforce passes Voice Call Session Data field values as SIP headers in requests. For custom fields, X_Account_ID__c becomes X-Account-ID as a header. To prevent headers from being included in requests, set the field value to null (blank).
    Update Records element in Flow Builder showing Voice Call Session Data fields, including SIP Disconnect Method set to SIP_REFER, SIP Refer to URI, SIP Referred By Info, and a custom X-Account-ID field.

Create a Fallback Flow

To handle situations where a call between an agent and customer gets disconnected, such as when a customer stops talking for an extended period (semantic hangup), when an agent abruptly ends the session due to an issue, or if there’s a disconnect during escalation, create a fallback autolaunched flow. Use this flow to select the SIP protocol and any custom headers you want to send in case of a disconnect.

  1. From Setup, in the Quick Find box, enter Flows, and then select Flows.
  2. Click New Flow and create an autolaunched flow. To avoid additional routing, don’t use an Omni-Channel flow for this step.
  3. Create an input variable that stores the Voice call record ID. Name the variable recordId, set the data type to Text, select Available for input, and then click Done.
  4. Add an Update Records element to update Voice Call Session Data fields.
    1. For How to Find Records to Update and Set Their Values, select Specify conditions to identify records, and set fields individually.
    2. For Object, select Voice Call Session Data.
    3. For Condition Requirements to Update Records, specify All Conditions are Met (AND) Voice Call ID Equals recordId.
    4. To handle disconnects using SIP REFER, set the SIP Disconnect Method field to SIP_REFER. Set the SIP Refer to URI field to your preferred SIP refer URI value, where the call should be sent. We also recommend setting the SIP Referred By Info field to identify the user or entity that initiated the call transfer. To handle disconnects during an escalation with SIP BYE instead, leave SIP Disconnect Method to its default value, SIP_BYE.
      For more information about available fields, see VoiceCallSessionData.
    5. Optionally, set custom headers or update header values to send information back to the SBC or telephony platform in the REFER or BYE request.
      Salesforce passes Voice Call Session Data field values as SIP headers in requests. For custom fields, X_Account_ID__c becomes X-Account-ID as a header. To prevent headers from being included, set their field value to null (blank).

Update the Inbound Flow

To specify the fallback autolaunched flow, update the inbound Omni-Channel flow for the agent. Salesforce uses the Fallback Flow API Name of the Voice Call Session Data record to identify the fallback flow.

  1. From Setup, in the Quick Find box, enter Flows, and then select Flows.
  2. To open the inbound Omni-Channel flow in Flow Builder, select it.
  3. Add an Update Records element to update Voice Call Session Data. Set the Fallback Flow API Name field to the API name of the fallback flow that you created previously.
    If you don’t specify a fallback flow, in case of a disconnect, Salesforce sends SIP_BYE as the disconnect method and no custom headers.

After testing incoming calls in your sandbox, repeat the steps in this article to turn on the setting and configure flows in production.

 
Loading
Salesforce Help | Article