how to start egress rcord with partiticant joın fo...
# ask-ai
m
how to start egress rcord with partiticant joın for outbound calls , ? it s alwasy startıng with ring, i disable play dialtone but now it records silence before agent how to handle this situation . also , in egress json i want to capture which number call which user phone . caller : 06.... call to :055.. give me tips : @millions-hair-24956
g
It seems likely that you are experiencing issues with starting egress recording at the right time for outbound calls, resulting in silence being recorded before the agent joins. To address this, you might consider starting the egress recording only after the participant has joined and published their track. This approach can help minimize the silence recorded at the beginning of the call. According to LiveKit documentation, you can use Participant Egress to record a participant's audio and video tracks by providing the participant's identity, which starts recording as soon as tracks are published. Regarding capturing the phone numbers involved in the call, you can use SIP participant attributes to log the caller and callee numbers. As per LiveKit SIP documentation, SIP participants have attributes like
sip.phoneNumber
and
sip.callStatus
that can be used to identify the caller and the call details. You can access these attributes in your application to log the necessary information. Would you like more detailed guidance on implementing these solutions? Sources: - LiveKit documentation - LiveKit SIP documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
m
how can i catch number form outbound-trunk.json ? i mean caller number @millions-hair-24956
g
To capture the caller number from an outbound trunk in LiveKit, you can utilize the SIP participant attributes. When you create an outbound call, the
sip.trunkPhoneNumber
attribute in the participant's attributes will contain the caller's phone number. This attribute is accessible once the SIP participant is created and the call is initiated. Here's a brief example of how you might access this attribute in your application:
Copy code
participant = await ctx.wait_for_participant()
caller_number = participant.attributes.get('sip.trunkPhoneNumber')
if caller_number:
    print(f"Caller number: {caller_number}")
else:
    print("Caller number not found.")
This code waits for a participant to join and then retrieves the caller's phone number from the participant's attributes. Would you like more detailed guidance on this process? Sources: - LiveKit SIP documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.