Using livekit I am placing a call using this json ...
# ask-ai
s
Using livekit I am placing a call using this json payload, how can I add a second phone number so that I can listenin to the conversation?
Copy code
{
  "sip_number": "+16467364664",
  "sip_trunk_id": "ST_JL7zM6R2Ljwf",
  "sip_call_to": "+33749505574",
  "room_name": "arico-dev-room",
  "participant_identity": "sip-test",
  "participant_name": "Test call participant",
  "wait_until_answered": true
}
t
Thanks for reaching out, aric. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd be happy to help you add a second phone number to listen in on the conversation! You can do this by using the
CreateSIPParticipant
API to invite the second participant into the same LiveKit room where your initial SIP call is happening. Here's a simple way to go about it: 1. First, make sure you have an outbound SIP trunk set up in LiveKit. 2. Then, use the
CreateSIPParticipant
API to start a new SIP call to the second phone number and place it in the same room as your original call. Here's an example payload you can use with the API:
Copy code
{
    "sip_trunk_id": "ST_JL7zM6R2Ljwf",
    "sip_call_to": "+1234567890",  // Second phone number
    "room_name": "arico-dev-room",  // Same room as the original call
    "participant_identity": "second-listener",
    "participant_name": "Second Listener",
    "wait_until_answered": true
}
This will call the second number and bring them into the same LiveKit room, so they can listen and join the conversation seamlessly. If you have any questions or need a hand with this, please don’t hesitate to reach out—I’m here to help! Sources: src/setup-livekit.ts | telephony/sip_lifecycle.py | Agent-assisted warm transfer | LiveKit Docs | lib/livekit/sip_service_client.rb
s
that's exatly what I did, but the problem is that my agent is not listening to my second participant. It's only listening to the first one.
t
It sounds like you're running into a subscription deadlock mechanism with LiveKit's SIP integration, which can be a bit tricky. When two SIP participants join a room, sometimes they end up waiting on each other to start transmitting audio, creating a circular situation where no audio flows. LiveKit actually has a thoughtful way to handle this by unblocking the subscription process once the second SIP participant joins. This helps kickstart the audio mixing so everyone can hear each other. Here are a few things you might want to check to help us get to the bottom of this: • Make sure both SIP participants are set up properly to publish and subscribe to audio tracks. • Take a look at the logs for messages like "unblocking subscription - second sip participant is in the room," which let you know the system is resolving the deadlock. • Double-check that the room’s audio settings and permissions are allowing both participants to communicate smoothly. If you’re still having trouble after this, please don’t hesitate to reach out. I’m here to help and we can dig deeper together to find a solution. Sources: test/lktest/sip.go
s
@bulky-wire-22694