title: How to send a voice message using Twilio-Client-Javascript or using Twiml - Our understanding & possible approach
body: <p>We are working on a requirement where we are initiating a call from Twilio client SDK [Javascript]. We have an ASP.Net MVC Core application handling incoming Webhook request from Twilio Twiml app. To initiate a call from a client side, we are using Twiml dial verb and providing from and to number. Further our requirement is to send a voice message as soon as an answering machine is detected. </p>
  
  <p>As we have used Dial verb of Twiml, we can't pass detect answering machine and hence can't send voice message. This is by design of Dial verb as it is an attended calling mechanism. After going through a documentation, I have found that, REST API allows to detect and answering machine and also allows sending a voice message. Twilio REST API shall be used for an unattended call initiation and rule based workflow. Twiml Dial verb uses VoiceResponse class to initiate a call whereas Twilio REST API uses CallResource to initiate a call. 
  I wanted to confirm my understanding before I start working on possible alternatives.</p>
  
  <p>We are thinking of implementing above use case with below steps</p>
  
  <p>Make a Twilio REST API call to initiate an unattnded phone call with answering machine detection option enabled.
  If API responds with answered_by value as human or unknown then we will invoke a webhook that shall patch the call using Twiml Dial verb.
  If API responds with answered_by value as machine then it shall use a Twiml which contains a voice message that can be sent to callee.</p>