billions-lamp-69014
02/16/2025, 8:56 PMgray-monkey-83525
02/16/2025, 8:56 PMdispatchRuleIndividual
, it should route each caller into an individual room with the agent. Verify that the room names are correctly prefixed and that the rule is applied to the correct trunk ID. According to the LiveKit SIP Quickstart, the dispatch rule should look something like this:
{
"name": "My dispatch rule",
"trunk_ids": [
"<livekit_trunk_id>"
],
"rule": {
"dispatchRuleIndividual": {
"roomPrefix": "call"
}
}
}
2. Room Name Consistency: Check that the room name used by the web client matches the room name generated by the dispatch rule. If the dispatch rule creates rooms with a specific prefix, ensure your web client is attempting to join the correct room.
3. Agent and Web Client Configuration: Ensure that both the agent and the web client are configured to connect to the same LiveKit server and that they are using the correct API keys and secrets. Verify that the agent is running and able to join rooms as expected.
Would you like more detailed guidance on any of these steps?
Sources:
- LiveKit SIP Quickstart 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.billions-lamp-69014
02/16/2025, 8:59 PMgray-monkey-83525
02/16/2025, 8:59 PMbillions-lamp-69014
02/16/2025, 9:03 PMgray-monkey-83525
02/16/2025, 9:03 PMbillions-lamp-69014
02/16/2025, 9:07 PMgray-monkey-83525
02/16/2025, 9:07 PMdeleteRoom
API: According to the LiveKit Server APIs documentation, you can use the deleteRoom
API to forcibly disconnect all participants and close the room. This can be done programmatically when you detect that a call should end.
from livekit import RoomServiceClient
client = RoomServiceClient("https://your.livekit.server", "api-key", "secret-key")
client.delete_room("room-name")
2. Monitor Participant Events: Implement event listeners to monitor when participants leave the room. According to the LiveKit Managing Participants documentation, you can listen for participant leave events and trigger room closure if no participants remain.
3. Set Room Timeout: Configure a timeout for rooms to automatically close after a certain period of inactivity. This can be set when creating the room using the empty_timeout
parameter, which specifies the number of seconds to keep the room open if no one joins.
4. Check SIP Participant Status: Ensure that SIP participants are correctly marked as disconnected when they leave. According to the LiveKit SIP Participant documentation, you can check the sip.callStatus
attribute to verify the call status.
Would you like more detailed guidance on any of these steps?
Sources:
- LiveKit Server APIs documentation
- LiveKit Managing Participants documentation
- LiveKit SIP Participant documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.billions-lamp-69014
02/16/2025, 9:15 PMgray-monkey-83525
02/16/2025, 9:15 PMempty_timeout
parameter, you need to explicitly create the room using the CreateRoom
API before adding SIP participants. This allows you to set the empty_timeout
parameter, which defines how long the room should remain open if no participants are present. Here's how you can do it:
1. Create the Room with empty_timeout
: Use the CreateRoom
API to create a room with the desired empty_timeout
setting. This parameter specifies the number of seconds the room will remain open if no participants join.
from livekit import RoomServiceClient
client = RoomServiceClient("https://your.livekit.server", "api-key", "secret-key")
room = client.create_room(
name="sip-room",
empty_timeout=300 # Set to 5 minutes (300 seconds)
)
2. Add SIP Participants: Once the room is created, you can add SIP participants using the CreateSIPParticipant
API. Ensure that the room name matches the one you created.
3. Monitor Room Status: Implement logic to monitor the room status and handle any necessary cleanup or notifications when the room is about to close due to the timeout.
Would you like more detailed guidance on any of these steps?
Sources:
- LiveKit Server APIs documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.billions-lamp-69014
02/16/2025, 9:17 PMgray-monkey-83525
02/16/2025, 9:17 PMempty_timeout
, you can manage room creation explicitly by pre-creating the room before any participants join. Here's how you can handle this:
1. Pre-create the Room: Use the CreateRoom
API to create the room with the desired settings before any participants, including SIP participants, join. This ensures that the room is configured with the empty_timeout
and any other parameters you need.
from livekit import RoomServiceClient
client = RoomServiceClient("https://your.livekit.server", "api-key", "secret-key")
room = client.create_room(
name="sip-room",
empty_timeout=300 # Set to 5 minutes (300 seconds)
)
2. Dispatch the Agent: After the room is created, dispatch your agent to the room. According to the LiveKit Dispatching Agents documentation, you can use explicit dispatch to control when the agent joins the room.
3. Add SIP Participants: Once the room is ready and the agent is dispatched, you can proceed to add SIP participants. Ensure that the room name used for SIP participants matches the pre-created room.
By pre-creating the room, you gain control over its configuration and ensure that all settings are applied before any participants join.
Would you like more detailed guidance on any of these steps?
Sources:
- LiveKit Dispatching Agents documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.billions-lamp-69014
02/16/2025, 9:30 PMgray-monkey-83525
02/16/2025, 9:30 PMDeleteRoom
API to forcibly close the room and disconnect any lingering sessions. Here's how you can do it:
1. Use the DeleteRoom
API: This API will forcibly disconnect all participants and close the room. Even if there are no visible participants, this action ensures that any backend processes associated with the room are terminated.
from livekit import RoomServiceClient
client = RoomServiceClient("https://your.livekit.server", "api-key", "secret-key")
client.delete_room("room-name")
2. Check for Room Closure: After calling the DeleteRoom
API, verify in the LiveKit console that the room is no longer listed as active. This should remove any lingering SIP sessions.
3. Monitor for Future Sessions: Implement monitoring to ensure that rooms are closed properly after use. You can set up alerts or logs to notify you if a room remains open unexpectedly.
If the room still appears active after these steps, it might be a display issue in the console. In such cases, you can contact LiveKit support for further assistance.
Would you like more detailed guidance on any of these steps?
Sources:
- LiveKit Server APIs documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.billions-lamp-69014
02/16/2025, 9:45 PMgray-monkey-83525
02/16/2025, 9:45 PMListRooms
API to confirm the actual state of rooms. If the API indicates that the room does not exist, it is likely a display issue in the dashboard. According to the LiveKit Server APIs documentation, the ListRooms
API should provide the current list of active rooms.
2. Check for Dashboard Updates: The LiveKit team has acknowledged that there can be delays in the dashboard updating to reflect the true state of rooms. This is a known issue, and they are working on improvements. If the API confirms the room is not active, it should not impact your billing or session limits.
3. Contact Support: If the issue persists and you need to ensure that no sessions are incorrectly billed or affecting your limits, consider reaching out to LiveKit support for assistance. They can provide more detailed insights and confirm the backend state.
Would you like more detailed guidance on any of these steps?
Sources:
- LiveKit Server APIs documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.billions-lamp-69014
02/16/2025, 11:40 PMgray-monkey-83525
02/16/2025, 11:40 PM