How an IP Phone system works
A VoIP phone system generally consists of the IP PBX server (SIP server), one or more SIP based IP Phones and a VoIP / PSTN gateway or a SIP Trunk / VoIP service provider. The SIP IP Phones, being either softphones or hardware based phones, register with the IP PBX server.
When they wish to make a call they ask the IP PBX to establish the connection. The IP PBX has a directory of all phones/users and their corresponding SIP address, and connects an internal call or routes an external call via either a VoIP / PSTN gateway or a VoIP service provider.