Giter Site home page Giter Site logo

stratus-web-responder-weather-1's Introduction

stratus-weather-ivr

Contact our Help Desk as we will need to work with you to get calls pointed at your Web responder. Include the following information:

  1. Subject: Web Responder
  2. The web URL of your Responder.
  3. Instructions to route calls to it ( DID, IVR Option, Internal Dial Code ).

Our Stratus platform has the possibility to use "Web Responders".

For instance, if someone dials into a DID on our system, we can cause that call to interact with your web server via HTTP/S API calls. This sample queries a web API for weather data but it is not limited to just that. You could use it to query your backend databases, salesforce, or many other systems.

This sample creates a Web Responder for our Stratus platform that:

  1. Causes Stratus to play an announcement and wait for a 5 digit US ZIP code.
  2. Queries https://openweathermap.org/ with that ZIP code and gets back the current weather.
  3. Uses Amazon Polly text to speech to create a wav file of the returned data.
  4. Causes Stratus to play that wav file.
  5. Hangs up the call.

Notes:

  • Requires /usr/bin/mpg123 and /usr/bin/sox to convert audio files created by Polly to format compatible with Stratus.
  • Rename includes/creds.sample.php to includes/creds.php and update it with your keys.

How Stratus Web Responders work:

Stratus will browse your web server and expects to receive XML "verbs" ( i.e. instructions ) and wav files. Stratus will do things based on these instructions. This gives you the ability create IVRs that do all sorts of things.

When Stratus requests to your WebResponder application (inbound or outbound), the URL always contains at least the following parameters:

  • NmsAni : caller, e.g., "1001"
  • NmsDnis : callee e.g., "2125551212"
  • AccountUser : Account User
  • AccountDomain : Account Domain
  • AccountLastDial : Last Dialed Digits by the Account User
  • Digits : Received Digits
  • OrigCallID : (1-1188b)
  • TermCallID : (1-1188b)
  • ToUser : User Part input to the Responder
  • ToDomain : Domain Part input to the Responder

There are three verbs you can give Stratus:

  1. Play
  2. Gather
  3. Forward

Verbs

All verbs take an "action" attribute. If the "action" attribute is present then control is returned to the URL given by the "action" attribute. If not present then the application ends.

Play

The action plays the given .wav file and posts back to the given action URL. For example,

<Play action='continue.php'>
 http://www.example.com/hello-world.wav
</Play>

This verb plays the .wav file and posts back (i.e., returns control) to continue.php.

To end the call, omit the action parameter.

Gather

The action gathers the given number of DTMF digits and posts back to the given action url, optionally playing the given .wav file. numDigits the number of digits to gather, e.g., '1' (default=20) For example,

<Gather numDigits='3' action='handle-account-number.php'>
 <Play>
  http://www.example.com/what-is-your-account-number.wav
 </Play>
<Gather>

This gathers 3 digits and posts back the relative URL handle-account-number.php?Digits=555. The verb posts back to the given action URL with the following parameters: Digits the gathered digits, for example, 123

Forward

The action forwards to the given destination. The verb does NOT take an "action" parameter. The verb is effectively a "goto". For example,

<Forward>
 2125551212
</Forward>

stratus-web-responder-weather-1's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.