def ensure_fs_external_bound_to_vpn(): # Make sure that we're bound to the VPN IP on the external sofia profile, # assuming the VPN is up. vpn_ip = system_utilities.get_vpn_ip() if not vpn_ip: return external_profile_ip = system_utilities.get_fs_profile_ip('external') if external_profile_ip != vpn_ip: # TODO: treat these as netaddr, not string logger.warning('external profile should be bound to VPN IP and isn\'t,' ' restarting FS.') Service.SystemService('freeswitch').restart()
def test_openbts(self): """We can get data for the 'openbts' profile.""" self.assertEqual('127.0.0.1', get_fs_profile_ip('openbts'))
def test_external(self): """We can get data for the 'external' profile.""" self.assertEqual('10.64.0.38', get_fs_profile_ip('external'))