Getting the number that was dialed

Is there a way to get the number that someone dials when calling an office with asterisk setup.

We are running a call center and there are many 800 numbers that are set up for different campaigns. Is there a way to know which 800 number was dialed?

Sure. On the inbound call you can append the caller ID name with like a prefix such as:

Exten => 8005551212,1,Answer
Exten => 8005551212,2,Set(CALLERID(name)= AA - ${CALLERID(NAME)})
................

This would append the caller ID name and add "AA - " to the beginning of it.