Initiating a TeXML outbound call using REST endpoint with AMD enabled
There are 2 possible options for using Answering Machine Detection for outbound calls:- Synchronous mode: In this case, the TeXML instructions are not executed until the results of AMD process are provided in the status callback. The new instructions can be sent back as response to be processed by the TeXML engine.
- Asynchronous mode: Here, the TeXML instructions are processed in parallel to the AMD process. The results of the AMD analysis are being provided in the AsyncAmdStatusCallback callback.
Synchronous mode request
The outbound TeXML call with AMD support enable in the synchronous mode can be requested in the following way:Don’t forget to update
YOUR_API_KEY here.AnsweredBy parameter of the StatusCallback request.
AnsweredBy parameter values
| Value | Description |
|---|---|
human | A human answered the call |
machine | An answering machine was detected |
fax | A fax machine was detected |
unknown | Detection was inconclusive |
The
MachineDetection parameter accepts the following values: Enable, Disable (default), and DetectMessageEnd. The DetectionMode parameter accepts Regular (default) or Premium.Asynchronous mode request
Similarly, the asynchronous AMD processing can be requested for outgoing TeXML calls:AsyncAmdStatusCallback parameter. Note that this can be used for basic and premium AMD.
AsyncAmdStatusCallback parameters
The callback to your AsyncAmdStatusCallback URL includes the following parameters:
| Parameter | Description |
|---|---|
AnsweredBy | The result of AMD analysis (human, machine, fax, or unknown) |
CallSid | The unique identifier for the call |
AccountSid | Your Telnyx account SID |