Simple Call Accounting
I work for an engineering firm and we have a couple thousand account codes for various projects. I would like to implement call accounting but cannot create pin sets because of the large number of existing account codes. Basically I need to have the dial plan prompt certain extensions for an account code followed by the # key after they dial the number they want and have that code put in the accountcode field in the CDR record. I don't need to verify that it is the correct code, and the user should be able to hit # without entering any number if they choose. Any help is appreciated.
Glenn

Sorry, I kept seeing this
Sorry, I kept seeing this but didn't get to answering it for you.
Try this:
Open up /etc/asterisk/extensions.conf
Go down to the section
[macro-dialout-trunk]
look for the entry:
exten => s,n,GotoIf($["${custom}" = "AMP"]?customtrunk)
exten => s,n,Dial(${OUT_${DIAL_TRUNK}}/${OUTNUM},300,${DIAL_TRUNK_OPTIONS})
BETWEEN those two lines, insert the code below
exten => s,n,Playback(please-enter-the&accounting)
exten => s,n,Read(account|number|3)
exten => s,n,SetAccount(${account})
I have it set up for max 3 digits (you can change the 3 to any number or just remove |3 for no maximum)
You can just press # to get through.
Try it out, let me know. The data should show up in the ACCOUNTCODE column in the CDR table.
Its VERY easy to change that to look at a generic text file of numbers to IF you want to make sure they are coded to something that is actually a valid account number.