JoeMV
JoeMV

Reputation: 23

Twilio Called Id

I have the following method which is hit when on my Twilio number is called:

    [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);
    }

How do I add a called id to this response do the person receiving the call does not see the original number?

Upvotes: 0

Views: 44

Answers (1)

JoeMV
JoeMV

Reputation: 23

I found the answer. Thanks to the following: 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);
    }

Upvotes: 1

Related Questions