Call transfer

Sometimes the bot needs to hand off the call to another party. This occurs if the bot cannot handle the call by itself, it therefore needs to escalate the call to a live (human) agent. In other cases, the normal flow of the call is for the bot to perform only a fraction of the conversation, and then hand off the call to another bot or a live agent for the rest of the conversation. Live Hub allows the bot to actively transfer (hand-off / escalate) the call at any stage of the conversation. If necessary, the bot can specify SIP headers that will be added to the generated SIP INVITE or REFER messages.

Live Hub offers two ways to perform the transfer. The first one is by initiating a new call towards the transfer target, this is used when the SIP server that initiated the original call doesn’t support the SIP REFER message and will end up with two SIP calls that are anchored on Live Hub. This is typically used when the call was originated from a SIP trunk or by a phone number provided by AudioCodes. It also requires a routing rule as described in the routing rule section.

The following diagram presents the flow for call transfer with a SIP INVITE:

If the SIP server that originated the call support the SIP REFER message (typically supported for contact centers), the transfer will be performed by sending a SIP REFER message, after a successful transfer the remote SIP server will disconnect the call with Live Hub, to initiate REFER the remote SIP server should be configured with REFER as the transfer method on the SIP connection advanced tab

The following diagram presents the flow for call transfer with a SIP REFER:

By default, once Live Hub performs the transfer, it immediately disconnects the call with the bot, regardless of whether the transfer succeeded or not. If needed, Live Hub can be configured to allow the bot to regain control over the call after a failed transfer attempt. In such a scenario, the bot can use its logic to select its next action, like playing a prompt or transferring the call to another target.

By default, Live Hub translates the telephone number ('tel' URI) into a SIP URI ('sip:xxx@x.x.x.x'). For example, if the Live Hub receives "transferURL": "tel:+14077511320", it changes the 'tel' URI to "Refer-To: <sip:+14077511320@<IP Address of SBC>:5060>" in the SIP message. If you want the SBC to preserve the 'tel' URI, the Administrator should configure the VAICPreserveTelURI parameter to 1.

If you want to transfer a call using a phone number purchased from AudioCodes, contact AudioCodes support.

Trigger call transfer

AudioCodes Bot API

To transfer the call, the bot should send a transfer event (or a handover event which is a synonym for the transfer event).

The target of the transfer should be specified in the transferTarget parameter.

For example:

{
  "type": "event",
  "name": "transfer",
  "activityParams": {
    "transferTarget": "tel:+123456789"
  }
}
Microsoft Bot Framework

To transfer the call, the bot should send a transfer event (or a handover event which is a synonym for the transfer event).

The target of the transfer should be specified in the transferTarget parameter.

For example:

{
  "type": "event",
  "name": "transfer",
  "channelData": {
    "activityParams": {
      "transferTarget": "tel:+123456789"
    }
  }
}
Microsoft Copilot Studio

Live Hub supports Copilot Studio native 'Transfer to agent'.

Before using the native option, the transfer details needed to be stored as a record:

Insert the transfer parameters as a formula (see example for basic format):

Specify the target of the transfer in the transferTarget parameter:

After saving the transfer parameters as a record, create a transfer conversation (under Topic management):

Add the variable in the dialog box:

Example:

{
  activityParams: {
    transferTarget: "tel:+123456789",
    transferNotifications: true
  }
}

Note: To use Copilot variable as transferTarget, switch the string to a variable:

{
  activityParams: {
    transferTarget: Topic.variable,
    transferNotifications: true
  }
}
Microsoft Copilot Studio legacy bot

Live Hub supports Copilot Studio legacy bot native 'Transfer to agent'. To transfer the call, select the Transfer to agent in the desired topic.

You can add all the transfer event parameters in the 'Private message to agent' text.

The target of the transfer should be specified in the transferTarget parameter.

For example:

{
  "activityParams": {
    "transferTarget": "tel:+123456789"
  }
}
Dialogflow CX

For Dialogflow CX, call transfer is done by adding the "Live agent handoff" fulfillment, as shown in the following example of configuration through the Dialogflow CX user interface:

The "Live agent handoff" fulfillment content is used to specify parameters like the target of the transfer (the transferTarget parameter):

{
  "activityParams": {
    "transferTarget": "tel:+123456789"
  }
}

As an alternative, transfer can be initiated by adding a "Custom Payload" fulfillment with the transfer event:

{
  "activities": [{
    "type": "event",
    "name": "transfer",
    "activityParams": {
      "transferTarget": "tel:+123456789"
    }
  }]
}
Dialogflow ES

To transfer the call, the bot should send a transfer event (or a handover event which is a synonym for the transfer event).

The target of the transfer should be specified in the transferTarget parameter.

This is done by adding a Custom Payload response with the following content:

{
  "activities": [{
    "type": "event",
    "name": "transfer",
    "activityParams": {
      "transferTarget": "tel:+123456789"
    }
  }]
}
Amazon Lex

To transfer the call, the bot should send a custom payload to the text that is being sent to the user. The target of the transfer should be specified in the transferTarget parameter.

For example:

{
  "type": "event",
  "name": "transfer",
  "activityParams": {
    "transferTarget": "sip:john@host.com",
    "transferSipHeaders": [
      {
        "name": "X-My-Header",
        "value": "my_value"
      }
    ]
  }
}

Event parameters

The following table lists the parameters associated with this event:

Parameter

Type

Description

transferTarget

String

URI to where the call should be transferred call to. Typically, the URI is a "tel" or "sip" URI.

handoverReason

String

Conveys a textual reason for the transfer.

The value of this parameter will appear on the CDR of the call.

transferSipHeaders

Array of Objects

Array of objects listing SIP headers that should be sent to the transferee. Each object comprises a name and a value attribute.

The total length must not exceed 12,000 characters.

Up to 100 SIP headers can be defined.

For more information, see Adding SIP headers below.

transferReferredByURL

String

Defines the party (URL) who initiated the call referral.

If this parameter exists, the SBC adds a SIP Referred-By header to the outgoing INVITE or REFER message. If the SBC handles locally (termination), the SBC adds it to a new outgoing INVITE. If not handled locally (regular), the SBC adds it to the forwarded REFER message.

transferNotifications

Boolean

Enables Live Hub to notify the bot on the outcome of call transfer attempts.

  • true

  • false (default)

For more information, see Handling call transfer failures below.

transferNotificationsHangupMS

Number

Defines a grace period (in milliseconds) for disconnecting the call after a successful transfer.

This parameter is only applicable when transferNotifications is set to true.

The valid value is 0 to 10000. The default is 5000.

Adding SIP headers

When the bot performs a call transfer, it can add data to be sent as SIP headers in the generated SIP message (REFER or INVITE). This is done by the transferSipHeaders parameter. This parameter contains an array of JSON objects with the following attributes:

Attribute

Type

Description

name

String

Name of the SIP header.

value

String

Value of the SIP header.

For example, the following event can be used to add the header "X-My-Header" with the value "my_value":

AudioCodes Bot API
{
  "type": "event",
  "name": "transfer",
  "activityParams": {
    "transferTarget": "sip:john@host.com",
    "transferSipHeaders": [
      {
        "name": "X-My-Header",
        "value": "my_value"
      }
    ]
  }
}
Microsoft Bot Framework
{
  "type": "event",
  "name": "transfer",
  "channelData": {
    "activityParams": {
      "transferTarget": "sip:john@host.com",
      "transferSipHeaders": [
        {
          "name": "X-My-Header",
          "value": "my_value"
        }
      ]
    }
  }
}
Microsoft Copilot Studio
{
  "activityParams": {
    "transferTarget": "sip:john@host.com",
    "transferSipHeaders": [
      {
        "name": "X-My-Header",
        "value": "my_value"
      }
    ]
  }
}
Microsoft Copilot Studio legacy bots
{
  "activityParams": {
      "transferTarget": "sip:john@host.com",
      "transferSipHeaders": [
        {
          "name": "X-My-Header",
          "value": "my_value"
        }
      ]
    }
}
Dialogflow CX

The "Live agent handoff" fulfillment content can be used to specify the transferSipHeaders parameter:

{
  "activityParams": {
    "transferTarget": "sip:john@host.com",
    "transferSipHeaders": [
      {
        "name": "X-My-Header",
        "value": "my_value"
      }
    ]
  }
}
Dialogflow ES

Add a Custom Payload response with the following content:

{
  "activities": [{
    "type": "event",
    "name": "transfer",
    "activityParams": {
      "transferTarget": "sip:john@host.com",
      "transferSipHeaders": [
        {
          "name": "X-My-Header",
          "value": "my_value"
        }
      ]
    }
  }]
}

If Live Hub is configured to handle transfer by sending a SIP INVITE message, it will contain the header, for example:

X-My-Header: my_value

If Live Hub is configured to handle transfer by sending a SIP REFER message, it will contain the value in the URI of the Refer-To header, for example:

Refer-To: <sip:john@host.com?X-My-Header=my_value>

Handling call transfer failures

By default, once Live Hub performs the transfer, it immediately disconnects the call with the bot, regardless of whether the transfer succeeded or not.

By using the transferNotifications parameter, you can allow the bot to regain control over the call after a failed transfer attempt.

When enabled, Live Hub notifies the bot on the outcome of call transfer attempts. If the transfer succeeded, Live Hub disconnects the call with the bot after the notification. If the transfer fails, the call with the bot resumes (not disconnected).

In addition, you can configure Live Hub with a grace period (using the transferNotificationsHangupMS parameter) for disconnecting the call after a successful transfer. This provides the bot with some time to perform additional actions (for example, sending metadata) before the call is disconnected by Live Hub.

For example, the following event can be used to enable handling of call transfer failures:

AudioCodes Bot API
{
  "type": "event",
  "name": "transfer",
  "activityParams": {
    "transferTarget": "sip:john@host.com",
    "transferNotifications": true
  }
}
Microsoft Bot Framework
{
  "type": "event",
  "name": "transfer",
  "channelData": {
    "activityParams": {
      "transferTarget": "sip:john@host.com",
      "transferNotifications": true
    }
  }
}
Microsoft Copilot Studio
{
  "activityParams": {
      "transferTarget": "sip:john@host.com",
      "transferNotifications": true
    }
}
Microsoft Copilot Studio legacy bots
{
  "activityParams": {
      "transferTarget": "sip:john@host.com",
      "transferNotifications": true
    }
}
Dialogflow CX

The "Live agent handoff" fulfillment content can be used to specify the transferNotifications parameter:

{
  "activityParams": {
    "transferTarget": "sip:john@host.com",
    "transferNotifications": true
  }
}
Dialogflow ES

Add a Custom Payload response with a transfer event:

{
  "activities": [{
    "type": "event",
    "name": "transfer",
    "activityParams": {
      "transferTarget": "sip:john@host.com",
      "transferNotifications": true
    }
  }]
}

Receiving call transfer notifications

The notifications to the bot are done using the transferStatus event, which is sent by Live Hub after each transfer attempt.

Set the transfer target number

The transfer target phone number can be specified either by the bot developer on the transfer action, or through Live Hub when you configure the bot.

If the transfer target number is specified both by the bot developer and by Live Hub, then the bot developer's configuration is used.

To configure the transfer target number in Live Hub for the specific bot:

  1. In the Navigation pane, select Bots.

  2. Select the bot for which you want to enable call transfer, and then click Edit.

  3. Click the Features tab.

  4. Under Call Transfer, in the 'Transfer number' field, enter the transfer target phone number.

Create a routing rule

You only need to configure a special routing rule for call transfer if the SIP Connection to which Live Hub forwards the bot request is performed with a new call (SIP INVITE). If the SIP Connection supports SIP REFER requests, a routing rule is not needed, and Live Hub simply sends the bot call transfer request as a SIP REFER message to the SIP Connection.

The following describes the specific configuration required for configuring a routing rule for call transfer. For complete instructions for creating routing rules, see information on Add a routing rule.

To configure a routing rule for call transfer:

  1. In the Navigation pane, select Routing, and then click the Routing Rules tab.

  2. Click Add new routing rule.

  1. Under General, from the 'Type' drop-down list, select Transfer.

  2. Under Call criteria, from the 'Transferred by' drop-down list, choose the bot that initiated the transfer.

  3. Under Route to, from the 'Call destination' drop-down list, select either the phone number used to transfer the call, or the relevant SIP Connection.

The format of the target number for the call transfer must be configured in E.164 format - e.g., +9725211111.

Viewing Transferred Call History

The following procedure describes how you can view your transferred calls.

  1. In the Navigation pane, select Call History.

  1. Select a call.

  2. Select Search for related call records; the transferred calls are displayed.

  3. If the selected call is part of a transfer call scenario, the records of the incoming and the outgoing transfer calls are displayed to the user.