Very often you need to transform the inbound numbers to E.164 format.
Or you need to transform the outbound numbers to whatever the PSTN providers require.
Go to Inbound and Outbound Message Manipulations. The hardest part here is to create a precise match of the DID numbers, so that you do not affect more calls than the one you need. There are few links below to help with the DID manipulation:
-The SIP Dialog flow provides info when the In-Outbound Number Manipulation is triggered.
-The Parameter Description article gives more details for the parameters in the Message Manipulations.
-The Regex patterns link can help creating the DID number pattern.