sipXproxy is able to add an Alert-Info Header to SIP INVITE Messages to tell phones to play a different ring tone for internal and external calls. By default this feature is enabled and your Proxy should look like this:
This proxy plugin looks at the FROM-Header and checks if the from domain is equal to the SIP Domain of the sipXcom system. If calls are not from the SIP domain, calls from a Gateway or Session Border Controller are thus detected as external calls.
Some phones use the information of the FROM-Header to fill their call history (e.g. Yealink T4x-Series). In this special case the phones (on re-dial from the phone) may try to call directly via the gateway and fail due to security settings.
To get this working it is necessary to set the SIP Domain inside the FROM-Header, which would otherwise break the Alert-Info detection.
An alternative way to mark this calls as external is to set an extra parameter in the SBC or Gateway in the FROM-Header which is called "x-sipx-alert-info=external".
You can add this tag or the Alert-Info Header directly in your gateway. For example, in a Patton Gateway you can't add a customer header but you can modify the FROM:
If your devices are configured this way, the INVITE Message that your Phone will receive will look more or less like the following and the phone will play a different ring tone for external vs. internal calls.