I'm building a system to allow sales representative to call from PC to their customer on phone. I'm using Dial feature of twilio:
var callerId = ConfigurationManager.AppSettings["TwilioCallerId"];
var response = new VoiceResponse();
var dial = new Dial(callerId: callerId);
if (Regex.IsMatch(to, "^[\\d\\+\\-\\(\\) ]+$")){
dial.Number(to);
}else{
dial.Client(to);
}
response.Dial(dial);
This works properly to connect sales representative with their customers.
Now i have a requirement to play a prerecorded voice if end user do not picks up the call and its reached to voicemail for leaving a message on an answering machine. I have seen this feature in rest api but not sure how it can be used with dial to connect sales representative and customer.
What's the best way to achieve this?