0

How to modify Call using AMD in Twilio

Till Now i have done this

var call = CallResource.Create(
                machineDetection: "Enable",
                url:  new Uri("https://handler.twilio.com/twiml/EHef.."),
                to: new Twilio.Types.PhoneNumber(to),
                from: new Twilio.Types.PhoneNumber(callerId),
                pathAccountSid: accountSid
           );

what i want if call is answered by human than caller and client should connect esle an recorded file should play to an answering machine

my twiml bin

<Response>
   {{#AnsweredBy}}
    <Dial>
      <Number>
        {{to}}
      </Number> 
    </Dial>
   {{/AnsweredBy}}
   {{^AnsweredBy}}
      <Play>{{recordFile}}</Play>
   {{/AnsweredBy}}
</Response>

1 Answers1

1

Twilio developer evangelist here.

You won't be able to react to the AnsweredBy parameter in a TwiML Bin. When using AMD the AnsweredBy parameter will always have a value, one of machine_start, human, fax or unknown when using Enable.

You'll need to build a dynamic endpoint that checks against those values and responds with the TwiML you want to play for each potential result.

Let me know if that helps.

philnash
  • 70,667
  • 10
  • 60
  • 88