Skip to content

Instantly share code, notes, and snippets.

@verma
Created September 11, 2012 20:22
Show Gist options
  • Save verma/3701727 to your computer and use it in GitHub Desktop.
Save verma/3701727 to your computer and use it in GitHub Desktop.
A simple DSL example for Call-flow generation
TxIVR do
say "Hello, good morning"
play "http://s3.amazon.com/verma/company.mp3"
dialog do
play "http://s3.amazon.com/verma/menu.mp3"
option key: "1", speech: "balance" do
say do
get "http://vendor.com/newcall/balance"
end
end
option key: "2", speech: "transactions" do
say do
get "http://vendor.com/newcall/transactions/3"
end
end
option key: "3", speech: "leave message" do
say "please start speaking after the beep"
record stopon: "#", max_duration: 60 do
post "http://vendor.com/newcall/recording"
end
hangup
end
option key: "4", speech: "talk with a real person" do
say "one moment please"
transfer do
get "http://vendor.com/newcall/who_to_transfer_to"
end
end
option key: "5", speech: "bye" do
say "goodbye"
hangup
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment