Esempio n. 1
0
def sysconf_command_association_updated(user_line):
    command = {
        'dird': [],
        'ipbx': ['dialplan reload', 'sip reload'],
        'agentbus': [],
        'ctibus': _generate_ctibus_commands(user_line)
    }
    sysconfd_connector.exec_request_handlers(command)
Esempio n. 2
0
def _send_sysconfd_command():
    command_dict = {
        'ctibus': ['xivo[cticonfig,update]'],
        'dird': [],
        'ipbx': [],
        'agentbus': [],
    }
    sysconfd_connector.exec_request_handlers(command_dict)
Esempio n. 3
0
def sysconf_reload_dialplan():
    sysconf_command = {
        'ctibus': [],
        'dird': [],
        'ipbx': ['dialplan reload'],
        'agentbus': []
    }

    sysconfd_connector.exec_request_handlers(sysconf_command)
Esempio n. 4
0
    def test_exec_request_handlers_live_reload_enabled(self, sysconfd_conn_request, is_live_reload_enabled):
        commands = {'ctibus': [],
                    'ipbx': []}
        is_live_reload_enabled.return_value = True

        sysconfd_connector.exec_request_handlers(commands)

        sysconfd_conn_request.assert_any_call('POST', '/exec_request_handlers', commands)
        is_live_reload_enabled.assert_called_once_with()
Esempio n. 5
0
    def test_exec_request_handlers_live_reload_disabled(self, sysconfd_conn_request, is_live_reload_enabled):
        commands = {'ctibus': [],
                    'ipbx': []}
        is_live_reload_enabled.return_value = False

        sysconfd_connector.exec_request_handlers(commands)

        self.assertFalse(sysconfd_conn_request.called)
        is_live_reload_enabled.assert_called_once_with()
Esempio n. 6
0
def send_sysconf_commands(line_extension):
    command = {
        'ctibus': _generate_ctibus_commands(line_extension),
        'dird': [],
        'ipbx': ['dialplan reload', 'sip reload'],
        'agentbus': [],
    }

    sysconfd_connector.exec_request_handlers(command)
Esempio n. 7
0
    def test_exec_request_handlers_live_reload_disabled(
            self, sysconfd_conn_request, is_live_reload_enabled):
        commands = {'ctibus': [], 'ipbx': []}
        is_live_reload_enabled.return_value = False

        sysconfd_connector.exec_request_handlers(commands)

        self.assertFalse(sysconfd_conn_request.called)
        is_live_reload_enabled.assert_called_once_with()
Esempio n. 8
0
def sysconf_reload_dialplan():
    sysconf_command = {
        'ctibus': [],
        'dird': [],
        'ipbx': ['dialplan reload'],
        'agentbus': []
    }

    sysconfd_connector.exec_request_handlers(sysconf_command)
Esempio n. 9
0
def send_sysconf_commands(line_extension):
    command = {
        'ctibus': _generate_ctibus_commands(line_extension),
        'dird': [],
        'ipbx': ['dialplan reload', 'sip reload'],
        'agentbus': [],
    }

    sysconfd_connector.exec_request_handlers(command)
Esempio n. 10
0
    def test_exec_request_handlers_live_reload_enabled(self,
                                                       sysconfd_conn_request,
                                                       is_live_reload_enabled):
        commands = {'ctibus': [], 'ipbx': []}
        is_live_reload_enabled.return_value = True

        sysconfd_connector.exec_request_handlers(commands)

        sysconfd_conn_request.assert_any_call('POST', '/exec_request_handlers',
                                              commands)
        is_live_reload_enabled.assert_called_once_with()
Esempio n. 11
0
def deleted(voicemail):
    data = _new_sysconfd_data('xivo[voicemail,delete,%s]' % voicemail.id)
    sysconfd_connector.exec_request_handlers(data)
    send_bus_command(DeleteVoicemailEvent(voicemail.id))
Esempio n. 12
0
def edited(voicemail):
    data = _new_sysconfd_data('xivo[voicemail,edit,%s]' % voicemail.id)
    sysconfd_connector.exec_request_handlers(data)
    send_bus_command(EditVoicemailEvent(voicemail.id))
Esempio n. 13
0
def deleted(line):
    data = _new_sysconfd_data()
    sysconfd_connector.exec_request_handlers(data)
    send_bus_command(DeleteLineEvent(line.id))
Esempio n. 14
0
def deleted(user):
    data = _new_sysconfd_data('xivo[user,delete,%s]' % user.id)
    sysconfd_connector.exec_request_handlers(data)
    send_bus_command(DeleteUserEvent(user.id))
Esempio n. 15
0
def _send_sysconfd_command(user_cti_profile):
    command_dict = {"ctibus": _generate_cti_commands(user_cti_profile), "dird": [], "ipbx": [], "agentbus": []}
    sysconfd_connector.exec_request_handlers(command_dict)
Esempio n. 16
0
def edited(user):
    data = _new_sysconfd_data('xivo[user,edit,%s]' % user.id)
    sysconfd_connector.exec_request_handlers(data)
    send_bus_command(EditUserEvent(user.id))
Esempio n. 17
0
def deleted(extension):
    sysconfd_connector.exec_request_handlers(sysconfd_base_data)
    send_bus_command(DeleteExtensionEvent(extension.id,
                                          extension.exten,
                                          extension.context))
Esempio n. 18
0
def deleted(user):
    data = _new_sysconfd_data('xivo[user,delete,%s]' % user.id)
    sysconfd_connector.exec_request_handlers(data)
    send_bus_command(DeleteUserEvent(user.id))
Esempio n. 19
0
def edited(user):
    data = _new_sysconfd_data('xivo[user,edit,%s]' % user.id)
    sysconfd_connector.exec_request_handlers(data)
    send_bus_command(EditUserEvent(user.id))