user531065
user531065

Reputation: 773

Can you initiate a Twilio phone call with answering machine detection using Twiml?

It appears that you can only do this with the REST API but not with the Twiml keyword.

Upvotes: 1

Views: 717

Answers (2)

Megan Speir
Megan Speir

Reputation: 3811

It is done via the REST API.

For example, the MachineDetection parameter can be Enable or DetectMessageEnd. Enable returns results as soon as recognition is complete. DetectMessageEnd will wait until after a greeting to return results if an answering machine is detected.

Using new AMD looks like this:

curl 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXX123456789/Calls.json' -X POST \
--data-urlencode 'To=+1562300000' \
--data-urlencode 'From=+18180000000' \
--data-urlencode 'MachineDetection=Enable' \
--data-urlencode 'Url=https://handler.twilio.com/twiml/EH8ccdbd7f0b8fe34357da8ce87ebe5a16' \
-u ACXXXXXXXXXXXXXXXX123456789:[AuthToken]

Upvotes: 0

dividius
dividius

Reputation: 820

Generally speaking, you don't make outbound interactive calls at all using TwiML. You can certainly use the Dial verb to connect a caller to another party, (http://www.twilio.com/docs/api/twiml/dial), but you aren't interacting with the caller/callee for the duration of that dialed call (i.e., you can't Say, Gather, etc...). The interaction picks up only after the Dial-ed call ends.

In short, initiate the call using the REST API, and then you can continue the interaction using TwiML as desired.

Upvotes: 3

Related Questions