Hi,
Do you need to install just a free gateway or a AAA server for the VoIP too (and the VoIP will be paid in the last case)??
There are a lot of hardware and software for these purposes. As a VoIP gatekeeper I could suggest Asterisk or GNUGK or OpenSER, that's up to you.
As an example, setting up GNUGK can be found in this
manual, page 226. Also you will find there how to set up GNUGK with a RADIUS server for AAA (authentication, authorization and accounting).