is there a way for a livekit agent to send a dtmf ...
# ask-ai
k
is there a way for a livekit agent to send a dtmf signal?
t
Thanks for reaching out, Ethan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Yes, LiveKit provides a way to send DTMF (Dual-Tone Multi-Frequency) signals. You can use the
publishDtmf
API on the
localParticipant
object to transmit DTMF tones. This is particularly useful for relaying signals to telephone users via SIP participants. The
publishDtmf
function requires two parameters: • `code`: An integer representing the DTMF signal code • `digit`: A string representing the DTMF digit (e.g., "1", "#", "*") Here is an example usage:
Copy code
// publishes 123# in DTMF
await localParticipant.publishDtmf(1, '1');
await localParticipant.publishDtmf(2, '2');
await localParticipant.publishDtmf(3, '3');
await localParticipant.publishDtmf(11, '#');
Let me know if you need further assistance! Sources: publishDtmf | Handling DTMF | LiveKit Docs