Rewrite invite - use display name as username


Is it possible to rewrite / replace the username part of the from header to contain the display name instead? Our carrier allows us to trace calls even if they are anonymous (places anonymous in display name and keeps number in username part of URI).

Is there an option in pjsip endpoint to enable rewrite (to avoid leaking the number to endpoints)? Otherwise I only see an option by rewriting using dialplan but there are a lot of cases to be checked for, which IMHO is complicated to script in extension-context.

Thank you!