Simple Number Pointing

Hi all

I am trying to setup an asterisk server as a simple number pointing system.

I will have a range of inbound DID’s from a provider being pointed at my server and I simply want to be able to control what the asterisk server does with the inbound calls from a database.

Basically I want a mysql database with a database called say aserisk and 1 firlds one being the DID and the other being a dialstring

So basically i store in the database

5554214,sip/5554212@123.123.333.444

and when a call comes into the asterisk server it sends the call out to the dialstring defined in the database.

Is this possible to do with asterisk as it stands or would there need to be a small script written to achieve this?

Any ideas would be appreciated.

Regards