I want to use the warm transfer feature, and I am ...
# ask-ai
e
I want to use the warm transfer feature, and I am using Twilio as my provider. I am able to run the warm transfer with a US number but not with Indian numbers, I have international calling enables and have tried calling Indian number using the Twilio numbers and SIP. It is a 408 eveyrtime can you help?
t
Thanks for reaching out, Hitesh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm here to help you with the 408 error you're encountering during warm transfers to Indian numbers. This issue often happens because SIP REFER might not be enabled on your Twilio trunk, or there could be some regional compliance settings to check. Let’s walk through some steps to get this sorted out together: 1. Enable SIP REFER on Twilio Trunk: 1. First, make sure you have the Twilio CLI installed and that you’re logged in. 2. Then, run this command to enable SIP REFER and PSTN transfer:
Copy code
twilio api trunking v1 trunks update \
  --sid <twilio-trunk-sid> \
  --transfer-mode enable-all \
  --transfer-caller-id from-transferee
3. After that, you can verify your trunk settings by running:
twilio api trunking v1 trunks list
2. Configure Region Pinning for India: • For inbound calls, please use a region-based SIP endpoint like this:
{sip_subdomain}.india.sip.livekit.cloud
, replacing
{sip_subdomain}
with your LiveKit project ID. • For outbound calls, set up a trunk pinned to India by using the
destination_country
parameter with the value
"in"
. 3. Additional Checks: • Make sure the Indian number is formatted in E.164 style (for example,
+91XXXXXXXXXX
). • Double-check that your Twilio trunk is allowed to make outbound calls to India. • If needed, enable TLS/SRTP for secure trunking to keep things safe. If you'd like, I’m more than happy to help you verify your current trunk configuration or assist with testing the warm transfer while capturing logs. Just let me know how you’d like to proceed! Sources: Transferring calls | LiveKit Docs | SIP cloud and region pinning | LiveKit Docs | Preserving Caller ID During SIP Transfers in LiveKit Agents | Secure trunking | LiveKit Docs | Agents telephony integration | LiveKit Docs
e
oops sorry i meant doing cold transfer but doesnt matter
t
I'm sorry to hear you're experiencing a 408 error during cold transfers to Indian numbers. This can often be related to regional compliance or trunk configuration, but don't worry—we can work through it together! Here's a friendly guide to help you resolve it: 1. Regional Compliance: • India has specific domestic call anchoring rules. To comply, please configure your outbound SIP trunk with
destination_country=IN
so calls route correctly. • Also, make sure to use a region-based SIP endpoint for LiveKit:
{sip_subdomain}.india.sip.livekit.cloud
, replacing
{sip_subdomain}
with your LiveKit project ID. 2. Verify Twilio Trunk Configuration: • It’s important to enable SIP REFER and PSTN Transfer. You can do this easily using the Twilio CLI:
Copy code
twilio api trunking v1 trunks update \
  --sid <twilio-trunk-sid> \
  --transfer-mode enable-all \
  --transfer-caller-id from-transferee
• Also, double-check that the Indian number is formatted in E.164 style (like
+91XXXXXXXXXX
). 3. Test Direct Outbound Call: • Try making a direct call to the Indian number. This helps us see if the issue is with the transfer or something else like trunk reachability or permissions. 4. Caller ID Passthrough: • Make sure to set the original caller ID in your transfer request using
sip_number=original_caller_number
. • Check that your Twilio trunk supports arbitrary caller ID passthrough, as this can affect the transfer. If you'd like, I’m here to help you verify your trunk configuration or walk you through testing the cold transfer setup. Just let me know how I can assist! Sources: Agents telephony integration | LiveKit Docs | Preserving Caller ID During SIP Transfers in LiveKit Agents | livekit-protocol/livekit/protocol/sip.pyi | SIP troubleshooting guide | LiveKit Docs | SIP cloud and region pinning | LiveKit Docs
e
Traceback (most recent call last): File "/Users/hiteshgoyal/Desktop/Projects/Experiments/POCs/livekit-calling-bot/worker/agent.py", line 572, in transfer_call await ctx.api.sip.transfer_sip_participant( File "/Users/hiteshgoyal/.pyenv/versions/3.11.9/lib/python3.11/site-packages/livekit/api/sip_service.py", line 436, in transfer_sip_participant return await self._client.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/hiteshgoyal/.pyenv/versions/3.11.9/lib/python3.11/site-packages/livekit/api/twirp_client.py", line 129, in request raise TwirpError( livekit.api.twirp_client.TwirpError: TwirpError(code=canceled, message=twirp error unknown: call transfer failed, status=408) 2025-09-15 210808,527 - __mp_main__ - ERROR - Transfer failed: TwirpError(code=canceled, message=twirp error unknown: call transfer failed, status=408) Traceback (most recent call last): File "/Users/hiteshgoyal/Desktop/Projects/Experiments/POCs/livekit-calling-bot/worker/agent.py", line 572, in transfer_call await ctx.api.sip.transfer_sip_participant( File "/Users/hiteshgoyal/.pyenv/versions/3.11.9/lib/python3.11/site-packages/livekit/api/sip_service.py", line 436, in transfer_sip_participant return await self._client.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/hiteshgoyal/.pyenv/versions/3.11.9/lib/python3.11/site-packages/livekit/api/twirp_client.py", line 129, in request raise TwirpError( livekit.api.twirp_client.TwirpError: TwirpError(code=canceled, message=twirp error unknown: call transfer failed, status=408) 2025-09-15 210808,527 - ERROR __mp_main__ - Transfer failed: TwirpError(code=canceled, message=twirp error unknown: call transfer failed, status=408) Traceback (most recent call last): File "/Users/hiteshgoyal/Desktop/Projects/Experiments/POCs/livekit-calling-bot/worker/agent.py", line 572, in transfer_call await ctx.api.sip.transfer_sip_participant( File "/Users/hiteshgoyal/.pyenv/versions/3.11.9/lib/python3.11/site-packages/livekit/api/sip_service.py", line 436, in transfer_sip_participant return await self._client.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/hiteshgoyal/.pyenv/versions/3.11.9/lib/python3.11/site-packages/livekit/api/twirp_client.py", line 129, in request raise TwirpError( livekit.api.twirp_client.TwirpError: TwirpError(code=canceled, message=twirp error unknown: call transfer failed, status=408) {"pid": 20921, "job_id": "AJ_4CeTdKKuSc5o"}
t
I'd love to help you get to the bottom of the 408 error you're experiencing during the cold transfer. When you have a moment, could you please share a few details with me? • Are you using a specific SIP trunk setup for Indian numbers, and do you have region pinning turned on? • Have you checked that the Indian number is formatted in E.164 style (like
+91XXXXXXXXXX
)? • Is SIP REFER and PSTN transfer enabled on your Twilio trunk? With this information, I'll be better equipped to understand what's going on and help you find the right solution.