Skip to content

Instantly share code, notes, and snippets.

@dchanTwilio
Last active August 29, 2015 14:02
Show Gist options
  • Save dchanTwilio/d86f40b340e29e729473 to your computer and use it in GitHub Desktop.
Save dchanTwilio/d86f40b340e29e729473 to your computer and use it in GitHub Desktop.
Csharp Dial with dial attributes
using Twilio.TwiML;
using Twilio.TwiML.Mvc;
namespace Demo.Controllers
{
public class DialExampleController : TwilioController
{
public ActionResult Dial()
{
var response = new TwilioResponse();
var toNumber = new Number
{
url = "someUrl",
// See documentation for other valid attributes here: https://www.twilio.com/docs/api/twiml/number#attributes
};
var dialAttributes = new
{
// See documentation for valid attributes https://www.twilio.com/docs/api/twiml/dial#attributes
timeout = "30",
record = "true",
someOtherAttribute = "attributeValue",
// etc.
};
response.Dial(toNumber, dialAttributes;
return TwiML(response);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment