我想从 twilio 获得响应,例如用户在通话期间按下的按钮。
var authToken = ConfigurationManager.AppSettings["twilioAuthToken"] + "";
var authAccSID = ConfigurationManager.AppSettings["twilioAccountSID"] + "";
var options = new CallOptions();
options.To = customer.PhoneNo;
options.From = "+14796898969";
//string Url1 = "http://localhost:62688/abc.xml";
options.Url = "http://twimlets.com/menu?Message=hello%20roopasoft%20sir%20please%20press%201%20to%20hear%20ur%20designation%202%20for%20ur%20name&Options%5B1%5D=http%3A%2F%2Ftwimlets.com%2Fholdmusic%3FBucket%3Dabcd%26Message%3Dhello%2520sir%2520welcome%2520to%2520roopasoft%26&Options%5B2%5D=http%3A%2F%2Ftwimlets.com%2Fmessage%3FMessage%255B0%255D%3Dohh%2520sir%2520get%2520out%2520%26&";
//options.Url = "http://twimlets.com/echo?Twiml=" + Url;
options.Method = "GET";
options.FallbackMethod = "GET";
options.FallbackUrl = "http://localhost:62688/VoiceRegister/Test";
options.SendDigits = "5";
options.StatusCallbackMethod = "GET";
options.Record = true;
var client = new TwilioRestClient(authAccSID, authToken);
var call = client.InitiateOutboundCall(options);
public ActionResult Test(VoiceRequest req)
{
int user_pushed = int.Parse(Request["Digits"]);
return null;
}