13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/robocall/robocalls_controller.rb', line 13
def connected_to_caller
@r = Robocall.find_by_id(params[:id])
error = ''
error = "Caller record #{params[:id]} not found" unless @r
error = "No token provided" unless params[:token]
error = "The token was invalid" unless @r && @r.token == params[:token]
if error != ''
xml = ::Robocall.render_say(text: "An error has occured retrieving your automatic message. "+
"Specifically, #{error}.")
render :xml => xml, :content_type => 'application/xml'
else
render :xml => @r.xml, :content_type => 'application/xml'
end
end
|