Adhearsion is a Ruby library that takes over Asterisk's internal processing of calls and puts them into the Ruby framework. You setup the dial plan of an Asterisk server to forward all calls to the Adhearsion server, either running locally or an a remote server. Once the call hits the Adhearsion server, you have the call in Ruby Land, and the world is your burrito. What can you do from there? Tons. You have at your disposal all of the Ruby integration with databases, UIs, web services calls, etc.
An example would be a hyper dial plan, that would connect calls, but also provide a gateway out to a Web Services function that would retrieve the latest weather report. Here's what it looks like :
#This is an example extensions.rb file which
# would handle how calls are processed by
# Asterisk. This is all completely valid Ruby
callee = User.find_by_extension extension
unless callee.busy? then dial callee
when 111 then exec :meetme
play weather_report('Dallas, Texas')
play %w(a-connect-charge-of 22
Now, here's a proof point. When I was at the Cluecon show, I told the crowd about the demonstration application I wrote to do a daily collection of body weight for Congestive Heart Failure cases. As I was describing it to the crowd, Jay - the author of Adhearsion - implemented the same application in Adhearsion as I was speaking. It didn't have the insane scale that my Amazon EC2 and Voxeo implementation did, but it was an amazingly complete implementation. Completely impressive stuff. Check it out.