ERFAHREN SIE, was Sie mit Twilio erreichen können

Probieren Sie die Telefonmenü-Demo aus, um zu sehen, wie es funktioniert.

ERFAHREN SIE, WAS SIE MIT TWILIO ERREICHEN KÖNNEN

Rufen Sie unter der Nummer (323) 992-0315 an und geben Sie den Code 6240 ein.

(Keine Sorge. Wir speichern Ihre Telefonnummer nicht und verwenden sie nach dieser Demo nicht weiter.)

Ahoy!

Rufen Sie uns an unter (323) 992-0315 und geben Sie „6240“ ein. So koppeln Sie Ihren Anruf mit diesem Texteditor. Als Nächstes passen wir die Nachricht an, die Sie hören, wenn Sie beim IVR anrufen.

Weiter: Passen Sie das Telefonmenü an


using Twilio.TwiML;
using Twilio.TwiML.Voice;
using System;

var response = new VoiceResponse();

var gather = new Gather(input: "dtmf", numDigits: 1);
gather.Say("Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you've made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.");

response.Append(gather);

Console.WriteLine(response.ToString());

var gather = new Gather(input: "dtmf", numDigits: 4);
gather.Say("Please enter the 4 digit code on your screen to get started");

response.Append(gather);

Console.WriteLine(response.ToString());

import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.voice.*;

import java.util.Arrays;

Say say = new Say.Builder("Please enter the 4 digit code on your screen to get started.")
	.build();

Gather gather = new Gather.Builder()
	.inputs(Arrays.asList(Gather.Input.DTMF))
	.numDigits(4)
	.say(say)
	.build();

VoiceResponse response = new VoiceResponse.Builder().gather(gather)
	.build();

System.out.println(response.toXml());

const VoiceResponse = require('twilio').twiml.VoiceResponse;
const response = new VoiceResponse();

const gather = response.gather({
	input: 'dtmf',
	numDigits: '4',
});

gather.say('Please enter the 4 digit code on your screen to get started');

console.log(response.toString());

<?php
require_once './vendor/autoload.php';

use Twilio\TwiML;

$response = new TwiML();

$gather = $response->gather(['input' => 'dtmf', 'numDigits' => '4']);
$gather->say('Please enter the 4 digit code on your screen to get started.');

echo $response;

from twilio.twiml.voice_response import VoiceResponse, Gather

response = VoiceResponse()

gather = Gather(input='dtmf', num_digits=4)
gather.say('Please enter the 4 digit code on your screen to get started.')

response.append(gather)

print(response)

require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new do |r|
  r.gather(numDigits: 4, input: 'dtmf') do |g|
    g.say(message: 'Please enter the 4 digit code on your screen to get started.')
  end
end

puts response

<Response>
	<Gather input="dtmf" numDigits="1">
		<Say>Please enter the 4 digit code on your screen to get started.</Say>
	</Gather>
</Response>

import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.voice.*;

import java.util.Arrays;

Say say = new Say.Builder("Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you&rsquo;ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.")
&#x9;.build();

Gather gather = new Gather.Builder()
	.inputs(Arrays.asList(Gather.Input.DTMF))
	.numDigits(1)
	.say(say)
	.build();

VoiceResponse response = new VoiceResponse.Builder().gather(gather)
	.build();

System.out.println(response.toXml());
const VoiceResponse = require('twilio').twiml.VoiceResponse;
const response = new VoiceResponse();

const gather = response.gather({
  input: 'dtmf',
  numDigits: '1',
});

gather.say('Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you’ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.');

console.log(response.toString());

<?php
require_once './vendor/autoload.php';

use Twilio\TwiML;

$response = new TwiML();

$gather = $response->gather(['input' => 'dtmf', 'numDigits' => '1']);
$gather->say('Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you\'ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.');

echo $response;
from twilio.twiml.voice_response import VoiceResponse, Gather

response = VoiceResponse()

gather = Gather(input='dtmf', num_digits=1)
gather.say('Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you\'ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.')

response.append(gather)

print(response)

require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new do |r|
	r.gather(numDigits: 1, input: 'dtmf') do |g|
		g.say(message: 'Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you’ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.')
	end
end

puts response

<Response>
	<Gather input="dtmf" numDigits="1">
		<Say>Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you’ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR. </Say>
	</Gather>
</Response>

Sind Sie dran? Sehr gut. Sie sollten nun die Begrüßungsnachricht hören. Sie können Änderungen an dieser Begrüßungsnachricht vornehmen und zurückrufen oder * drücken, um sich Ihre Änderungen anzuhören.

Genial! Als Nächstes befassen wir uns mit den Anweisungen, mit denen Sie Twilio sagen können, wie es Anrufe abwickeln soll.

Weiter:  TwiML


using Twilio.TwiML;
using Twilio.TwiML.Voice;
using System;

var response = new VoiceResponse();

var gather = new Gather(input: "dtmf", numDigits: 1);
gather.Say("Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you've made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.");

response.Append(gather);

Console.WriteLine(response.ToString());

import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.voice.*;

import java.util.Arrays;

Say say = new Say.Builder("Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you&rsquo;ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.")
&#x9;.build();

Gather gather = new Gather.Builder()
	.inputs(Arrays.asList(Gather.Input.DTMF))
	.numDigits(1)
	.say(say)
	.build();

VoiceResponse response = new VoiceResponse.Builder().gather(gather)
	.build();

System.out.println(response.toXml());

const VoiceResponse = require('twilio').twiml.VoiceResponse;
const response = new VoiceResponse();

const gather = response.gather({
  input: 'dtmf',
  numDigits: '1',
});

gather.say('Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you’ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.');

console.log(response.toString());

<?php
require_once './vendor/autoload.php';

use Twilio\TwiML;

$response = new TwiML();

$gather = $response->gather(['input' => 'dtmf', 'numDigits' => '1']);
$gather->say('Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you\'ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.');

echo $response;

from twilio.twiml.voice_response import VoiceResponse, Gather

response = VoiceResponse()

gather = Gather(input='dtmf', num_digits=1)
gather.say('Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you\'ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.')

response.append(gather)

print(response)

require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new do |r|
	r.gather(numDigits: 1, input: 'dtmf') do |g|
		g.say(message: 'Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you’ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR.')
	end
end

puts response

<Response>
	<Gather input="dtmf" numDigits="1">
		<Say>Welcome to the Twilio IVR! You can modify this message by changing this text in your browser. Hang up and call back to hear the changes you’ve made or press * to restart this IVR with your changes. Press 2 to continue with the IVR. </Say>
	</Gather>
</Response>

Sie steuern Ihre Anrufe auf Twilio anhand von TwiML, der Twilio Markup Language. Ihr TwiML-Code teilt Twilio mit, was zu tun ist, wenn Ihre App einen neuen Anruf empfängt. Sie können TwiML mit rohem XML schreiben oder Ihre bevorzugte serverseitige Sprache (und unsere Hilfebibliotheken) verwenden. Ein Beispiel sehen Sie rechts.

Das TwiML-Verb<Say> weist Twilio an, diesen dynamischen Text dem Anrufer vorzulesen. Dafür stehen mehr als 50 Stimmen in 25 Sprachen zur Verfügung. Verwenden Sie stattdessen <Play>, um eine beliebige Art von Audiodatei, wie z. B. aufgezeichnete Nachrichten oder Musik, abzuspielen, wenn Sie angerufen werden.

Das TwiML-Verb<Gather> erfasst Zahlen oder transkribiert das Gesagte des Anrufers. Nach Ende des Anrufs sendet Twilio die Daten an die angegebene Action-URL.

Weiter: Wählen Sie den Befehl aus, über den Sie mehr erfahren möchten: <Dial><Record>, oder SMS


using Twilio.TwiML;
using Twilio.TwiML.Voice;
using System;

var response = new VoiceResponse();

var gather = new Gather(input: "speech dtmf", numDigits: 1);
gather.Say("Please choose from the following options. Press 1 or say “dial” to be connected to the Twilio support phone menu. Press 2 or say “record” to leave yourself a message. Press 3 or say “message” to send yourself an SMS. While you choose your own adventure, here’s a lovely Chopin nocturne.");

var play = new Play(new Uri("http://com.twilio.sounds.music.s3.amazonaws.com/ith_chopin-15-2.mp3"));
gather.Append(play);

response.Append(gather);

Console.WriteLine(response.ToString());

import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.voice.*;

import java.util.Arrays;

Say say = new Say.Builder("Please choose from the following options. Press 1 or say “dial” to be connected to the Twilio support phone menu. Press 2 or say “record” to leave yourself a message. Press 3 or say “message” to send yourself an SMS. While you choose your own adventure, here’s a lovely Chopin nocturne.")
	.build();

Play play = new Play.Builder("http://com.twilio.sounds.music.s3.amazonaws.com/ith_chopin-15-2.mp3")
	.build();

Gather gather = new Gather.Builder()
	.inputs(Arrays.asList(Gather.Input.DTMF, Gather.Input.SPEECH))
	.numDigits(1)
	.say(say)
	.play(play)
	.build();

VoiceResponse response = new VoiceResponse.Builder().gather(gather)
	.build();

System.out.println(response.toXml());

const VoiceResponse = require('twilio').twiml.VoiceResponse;
const response = new VoiceResponse();

const gather = response.gather({
	input: 'speech dtmf',
	numDigits: '1',
});

gather.say('Please choose from the following options. Press 1 or say “dial” to be connected to the Twilio support phone menu. Press 2 or say “record” to leave yourself a message. Press 3 or say “message” to send yourself an SMS. While you choose your own adventure, here’s a lovely Chopin nocturne.');

gather.play('http://com.twilio.sounds.music.s3.amazonaws.com/ith_chopin-15-2.mp3');

console.log(response.toString());
<?php
require_once './vendor/autoload.php';

use Twilio\TwiML;

$response = new TwiML();

$gather = $response->gather(['input' => 'speech dtmf', 'numDigits' => '1']);
$gather->say('Please choose from the following options. Press 1 or say "dial" to be connected to the Twilio support phone menu. Press 2 or say "record" to leave yourself a message. Press 3 or say "message" to send yourself an SMS. While you choose your own adventure, here’s a lovely Chopin nocturne.');
$gather->play('http://com.twilio.sounds.music.s3.amazonaws.com/ith_chopin-15-2.mp3');

echo $response;

from twilio.twiml.voice_response import VoiceResponse, Gather

response = VoiceResponse()

gather = Gather(input='speech dtmf', num_digits=1)
gather.say('Please choose from the following options. Press 1 or say "dial" to be connected to the Twilio support phone menu. Press 2 or say "record" to leave yourself a message. Press 3 or say "message" to send yourself an SMS. While you choose your own adventure, here’s a lovely Chopin nocturne.')
gather.play('http://com.twilio.sounds.music.s3.amazonaws.com/ith_chopin-15-2.mp3')

response.append(gather)

print(response)

require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new do |r|
  r.gather(numDigits: 1, input: 'dtmf') do |g|
    g.say(message: 'Please choose from the following options. Press 1 or say “dial” to be connected to the Twilio support phone menu. Press 2 or say “record” to leave yourself a message. Press 3 or say “message” to send yourself an SMS. While you choose your own adventure, here’s a lovely Chopin nocturne.')
    g.play(url: 'http://com.twilio.sounds.music.s3.amazonaws.com/ith_chopin-15-2.mp3')
  end
end

puts response

<Response>
	<Gather input="speech dtmf" numDigits="1">
	<Say>Please choose from the following options. Press 1 or say "dial" to be connected to the Twilio support phone menu. Press 2 or say "record" to leave yourself a message. Press 3 or say "message" to send yourself an SMS. While you choose your own adventure, here’s a lovely Chopin nocturne.</Say>
	<Play>http://com.twilio.sounds.music.s3.amazonaws.com/ith_chopin-15-2.mp3</Play>
	</Gather>
</Response>

Das Verb <Dial> leitet Ihren Anrufer an die korrekte Stelle weiter. Dabei kann es sich um eine andere Nummer, einen Konferenzanruf, Mitarbeitende oder sogar eine programmierbare drahtlose SIM-Karte handeln.

In diesem Beispiel verwenden wir <Dial>, um Sie zum Twilio-Support-IVR weiterzuleiten. Unsere Kunden verwenden dies, um unsere Vertriebs-, Support- und Empfangsteams zu kontaktieren.

Vielen Dank für Ihre Kooperation!

Melden Sie sich für ein kostenloses Twilio-Konto an, um Ihre eigene Twilio-Nummer zu erhalten und Ihr erstes programmierbares Telefonmenü zu erstellen.


using Twilio.TwiML;
using Twilio.TwiML.Voice;
using System;

var response = new VoiceResponse();

response.Say("During an active call, you can use the Dial verb to connect the current caller to another party. We’re now going to connect you to the Twilio support phone menu, which we built with these same TwiML verbs.");
response.Dial("+18448144627");

Console.WriteLine(response.ToString());

import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.voice.*;

import java.util.Arrays;

Say say = new Say.Builder("During an active call, you can use the Dial verb to connect the current caller to another party. We’re now going to connect you to the Twilio support phone menu, which we built with these same TwiML verbs.")
	.build();

Dial dial = new Dial.Builder("+18448144627")
	.build();

VoiceResponse response = new VoiceResponse.Builder()
	.say(say)
	.dial(dial)
	.build();

System.out.println(response.toXml());
const VoiceResponse = require('twilio').twiml.VoiceResponse;
const response = new VoiceResponse();

response.say('During an active call, you can use the Dial verb to connect the current caller to another party. We’re now going to connect you to the Twilio support phone menu, which we built with these same TwiML verbs.');

response.dial('+18448144627');

console.log(response.toString());

<?php
require_once './vendor/autoload.php';

use Twilio\TwiML;

$response = new TwiML();

$response->say('During an active call, you can use the Dial verb to connect the current caller to another party. We\'re now going to connect you to the Twilio support phone menu, which we built with these same TwiML verbs.');
$response->dial('+18448144627');

echo $response;
from twilio.twiml.voice_response import VoiceResponse, Gather

response = VoiceResponse()

response.say('During an active call, you can use the Dial verb to connect the current caller to another party. We\'re now going to connect you to the Twilio support phone menu, which we built with these same TwiML verbs.')
response.dial('+18448144627')

print(response)

require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new do |r|
  r.say(message: 'During an active call, you can use the Dial verb to connect the current caller to another party. We’re now going to connect you to the Twilio support phone menu, which we built with these same TwiML verbs.')
  r.dial(number: '+18448144627')
end

puts response

<Response>
	<Say>During an active call, you can use the Dial verb to connect the current caller to another party. We’re now going to connect you to the Twilio support phone menu, which we built with these same TwiML verbs.</Say>
	<Dial>+18448144627</Dial>
</Response>
Flowchart

Starten Sie das Telefonmenü-Tutorial mit einer vollständig funktionsfähigen Beispielanwendung

Sehen Sie sich den restlichen Code an, den Sie für die Erstellung Ihres Twilio IVR benötigen.

Flowchart

Entdecken Sie, was Sie mit Twilio erreichen können

Sehen Sie sich diese produktionsbereiten Beispielprojekte für Telefonüberprüfungen, Terminerinnerungen, Webchats und vieles mehr an.

Flowchart

Gestalten Sie mithilfe von Drag-and-Drop ein Telefonmenü

Sparen Sie Zeit und Sprints mit Twilio Studio. Alle in Ihrem Team können Sprachabläufe in einem gemeinsamen Rahmen über Ihren eigenen Code oder den von Twilio erstellen und ändern.