Getting call forwarding data from MySQL

I’m a rank newbie to Asterisk, but wanted to ask here if Asterisk could be used to solve a problem we have here where I work. If it’s relatively easy to set this up, I think setting up an asterisk server would be a pretty easy sell.

Basically, our IT organization is set up into teams that are set up across different geographic locations. This causes problems with contacting oncall support people during off-hours. Either we have to rely on users to look up who is on call and call that person directly or we have to constantly change the forwarding number for the primary oncall number to whoever is on call.

It should be relatively straight-forward to setup an interface to enter an oncall schedule into a database that contains contact information. If we set up a separate oncall number for each team, how difficult would it be to configure Asterisk to use that data for forwarding incoming calls to the oncall person for that team? Also, is it possible to have Asterisk automatically follow a configured escallation list when it gets no answer? Is it possible to get Asterisk to detect an automated answer from an answering machine and treat it as no answer (or even better, get it to leave a message and still continue up the escallation list)?

Ideally, I’d like to configure Asterisk to query MySQL directly to get the call forwarding information, but building automated scripts to update call forwarding information periodically would be ok.

Is this kind of setup possible with Asterisk today or would this be a feature development type of request?