我正在尝试使用 Plivo 从我的软件电话拨打电话。
答案网址(在我的 Plivo 帐户上)是http://frozen-lake-7349.herokuapp.com/outbound
如果你去那个 url,在 heroku 上,你会看到:
<Response><Hangup/></Response>
哪个是对的。
红宝石代码是:
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
然而,当我尝试从我的软电话拨打电话时,它始终无法正常工作。Plivo 调试日志告诉我,我收到 http 响应失败,并且
XML:不存在响应标签
和heroku日志说
[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
伙计们,我完全迷路了。非常感谢您的帮助。