Hmmm not sure I understand what you are explaining
Ports 50,000-59,999 are used by the OCS AV EDGE Server (remote users on the internet)
When integrating with a PBX you must connect your PBX or Gateway to the Mediation Server
So what is your scenario?