FreePBX/Asterisk missing DID; how to force DID on trunk
If you get a SIP account from a provider which isn’t really a trunk it can be configured as a trunk in FreePBX but DID on incoming calls is set to “s” so it is impossible to get an inbound route working.
The trunk in this case will only have one DID so a workaround is to set the DID “hardcoded” on the trunk in order to get the inbound route working.
Edit extensions_custom.conf and add something like this, but replace “123456789” with the DID you wish to set:
[custom-123456789]
exten => s,1,Noop(Setting DID to 123456789)
exten => s,n,Goto(from-trunk,123456789,1)
Now edit the trunk and go to the pjsip tab and enter custom-123456789 (replacing “123456789” with your DID) in the Context field.
Now all incoming calls in this trunk will get your desired DID and your inbound route will be able to catch them by the DID.