Reputation: 84
I'm a developer of firmware at a startup in Paris. We are using Twilio for our product and we want to stop the call when it's a voice machine, thus we've used IfMachine
parameter, but without any result.
We wish you can help us with this. Below is the code we use (Node.js); please see if we use the parameter in the right way.
I read in some forums that IfMachine
works only in the USA, I wish have that is not true.
Regards.
Client.calls.create({
url: returnXmlUrlFile(textToSpeech),
to: userData.phoneNumber,
from: "+339xxxxxxxx",
IfMachine = "Hangup",
Method = "POST",
timeout: 11,
statusCallback: apiCoassistTwilioStatusCallbackHelper
}, function(err, call)
Upvotes: 1
Views: 877
Reputation: 3811
You could reverse engineer it as I have described in this post.
Using the <Gather>
verb you can choose to continue call flow only when a human answers the phone by building in IVR behavior as you'll find in this Node.js tutorial.
twiml.gather({
action: "/path-to-message-for-people",
}
March 2017 Update:
We now have enhanced Answering Machine Detection.
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 would look like this as seen in the docs:
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: 2