Patent ID: 7068646

Claim:
A method for performing IP telephony, comprising: registering a first Media Gateway with a Media Gateway Controller, wherein said registering the first Media Gateway comprises receiving and storing the public IP address of the first Media Gateway; registering a second Media Gateway with the Media Gateway Controller, wherein said registering the second Media Gateway comprises receiving and storing the public IP address of the second Media Gateway; the Media Gateway Controller receiving a Call Setup request, wherein the Call Setup request comprises a source IP address and a destination telephone number; the Media Gateway Controller selecting the first Media Gateway based on the source IP address; the Media Gateway Controller selecting the second Media Gateway based on the destination telephone number; the Media Gateway Controller comparing a public IP address of the first Media Gateway to a public IP address of the second Media Gateway; if the public IP address of the first Media Gateway is the same as the public IP address of the second Media Gateway, the Media Gateway Controller selecting a private IP address of the first Media Gateway and a private IP address of the second Media Gateway for Call Setup; and if the public IP address of the first Media Gateway is not the same as the public IP address of the second Media Gateway, the Media Gateway Controller selecting the public IP address of the first Media Gateway and the public IP address of the second Media Gateway for Call Setup.