Provides an example Adhearsion component that conducts call surveys. The component also provides a Rails GUI.
- Adhearsion v0.8+
- Ruby on Rails v2.3.2
- Hobo v0.8.7
- A text to speech engine: Festival, Cepstral/VoiceForge or PlainTalk/Say
In the ~ahn_project/components directory:
git clone git://github.com/jsgoecke/surveys.git
There is an included example SQLite3 database with data in the development environment of the Rails GUI. You may simply use this, the user details are:
username: jason@adhearsion.com passwd: sunnyday
You will need to connect and setup the Rails database to configure your surveys by doing the following:
cd ~ahn-project/components/surveys/gui/config
Edit the database.yml file to connect to your database
cd ~ahn-project/
rake db:migrate
script/server
Then you must also configure your Adhearsion application to use the Rails integration as follows:
cd ~ahn-project/config
Edit the startup.rb file
config.enable_rails :path => 'components/surveys/gui', :env => :development
Here is an example for your dialplan.rb:
surveys {
#Play ringback to the caller
execute('Ringing')
#Build the menu in another thread so that we may get on to welcoming
#The customer
get_menu_thread = Thread.new do
@questions_to_ask = surveys_build_questions("New Accounts")
#Create a new tag for this call to uniquely group the responses
@tag = new_guid
end
#Play the welcome message with the company name
play surveys_build_welcome("ACME")
#Wait for the thread to come back with our data
get_menu_thread.join
sleep(1)
#Ask the questions and get the reponses
surveys_ask_questions(@questions_to_ask, @tag)
#All done, say thanks!
play surveys_build_thankyou("ACME")
hangup
}
The MIT License
Copyright © 2009 Jason Goecke
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.