Send DTMF
The SendDtmf verb is used to play DTMF digits in the call.
- The
,
and lowercasew
characters introduce a half-second pause into the DTMF sequence. - An uppercase
W
character introduces a one-second pause into the DTMF sequence. *
,#
,a-d
, andA-D
are also supported in addition to the numeric characters0-9
.
Text Content
Name | Description |
---|---|
digits | String containing the DTMF characters to be sent in a call. Allows a maximum of 50 characters. The digits will be sent one-by-one with a marginal delay. |
Attributes
ATTRIBUTE | Description |
---|---|
toneDuration | (optional) The length (in milliseconds) of each DTMF tone. Default value is 200. Range: decimal values between 50 - 5000. |
toneInterval | (optional) The duration of silence (in milliseconds) following each DTMF tone. Default value is 400. Range: decimal values between 50 - 5000. |
tip
All w
, ,
and W
chars replace toneInterval
, so if a <SendDtmf toneInterval="300">1w2</SendDtmf>
is used, 2
will be played 500ms after 1
because of w
Webhooks Received
There are no webhooks received after the <SendDtmf>
verb is executed.
Examples
Send DTMF Tones to a Call
- XML
- Java
- C#
- Ruby
- NodeJS
- Python
- PHP
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<SendDtmf>12w34</SendDtmf>
</Response>
SendDtmf sendDtmf = new SendDtmf().builder()
.digits("12w34")
.build();
Response response = new Response()
.with(sendDtmf);
SendDtmf sendDtmf = new SendDtmf
{
Digits = "12w34"
};
Response response = new Response();
response.Add(sendDtmf);
Console.WriteLine(response.ToBXML());
send_dtmf = Bandwidth::Bxml::SendDtmf.new('12w34')
response = Bandwidth::Bxml::Response.new([send_dtmf])
p response.to_bxml
const sendDtmf = new Bxml.SendDtmf('12w34');
const response = new Bxml.Response(sendDtmf);
console.log(response.toBxml());
send_dtmf = SendDtmf(digits="12w34")
response = Response()
response.add_verb(send_dtmf)
print(response.to_bxml())
$sendDtmf = new BandwidthLib\Voice\Bxml\SendDtmf("12w34");
$response = new BandwidthLib\Voice\Bxml\Response();
$response->addVerb($sendDtmf);
echo $response->toBxml();