This Tropo Scripting app is written in Ruby and uses couchDB - http://www.iriscouch.com/ - to store and read the progress of an SMS conversation in a database, effectively eliminating any timeout concerns. You can read the full blog that describes the methodology at Tropo - http://blog.tropo.com/2012/03/28/couchdb-sms/ .