【发布时间】:2017-10-30 21:03:34
【问题描述】:
接收传真的我的控制器代码:
$twimlResponse = new \SimpleXMLElement("<Response></Response>");
$recieveEl = $twimlResponse->addChild('Receive');
$recieveEl->addAttribute('action', '/api/fax/received/file');
return response($twimlResponse->asXML(), 200)
->header('Content-Type', 'text/xml');
上述代码定义的传入网络挂钩的输出
<?xml version="1.0"?>
<Response>
<Receive action="/api/fax/received/file"/>
</Response>
Twilio 错误日志(警告消息)
Msg: XML Validation warning
line: 2
parserMessage: Invalid content was found starting with element 'Receive'. One of '{Play
ErrorCode:12200
cols:79
LogLevel:WARN
url:http://......./api/fax/incoming
https://www.twilio.com/docs/api/fax/quickstart#allow-twilio-to-talk-to-your-web-application
【问题讨论】:
-
“当 Twilio 收到对已配置为传真号码的传入电话号码的呼叫时,您将收到对为该号码配置的 FaxUrl 的 HTTP 请求。”。这是触发该错误的原因吗?
-
感谢@PatrickQ,了解问题所在。