{
  "modules": [
    {
      "id": "8195d6df-3411-416f-8293-31657013fef7",
      "type": "SetLoggingBehavior",
      "branches": [
        {
          "condition": "Success",
          "transition": "49ec6a04-3f39-4978-99f7-95ebed5071f0"
        }
      ],
      "parameters": [
        {
          "name": "LoggingBehavior",
          "value": "Enable"
        }
      ],
      "metadata": {
        "position": {
          "x": 222,
          "y": 21
        }
      }
    },
    {
      "id": "f869f028-7da7-4530-b0f3-f69840f33ead",
      "type": "InvokeExternalResource",
      "branches": [
        {
          "condition": "Success",
          "transition": "fcf7b55d-5292-4248-affb-2887166aaeb0"
        },
        {
          "condition": "Error",
          "transition": "fcf7b55d-5292-4248-affb-2887166aaeb0"
        }
      ],
      "parameters": [
        {
          "name": "FunctionArn",
          "value": "****change to your arn for your lambda function:ReadCallback",
          "namespace": null
        },
        {
          "name": "TimeLimit",
          "value": "3"
        }
      ],
      "metadata": {
        "position": {
          "x": 1343,
          "y": 21
        },
        "dynamicMetadata": {},
        "useDynamic": false
      },
      "target": "Lambda"
    },
    {
      "id": "101b3d98-6044-4f86-ac91-800e6f293ae8",
      "type": "GetUserInput",
      "branches": [
        {
          "condition": "Evaluate",
          "conditionType": "Equals",
          "conditionValue": "1",
          "transition": "006fe324-d6cc-410a-b3b9-a4f11871cc34"
        },
        {
          "condition": "Timeout",
          "transition": "636dc1db-4095-4d0f-adf6-de8e5660e744"
        },
        {
          "condition": "NoMatch",
          "transition": "636dc1db-4095-4d0f-adf6-de8e5660e744"
        },
        {
          "condition": "Error",
          "transition": "636dc1db-4095-4d0f-adf6-de8e5660e744"
        }
      ],
      "parameters": [
        {
          "name": "Text",
          "value": "All of our agents are busy. Press 1 to leave a call back or continue to hold.",
          "namespace": null
        },
        {
          "name": "TextToSpeechType",
          "value": "text"
        },
        {
          "name": "Timeout",
          "value": "5"
        },
        {
          "name": "MaxDigits",
          "value": "1"
        }
      ],
      "metadata": {
        "position": {
          "x": 1902,
          "y": 199
        },
        "conditionMetadata": [
          {
            "id": "3d971bdd-8532-4b20-b5d6-d68f7a817fd6",
            "value": "1"
          }
        ],
        "useDynamic": false
      },
      "target": "Digits"
    },
    {
      "id": "636dc1db-4095-4d0f-adf6-de8e5660e744",
      "type": "Transfer",
      "branches": [
        {
          "condition": "AtCapacity",
          "transition": "da4fa7f6-be0c-49aa-b65a-3953c6679982"
        },
        {
          "condition": "Error",
          "transition": "da4fa7f6-be0c-49aa-b65a-3953c6679982"
        }
      ],
      "parameters": [],
      "metadata": {
        "position": {
          "x": 2182,
          "y": 419
        },
        "useDynamic": false,
        "queue": null
      },
      "target": "Queue"
    },
    {
      "id": "da4fa7f6-be0c-49aa-b65a-3953c6679982",
      "type": "Disconnect",
      "branches": [],
      "parameters": [],
      "metadata": {
        "position": {
          "x": 2459,
          "y": 536
        }
      }
    },
    {
      "id": "044a254d-86b7-4aa2-9c91-a07a801c112f",
      "type": "InvokeExternalResource",
      "branches": [
        {
          "condition": "Success",
          "transition": "959eb464-9570-40cd-913f-4c4aef27de18"
        },
        {
          "condition": "Error",
          "transition": "959eb464-9570-40cd-913f-4c4aef27de18"
        }
      ],
      "parameters": [
        {
          "name": "FunctionArn",
          "value": "****change to your arn for your lambda function:ReadCallback",
          "namespace": null
        },
        {
          "name": "TimeLimit",
          "value": "3"
        }
      ],
      "metadata": {
        "position": {
          "x": 3302,
          "y": 420
        },
        "dynamicMetadata": {},
        "useDynamic": false
      },
      "target": "Lambda"
    },
    {
      "id": "edfff5bb-840b-4fae-a950-5d05b1996fec",
      "type": "SetAttributes",
      "branches": [
        {
          "condition": "Success",
          "transition": "044a254d-86b7-4aa2-9c91-a07a801c112f"
        },
        {
          "condition": "Error",
          "transition": "044a254d-86b7-4aa2-9c91-a07a801c112f"
        }
      ],
      "parameters": [
        {
          "name": "Attribute",
          "value": "Stored customer input",
          "key": "CallbackNumber",
          "namespace": "System"
        }
      ],
      "metadata": {
        "position": {
          "x": 3022,
          "y": 420
        }
      }
    },
    {
      "id": "006fe324-d6cc-410a-b3b9-a4f11871cc34",
      "type": "CheckAttribute",
      "branches": [
        {
          "condition": "Evaluate",
          "conditionType": "StartsWith",
          "conditionValue": "+",
          "transition": "ae5e7ccd-86b2-4bcb-b9d0-f28cd31c71dc"
        },
        {
          "condition": "NoMatch",
          "transition": "6ff746b7-6489-4dc2-8c7e-8887b4e56065"
        }
      ],
      "parameters": [
        {
          "name": "Attribute",
          "value": "Customer Number"
        },
        {
          "name": "Namespace",
          "value": "System"
        }
      ],
      "metadata": {
        "position": {
          "x": 2181,
          "y": 201
        },
        "conditionMetadata": [
          {
            "id": "3fc75e80-b6e0-4a3f-a0f1-ab097bd97d94",
            "operator": {
              "name": "Starts with",
              "value": "StartsWith",
              "shortDisplay": "starts with"
            },
            "value": "+"
          }
        ]
      }
    },
    {
      "id": "ae5e7ccd-86b2-4bcb-b9d0-f28cd31c71dc",
      "type": "GetUserInput",
      "branches": [
        {
          "condition": "Evaluate",
          "conditionType": "Equals",
          "conditionValue": "1",
          "transition": "a4e6d388-5f10-42e3-88b6-814d4593f5a5"
        },
        {
          "condition": "Evaluate",
          "conditionType": "Equals",
          "conditionValue": "2",
          "transition": "6ff746b7-6489-4dc2-8c7e-8887b4e56065"
        },
        {
          "condition": "Timeout",
          "transition": "6ff746b7-6489-4dc2-8c7e-8887b4e56065"
        },
        {
          "condition": "NoMatch",
          "transition": "6ff746b7-6489-4dc2-8c7e-8887b4e56065"
        },
        {
          "condition": "Error",
          "transition": "6ff746b7-6489-4dc2-8c7e-8887b4e56065"
        }
      ],
      "parameters": [
        {
          "name":"Text","value":"<speak>We can see you are calling on <say-as interpret-as=\"telephone\"> $.CustomerEndpoint.Address.</say-as> <break time=\"500ms\"/>Press 1 to get a call back on this number, or press 2 to enter a new number.</speak>","namespace":null},{"name":"TextToSpeechType","value":"ssml"},
        {
          "name": "Timeout",
          "value": "5"
        },
        {
          "name": "MaxDigits",
          "value": "1"
        }
      ],
      "metadata": {
        "position": {
          "x": 2462,
          "y": 201
        },
        "conditionMetadata": [
          {
            "id": "43e86a5d-f4dd-4639-8de3-bd04d5f86314",
            "value": "1"
          },
          {
            "id": "0fdbfdbc-82dc-4a4a-8357-5a20f5a230af",
            "value": "2"
          }
        ],
        "useDynamic": false
      },
      "target": "Digits"
    },
    {
      "id": "6ff746b7-6489-4dc2-8c7e-8887b4e56065",
      "type": "StoreUserInput",
      "branches": [
        {
          "condition": "Success",
          "transition": "edfff5bb-840b-4fae-a950-5d05b1996fec"
        },
        {
          "condition": "InvalidNumber",
          "transition": "006fe324-d6cc-410a-b3b9-a4f11871cc34"
        },
        {
          "condition": "Error",
          "transition": "006fe324-d6cc-410a-b3b9-a4f11871cc34"
        }
      ],
      "parameters": [
        {
          "name": "Text",
          "value": "Please enter the callback number including the country code without the plus"
        },
        {
          "name": "TextToSpeechType",
          "value": "text"
        },
        {
          "name": "CustomerInputType",
          "value": "PhoneNumber"
        },
        {
          "name": "Timeout",
          "value": "5"
        },
        {
          "name": "PhoneNumberFormat",
          "value": "International"
        }
      ],
      "metadata": {
        "position": {
          "x": 2743,
          "y": 421
        },
        "useDynamic": false,
        "useDynamicForEncryptionKeys": true,
        "countryCodePrefix": "+1"
      }
    },
    {
      "id": "e1466d7d-35c4-4c2e-840e-433d81316b02",
      "type": "PlayPrompt",
      "branches": [
        {
          "condition": "Success",
          "transition": "6ff746b7-6489-4dc2-8c7e-8887b4e56065"
        }
      ],
      "parameters": [
        {
          "name": "Text",
          "value": "There was something wrong with your phone number",
          "namespace": null
        },
        {
          "name": "TextToSpeechType",
          "value": "text"
        }
      ],
      "metadata": {
        "position": {
          "x": 3299,
          "y": 642
        },
        "useDynamic": false
      }
    },
    {
      "id": "a4e6d388-5f10-42e3-88b6-814d4593f5a5",
      "type": "SetAttributes",
      "branches": [
        {
          "condition": "Success",
          "transition": "750860a6-92f7-4358-8478-b56cd79abe02"
        },
        {
          "condition": "Error",
          "transition": "750860a6-92f7-4358-8478-b56cd79abe02"
        }
      ],
      "parameters": [
        {
          "name": "Attribute",
          "value": "Customer Number",
          "key": "CallbackNumber",
          "namespace": "System"
        }
      ],
      "metadata": {
        "position": {
          "x": 2743,
          "y": 202
        }
      }
    },
    {
      "id": "959eb464-9570-40cd-913f-4c4aef27de18",
      "type": "CheckAttribute",
      "branches": [
        {
          "condition": "Evaluate",
          "conditionType": "Equals",
          "conditionValue": "true",
          "transition": "6b30c81b-c8b7-484d-ab73-033a20c54e0c"
        },
        {
          "condition": "NoMatch",
          "transition": "750860a6-92f7-4358-8478-b56cd79abe02"
        }
      ],
      "parameters": [
        {
          "name": "Attribute",
          "value": "Callback"
        },
        {
          "name": "Namespace",
          "value": "External"
        }
      ],
      "metadata": {
        "position": {
          "x": 3581,
          "y": 421
        },
        "conditionMetadata": [
          {
            "id": "8fa43abc-fbcb-48c6-9761-b5ddc74dbb26",
            "operator": {
              "name": "Equals",
              "value": "Equals",
              "shortDisplay": "="
            },
            "value": "true"
          }
        ]
      }
    },
    {
      "id": "750860a6-92f7-4358-8478-b56cd79abe02",
      "type": "SetCallBackNumber",
      "branches": [
        {
          "condition": "Success",
          "transition": "329c5a32-816e-4798-9046-c3bfdb5d7cbe"
        },
        {
          "condition": "InvalidPhoneNumber",
          "transition": "e1466d7d-35c4-4c2e-840e-433d81316b02"
        },
        {
          "condition": "NonDialableNumber",
          "transition": "e1466d7d-35c4-4c2e-840e-433d81316b02"
        }
      ],
      "parameters": [
        {
          "name": "CallBackNumber",
          "value": "CallbackNumber",
          "namespace": "User Defined"
        }
      ],
      "metadata": {
        "position": {
          "x": 3863,
          "y": 600
        }
      }
    },
    {
      "id": "329c5a32-816e-4798-9046-c3bfdb5d7cbe",
      "type": "InvokeExternalResource",
      "branches": [
        {
          "condition": "Success",
          "transition": "5aa9902d-f206-49f4-a320-9c0ded76d523"
        },
        {
          "condition": "Error",
          "transition": "5aa9902d-f206-49f4-a320-9c0ded76d523"
        }
      ],
      "parameters": [
        {
          "name": "FunctionArn",
          "value": "****change to your arn for your lambda function:WriteCallback",
          "namespace": null
        },
        {
          "name": "TimeLimit",
          "value": "3"
        }
      ],
      "metadata": {
        "position": {
          "x": 4143,
          "y": 600
        },
        "dynamicMetadata": {},
        "useDynamic": false
      },
      "target": "Lambda"
    },
    {
      "id": "6b30c81b-c8b7-484d-ab73-033a20c54e0c",
      "type": "PlayPrompt",
      "branches": [
        {
          "condition": "Success",
          "transition": "e06be64d-0f69-4f36-9834-b40e39766fc0"
        }
      ],
      "parameters": [
        {
          "name": "Text",
          "value": "You already have a call back requested at $.External.Time on $.External.Date. please be patient or you might lose your place in the queue or get several call backs. Goodbye.",
          "namespace": null
        },
        {
          "name": "TextToSpeechType",
          "value": "text"
        }
      ],
      "metadata": {
        "position": {
          "x": 3863,
          "y": 421
        },
        "useDynamic": false
      }
    },
    {
      "id": "e06be64d-0f69-4f36-9834-b40e39766fc0",
      "type": "Disconnect",
      "branches": [],
      "parameters": [],
      "metadata": {
        "position": {
          "x": 4142,
          "y": 420
        }
      }
    },
    {
      "id": "5aa9902d-f206-49f4-a320-9c0ded76d523",
      "type": "CreateCallback",
      "branches": [
        {
          "condition": "Success",
          "transition": "73f6f830-9984-426c-b31a-6527b0f3c522"
        },
        {
          "condition": "Error",
          "transition": "de21f981-1913-45f0-95cb-9096fe1d918c"
        }
      ],
      "parameters": [
        {
          "name": "InitialDelaySeconds",
          "value": 99
        },
        {
          "name": "RetryDelaySeconds",
          "value": 600
        },
        {
          "name": "MaxRetryAttempts",
          "value": 1
        }
      ],
      "metadata": {
        "position": {
          "x": 4425,
          "y": 600
        },
        "useDynamic": false,
        "queue": null
      }
    },
    {
      "id": "73f6f830-9984-426c-b31a-6527b0f3c522",
      "type": "PlayPrompt",
      "branches": [
        {
          "condition": "Success",
          "transition": "de21f981-1913-45f0-95cb-9096fe1d918c"
        }
      ],
      "parameters": [
        {
          "name": "Text",
          "value": "Thank you. We will call you back when it is your turn. Goodbye",
          "namespace": null
        },
        {
          "name": "TextToSpeechType",
          "value": "text"
        }
      ],
      "metadata": {
        "position": {
          "x": 4704,
          "y": 601
        },
        "useDynamic": false
      }
    },
    {
      "id": "de21f981-1913-45f0-95cb-9096fe1d918c",
      "type": "Disconnect",
      "branches": [],
      "parameters": [],
      "metadata": {
        "position": {
          "x": 4702,
          "y": 781
        }
      }
    },
    {
      "id": "dc079ec2-05b5-4b6c-b46e-bfac80f219a0",
      "type": "SetAttributes",
      "branches": [
        {
          "condition": "Success",
          "transition": "f869f028-7da7-4530-b0f3-f69840f33ead"
        },
        {
          "condition": "Error",
          "transition": "f869f028-7da7-4530-b0f3-f69840f33ead"
        }
      ],
      "parameters": [
        {
          "name": "Attribute",
          "value": "Customer Number",
          "key": "CallbackNumber",
          "namespace": "System"
        }
      ],
      "metadata": {
        "position": {
          "x": 1063,
          "y": 21
        }
      }
    },
    {
      "id": "49ec6a04-3f39-4978-99f7-95ebed5071f0",
      "type": "SetVoice",
      "branches": [
        {
          "condition": "Success",
          "transition": "d0d4a1e4-ec2e-4aa4-a39a-b58b2b3ef7da"
        }
      ],
      "parameters": [
        {
          "name": "GlobalVoice",
          "value": "Joanna"
        }
      ],
      "metadata": {
        "position": {
          "x": 502,
          "y": 21
        }
      }
    },
    {
      "id": "d0d4a1e4-ec2e-4aa4-a39a-b58b2b3ef7da",
      "type": "SetQueue",
      "branches": [
        {
          "condition": "Success",
          "transition": "dc079ec2-05b5-4b6c-b46e-bfac80f219a0"
        },
        {
          "condition": "Error",
          "transition": "dc079ec2-05b5-4b6c-b46e-bfac80f219a0"
        }
      ],
      "parameters": [
        {
          "name": "Queue",
          "value": "****delete and recreate this block for your queue",
          "namespace": null,
          "resourceName": "****delete and recreate this block for your queue"
        }
      ],
      "metadata": {
        "position": {
          "x": 796,
          "y": 20
        },
        "useDynamic": false,
        "queue": {
        "value": "****delete and recreate this block for your queue",
          "resourceName": "****delete and recreate this block for your queue"
        }
      }
    },
    {
      "id": "fcf7b55d-5292-4248-affb-2887166aaeb0",
      "type": "CheckAttribute",
      "branches": [
        {
          "condition": "Evaluate",
          "conditionType": "Equals",
          "conditionValue": "true",
          "transition": "6b30c81b-c8b7-484d-ab73-033a20c54e0c"
        },
        {
          "condition": "NoMatch",
          "transition": "101b3d98-6044-4f86-ac91-800e6f293ae8"
        }
      ],
      "parameters": [
        {
          "name": "Attribute",
          "value": "Callback"
        },
        {
          "name": "Namespace",
          "value": "External"
        }
      ],
      "metadata": {
        "position": {
          "x": 1622,
          "y": 21
        },
        "conditionMetadata": [
          {
            "id": "5cf28926-58b5-4529-917f-1ea40bebe2d9",
            "operator": {
              "name": "Equals",
              "value": "Equals",
              "shortDisplay": "="
            },
            "value": "true"
          }
        ]
      }
    }
  ],
  "version": "1",
  "type": "contactFlow",
  "start": "8195d6df-3411-416f-8293-31657013fef7",
  "metadata": {
    "entryPointPosition": {
      "x": 30,
      "y": 20
    },
    "snapToGrid": false,
    "name": "Callback",
    "description": "Callback Demo",
    "type": "contactFlow",
    "status": "published",
    "hash": "82936b14a9f0618c02d60735ea8b44201ad2fffc10912c0abb5f33df74984395"
  }
}
