Exemple #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)
Exemple #2
0
def _send_sysconfd_command():
    command_dict = {
        'ctibus': ['xivo[cticonfig,update]'],
        'dird': [],
        'ipbx': [],
        'agentbus': [],
    }
    sysconfd_connector.exec_request_handlers(command_dict)
Exemple #3
0
def sysconf_reload_dialplan():
    sysconf_command = {
        'ctibus': [],
        'dird': [],
        'ipbx': ['dialplan reload'],
        'agentbus': []
    }

    sysconfd_connector.exec_request_handlers(sysconf_command)
    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()
    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()
Exemple #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)
Exemple #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()
Exemple #8
0
def sysconf_reload_dialplan():
    sysconf_command = {
        'ctibus': [],
        'dird': [],
        'ipbx': ['dialplan reload'],
        'agentbus': []
    }

    sysconfd_connector.exec_request_handlers(sysconf_command)
Exemple #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)
Exemple #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()
Exemple #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))
Exemple #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))
Exemple #13
0
def deleted(line):
    data = _new_sysconfd_data()
    sysconfd_connector.exec_request_handlers(data)
    send_bus_command(DeleteLineEvent(line.id))
Exemple #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))
Exemple #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)
Exemple #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))
Exemple #17
0
def deleted(extension):
    sysconfd_connector.exec_request_handlers(sysconfd_base_data)
    send_bus_command(DeleteExtensionEvent(extension.id,
                                          extension.exten,
                                          extension.context))
Exemple #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))
Exemple #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))