Gather DTMF using audio prompt in a conference
Play an audio file to a specific conference participant and gather DTMF input.
POST
/
conferences
/
{id}
/
actions
/
gather_using_audio
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.conferences.actions.gatherDtmfAudio(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg' },
);
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.conferences.actions.gather_dtmf_audio(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
call_control_id="v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Conferences.Actions.GatherDtmfAudio(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.ConferenceActionGatherDtmfAudioParams{
CallControlID: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.conferences.actions.ActionGatherDtmfAudioParams;
import com.telnyx.sdk.models.conferences.actions.ActionGatherDtmfAudioResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ActionGatherDtmfAudioParams params = ActionGatherDtmfAudioParams.builder()
.id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.callControlId("v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg")
.build();
ActionGatherDtmfAudioResponse response = client.conferences().actions().gatherDtmfAudio(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.conferences.actions.gather_dtmf_audio(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->conferences->actions->gatherDtmfAudio(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
callControlID: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
audioURL: 'http://example.com/gather_prompt.wav',
clientState: 'aGF2ZSBhIG5pY2UgZGF5ID1d',
gatherID: 'gather_id',
initialTimeoutMillis: 10000,
interDigitTimeoutMillis: 3000,
invalidAudioURL: 'invalid_audio_url',
invalidMediaName: 'invalid_media_name',
maximumDigits: 4,
maximumTries: 3,
mediaName: 'media_name',
minimumDigits: 1,
stopPlaybackOnDtmf: true,
terminatingDigit: '#',
timeoutMillis: 30000,
validDigits: '0123456789',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx conferences:actions gather-dtmf-audio \
--api-key 'My API Key' \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--call-control-id v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqgcurl --request POST \
--url https://api.telnyx.com/v2/conferences/{id}/actions/gather_using_audio \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"call_control_id": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
"audio_url": "http://example.com/gather_prompt.wav",
"minimum_digits": 1,
"maximum_digits": 4,
"timeout_millis": 30000
}
'{
"data": {
"result": "ok"
}
}Authorizations
Body
application/json
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.conferences.actions.gatherDtmfAudio(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg' },
);
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.conferences.actions.gather_dtmf_audio(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
call_control_id="v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Conferences.Actions.GatherDtmfAudio(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.ConferenceActionGatherDtmfAudioParams{
CallControlID: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.conferences.actions.ActionGatherDtmfAudioParams;
import com.telnyx.sdk.models.conferences.actions.ActionGatherDtmfAudioResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ActionGatherDtmfAudioParams params = ActionGatherDtmfAudioParams.builder()
.id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.callControlId("v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg")
.build();
ActionGatherDtmfAudioResponse response = client.conferences().actions().gatherDtmfAudio(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.conferences.actions.gather_dtmf_audio(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->conferences->actions->gatherDtmfAudio(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
callControlID: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
audioURL: 'http://example.com/gather_prompt.wav',
clientState: 'aGF2ZSBhIG5pY2UgZGF5ID1d',
gatherID: 'gather_id',
initialTimeoutMillis: 10000,
interDigitTimeoutMillis: 3000,
invalidAudioURL: 'invalid_audio_url',
invalidMediaName: 'invalid_media_name',
maximumDigits: 4,
maximumTries: 3,
mediaName: 'media_name',
minimumDigits: 1,
stopPlaybackOnDtmf: true,
terminatingDigit: '#',
timeoutMillis: 30000,
validDigits: '0123456789',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx conferences:actions gather-dtmf-audio \
--api-key 'My API Key' \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--call-control-id v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqgcurl --request POST \
--url https://api.telnyx.com/v2/conferences/{id}/actions/gather_using_audio \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"call_control_id": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
"audio_url": "http://example.com/gather_prompt.wav",
"minimum_digits": 1,
"maximum_digits": 4,
"timeout_millis": 30000
}
'{
"data": {
"result": "ok"
}
}