Call Transfer over PSTN
Learn how to use call transfers to handle GA calls with any platform
ASAPP’s Call Transfer over PSTN enables businesses to integrate GenerativeAgent Voice without being constrained by their existing telephony infrastructure.
We have dedicated connector integrations for some platforms (Genesys, Amazon Connect), but not every platform allows native integrations. Call transfers allow you to use PSTN (dialing a number) to connect your users to GenerativeAgent while keeping you in control of the call the entire time.
How it works
At a high level, call transfer over PSTN works by assigning a temporary phone number for a given customer that you can dial in for GenerativeAgent:
- Request a number: Your system requests a temporary phone number from ASAPP. Optionally you can provide context to the call.
- GenerativeAgent handles the conversation: Dial in GenerativeAgent via the temporary phone number so it can talk directly to the customer.
- Return control: When GenerativeAgent has completed the call, it will disconnect the call and your system will fetch the resulting context and handle the rest of the call flow.
Detailed Flow
Detailed Flow
-
Incoming Call: A customer calls your existing phone number
-
IVR Processing: Your existing IVR system processes the call and determines when to transfer to GenerativeAgent
-
Request a number: Your system requests a temporary phone number from ASAPP. Optionally you can provide context to the call.
-
Dial the number (Supervised transfer): Your system dials the temporary phone number via a Supervised transfer.
With the supervised transfer, you can monitor the call and control the call flow while GenerativeAgent is talking to the user.
-
Detect GenerativeAgent disconnect: When GenerativeAgent has completed the call, it will disconnect the call and your system will detect the disconnect.
-
Fetch the call context: Your system will fetch the context, which includes the transfer type, from the call.
-
Handle the call: Using the context and transfer type, your system handles the agent escalation, call disposition, or any other steps in your call flow.
Before you Begin
Before implementing PSTN Call Transfer, you need:
- Get your API Key Id and Secret
- Ensure your API key has been configured to access GenerativeAgent APIs. Reach out to your ASAPP team if you need access enabled.
- Configure Tasks and Functions
- Contact your ASAPP account team to enable call transfer over PSTN
- This includes determining how many concurrent calls you need to support, phone number countries to support, etc.
Step 1: Request a temporary number
To transfer a call to GenerativeAgent, you need to create a call-transfer
. A call transfer is the attempt to transfer a call to GenerativeAgent. This resource will include a temporary phone number from ASAPP that you can connect the customer to. This number will be assigned specifically for this customer interaction and will expire after a set time period, by default 1 minute.
To create a call transfer, you need to specify:
Parameter | Description |
---|---|
id | Your unique identifier for the call transfer. You will use this later to fetch the call transfer result. |
externalConversationId | Your unique identifier for the conversation. This allows you to reconnect the customer to the same conversation and is used in reporting. |
type | Specify a type of PHONE_NUMBER. |
phoneNumber.country | The country code for the phone number. |
inputContext | Optionally specify the taskName and inputVariables to trigger GenerativeAgent with specific task information and variables. |
A successful request returns 200 with the call transfer data:
Save the phoneNumber.transferNumber
; you will need to transfer to it before the phoneNumber.expireAt
time. This is 1 minute by default.
Step 2: Make a supervised transfer
Perform a supervised transfer to the phoneNumber.transferNumber
in the call transfer resource. Once you dial the number, GenerativeAgent is given the input context, if provided, and talks to the customer.
Once connected or expired, the number will be released and can be used by a subsequent call transfer.
The specific implementation on how to perform a supervised transfer depends on your call center system, but you must maintain call control throughout the transfer.
With the supervised transfer, your system is on the call the entire time. You can monitor the call and control the call flow while GenerativeAgent is talking to the user.
Step 3: Detect disconnect
With the supervised transfer, your system will be monitoring the call and two scenarios are possible during the conversation that you must handle accordingly:
-
GenerativeAgent completes the conversation with an agent escalation or a system transfer
- GenerativeAgent has determined it needs to return the call to your system, either to an agent escalation or a system transfer.
- GenerativeAgent disconnects from the call and the output context of the conversation can be retrieved; this is covered in the next step.
-
Customer hangs up the phone call
- When the customer hangs up, there are no output variables since GenerativeAgent didn’t close out the conversation.
The disconnect detection is crucial for maintaining proper call flow control and ensuring you can fetch the conversation context before handling the next steps.
Step 4: Fetch the call context
Once you detect the disconnect, you need to retrieve the call transfer result and resulting outputContext.
To retrieve the call transfer result, you need to fetch the call-transfers
with the id
of the original call transfer:
A successful request returns 200 with call transfer data:
Extract the key information:
-
Status: Indicates if the call was completed successfully.
Call transfer status
Status Description ACTIVE The call transfer is active and the temporary phone number is waiting to be connected. ONGOING The call was connected and GenerativeAgent is talking to the customer. COMPLETED The call transfer has completed. EXPIRED The call transfer has expired and the temporary phone number is no longer valid for that conversation. -
outputContext: Contains the conversation results and any transfer variables
- transferType: Indicates the type of transfer that occurred. This can be either
AGENT
orSYSTEM
. - referenceVariables: Context information about the customer and conversation
- transferVariables: Data that should be passed to the next system or agent
- transferType: Indicates the type of transfer that occurred. This can be either
With this information, handle the call according to your own business logic, such as routing the call to an agent or handling call disposition.
Handling customer reconnections
There may be scenarios where you want to reconnect a customer directly to where they left off with GenerativeAgent. For example, if the customer hangs up the phone, or after transferring back to your system, you want to transfer them back again to GenerativeAgent.
To do this, ensure you use the same externalConversationId
to reconnect the customer to the same conversation. GenerativeAgent will resume the conversation where it left off.
Next Steps
Now that you have successfully implemented PSTN Call Transfer with GenerativeAgent, here are some important next steps to consider:
Configuration Overview
Learn how to configure GenerativeAgent’s behaviors, tasks, and communication style
Connect your APIs
Configure your APIs to allow GenerativeAgent to access necessary data and perform actions
Review Knowledge Base
Connect and optimize your knowledge base to improve GenerativeAgent’s responses
Go Live
Follow the deployment checklist to launch GenerativeAgent in your production environment