Twilio叫Id

时间:2017-11-29 18:55:16

标签: twilio twiml

我在调用Twilio号时遇到以下方法:

    [HttpPost]
    public ActionResult Merge(string from, string to)
    {
        string outgoingPhoneNumber = "+1xxxxxxx";

        var response = new TwilioResponse();

        Number n = new Number(outgoingPhoneNumber);
        response.Dial(n);

        return TwiML(response);
    }

如果接听电话的人看不到原始号码,如何在此回复中添加被叫ID?

1 个答案:

答案 0 :(得分:1)

我找到了答案。感谢以下内容: https://gist.github.com/dchanTwilio/d86f40b340e29e729473

    [HttpPost]
    public ActionResult Merge(string from, string to)
    {
        string outgoingPhoneNumber = "+1xxxxxxxxxx";

        var response = new TwilioResponse();

        Number n = new Number(outgoingPhoneNumber);
        var dialAttributes = new
        {
            callerId = "+1nnnnnnnnnn",
        };
        response.Dial(n, dialAttributes);

        return TwiML(response);
    }