This message was deleted.
# ask-ai
s
This message was deleted.
✅ 1
t
Thanks for reaching out, Aleh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I looked at your code and what you described. You can collect DOB but not SSN; here are the most likely causes and quick checks to run. Possible causes • Per-digit timeout: GetDtmfTask defaults to a 4s timeout per digit. Users often hesitate entering sensitive data (SSN), so the task can stop before 4 digits arrive. • SIP/DTMF transport: Your SIP trunk/provider must forward DTMF (RFC2833 or SIP INFO). If the trunk doesn’t forward tones, nothing reaches LiveKit. • Overlap or interruption: If audio prompts overlap the DTMF listening window, input can be missed; ensure playout finished before starting GetDtmfTask. • Signal processing: Noise-suppression or audio processing (e.g., Krisp) can interfere with DTMF in some setups. • Silent exceptions / logging gap: Your except block returns without logging the ToolError, so you may be missing a useful error message. Recommended quick fixes to try 1. Increase per-digit timeout:
Copy code
result = await GetDtmfTask(
    num_digits=4,
    dtmf_input_timeout=8.0,
    chat_ctx=self.chat_ctx.copy(exclude_instructions=True, exclude_function_call=True),
)
1. Ensure you finish playout before listening (you already call
await context.wait_for_playout()
— confirm it actually completes before the prompt ends). 2. Add logging for DTMF events and ToolError:
Copy code
except ToolError as e:
    logger.error(f"GetDtmfTask failed: {e}")
    return self._retry_ssn_message
And on the room side:
Copy code
@ctx.room.on("dtmf_received")
def on_dtmf(digit, participant):
    logger.info(f"DTMF received: {digit}")
1. Verify your SIP trunk/provider supports RFC2833 or SIP INFO and that DTMF is enabled/forwarded. 2. Temporarily disable noise-suppression (Krisp) to rule out interference. If you run the logging steps and paste the dtmf_received logs or the ToolError output here, I can help interpret them and suggest a next step. Sources: GetDtmfTask | LiveKit Documentation | examples/dtmf | livekit/livekit_composite | DeepWiki | sip | livekit/livekit_composite | DeepWiki | Agents telephony integration | LiveKit Documentation, with interactive elements
b
i was able to enter dob, issue that 2nd time when i was prompted to enter ssn i see in logs that there is no dtfm event
t
Thanks — I hear that DOB worked but on the second prompt for SSN there are no DTMF events in the logs. Let's narrow this down. Quick clarifying question: • When SSN was prompted the second time, did the agent replay the same audio prompt (no overlap) and did you see any ToolError logged? If not, enable error logging as below. Please run these checks and share results: 1. Add DTMF and ToolError logging (paste outputs here):
Copy code
except ToolError as e:
    logger.error(f"GetDtmfTask failed: {e}")
    return self._retry_ssn_message
and
Copy code
@ctx.room.on("dtmf_received")
def on_dtmf(digit, participant):
    logger.info(f"DTMF received: {digit} from {participant.sid}")
1. Increase per-digit timeout for SSN (users often hesitate):
Copy code
result = await GetDtmfTask(num_digits=4, dtmf_input_timeout=8.0, ...)
1. Confirm playout completed before listening (ensure
await context.wait_for_playout()
actually finished and the prompt audio stopped). 2. Verify SIP trunk DTMF transport (RFC2833 or SIP INFO) is enabled and the provider forwarded tones for that call — check SIP signaling/SDP if possible. 3. Temporarily disable any noise-suppression (Krisp) or other audio processing during the test. If you share: • the dtmf_received logs (if any), • the ToolError log output, and • whether you changed dtmf_input_timeout and the result, I’ll help interpret them and suggest the next step. , with interactive elements