.NET

着信ルートを追加する

これから、あなたは アンサーウェブフック これにより、あなたのバーチャル番号に着信コールがあった場合、Vonage APIプラットフォームはHTTPリクエストを経由してそのWebhookに通知します。

ウェブフックは エヌシーシーオー をVonageに送る。 stream アクションを実行します。 STREAM_URL を呼び出す。

テストにはURLを使用する: https://raw.githubusercontent.com/nexmo-community/ncco-examples/gh-pages/assets/welcome_to_nexmo.mp3

以下のコードを VoiceController クラス

[HttpGet("/webhooks/answer")]
public string Answer()
{
    const string STREAM_URL = "https://raw.githubusercontent.com/nexmo-community/ncco-examples/gh-pages/assets/welcome_to_nexmo.mp3";
    var streamAction = new StreamAction{
        StreamUrl = new string[]
        {
            STREAM_URL
        }
    };
    var ncco = new Ncco(streamAction);
    return ncco.ToString();
}