how can i start recording only when the other part...
# ask-ai
p
how can i start recording only when the other participant joins the room. i am using telephony.
t
Thanks for reaching out, Bryner. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
p
from livekit import api async def entrypoint(ctx: JobContext): # Add the following code to the top, before calling ctx.connect() # Set up recording req = api.RoomCompositeEgressRequest( room_name=ctx.room.name, audio_only=True, file_outputs=[api.EncodedFileOutput( file_type=api.EncodedFileType.OGG, filepath="livekit/my-room-test.ogg", s3=api.S3Upload( bucket="<S3 bucket name>", region="<S3 region>", access_key="<S3 access key>", secret="<S3 secret key>", ), )], ) lkapi = api.LiveKitAPI() res = await lkapi.egress.start_room_composite_egress(req) await lkapi.aclose() # .. The rest of your entrypoint code follows ... can i execute this recording after the sip participant picked up the call.