wonderful-kilobyte-85140
12/08/2025, 11:53 AMtall-airline-16756
12/08/2025, 11:53 AMtall-airline-16756
12/08/2025, 11:54 AMsip_dtmf_received event and handling the SipDTMF payload.
Quick steps:
1. Register a listener on the Room for sip_dtmf_received.
◦ Example (Python):
@room.on("sip_dtmf_received")
def dtmf_received(dtmf: rtc.SipDTMF):
logging.info(f"DTMF from {dtmf.participant.identity}: {dtmf.digit} / {dtmf.code}")
1. Read the event data:
◦ `digit`: the key pressed as a string ("0"-"9", "*", "#").
◦ `code`: numeric RFC‑4733 code (e.g., 10 for *, 11 for #).
◦ `participant`: identity of the SIP caller.
1. If you need async handling (e.g., to interrupt speech or route choices), create an async task from the sync callback:
async def _async_handle_dtmf(dtmf_event: rtc.SipDTMF):
await phone_assistant.session.interrupt()
# process dtmf_event.digit
@room.on("sip_dtmf_received")
def handle_dtmf(dtmf_event: rtc.SipDTMF):
asyncio.create_task(_async_handle_dtmf(dtmf_event))
1. Optional: enable IVR detection in an AgentSession with ivr_detection=True to help with IVR workflows and DTMF relay.
Note: sip_dtmf_received is emitted for SIP participants (phone callers). If you need DTMF from WebRTC clients, let me know your use case and environment so I can suggest alternatives. Would you like code examples for another language or help wiring this into your IVR/menu logic?
Sources: Handling DTMF | LiveKit docs | Company directory phone assistant | LiveKit docswonderful-kilobyte-85140
12/08/2025, 12:22 PMtall-airline-16756
12/08/2025, 12:23 PMAgent constructor does not accept region or sip_region. You cannot set deployment region or SIP routing from the Agent object.
• To deploy an agent in a region, use the CLI during creation:
lk agent create --region eu-central
• To pin SIP calls to a region, configure region-based SIP endpoints (e.g., your provider uses {subdomain}.india.sip.livekit.cloud) or set destination_country="in" for outbound trunks.
You can keep choosing STT/LLM/TTS providers in your agent config (e.g., stt=deepgram.STT()), but those do not control agent deployment region or SIP routing.
Do you want the exact Agent init pattern for your SDK/language so I can show a corrected example?
Sources: Deploying to production | LiveKit Docs | SIP cloud and region pinning | LiveKit docs | Agents and handoffs | LiveKit docs | Agents telephony integration | LiveKit docs | OpenAI LLM models | LiveKit Docs