Passwords for long distance with reporting

Is there any way I can require a password for users to dail external phone numbers except those begining with a certain few area codes that I explicitly allow?

If this is possible, is there away I can view the number and duration of calls per password (user) to these “long distance” area codes?

sure. For your outgoing call context,

exten => _1123NXXXXXX,1,Dial(trunk/${EXTEN})
replace 123 with your area code, repeat as needed

for everything else (_1NXXNXXXXXX), setup a script that first authenticates them (perhaps using Authenticate, VMAuthenticate or any one of a few other scripts available on the voip-info.org Wiki)
sets their CDR accountcode to their password (as above), then dials.

Your CDR records will contain records of the calls, and you can identify them based on accountcode.

Excellent, thank you. I am going to have to read up on scripting. Thanks!

FYI- the ‘script’ you want is the dialplan. Wiki for asterisk config extensions.conf; asterisk variables, and (i think) asterisk dialplan patterns. Also asterisk cmd authenticate.