Preview: Answering Machine Detection

Enhanced Answering Machine Detection

Answering Machine Detection enables you to determine if a human, answering machine or fax machine has picked up an outbound API call and tailor your call flow accordingly. This feature also you to leave a message on an answering machine if desired. The Developer Preview for Answering Machine Detection supports calling to the US and Canada. We will add support for Western European countries before public Beta. Other regions will be added over time based on demand.

This is a developer preview and this API is subject to change. Breaking changes will be called out in these docs and communicated to any customer actively using the API.

Note: Support for calling the UK is under development, we hope to make it available week of February 27th.

Making A Call with AMD

New REST API Parameters
パラメーター 説明
MachineDetection Possible values are Enable or DetectMessageEnd. Use Enable if you would like Twilio to return an AnsweredBy value as soon as it identifies the called party. This is useful if you would like to leave a message to a human but hang up on a machine. If you would like to leave a message on an answering machine specify DetectMessageEnd. Twilio will return a AnsweredBy value once the end of the answering machine greeting is reached. If both SendDigits and MachineDetection parameters are provided, then MachineDetection will be ignored.
MachineDetectionTimeout The number of seconds that Twilio should attempt to perform answering machine detection before timing out and firing the Answered webhook with AnsweredBy as unknown. By default this is 30 seconds
Loading Code Samples...
言語
形式:
  • JSON
curl 'https://api.twilio.com/2010-04-01/Accounts/AC22ef5e6f64bf40a6ac84123ae4fb9fa7/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 AC22ef5e6f64bf40a6ac84123ae4fb9fa7:[AuthToken]
{
  "sid": "CA2ee3a4bce40452c7f7a0a43fcd24b301",
  "date_created": null,
  "date_updated": null,
  "parent_call_sid": null,
  "account_sid": "AC22ef5e6f64bf40a6ac84123ae4fb9fa7",
  "to": "+1562300000",
  "to_formatted": "(562) 300-0000",
  "from": "+18180000000",
  "from_formatted": "(818) 000-0000",
  "phone_number_sid": "PNe8bab76ac59a79c26b3f6490d8075a91",
  "status": "queued",
  "start_time": null,
  "end_time": null,
  "duration": null,
  "price": null,
  "price_unit": "USD",
  "direction": "outbound-api",
  "answered_by": null,
  "api_version": "2010-04-01",
  "annotation": null,
  "forwarded_from": null,
  "group_sid": null,
  "caller_name": null,
  "uri": "\/2010-04-01\/Accounts\/AC22ef5e6f64bf40a6ac84123ae4fb9fa7\/Calls\/CA2ee3a4bce40452c7f7a0a43fcd24b301.json",
  "subresource_uris": {
    "notifications": "\/2010-04-01\/Accounts\/AC22ef5e6f64bf40a6ac84123ae4fb9fa7\/Calls\/CA2ee3a4bce40452c7f7a0a43fcd24b301\/Notifications.json",
    "recordings": "\/2010-04-01\/Accounts\/AC22ef5e6f64bf40a6ac84123ae4fb9fa7\/Calls\/CA2ee3a4bce40452c7f7a0a43fcd24b301\/Recordings.json"
  }
}
Make Call with AMD

Create a call with enhanced AMD

New Webhook Parameters
パラメーター 説明
AnsweredBy The result of answering machine detection. If Enable was specified, results can be: MACHINE_START, HUMAN, FAX, UNKNOWN. If DetectMessageEnd was specified, results can be: machine_end_beep, machine_end_silence, machine_end_other, human, fax, unknown.

料金表

During this developer preview there will not be a charge for using Enhanced Answering Machine Detection. Once we announce the Developer Preview Publically we will begin billing for calls that use Enhanced Answering Machine Detection.

Enhanced Answering Machine Detection will be charged at $.005 per completed call. No-Answer, Busy, or Failed calls may engage our AMD system but will not be charged.

ベスト プラクティス

The lifecycle of a call using AMD is below. The user experience for a recipient of a call using AMD is impacted if there is a delay from the time they picks up the phone to the first packet of audio they hear. Twilio has optimized our AMD system to quickly classify calls, it is important to also optimize your application to respond quickly to TwiML requests.

 

AMD Call Progress

 

Optimize TwiML Responses

To minimize delay, ensure you benchmark your application to ensure that webhooks from Twilio are processed and responded in a timely manner. In test applications running in EC2 we can get this time under 150ms, TwiML served from TwiMLBins can come in under 100ms.

Cache Static TwiML and Media for Play Verbs

If you are using Play verbs we recommend hosting your media in AWS S3 in US East 1. No matter where you host your media files, ensure that you're setting appropriate Cache Control headers. Twilio uses a caching proxy in it's webhook pipeline and will cache media files that have cache headers. Serving media out of Twilio's cache can take 10ms or less, keep in mind that we run a fleet of caching proxies so it may take 10 or so requests before all of the proxies have a copy of your file in cache.

リクエスト調査

To help you benchmark your server's response time to Twilio, we expose the request duration in milliseconds for every request in the request inspector. You can view these clicking into the call detail page in the console.

Request Inspector Fetch Time

 

Limitations

This service is not fully scaled out for production capacity, if you want to move production traffic onto this feature, we require coordination from your team.

Please keep in mind that the early access to the Enhanced Answering Machine Detection may mean that components could still be under active development. We will work with you to resolve any issues you encounter, but there may be features and functionality not fully present during developer preview.

Backwards Compatibility

Enhanced Answering Machine Detection is not backwards compatible with IfMachine. It accepts different POST parameters and AnsweredBy returns different values.

Communications

This API is still in an early phase and will be shaped by your feedback. Please take the time to test this API in your application. Please do not hesitate to reach out with any questions or comments at any time regarding. Andrew Jordan (andrew@twilio.com) will be your primary point of communication regarding the new product.

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

1 / 1
Loading Code Samples...
形式:
  • JSON
curl 'https://api.twilio.com/2010-04-01/Accounts/AC22ef5e6f64bf40a6ac84123ae4fb9fa7/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 AC22ef5e6f64bf40a6ac84123ae4fb9fa7:[AuthToken]
{
  "sid": "CA2ee3a4bce40452c7f7a0a43fcd24b301",
  "date_created": null,
  "date_updated": null,
  "parent_call_sid": null,
  "account_sid": "AC22ef5e6f64bf40a6ac84123ae4fb9fa7",
  "to": "+1562300000",
  "to_formatted": "(562) 300-0000",
  "from": "+18180000000",
  "from_formatted": "(818) 000-0000",
  "phone_number_sid": "PNe8bab76ac59a79c26b3f6490d8075a91",
  "status": "queued",
  "start_time": null,
  "end_time": null,
  "duration": null,
  "price": null,
  "price_unit": "USD",
  "direction": "outbound-api",
  "answered_by": null,
  "api_version": "2010-04-01",
  "annotation": null,
  "forwarded_from": null,
  "group_sid": null,
  "caller_name": null,
  "uri": "\/2010-04-01\/Accounts\/AC22ef5e6f64bf40a6ac84123ae4fb9fa7\/Calls\/CA2ee3a4bce40452c7f7a0a43fcd24b301.json",
  "subresource_uris": {
    "notifications": "\/2010-04-01\/Accounts\/AC22ef5e6f64bf40a6ac84123ae4fb9fa7\/Calls\/CA2ee3a4bce40452c7f7a0a43fcd24b301\/Notifications.json",
    "recordings": "\/2010-04-01\/Accounts\/AC22ef5e6f64bf40a6ac84123ae4fb9fa7\/Calls\/CA2ee3a4bce40452c7f7a0a43fcd24b301\/Recordings.json"
  }
}