By using the Aculab site, you agree with our use of cookies.
right  Talk To Us!

simple run speech menu Sample

A simple application that presents an audio menu to an answered inbound or outbound call.

Options 1 and 2 direct to a page that reads out a weather report for the selected country (Belgium or Venezuala). Option 3 directs to a page that read out a weather report for Outer Mongolia. Each page then returns to the menu page.

If no selection or an invalid selection is made the caller is prompted to re-select. After several attempts the caller will be played an audio file (oneMoreTime.wav) prompting for a final go.

This application requires the wav file oneMoreTime.wav to be available in the cloud media store.

Uses actions: Run Speech Menu, Play, Redirect

    • {
          "actions" :
          [
              {
                  "run_speech_menu":
                  {
                      "prompt" :
                      {
                          "play" :
                          {
                              "play_list" :
                              [
                                  {
                                      "text_to_say" : "Say the country for which you want a weather report, Belgium, Venezuela or Outer Mongolia. Or press 1 for Belgium, 2 for Venezuela, 3 for Outer Mongolia. Or press 5 to listen to the options again."
                                  }
                              ]
                          }
                      },
                      "menu_options" :
                      [
                          {
                              "speech" : "belgium",
                              "digit" : "1",
                              "next_page" :
                              {
                                  "url" : "WeatherReport"
                              }
                          },
                          {
                              "speech" : "venezuela",
                              "digit" : "2",
                              "next_page" :
                              {
                                  "url" : "WeatherReport"
                              }
                          },
                          {
                              "speech" : "outer mongolia",
                              "digit" : "3",
                              "next_page" :
                              {
                                  "url" : "WeatherInOuterMongolia"
                              }
                          }
                      ],
                      "help_digit" : "5",
                      "help_word" : "help",
                      "on_input_timeout_messages":
                      [
                          {
                              "play" :
                              {
                                  "play_list" :
                                  [
                                      {
                                          "text_to_say" : "I didn't catch your entry."
                                      }
                                  ]
                              }
                          },
                          {
                              "play" :
                              {
                                  "play_list" :
                                  [
                                      {
                                          "text_to_say" : "Please select a country."
                                      }
                                  ]
                              }
                          },
                          {
                              "play" :
                              {
                                  "play_list" :
                                  [
                                      {
                                          "file_to_play" : "oneMoreTime.wav"
                                      }
                                  ]
                              }
                          }
                      ],
                      "on_invalid_input_messages" :
                      [
                          {
                              "play" :
                              {
                                  "play_list" :
                                  [
                                      {
                                          "text_to_say" : "That wasn't one of the options. Please try again."
                                      }
                                  ]
                              }
                          },
                          {
                              "play" :
                              {
                                  "play_list" :
                                  [
                                      {
                                          "file_to_play" : "oneMoreTime.wav"
                                      }
                                  ]
                              }
                          }
                      ]
                  }
              }
          ],
          "token" : "my run speech menu instance id",
          "api_version": "2.0"
      }