Arme,
If you are seeing "mod_sofia" on the screen of the phone there is something else wrong here. Yealink's documentation on Caller ID says nothing about the contact header. See page 286 of
http://www.yealink.com/Upload/T4X/Yealink_SIP-T46G_IP_Phone_Administrator_Guide_V71_60.pdfThe only headers it can be configured to look at for Caller ID are From, PAI, and RPID. It has support for looking at those headers in a preference order depending on which headers are present. I suggest option 4 (PAI-RPID-FROM). PAI is part of the official SIP standard and as part of it's spec it overrides the From header. RPID was a proposal to the SIP standard that was never accepted into the official standard.
FYI "mod_sofia" is in the user part of the Contact URI.
The Yealink phone would display the "Display Name" portion of the URI and maybe the User portion when the "Display Name" is present in the URI of the header it finds (PAI, RPID, FROM). If the "Display Name" is not present it will use the User portion of the URI.
P-Asserted-Identity: "Cullen Jennings" <sip:flu...@cisco.com>The Display Name portion is "Cullen Jennings". That is all about the Caller ID.
As far as the Callee ID, I don't see anything in the admin guide but It would be using either it's own display name, the user portion of the Request URI, or possibly the user portion of To header.
The default way kazoo has FreeSwitch send the call the user part of the Request URI and To headers is the username of the device. You can change it to e164 or NPA. I'm not sure what would happen when the original dialed number was by a local user dialing like a 4 digit extension.
There is a way to set the user portion of the contact header. Example:
The example that you provided just sets the RURI from the destination user's registered contact. But based on the documentation for the sofia_contact function it would not work the way it is on a regular FS installation. I believe with the kazoo setup FS does not handle any registration stuff. So anything like that would have to be done in the kazoo erlang code. But pretty sure that is not needed for this problem.
Hope this helps. :)