Skip to content

Commit

Permalink
hangup urls formatted correctly, call session mgmt filter tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffrey Longman committed Oct 19, 2009
1 parent 20008f0 commit cd69471
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions 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 => [
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion 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.
# either db, or memcached sessions. Something to look at.
require 'call_sessions'
ActionController::Base.send :include, CallSessionFilter
4 changes: 1 addition & 3 deletions lib/call_sessions.rb
Expand Up @@ -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
end

0 comments on commit cd69471

Please sign in to comment.