Building A Twilio-Powered IVR Using Haskell

October 13, 2015
Written by

haskell-logo-with-name

Steve Profile
Steve Kollmansberger (right) is a renaissance man, shipping code and flying planes in the Pacific Northwest. It’s not uncommon to have a hobby or discipline outside of coding, it’s always interesting to see what happens when and how the two disciplines inevitably meet.

Flying High with Twilio and IVR

With “software development” on one side of the venn-diagram and “aviation” on the other, pencil in “IVR” in the areas where the two circles intersect. When Steve finished coding, he wanted to get some flying time in. But, his flying club’s phone reservation system was cumbersome. Using Twilio and a little Haskell, Steve revamped his flying club’s reservation system.

Here’s how it works now. You call the Twilio-powered number, enter your Member ID, start date, end date, and aircraft number. If it’s available, you confirm the reservation. Then you hit the friendly skies, no problem.
Check out Steve’s post detailing how he built the app, originally published here.

simple :: Call -> TwilioIVRCoroutine ()
simple call = do
    say $ "hello to you " ++ (intersperse ' ' $ call ^. Twilio.IVR.from)
    num <- gather "Please enter your five digit sign in code" (numDigits .~ 5)    
    let ok = num == "12345"
    say "Please wait"
    say "While we process your request"
    -- We can do some IO, like if you need to read from a database
    lift $ print ok
    if ok then say "You've signed in correctly!" else say "We were unable to verify your account"

Not a Haskell developer? We have IVR guides and tutorials in many common programming languages.