| 102 | savedPeerId = None |
| 103 | |
| 104 | def _loadConfig(): |
| 105 | logger.info('Loading configuration') |
| 106 | global config |
| 107 | conf_file = Path(CONFIG_FILE) |
| 108 | exists = conf_file.exists() |
| 109 | if exists: |
| 110 | logger.info(f'Loading config from: {conf_file}') |
| 111 | with conf_file.open() as infile: |
| 112 | config = yaml.load(infile, Loader=yaml.SafeLoader) |
| 113 | else: |
| 114 | logger.info(f'Config file not found: {conf_file}') |
| 115 | # Set defaults |
| 116 | if config is None: |
| 117 | config = {} |
| 118 | if "signaling_server" not in config.keys(): |
| 119 | config["signaling_server"] = AMBIANIC_PNP_HOST |
| 120 | if "port" not in config.keys(): |
| 121 | config["port"] = AMBIANIC_PNP_PORT |
| 122 | if "secure" not in config.keys(): |
| 123 | config["secure"] = AMBIANIC_PNP_SECURE |
| 124 | if "ice_servers" not in config.keys(): |
| 125 | config["ice_servers"] = default_ice_servers |
| 126 | |
| 127 | return exists |
| 128 | |
| 129 | |
| 130 | def _saveConfig(): |