If you want the user to dial e.g. 900234 and 234 should be sent to the Valcom trunk, set up your Outbound Route:
prefix: 900
match pattern: X.
If you want the user to dial 900, hear dialtone from the Valcom and then dial the required code, set your Outbound Route with match pattern 900 and set the dial plan in the Grandstream to replace 900 with an empty string. Some FXO devices won’t allow an empty string, so try replacing 900 with ‘a’ (without the quotes).
If these are not what you want, please ask a more specific question with examples of desired behavior. Also post model numbers of Grandstream and Valcom devices.
What do you mean by ‘hookflash’ in this context?