Twilio .NET 7:我在 Gather 中设置的操作方法受到攻击,但我无法获得 SpeechResult 或 Confidence

问题描述 投票:0回答:0
[HttpPost]
    public TwiMLResult Index()
    {
     var redirectUrl = Url.Action(nameof(IncomingCallController.Respond), nameof(IncomingCallController).RemoveController());
        var uri = new Uri(redirectUrl, UriKind.Relative);
        var response = new VoiceResponse();
        var gather =
            new Gather(
                action: uri,
                input: new[] { Gather.InputEnum.Speech }.ToList(),
                speechTimeout: "auto",
                timeout: 3,
                enhanced: true,
                speechModel: Gather.SpeechModelEnum.PhoneCall,
                language: Gather.LanguageEnum.EnUs
            );
        var say = new Say("Hello!", Say.VoiceEnum.PollyJoannaNeural, language: Say.LanguageEnum.EnUs);
   



        response.Append(gather.Append(say));
 return TwiML(response);
    }

我尝试获取原始主体并将其解析为 json。我试过查看 Request.QueryString。它似乎不存在于请求对象中的任何地方。我已经搜索了文档和网络,但没有发现任何与此相关的内容。如果 TwilioRequest 对象有一个 SpeechResult 属性就好了,但它没有。

如有任何帮助,我们将不胜感激!提前谢谢你!

c# .net twilio ivr twilio-programmable-voice
© www.soinside.com 2019 - 2024. All rights reserved.