machine_detection
parameter when you make an outbound call using the Call API. Plivo runs machine detection in the background. When it finds a machine, Plivo makes an HTTP request, sending a Machine
parameter with the value true
to the machine_detection_url
you specify. Your application can then make a decision based on this parameter. Chances are you’ll use the Transfer API to change the flow of the call. See the Asynchronous machine detection page of our API reference documentation for details on the parameters sent.
Getting started
- Sign up for a free Plivo trial account.
- Check out our server SDKs page and install the SDK for the programming language you want to use.
- Buy a Plivo phone number (optional). You need a Plivo phone number to receive calls. You can buy a Plivo phone number in more than 20 countries by visiting Phone Numbers > Buy Numbers in the Plivo console. Check the Voice API coverage page to see the supported countries.
- Use a web hosting service to host your web application. Many inexpensive cloud hosting providers cost just a few dollars a month. Follow the instructions of your hosting provider to host your web application.
Implementation
- Copy the code below into a text file and save it.
- Replace the placeholders
<auth_id>
and<auth_token>
with your account’s Auth ID and Auth Token, which you can find on the overview page of the Plivo console. - Add your
from
(source) phone number, which will show up as your caller ID. All phone numbers should include country code, area code, and phone number without spaces or dashes (e.g., 14153336666). - Add your
to
(destination) phone number. To place bulk calls to more than one number, separate the destination phone numbers with the<
character (e.g., 14156667777<14157778888<14158889999).
Note: If you’re using a trial account, your destination number needs to be verified with Plivo. Phone numbers can be verified at the Phone Numbers > Sandbox Numbers page of the console.
- Edit the
answer_url
field and supply a URL for Plivo to request when the call is answered. This URL supplies XML code that Plivo what to do with the call. - Give the
answer_method
field a value of eitherGET
orPOST
. - Edit the
machine_detection_url
field and supply a URL for Plivo to request if an answering machine or voicemail is detected on the call. - Give the
machine_detection_method
field a value of eitherGET
orPOST
.