Issue
When using Twilio SIP Domains with SIP desk phones (such as Yealink), organizations often want internal calls to display a user-friendly name or extension (e.g., “100-Adam”) rather than a generic phone number. This article explains how Twilio handles caller ID for internal SIP-to-SIP calls and how to configure your system so that the correct information appears on the receiving phone.
By default, when making internal calls between SIP endpoints registered to a Twilio SIP Domain, the receiving phone may display the caller’s phone number (E.164 format) instead of the SIP username or a custom directory name. This can make it difficult for users to identify internal callers by name or extension.
Product
Programmable Voice
Environment
Twilio Console
Cause
This behavior is typically caused by the use of the callerId attribute in the TwiML <Dial> verb. When callerId is set to a phone number, Twilio uses this value in the SIP From header, which is then displayed by the receiving phone.
Resolution
To have the receiving phone display the SIP username (which can be mapped to a friendly name in the phone’s directory), follow these steps:
- Remove the
callerIdattribute from the<Dial>verb in your TwiML for internal SIP-to-SIP calls. - Ensure your SIP phones’ directories are configured to map SIP usernames (e.g., “100”) to the desired display names (e.g., “100-Adam”).
- Test internal calls to confirm that the correct name or extension appears on the receiving phone.
Example TwiML for Internal SIP Call
<Response>
<Dial>
<Sip>sip:101@yourdomain.sip.twilio.com</Sip>
</Dial>
</Response>Do not include the callerId attribute for internal calls.
Troubleshooting
- If the expected name does not appear, verify that the SIP username matches the entry in the phone’s directory.
- Check your TwiML configuration to ensure
callerIdis not set for internal calls. - Review SIP logs to confirm the correct
Fromheader is being sent.
Additional Information
To display user-friendly names or extensions for internal SIP calls on Twilio SIP Domains, avoid setting the callerId attribute in your TwiML <Dial> verb. This allows the SIP username to be used, enabling the receiving phone to match it to a local directory entry and display the desired name.
- For calls to the PSTN (external phone numbers), you may still want to set
callerIdto a valid E.164 number. - The display name shown on the receiving phone depends on both the SIP headers sent by Twilio and the local directory configuration on the phone.