def synchronize(self, device, raw_config): device_name = 'SEP' + format_mac(device[u'mac'], separator='', uppercase=True).encode('ascii') sync_service = synchronize.get_sync_service() if sync_service is None or sync_service.TYPE != 'AsteriskAMI': return defer.fail(Exception('Incompatible sync service: %s' % sync_service)) else: return threads.deferToThread(sync_service.sccp_reset, device_name)
def synchronize(self, device, raw_config): try: ip = device[u'ip'].encode('ascii') except KeyError: return defer.fail(Exception('IP address needed for device synchronization')) else: sync_service = synchronize.get_sync_service() if sync_service is None or sync_service.TYPE != 'AsteriskAMI': return defer.fail(Exception('Incompatible sync service: %s' % sync_service)) else: return threads.deferToThread(sync_service.sip_notify, ip, 'check-sync')
def synchronize(self, device, raw_config): try: ip = device[u"ip"].encode("ascii") except KeyError: return defer.fail(Exception("IP address needed for device synchronization")) else: sync_service = synchronize.get_sync_service() if sync_service is None or sync_service.TYPE != "AsteriskAMI": return defer.fail(Exception("Incompatible sync service: %s" % sync_service)) else: return threads.deferToThread(sync_service.sip_notify, ip, "check-sync;reboot=true")