@llm.ai_callable() async def send_dtmf_code( ...
# ask-ai
a
@llm.ai_callable() async def send_dtmf_code( self, code: Annotated[ int, llm.TypeInfo( description="The DTMF code to send to the phone number for the current step.") ], ): This was used in 0.x version what can be used in version 1.x
t
Thanks for reaching out, giri. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
In LiveKit version 1.x, the
send_dtmf_code
function from earlier versions or custom implementations can be replaced with the official
publish_dtmf
method. This method is available across multiple SDKs and is the standard way to send DTMF tones. Below are examples for different languages: Python:
Copy code
await room.local_participant.publish_dtmf(
    code=code,
    digit=str(code)
)
JavaScript/TypeScript:
Copy code
await localParticipant.publishDtmf(code, digit);
Node.js:
Copy code
await localParticipant.publishDtmf(code, digit);
Android:
Copy code
localParticipant.publishDtmf(code, digit)
If you were using a custom
send_dtmf_code
function, you can directly call
publish_dtmf
with the numeric code and its string representation. This ensures compatibility with various SIP implementations. Sources: Building an Automated IVR Menu Caller | LiveKit Docs | src/room/participant/LocalParticipant.ts | packages/livekit-rtc/src/participant.ts | livekit-android-sdk/src/main/java/io/livekit/android/room/participant/Local... | Handling DTMF | LiveKit Docs