Twilio应答机检测

时间:2016-04-21 11:23:01

标签: node.js twilio

我是巴黎创业公司的固件开发商。我们正在为我们的产品使用Twilio,我们希望在它是语音机时停止呼叫,因此我们使用了IfMachine参数,但没有任何结果。

我们希望您能帮助我们。下面是我们使用的代码(Node.js);请看看我们是否以正确的方式使用参数。

我在一些论坛中读到IfMachine仅在美国有效,我希望这不是真的。

问候。

Client.calls.create({
url: returnXmlUrlFile(textToSpeech),
to: userData.phoneNumber,
from: "+339xxxxxxxx",
IfMachine = "Hangup",
Method = "POST",
timeout: 11,

statusCallback: apiCoassistTwilioStatusCallbackHelper
}, function(err, call)

1 个答案:

答案 0 :(得分:2)

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]