ruby, Plivo and Heroku getting status "404" or no xml response error

267 views Asked by At

I am attempting to make an outbound call from my softphone using Plivo.

The answer url (on my Plivo account) is http://frozen-lake-7349.herokuapp.com/outbound

if you go to that url, on heroku, you will see:

<Response><Hangup/></Response>

which is correct.

The ruby code is:

get '/outbound' do
  to_number = params[:To]
  from_number = params[:CLID] ? params[:CLID] : params[:From] ? params[:From] : ''
  caller_name = params[:CallerName] ? params[:CallerName] : ''
  resp = Plivo::Response.new()
  if not to_number
    resp.addHangup()
  else
    if to_number[0, 4] == "sip:"
      d = resp.addDial({'callerName' => caller_name})
      d.addUser(to_number)
    else
      d = resp.addDial({'callerId' => from_number})
      d.addNumber(to_number)
    end
  end
  content_type 'text/xml'
    resp.to_xml()
end

Yet when I try to make a call from my softphone it never works. Plivo debug logs tells me that I get an http response failure and

XML : No Response tag present

and heroku logs say

[03/Sep/2013 16:38:46] "POST /outbound HTTP/1.1" 404 18 0.0007
2013-09-03T16:38:46.063235+00:00 heroku[router]: at=info method=POST path=/outbound host=frozen-lake-7349.herokuapp.com fwd="54.219.28.199" dyno=web.1 connect=1ms service=4ms status=404 bytes=18

I am totally lost here guys. Your help greatly appreciated.

0

There are 0 answers