Updated on 2023-10-12 GMT+08:00

(Optional) Configuring an Inbound Call Flow

Prerequisites

  • You have completed the connection between the AICC and OIAP.
  • You have obtained the information about the mobile agent and bidirectional call interfaces in the API Fabric from the O&M personnel.

Context

The flow invokes the getCalledInfo interface to obtain the inbound call data, and transfers the inbound calls to a specified number or a skill queue based on the data.

Procedure

  1. Add a voice file, which is used as a voice prompt for an error flow.

    1. Sign in to the AICC as a tenant administrator and choose Configuration Center > Resource Management > Audio and Video Resource Management.
    2. Click Language to view the language configuration. Select the language to be set as the default language, click Set As Default, and click OK.

    3. Click New in the upper right corner. The page for adding a voice file is displayed.
    4. Set voice prompt parameters.
      • Name: Enter the name of the file to be uploaded.
      • Usage Scenario: Select IVR.
      • Select Select a voice file, click , select a local WAV voice file, click OK. If you do not have a voice file, click Online Recording.
      Figure 1 Adding a voice file
    5. Return to the voice list page, select the voice file that is successfully uploaded, and click Submit to submit the voice file to the system administrator for approval.

  2. Add an error flow.

    A tenant space has only one error flow. The flow provides a solution for common errors in a normal flow (for example, the next code cannot be found).
    1. Choose Configuration Center > Flow Configuration > Flow Management.
    2. Click New. The page for adding a flow is displayed.
    3. Set flow parameters. Enter a flow name, set Type to Exception Handling Flow, set Is Referenced to Yes, and click Complete.
    4. Click the flow to expand it and click Edit. The flow editing page is displayed.
    5. Draw a flow, set the voice file added in 1 as the prompt tone for the Play Voice node, as shown in the following figure, and click to save the flow.

    6. Expand the new error flow, click Release, select Official Release, and click OK. The new flow is successfully released.

  3. Add the whitelist and two interfaces.

    The two interfaces are used for authentication and obtaining interface data.
    1. Contact the system administrator to add the IP addresses and port numbers, or domain names of the interfaces to the trustlist of the interface control menu.
    2. Choose Configuration Center > Flow Configuration > Flow Management.
    3. Choose Interface Configuration.
    4. Click New. Set interface parameters by referring to Figure 2 to Figure 5.

      Figure 2 and Figure 3 indicate the input and output parameters of the getCalledInfo interface. Figure 4 and Figure 5 indicate the input and output parameters of the token interface.

      The token interface is used to obtain the token for AICC authentication. The getCalledInfo interface is used to check whether the current calling number has historical call records. If historical call records are available, the called numbers are found.
      Figure 2 Input parameter header and output parameters of the getCalledInfo interface
      Figure 3 Input parameter body of the getCalledInfo interface
      Figure 4 Input parameter header and output parameter of the token interface
      Figure 5 Input parameter body of the token interface

  4. Add an inbound call flow.

    1. Choose Configuration Center > Flow Configuration > Flow Management.
    2. Click New.
    3. Configure flow information. Enter a flow name, set Type to Subflow, set Is Referenced to Yes, and click Complete to save the flow information.
    4. Click the flow to expand it and click Edit. The flow editing page is displayed.
    5. Click a blank area in the canvas and add the following flow variables on the right.

      These variables are used to store the data returned by the interface in the flow.

      Figure 6 Configuring parameters
    6. Drag diagram elements to the canvas and draw the flow as shown in the following figure.
      Figure 7 Drawing a flow
    7. Configure nodes.

      Node

      Configuration

      token

      Interface invocation diagram element, which references the token interface added in 3.

      Input parameter header:

      • Set Content-Type to application/json.
      • Set X-Token-Expire to 6000.

      Input parameter body:

      • Set app_key to the value of AK.
      • Set app_secret to the value of SK.

      Output parameter:

      • AccessToken: FLOW.AccessToken

      getCalledInfo

      Interface invocation diagram element, which references the getCalledInfo interface added in 3.

      Input parameter header:

      • Set x-app-key to the value of AK.
      • Set Authorization to Bearer ${FLOW.AccessToken}.
      • Set Content-Type to application/json.

      Input parameter body:

      • Set caller to ${SYS.callingNumber}.
      • Set called to the system access code provided by the mobile agent.

      Output parameter:

      • retCode: FLOW.retCode
      • result.devType: FLOW.devType
      • result.called: FLOW.called
      • result.skillId: FLOW.skillId

      Condition Judgment (left)

      Condition judgment diagram element, which is used to determine whether an interface is successfully invoked.

      If the value of FLOW.retCode is 0, the interface is successfully invoked.

      Condition Judgment (right)

      Condition judgment diagram element, which is used to determine the flow direction.

      • If the value of FLOW.devType is 1, the call is transferred to the called number returned by the getCalledInfo interface.
      • If the value of FLOW.devType is 0, the call is transferred to the skill queue specified by the call center.
        NOTE:

        Note that the skill queue is a voice skill queue of common agents, but not mobile agents.

      Transfer to number

      Transfer diagram element, which is used to transfer a call to a third-party number.

      Select Transfer to Third Party and set the transferred number to ${FLOW.called}.

      Transfer to Skill Queue

      Transfer diagram element, which indicates that a call is transferred to a manual skill queue.

      Select Transfer to Agent and select an existing voice skill queue in the system.

    8. Click in the upper part of the canvas to save the flow.
    9. Expand the new subflow, click Release, select Official Release, and click OK.

  5. Set the called route and add the association between the flow and the system access code.

    1. Choose Configuration Center > Access Configuration > Called Route.
    2. Click New to add a called route.
    3. Click , select a system access code of the Audio/Video type, add an extension code, set Device Type to IVR, and select the flow configured in 4.

    4. Click Complete.