mysterious-nightfall-40832
10/27/2025, 5:28 AM@ctx.room.on("track_subscribed")
def on_track_subscribed(
track: rtc.Track,
publication: rtc.RemoteTrackPublication,
participant: rtc.RemoteParticipant,
) -> None:
try:
if appointment_scheduling_assistant._activity:
logger.warning("[on_track_subscribed] Appointment scheduling assistant is not initialized.")
# Extract session GUID from participant metadata
if participant.metadata:
import json
metadata = json.loads(participant.metadata)
session_guid = metadata.get("sessionGuid")
if session_guid:
logger.info(f"[on_track_subscribed] Session GUID: {session_guid}")
else:
logger.debug("[on_track_subscribed] No session GUID found in metadata.")
# Update user information in the assistant session
user_data = appointment_scheduling_assistant.session.userdata Hi All ,When I stop the call,I start again in some seconds,Getting error as agent is not runnings ,not able to get the activity,getting error while accessing the agent inside this on_track_subscribed function.After starting the call for the first time it works fine.Please help me to resolve this🙏🏻lively-winter-88668
10/27/2025, 10:30 AMtrack_subscribed is the right way to approach this, since I would have expected an approach more similar to that example with standard agent lifecycle and tool calls