f
hii
✅ 1
t
Thanks for reaching out, Vishalli. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
f
hii my sip transfer is working for outbound but not inbound what can be the issue
t
Thanks — I’m looking into why your SIP transfer works outbound but not inbound. I’ll cover the most likely causes and a short troubleshooting checklist so we can pinpoint the issue quickly. Quick checks to start • Confirm an outbound SIP trunk is configured and the transfer request uses the correct
sip_trunk_id
. Inbound→transfer still requires an outbound trunk to dial the new leg. • Verify your SIP provider supports outbound transfers from an inbound call (SIP REFER or equivalent). Some providers block REFER or caller-ID passthrough. • Ensure the inbound call was routed by a valid inbound trunk + dispatch rule (the inbound caller should have a SIP participant created in the room). • Check whether you’re explicitly setting
sip_number
(caller ID). If you want to preserve the original caller ID, set `sip_number=original_from_number`; otherwise the provider may replace it and reject the call. Troubleshooting steps 1. Reproduce the failing inbound transfer and capture LiveKit logs / SIP signaling for that flow. 2. Confirm the transfer request payload includes: ◦ correct
sip_trunk_id
(points to an outbound trunk) ◦
sip_call_to
(callee number) ◦ optional
sip_number
if preserving caller ID 1. Inspect provider responses during the transfer attempt (SIP 4xx/5xx codes or REFER rejection). 2. Test the same outbound dial target directly from an outbound call using that trunk to confirm the trunk can reach the destination. 3. If the provider returns a caller-ID or REFER-related error, try an alternate outbound trunk or ask the provider to allow REFER/ANI passthrough. What I need from you if this doesn’t resolve it • Example transfer request payload (redact sensitive tokens/numbers) • The outbound
sip_trunk_id
you’re using • Any SIP response codes or LiveKit webhook/log snippets captured during the failing transfer If you share those, I’ll help interpret the logs and suggest the next fix. Sources: Agents telephony integration | LiveKit Documentation | WarmTransferTask | LiveKit Documentation | Accepting calls overview | LiveKit Documentation | Preserving Caller ID During SIP Transfers in LiveKit Agents, with interactive elements
f
await livekit_api.sip.transfer_sip_participant( api.TransferSIPParticipantRequest( participant_identity=sip_participant.identity, room_name=job_ctx.room.name, transfer_to=transfer_to, play_dialtone=True, headers=headers, ) )
t
Thanks — I see the
transfer_sip_participant
call you’re making. That helps. First, confirm these fields in your request: •
transfer_to
contains the callee phone number in the provider-expected format. • The outbound trunk used for the transfer is configured and reachable (LiveKit still needs an outbound trunk to place the transfer). If your code relies on an environment default, verify it’s set to the intended trunk. Quick checklist to debug this inbound-to-transfer flow 1. Capture LiveKit logs/webhook events during the failing transfer and share any SIP response codes (4xx/5xx) or error messages. 2. Verify the outbound trunk can successfully place a direct outbound call to
transfer_to
(test dialing the number using the same trunk). 3. Ensure your SIP provider allows REFER/transfer and caller-ID passthrough; provider restrictions often block inbound-initiated transfers. 4. Try explicitly setting
sip_number
to the original caller number if you need to preserve caller ID. 5. If you use
headers
, confirm they don’t conflict with your provider’s requirements (some providers reject unexpected SIP headers). If you still see it fail, please paste: • the transfer request payload (redact tokens and full phone numbers if needed), • any SIP response codes or LiveKit webhook/log snippets from the failed attempt, • the
sip_trunk_id
you expect the transfer to use. With those I’ll interpret the logs and recommend the next concrete fix. , with interactive elements
f
outbound is working fine
t
Thanks — since outbound works, the next step is to see what fails when you attempt the inbound transfer. Please provide: • Any LiveKit logs or webhook events from the failing transfer (SIP response codes like 4xx/5xx, error messages). • The dispatch rule/inbound trunk used to create the SIP participant (confirm the inbound call created a SIP participant in the room). • The
transfer_to
value format (mask digits if needed) and whether you set
sip_number
. • Any SIP provider error or rejection you’ve seen. While you grab that, try this quick test: 1. From the inbound call’s room, call the same
transfer_to
number using the same outbound trunk manually (to confirm the trunk can place that call). 2. Retry the transfer with
sip_number
set to the original caller number. Send the logs/snippets and I’ll analyze them and point to the precise fix. , with interactive elements