microscopic-dress-75199
09/29/2025, 11:06 PMtall-airline-16756
09/29/2025, 11:06 PMtall-airline-16756
09/29/2025, 11:06 PMmicroscopic-dress-75199
09/29/2025, 11:16 PMtall-airline-16756
09/29/2025, 11:17 PMCreateSIPParticipant) after the MCP process is successfully resolved, ensuring that no telephony connection is established until MCP gives the green light.
For inbound calls, LiveKit creates the SIP participant right away when it receives an INVITE. Although it’s not possible to delay the SIP ANSWER, you can accept the call, perform the MCP check, and then terminate the call if the MCP denies it.
Could you please share a bit more about whether you’re working with inbound or outbound calls? Also, is the MCP check mainly for authorization, routing, or data enrichment? Knowing this will really help me guide you with the best implementation approach.
Sources: SIP & Telephony Integration | livekit/livekit_composite | DeepWiki | SIP Integration | livekit/livekit_composite | DeepWiki | cmd/lk/sip.go | Docs::Telephony | Integrating with Telephony | LiveKit Docsmicroscopic-dress-75199
09/29/2025, 11:20 PMtall-airline-16756
09/29/2025, 11:20 PMasync def on_inbound_call(room: Room):
# Identify the SIP participant
sip_participant = next(p for p in room.participants.values() if p.identity.startswith("sip_"))
# Run MCP check
auth_result = await mcp_client.check_authorization(sip_participant.metadata)
if not auth_result.allowed:
# Remove the participant or delete the room
await room.remove_participant(sip_participant)
# Or delete the entire room if needed
This way, the call is dropped quickly if the MCP check fails, helping to avoid any unnecessary media flow. If you’d like, I’m here to help you with implementing this or answer any questions you have!tall-airline-16756
09/29/2025, 11:23 PMmicroscopic-dress-75199
09/29/2025, 11:41 PM