0
私のC#asp.netコアWeb APIプロジェクトでは、Twilioの電話番号から着信音声をキャプチャするためにwebhooksを使用しています。通話を処理することに加えて、私は電子メールを介して着信のための管理者に通知したいと思います。これを行うには、着信電話番号を取得する必要があります。それ、どうやったら出来るの?ここでTwilio - C#で受信電話番号を取得
は私のコードです:
[HttpPost("incomingVoice")]
public async Task<IActionResult> IncomingVoice(string digits)
{
var response = new VoiceResponse();
if (!string.IsNullOrEmpty(digits))
{
... Handle the user selection
}
response.Append(new Gather(numDigits: 1).Say("Welcome to ...! For sales, press 1. For marketing, press 2. For support press 3", voice: "alice", language: "en-GB"));
//handle the lack of response
response.Say("Please leave a message after the tone. Hang up when finished.", voice: "alice", language: "en-GB");
response.Record();
response.Hangup();
string phoneNumber = <??? INCOMING PHONE NUMBER ???>
IRestResponse mgresp = await SendMGMessage(phoneNumber);
return Content(response.ToString(), "application/xml");
}
ありがとうございました。