Hi All, We have built an AI Voice Agent using Live...
# telephony
b
Hi All, We have built an AI Voice Agent using LiveKit and the Telnyx SIP trunk. Currently, calls are running fine, but the answering machine detection is not working properly. Can anyone suggest how I can implement call disconnection on my end? Currently we have used @function tool as specified on live kit documentation.
r
b
thank you for the reponse, that points to older agent version. i am following
Copy code
@function_tool
    async def detected_answering_machine(self):
        """Call this tool if you have detected a voicemail system, AFTER hearing the voicemail greeting"""
        await self.session.generate_reply(
            instructions="Leave a voicemail message letting the user know you'll call back later."
        )
        await asyncio.sleep(0.5) # Add a natural gap to the end of the voicemail message
        await hangup_call()
from https://docs.livekit.io/agents/start/telephony/ but it does not always detect the VM
r
Oops... Not sure how I did that.
b
no issues, for a min i thought i need to rewrite the whole code before realizing its from the older version. 😄
r
It is the most recent telephony example we have and straight from the agent steam.
b
i havn't looked at this, but thank you, let me check this out.