Touch-Tone Communication
DTMF (Dual-Tone Multi-Frequency) permite utilizatorilor să interacționeze cu voice AI prin apăsarea tastelor telefonului.
DTMF Keypad
1
2
3
A
4
5
6
B
7
8
9
C
*
0
#
D
Each key produces two frequencies (one row + one column)
Row: 697Hz, 770Hz, 852Hz, 941Hz | Col: 1209Hz, 1336Hz, 1477Hz, 1633Hz
DTMF Transport Methods
In-Band
DTMF tones carried în audio stream.
- • Traditional method
- • Works everywhere
- • Affected by codec compression
- • May be misdetected
RFC 2833 (Recommended)
DTMF events în RTP stream, separate from audio.
- • Reliable detection
- • Not affected by codecs
- • Industry standard
- • Payload type 101
SIP INFO
DTMF sent as SIP INFO message.
- • Separate from media
- • Higher latency
- • Less common
- • Firewall friendly
RFC 2833 Packet Structure
// RFC 2833 DTMF Event Packet 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | event |E|R| volume | duration | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ event: 0-9, 10=*, 11=#, 12-15=A-D E (end): 1 = last packet for this event R: reserved volume: power level (0-63, -dBm0) duration: in timestamp units
Example: Key "5" pressed
event=5, E=0, volume=10, duration=160
Example: Key "5" released
event=5, E=1, volume=10, duration=800
Voice AI DTMF Integration
// Handle DTMF in Voice AI
voiceAI.on('dtmf', (event) => {
const { digit, duration } = event;
switch (digit) {
case '1':
voiceAI.speak('You selected sales. Transferring...');
voiceAI.transfer('sales-queue');
break;
case '2':
voiceAI.speak('You selected support.');
voiceAI.setContext({ intent: 'support' });
break;
case '0':
voiceAI.speak('Connecting to a human agent.');
voiceAI.transfer('human-agent');
break;
case '*':
voiceAI.speak('Returning to main menu.');
voiceAI.reset();
break;
default:
voiceAI.speak(`You pressed ${digit}.`);
}
});
// Generate DTMF (for outbound IVR navigation)
voiceAI.sendDTMF('1234#', { duration: 100, gap: 50 });DTMF Use Cases
Inbound (Detection)
- • IVR menu navigation
- • Account/PIN entry
- • Confirmation (Press 1 to confirm)
- • Language selection
- • Transfer request (0 for agent)
Outbound (Generation)
- • Navigate external IVR systems
- • Enter extension numbers
- • Enter conference PIN
- • Automated phone tree navigation
- • Two-factor authentication
Configuration
DTMF Mode
Transport method
Min Duration
40msMinimum tone duration to detect
Inter-digit Timeout
3000msMax gap between digits în sequence
Terminator
# keyEnd of input marker