在我的概念验证代码中,我成功地创建了一个电话会议,并且能够进入等候室并听到等待音乐,直到另一个参与者加入。但是,当我将此代码移动到 Visual Studio 中的 .NET Core 生产类型解决方案时,它会通过读取 Room # 并立即挂断来响应。我相信这与 .NET Core 有关,但无法查明根本原因。
概念验证代码
using Twilio.TwiML;
using Twilio.AspNet.Mvc;
using System.Web.Mvc;
using Twilio.TwiML.Voice;
namespace MakeAndReceiveCalls.Controllers
{
public class PhoneController : TwilioController
{
[HttpPost]
public ActionResult MakeConferenceCall()
{
var response = new VoiceResponse();
var dial = new Dial();
dial.Conference("Room 1234");
response.Append(dial);
return Content(response.ToString());
}
}
}
生产代码
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Twilio.AspNet.Core;
using Twilio.TwiML;
using Twilio.TwiML.Voice;
namespace RL.Domain.AudioConference.API.Controllers
{
[Route("v1/[Controller]")
public class AudioConferenceController : TwilioController
{
[HttpPost("MakeConferenceCall")]
public ActionResult MakeConferenceCall()
{
var response = new VoiceResponse();
var dial = new Dial();
dial.Conference("Room 1234");
response.Append(dial);
return Content(response.ToString());
}
}
}