Пример #1
0
    def test_device_with_remote_state_sip_username(self):
        device = {
            u'id': u'a',
            u'remote_state_sip_username': u'foobar',
        }

        yield synchronize.standard_sip_synchronize(device)

        self.sync_service.sip_notify_by_peer.assert_called_once_with(
            u'foobar', 'check-sync', None)
Пример #2
0
    def test_empty_device(self):
        device = {
            u'id': u'a',
        }

        try:
            yield synchronize.standard_sip_synchronize(device)
        except synchronize.SynchronizeException:
            pass
        else:
            self.fail('Exception should have been raised')
Пример #3
0
    def test_no_sync_service(self):
        synchronize._SYNC_SERVICE = None
        device = {
            u'id': u'a',
        }

        try:
            yield synchronize.standard_sip_synchronize(device)
        except synchronize.SynchronizeException:
            pass
        else:
            self.fail('Exception should have been raised')
Пример #4
0
 def synchronize(self, device, raw_config):
     try:
         action = [
             'Content-type=text/plain',
             'Content=action=restart',  # restart unregisters and redownloads config files from the server, reset unregisters and reboots the phone
             'Content=RegisterCallId={}',
             'Content=ConfigVersionStamp={0000000000000000}',
             'Content=DialplanVersionStamp={0000000000000000}',
             'Content=SoftkeyVersionStamp={0000000000000000}',
         ]
         return synchronize.standard_sip_synchronize(
             device, event='service-control', extra_vars=action)
     except TypeError:  # xivo-provd not up to date for extra_vars
         return defer.fail(
             Exception(
                 'operation not supported, please update your xivo-provd'))
Пример #5
0
 def synchronize(self, device, raw_config):
     return synchronize.standard_sip_synchronize(device)
Пример #6
0
 def synchronize(self, device, raw_config):
     return synchronize.standard_sip_synchronize(device)
Пример #7
0
 def synchronize(self, device, raw_config):
     return synchronize.standard_sip_synchronize(
         device, event='check-sync;reboot=true')
Пример #8
0
 def synchronize(self, device, raw_config):
     return synchronize.standard_sip_synchronize(device, event='check-sync;reboot=true')