Transfer Calls to an Omni-Channel Flow

Implement Transfer to Flow.

Give vendors the option to transfer live calls to an Omni-Channel flow using the Route Voice Call API. The existingExecute an Omni-Channel Flow API cannot be used for this use case. The routingTarget field in the request body accepts the ID of the target flow.

For example, see this sample implementation for Transfer to Flow using the Route Voice Call API.

1async addParticipant(contact, call, isBlindTransfer) {
2	....
3	....
4
5if (contact.type === Constants.CONTACT_TYPE.FLOW) {
6		// new Route Voice Call API Integration for unified routing
7            if (this.state?.flowConfig?.isUnifiedRoutingEnabled) {
8                unifiedRoutingTransfertoFlow = true;
9                const routePayload = { routingTarget: transferTo };
10                await this.routeVoiceCall(transferCall.voiceCallId, routePayload);
11            } else {
12		//For federated routing, use existing API as it is.
13                let routingInstruction = await this.executeOmniFlow(transferCall, contact.id);
14                transferTo = routingInstruction.agent || routingInstruction.queue;
15            }
16        }
17
18....
19}