SIP Trunking - Server

How would one go about setting up their own SIP Trunking service/server instead of having to go through a VOIP/SIP provider to connect to the PSTN/ISDN?

EDIT: In terms of the this, what type of equipment and connections would one have to have?

Thank you in advanced for any information that can be provided. Thank you.