You would need to define a new transport, and replace the transport setting for the trunk aor, etc.
I don’t know if there is any better way of doing this than that described in Custom transport in PJSIP, possible from GUI? - #5 by lgaetz (read the whole posting, as it has been edited with an easier way than the one it starts with).