diff --git a/app/controllers/calls_controller.rb b/app/controllers/calls_controller.rb index a73b5f7..da6ac58 100644 --- a/app/controllers/calls_controller.rb +++ b/app/controllers/calls_controller.rb @@ -1,6 +1,6 @@ class CallsController < ApplicationController - around_filter :shopify_calls_session, :only => 'orders' + around_filter :shopify_call_session, :only => 'order_total' def index render :text => [ @@ -33,7 +33,7 @@ def order_total else render :text => [ {:name => :Speak, :phrase => 'I did not find any orders that were created today. Goodbye.'}, - {:name => :Hangup, :url => hangup_url} + {:name => :Hangup, :url => "#{hangup_url}.json"} ].to_json end else @@ -42,7 +42,7 @@ def order_total end render :text => [ {:name => :Speak, :phrase => "The total value for todays orders is #{total}. Goodbye."}, - { :name => :Hangup, :url => hangup_url} + { :name => :Hangup, :url => "#{hangup_url}.json"} ].to_json end end diff --git a/config/initializers/calls.rb b/config/initializers/calls.rb index 6528162..2450207 100644 --- a/config/initializers/calls.rb +++ b/config/initializers/calls.rb @@ -1,3 +1,5 @@ CALLS = {} # expedient. Scale with memcached or equiv. # could wedge calls into the http session metaphor, use the call-id as a session id, and then use -# either db, or memcached sessions. Something to look at. \ No newline at end of file +# either db, or memcached sessions. Something to look at. +require 'call_sessions' +ActionController::Base.send :include, CallSessionFilter \ No newline at end of file diff --git a/lib/call_sessions.rb b/lib/call_sessions.rb index d964fad..e70a513 100644 --- a/lib/call_sessions.rb +++ b/lib/call_sessions.rb @@ -33,6 +33,4 @@ def shopify_call_session def current_call_session CALLS[params[:call_id]] if params[:call_id] end -end - -ActionController::Base.send :include, CallSessionFilter \ No newline at end of file +end \ No newline at end of file