{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jambonz.org/schema/components/actionHookDelayAction",
  "title": "ActionHookDelayAction",
  "description": "Configuration for what to do when an actionHook (webhook) takes a long time to respond. Allows playing interim content (e.g. 'please wait' messages, hold music) while waiting for the webhook response, with configurable retry and give-up behavior.",
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean",
      "description": "Whether to enable delay handling for actionHooks."
    },
    "noResponseTimeout": {
      "type": "number",
      "description": "Time in seconds to wait before executing the delay actions. If the webhook responds before this timeout, the delay actions are skipped.",
      "examples": [3, 5]
    },
    "noResponseGiveUpTimeout": {
      "type": "number",
      "description": "Total time in seconds to wait for a webhook response before giving up and executing the giveUpActions.",
      "examples": [30, 60]
    },
    "retries": {
      "type": "number",
      "description": "Number of times to retry the delay actions while still waiting for the webhook response."
    },
    "actions": {
      "type": "array",
      "description": "An array of jambonz verbs to execute while waiting for the webhook response. Typically 'say' or 'play' verbs with messages like 'please hold'.",
      "items": { "type": "object" }
    },
    "giveUpActions": {
      "type": "array",
      "description": "An array of jambonz verbs to execute if the webhook never responds within the giveUpTimeout. Typically an error message and/or hangup.",
      "items": { "type": "object" }
    }
  }
}
