fixed dynamic endpoints port calculation
Merge pull request #996 from control-center/feature/CC-122-1

fixed dynamic endpoints port calculation