0

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.

user1903663
  • 1,713
  • 2
  • 22
  • 44
  • In controller you accept `get /outbound` but in request you use `post /outbound`. Make `get` request or define `post` in controller. RTFM: http://www.sinatrarb.com/intro.html – Yevgeniy Anfilofyev Sep 03 '13 at 18:24
  • thanks, makes no difference I am afraid. Fetched xml from GET http://musashi.herokuapp.com/outbound (http code 404) is the Plivo debug. – user1903663 Sep 03 '13 at 20:10
  • Please ignore previous comment. It works, thank you, so simple. OK with SFL sip phone but not Blink. I will keep working on it and send you a link to my app when it's completed. – user1903663 Sep 03 '13 at 20:19

0 Answers0