Reputation: 379
In my app I am attempting to transfer the call to a different phone number. Currently it redirects to the correct xml page, says transferring to an agent, and then the call just hangs up. Not sure what I am doing wrong here, would love an extra set of eyes.
routes.rb
post 'call_logs/connect' => 'call_logs#connect'
post 'call_logs/directions' => 'call_logs#directions'
controller
def connect
@post_to = BASE_URL + "/directions"
render :action => "reminder.xml.builder", :layout => false
end
def directions
if params['Digits'] == '1'
render :action => "transfer.xml.builder", :layout => false
return
end
end
transfer.xml.builder
xml.instruct!
xml.Response do
xml.Gather(:action => @post_to, :numDigits => 1) do
xml.Say "transferring you to an agent"
xml.Dial "+12142222222", :timeout => "60", :callerID => 'MY_TWILIO_NUMBER'
end
end
Upvotes: 0
Views: 62
Reputation: 73057
Twilio developer evangelist here.
The problem is that you cannot use a <Dial>
verb inside of the <Gather>
verb. I'm not sure exactly what you're trying to achieve with that setup, but that's why it is just hanging up.
Let me know if I can help any further.
Upvotes: 1