{
  "$schema": "https://schema.spbx.tel/v1/structs.realm.lib",
  "description": "Single-digit IVR: answer, play a prompt, collect one DTMF digit into a call variable. Route on the variable in your realm (e.g. conditions/variable_equals).",
  "params": {
    "prompt_file": {
      "type": "string",
      "description": "WAV file (realm files storage) played as the menu prompt."
    },
    "variable": {
      "type": "string",
      "description": "Call variable the collected digit is stored in.",
      "default": "ivr_choice"
    }
  },
  "exports": {
    "collect": {
      "description": "Answer, play the prompt, store one digit in the configured variable.",
      "flow": "flows/sub_flow/collect"
    }
  },
  "uses": {
    "std": {
      "preset": "stdlib"
    }
  },
  "sounds": {
    "wav_file": {
      "prompt": {
        "file_name": "${prompt_file}"
      }
    }
  },
  "flows": {
    "dual_tone_multi_frequency": {
      "menu": {
        "sound": [
          "sounds/wav_file/prompt"
        ],
        "stop_on_digit": true,
        "variable": "${variable}",
        "digit_count": 1
      }
    },
    "sub_flow": {
      "collect": {
        "dial_plan": [
          "presets/std/answer",
          "flows/dual_tone_multi_frequency/menu"
        ]
      }
    }
  }
}
