Hi! I'm trying to manually end a call coming into ...
# agents
f
Hi! I'm trying to manually end a call coming into my inbound SIP trunk. I'm using the
delete_room
api function to do this, following https://docs.livekit.io/agents/worker/job/#disconnecting-everyone:
Copy code
async def hangup_call():
    """Helper function to delete the room and end the call for all participants"""
    ctx = get_job_context()
    if ctx is None:
        # Not running in a job context
        return
    
    await ctx.api.room.delete_room(api.DeleteRoomRequest(room=ctx.room.name))
When this function is called, the agent appears to have deleted the room, but the call is left hanging on the user's end. The call ends after about 30 seconds. What could be causing this?
✅ 1
r
Are you using TLS for the SIP call?
There is currently a know issue with hang up when the SIP trunk uses TLS.
g
@refined-appointment-81829 yup TLS is used. Is it a consistent error/ is there a fix eta?
r
It is persistent with TLS. If you can use TCP instead BYE will work fine.
g
We require secure trunking for compliance purposes 😕 Is there a GH issue, we can follow?
just created this issue. I assume it's the SIP repo responsible for this since TLS is causing issues here.
r
Yes, that is the correct repo
This is the related issue but probably makes some sense to have a BYE specific one: https://github.com/livekit/sip/issues/435