PIN code for outgoing calls

I want to give each user on my asterisk based IP-PBX a pin code to make its calls to the PSTN. That is to restrict the outgoing calls by user code and not by extension. How can I do this?

Thanks in advance

hi

use authenticate() uin your dialplan.

voip-info.org/tiki-index.php … thenticate

Thank you very much. It works.