user1578872
user1578872

Reputation: 9028

Twilio - IfMachine rest code

Is there a way to find whether the voice call is answered by machine or human . We came to know from the REST docs that if machine will be deprecated . If that so , whether the below code will work

*Call call = Call
            .creator(new PhoneNumber(phSettings.getQueueConnectNumber()), new PhoneNumber(callnum),
                new URI(url))

            .setIfMachine("Hangup")
            .setMethod(HttpMethod.GET).setStatusCallback(statusurl)
            .setStatusCallbackMethod(HttpMethod.POST).setStatusCallbackEvent(callbackEvents).create(RestClient);*

Also from the docs we found MachineDetection is in beta , will we be get beta access for our testing.

Upvotes: 1

Views: 581

Answers (1)

Megan Speir
Megan Speir

Reputation: 3811

Answering Machine Detection is in public beta so you can start experimenting with it right away.

The IfMachine parameter will be deprecated so you will need to update your code. For example, use the MachineDetection parameter as 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.

As call to the API 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

Related Questions