Can you log the number the person dialed to call you?

A firm I work for has multiple 800 #'s pointed at their hunt group and would like to know if they can find out what number was dialed to get to them.

I assume POTS won’t do this. Will a PRI do it? Does the Telco need to put any kind of service on it besides caller ID?

Although I do want the # of the caller I am also interested in the # the caller dialed.

Let’s say I sell a product and I run ads in 3 magazines advertising 3 different 800 #'s. I want to know which 800# was dialed so I know if my ad was effective.

My telephony knowledge is weak so I want to make sure I ask for the right thing when I talk to the telco. My customer and I want to know if Asterisk can log that data if the telco is providing it.

Thank you Walter. I thought DID was only for direct dialing to extensions.