Hi,
you can use a 2821 or 2851 for this. The router comes with a feature called CCME that does a really complete IP PBX.
http://www.cisco.com/en/US/products/sw/voicesw/ps4625/index.html
Note, you will also need a 48-ports switch, suggest you get a 3560 or 3750 with PoE support so you don't need the power supply for the phones that.
Also very important, please do not use regulat phone lines that can give problems and lack features, ask you telco about ISDN BRI or PRI, that is the best way to do telephony with the router.
Hope this helps, please rate post if it does!