In the 3CX UI > Gateway or VOIP Provider and click on the line number / DID number you want to send to VM. You will now have the routing options for that number. Choose the 'Voicemail box for extension' option. Choose the extension VM you wish the call to go to. Then click Apply and OK.
You need to create a forwarding rule for your extension. You can create these from the admin UI or via the /myphone interface for your extension. You can then create a forwarding rule based on the caller ID string.