kind-bear-14210
12/14/2025, 10:30 AMrefined-appointment-81829
12/15/2025, 10:37 PMkind-bear-14210
12/16/2025, 12:09 AMrefined-appointment-81829
12/16/2025, 12:20 AMkind-bear-14210
12/16/2025, 12:28 AMrefined-appointment-81829
12/16/2025, 12:32 AMkind-bear-14210
12/16/2025, 1:00 AMI already set unique name for room and I have same issue with audio.
There is my python code from my windows 10 machine:
import time
import jwt
import requests
# ============================================================
# :closed_lock_with_key: LIVEKIT CREDENTIALS (FROM DASHBOARD)
# ============================================================
LIVEKIT_API_KEY = "My_LIVEKIT_API_KEY "
LIVEKIT_API_SECRET = "My_LIVEKIT_API_SECRET "
LIVEKIT_BASE_URL = "<https://lagent-vjsmrvrs.livekit.cloud>"
# ============================================================
# :telephone_receiver: SIP + AGENT CONFIG
# ============================================================
ROOM_NAME = "sip-room-audio-test-004"
# SIP caller
CALLER_IDENTITY = "sip-caller-004"
CALLER_NAME = "SIP Caller"
SIP_TRUNK_ID = "ST_YVKTAZjazUSa"
DIAL_NUMBER = "XXX905908"
# Agent
AGENT_ID = "CA_CXVqqec98MpN"
AGENT_IDENTITY = "audio-agent-004"
AGENT_NAME = "Audio Test Agent 004"
# ============================================================
# :globe_with_meridians: LIVEKIT API ENDPOINTS
# ============================================================
SIP_URL = f"{LIVEKIT_BASE_URL}/twirp/livekit.SIP/CreateSIPParticipant"
AGENT_URL = f"{LIVEKIT_BASE_URL}/twirp/livekit.Agents/StartAgent"
# ============================================================
# :key: ADMIN JWT (ONE TOKEN FOR EVERYTHING)
# ============================================================
def generate_admin_jwt(identity: str) -> str:
now = int(time.time())
payload = {
"jti": f"admin-{now}",
"iat": now,
"exp": now + 3600,
"iss": LIVEKIT_API_KEY,
"sub": "admin",
"identity": identity,
# SIP permissions
"sip": {
"admin": True,
"call": True,
"connect": True
},
# Agent permissions
"agent": {
"start": True
},
# Room + media permissions
"video": {
"room": "*",
"roomJoin": True,
"roomCreate": True,
"canPublish": True,
"canSubscribe": True
}
}
return jwt.encode(payload, LIVEKIT_API_SECRET, algorithm="HS256")
# ============================================================
# :arrow_forward: STEP 1 — START AGENT FIRST
# ============================================================
admin_jwt = generate_admin_jwt(AGENT_IDENTITY)
headers = {
"Authorization": f"Bearer {admin_jwt}",
"Content-Type": "application/json"
}
agent_body = {
"agent_id": AGENT_ID,
"room_name": ROOM_NAME,
"participant_identity": AGENT_IDENTITY,
"participant_name": AGENT_NAME
}
print("\n:arrow_forward: Starting Agent...")
agent_response = requests.post(AGENT_URL, json=agent_body, headers=headers)
print("Agent Status:", agent_response.status_code)
print(agent_response.text)
if agent_response.status_code != 200:
raise RuntimeError(":x: Agent failed to start")
# VERY IMPORTANT: allow agent to publish audio
time.sleep(2)
# ============================================================
# :telephone_receiver: STEP 2 — CREATE SIP CALL
# ============================================================
sip_body = {
"sip_trunk_id": SIP_TRUNK_ID,
"sip_call_to": DIAL_NUMBER,
"room_name": ROOM_NAME,
"participant_identity": CALLER_IDENTITY,
"participant_name": CALLER_NAME,
"wait_until_answered": True,
"play_dialtone": True
}
print("\n:telephone_receiver: Creating SIP Call...")
sip_response = requests.post(SIP_URL, json=sip_body, headers=headers)
print("SIP Status:", sip_response.status_code)
print(sip_response.text)
if sip_response.status_code != 200:
raise RuntimeError(":x: SIP call failed")
print("\n:white_check_mark: SUCCESS — Agent + SIP should now have AUDIO")refined-appointment-81829
12/16/2025, 1:32 PMrefined-appointment-81829
12/16/2025, 1:32 PMkind-bear-14210
12/16/2025, 7:13 PMrefined-appointment-81829
12/16/2025, 7:24 PMconsole?kind-bear-14210
12/16/2025, 7:26 PMkind-bear-14210
12/16/2025, 7:27 PMrefined-appointment-81829
12/16/2025, 7:27 PMkind-bear-14210
12/16/2025, 7:28 PMrefined-appointment-81829
12/16/2025, 7:28 PMpython agent.py console and see if that worksrefined-appointment-81829
12/16/2025, 7:29 PMkind-bear-14210
12/16/2025, 7:30 PMrefined-appointment-81829
12/16/2025, 7:30 PMkind-bear-14210
12/16/2025, 7:32 PMrefined-appointment-81829
12/16/2025, 7:33 PMrefined-appointment-81829
12/16/2025, 7:33 PMkind-bear-14210
12/16/2025, 7:35 PMrefined-appointment-81829
12/16/2025, 7:36 PMrefined-appointment-81829
12/16/2025, 7:36 PMdev or start