TwiML App unexpected end of call: Cannot find the declaration of element 'response'

做~自己de王妃 提交于 2019-12-02 01:34:43

Hi Twilio developer evangelist here.

Can you try modifying your view to look like this instead?

<?xml version="1.0" encoding="UTF-8" ?>
<Response>
    <Dial callerId="@ViewBag.CallerId">
        @Html.Raw(ViewBag.NumberOfClient)
    </Dial>
</Response>

Remember XML is case-sensitive, so the casing in your XML tags actually matter. Also, I would suggest using the Twilio.TwiML helper library. With that, you can get your XML generated for you with the right casing, and avoiding typos altogether.

Here's how you'd do it:

var twiml = new TwilioResponse();
var dialAttributes = new {callerId = "48326304351"};

var dial = twiml.Dial("+15555555555", dialAttributes);
return TwiML(dial);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!