The DID provider that is giving you a real DID should forward it to your IP gateway.
What I do with voicemaster is the next:
I register my Endpoint with the DID that I want to receive for example 6784603333, then I create a local listener on the voicemaster that is practically a gateway pointing to the loopback interface where the gatekeeper or SIP proxy is running and I add a 999 as a prefix to the incoming DNIS that has been forwarded by my DID provider so the system will route it to that specific listener.
Once my endpoint is registered with the DNIS number the gatekeeper finds it easily and routes the call to the endpoint.
Something has to be configured before, the account has to be set as username, dnis or ani authentication and also I need to put the number of the did in the forward number option of the voicemaster.
For other technologies should be similar, register the endpoint to the gatekeeper with the phone number you want to get it forwarded to and ask your did provider to map the did to the your gatekeeper IP:
When I say map it means that the provider will receive the call from the PSTN and put it on his gateway and point to your gatekeeper.