Hi, in your dialplan, -extensions.conf, if you are from scratch- You need to define the
authenticate application, then if it exist make the call.
If you want to use a database then with Agi script is the solution.
If you are using one of freepbx based gui, you need to define a Pinset and then in your outbound route select that pinset.