A VoIP gateway acts as an interface between a public switched telephone network (PSTN) and an IP network, converting voice and fax calls between the two in real time. Key functions include voice and fax compression/decompression, packetization, and call routing. There are analog gateways for connecting PSTN lines to VoIP systems and digital gateways for connecting PBX systems. When selecting a gateway, factors to consider include call load, supported protocols and compatibility, and cost.