Skip to main content
 
Field Guides

Preserve caller ID during SIP transfers with Twilio

Configure your Twilio SIP trunk so LiveKit Agents keep the original caller ID during cold transfers.

Last Updated:


LiveKit Agents pass caller ID along during a REFER transfer, but your SIP trunk provider ultimately decides what number shows up on the PSTN leg. You need a trunk feature that forwards the original caller ID instead of rewriting it to the trunk or agent DID. Twilio is one example of a provider that exposes this as a configurable setting.

Enable transfers on the SIP trunk

Check your carrier’s documentation for call-transfer support and caller-ID preservation. In Twilio, the SIP trunk console or CLI lets you enable both call transfer and PSTN transfer support on the trunk that points to LiveKit. Without comparable settings, any provider will rewrite caller ID to whatever number they consider canonical for the trunk.

Choose which number the provider presents

When the provider offers caller-ID selection, pick which party’s number is shown. In Twilio the options are:

  • from-transferee: Shows the original caller’s PSTN number to the destination.
  • from-transferor: Shows the phone number assigned to your LiveKit-managed trunk (your agent’s DID).

Use the CLI to enable transfers and opt into the caller ID you prefer. The Twilio example below preserves the caller’s original number:

twilio api trunking v1 trunks update --sid <twilio-trunk-sid> \
--transfer-mode enable-all \
--transfer-caller-id from-transferee

List your trunks with twilio api trunking v1 trunks list if you need to look up the SID. Swap from-transferee for from-transferor when you want recipients to see the agent or trunk number instead. For other carriers, look for equivalent flags or API fields—most label them “caller ID pass-through,” “presentation number,” or similar.

Verify behavior inside LiveKit Agents

  • Place a PSTN call through the trunk, answer with a LiveKit Agent, then initiate a cold transfer inside your workflow.
  • Inspect the Twilio Call Inspector or your downstream SIP logs to confirm the From header matches the caller ID setting you chose.
  • If the wrong number shows up, double-check that the transfer mode is enabled on the same trunk your Agent uses and that no downstream SBC rewrites headers.

Once the trunk is configured, no additional Agent settings are required—LiveKit always forwards the caller ID it receives, so Twilio’s trunk-level policy is the source of truth.