Пример #1
0
def register_events():
    callback_handler = AMICallbackHandler.get_instance()
    callback_handler.register_callback('Join', parse_join)
    callback_handler.register_callback('Leave', parse_leave)
    callback_handler.register_callback('QueueEntry', parse_queue_entry)
    callback_handler.register_callback('QueueParams', parse_queue_params)
    callback_handler.register_callback('QueueStatusComplete', parse_queue_status_complete)
Пример #2
0
def register_events():
    callback_handler = AMICallbackHandler.get_instance()
    callback_handler.register_callback('QueueCallerJoin', parse_join)
    callback_handler.register_callback('QueueCallerLeave', parse_leave)
    callback_handler.register_callback('QueueEntry', parse_queue_entry)
    callback_handler.register_callback('QueueParams', parse_queue_params)
    callback_handler.register_callback('QueueStatusComplete', parse_queue_status_complete)
Пример #3
0
def setup():
    context.register('ami_18', AMI_1_8)
    context.register('ami_callback_handler', AMICallbackHandler.get_instance())
    context.register('ami_class', AMIClass)
    context.register('agent_availability_computer', AgentAvailabilityComputer)
    context.register('agent_availability_notifier', AgentAvailabilityNotifier)
    context.register('agent_availability_updater', AgentAvailabilityUpdater)
    context.register('agent_client', AgentClient)
    context.register('agent_executor', AgentExecutor)
    context.register('agent_service_cti_parser', AgentServiceCTIParser)
    context.register('agent_service_manager', AgentServiceManager)
    context.register('agent_status_adapter', AgentStatusAdapter)
    context.register('agent_status_manager', AgentStatusManager)
    context.register('agent_status_parser', AgentStatusParser)
    context.register('agent_status_router', AgentStatusRouter)
    context.register('bus_producer', BusProducer)
    context.register('call_form_dispatch_filter', DispatchFilter)
    context.register('call_form_result_handler', CallFormResultHandler)
    context.register('call_form_variable_aggregator', VariableAggregator)
    context.register('call_notifier', CallNotifier)
    context.register('call_receiver', CallReceiver)
    context.register('call_storage', CallStorage)
    context.register('call_manager', CallManager)
    context.register('channel_updater', ChannelUpdater)
    context.register('cti_server', CTIServer)
    context.register('current_call_formatter', CurrentCallFormatter)
    context.register('current_call_manager', CurrentCallManager)
    context.register('current_call_notifier', CurrentCallNotifier)
    context.register('current_call_parser', CurrentCallParser)
    context.register('delta_computer', DeltaComputer)
    context.register('device_manager', DeviceManager)
    context.register('async_dird_client', AsyncDirdClient)
    context.register('endpoint_notifier', EndpointNotifier)
    context.register('funckey_manager', FunckeyManager)
    context.register('innerdata', Safe)
    context.register('interface_ami', AMI)
    context.register('meetme_service_manager', MeetmeServiceManager)
    context.register('meetme_service_notifier', MeetmeServiceNotifier)
    context.register('people_cti_adapter', PeopleCTIAdapter)
    context.register('presence_service_executor', PresenceServiceExecutor)
    context.register('presence_service_manager', PresenceServiceManager)
    context.register('pubsub', Pubsub)
    context.register('queue_entry_encoder', QueueEntryEncoder)
    context.register('queue_entry_manager', QueueEntryManager)
    context.register('queue_entry_notifier', QueueEntryNotifier)
    context.register('queue_statistics_manager', QueueStatisticsManager)
    context.register('queue_statistics_producer', QueueStatisticsProducer)
    context.register('queue_member_cti_subscriber', QueueMemberCTISubscriber)
    context.register('queue_member_cti_adapter', QueueMemberCTIAdapter)
    context.register('queue_member_indexer', QueueMemberIndexer)
    context.register('queue_member_manager', QueueMemberManager)
    context.register('queue_member_notifier', QueueMemberNotifier)
    context.register('queue_member_updater', QueueMemberUpdater)
    context.register('statistics_notifier', StatisticsNotifier)
    context.register('statistics_producer_initializer', StatisticsProducerInitializer)
    context.register('task_queue', new_task_queue)
    context.register('task_scheduler', new_task_scheduler)
    context.register('user_service_manager', UserServiceManager)
    context.register('user_service_notifier', UserServiceNotifier)
Пример #4
0
 def init_connection(self):
     AMIAgentLoginLogoff.register_callbacks()
     ami_agent_login_logoff = AMIAgentLoginLogoff.get_instance()
     ami_agent_login_logoff.queue_statistics_producer = self._ctiserver._queue_statistics_producer
     ami_agent_login_logoff.innerdata_dao = dao.innerdata
     self._ami_initializer = AMIInitializer()
     self._ami_initializer._ami_class = self.amiclass
     self._ami_initializer._ami_callback_handler = AMICallbackHandler.get_instance(
     )
Пример #5
0
def register_events():
    callback_handler = AMICallbackHandler.get_instance()
    callback_handler.register_callback('QueueMemberStatus',
                                       parse_queue_member_status)
    callback_handler.register_callback('QueueMemberAdded',
                                       parse_queue_member_status)
    callback_handler.register_callback('QueueMemberRemoved',
                                       parse_queue_member_status)
    callback_handler.register_callback('QueueMemberPaused',
                                       parse_queue_member_status)
Пример #6
0
 def init_connection(self):
     ami_logger.AMILogger.register_callbacks()
     ami_event_complete_logger.AMIEventCompleteLogger.register_callbacks()
     ami_status_request_logger.AMIStatusRequestLogger.register_callbacks()
     AMIAgentLoginLogoff.register_callbacks()
     ami_agent_login_logoff = AMIAgentLoginLogoff.get_instance()
     ami_agent_login_logoff.queue_statistics_producer = self._ctiserver._queue_statistics_producer
     ami_agent_login_logoff.innerdata_dao = dao.innerdata
     self._ami_initializer = AMIInitializer()
     self._ami_initializer._ami_class = self.amiclass
     self._ami_initializer._ami_callback_handler = AMICallbackHandler.get_instance()
Пример #7
0
 def init_connection(self):
     ami_logger.AMILogger.register_callbacks()
     ami_event_complete_logger.AMIEventCompleteLogger.register_callbacks()
     ami_status_request_logger.AMIStatusRequestLogger.register_callbacks()
     AMIAgentLoginLogoff.register_callbacks()
     ami_agent_login_logoff = AMIAgentLoginLogoff.get_instance()
     ami_agent_login_logoff.queue_statistics_producer = self._ctiserver._queue_statistics_producer
     ami_agent_login_logoff.innerdata_dao = dao.innerdata
     self._ami_initializer = AMIInitializer()
     self._ami_initializer._ami_class = self.amiclass
     self._ami_initializer._ami_callback_handler = AMICallbackHandler.get_instance()
def register_events():
    callback_handler = AMICallbackHandler.get_instance()
    callback_handler.register_callback('QueueSummary', parse_queue_summary)
def register_events():
    callback_handler = AMICallbackHandler.get_instance()
    callback_handler.register_callback('QueueMemberStatus', parse_queue_member_status)
    callback_handler.register_callback('QueueMemberAdded', parse_queue_member_status)
    callback_handler.register_callback('QueueMemberRemoved', parse_queue_member_status)
    callback_handler.register_callback('QueueMemberPaused', parse_queue_member_status)
def register_events():
    callback_handler = AMICallbackHandler.get_instance()
    callback_handler.register_callback('QueueSummary', parse_queue_summary)
Пример #11
0
def setup():
    bus_cfg_dict = dict(config['bus'])
    bus_cfg_dict.pop('routing_keys')
    bus_cfg = BusConfig(**bus_cfg_dict)

    context.register('ami_18', AMI_1_8)
    context.register('ami_callback_handler', AMICallbackHandler.get_instance())
    context.register('ami_class', AMIClass)
    context.register('agent_availability_computer', AgentAvailabilityComputer)
    context.register('agent_availability_notifier', AgentAvailabilityNotifier)
    context.register('agent_availability_updater', AgentAvailabilityUpdater)
    context.register('agent_client', AgentClient(config=bus_cfg))
    context.register('agent_executor', AgentExecutor)
    context.register('agent_service_cti_parser', AgentServiceCTIParser)
    context.register('agent_service_manager', AgentServiceManager)
    context.register('agent_status_adapter', AgentStatusAdapter)
    context.register('agent_status_manager', AgentStatusManager)
    context.register('agent_status_parser', AgentStatusParser)
    context.register('agent_status_router', AgentStatusRouter)
    context.register('broadcast_cti_group', new_broadcast_cti_group)
    context.register('bus_producer', BusProducer(bus_cfg))
    context.register('call_form_dispatch_filter', DispatchFilter)
    context.register('call_form_result_handler', CallFormResultHandler)
    context.register('call_form_variable_aggregator', VariableAggregator)
    context.register('call_notifier', CallNotifier)
    context.register('call_receiver', CallReceiver)
    context.register('call_storage', CallStorage)
    context.register('call_manager', CallManager)
    context.register('channel_updater', ChannelUpdater)
    context.register('cti_group_factory', CTIGroupFactory)
    context.register('cti_msg_codec', CTIMessageCodec)
    context.register('cti_server', CTIServer)
    context.register('current_call_formatter', CurrentCallFormatter)
    context.register('current_call_manager', CurrentCallManager)
    context.register('current_call_notifier', CurrentCallNotifier)
    context.register('current_call_parser', CurrentCallParser)
    context.register('delta_computer', DeltaComputer)
    context.register('device_manager', DeviceManager)
    context.register('endpoint_status_notifier', EndpointStatusNotifier)
    context.register('endpoint_status_updater', EndpointStatusUpdater)
    context.register('async_dird_client', AsyncDirdClient)
    context.register('endpoint_notifier', EndpointNotifier)
    context.register('flusher', Flusher)
    context.register('funckey_manager', FunckeyManager)
    context.register('innerdata', Safe)
    context.register('interface_ami', AMI)
    context.register('meetme_service_manager', MeetmeServiceManager)
    context.register('meetme_service_notifier', MeetmeServiceNotifier)
    context.register('people_cti_adapter', PeopleCTIAdapter)
    context.register('presence_service_executor', PresenceServiceExecutor)
    context.register('presence_service_manager', PresenceServiceManager)
    context.register('pubsub', Pubsub)
    context.register('queue_entry_encoder', QueueEntryEncoder)
    context.register('queue_entry_manager', QueueEntryManager)
    context.register('queue_entry_notifier', QueueEntryNotifier)
    context.register('queue_statistics_manager', QueueStatisticsManager)
    context.register('queue_statistics_producer', QueueStatisticsProducer)
    context.register('queue_member_cti_subscriber', QueueMemberCTISubscriber)
    context.register('queue_member_cti_adapter', QueueMemberCTIAdapter)
    context.register('queue_member_indexer', QueueMemberIndexer)
    context.register('queue_member_manager', QueueMemberManager)
    context.register('queue_member_notifier', QueueMemberNotifier)
    context.register('queue_member_updater', QueueMemberUpdater)
    context.register('statistics_notifier', StatisticsNotifier)
    context.register('statistics_producer_initializer',
                     StatisticsProducerInitializer)
    context.register('task_queue', new_task_queue)
    context.register('task_scheduler', new_task_scheduler)
    context.register('user_service_manager', UserServiceManager)
    context.register('user_service_notifier', UserServiceNotifier)
Пример #12
0
def setup(xivo_uuid):
    auth_client = new_auth_client()

    bus_url = 'amqp://{username}:{password}@{host}:{port}//'.format(**config['bus'])
    bus_connection = Connection(bus_url)
    bus_exchange = Exchange(config['bus']['exchange_name'],
                            type=config['bus']['exchange_type'])
    bus_producer = Producer(bus_connection, exchange=bus_exchange, auto_declare=True)
    bus_marshaler = Marshaler(xivo_uuid)
    bus_publisher = Publisher(bus_producer, bus_marshaler)
    bus_listener = BusListener(bus_connection, bus_exchange)

    same_exchange_arguments_as_collectd = {'arguments': {'auto_delete': True}, 'durable': False}
    collectd_exchange = Exchange('collectd', type=config['bus']['exchange_type'], **same_exchange_arguments_as_collectd)
    collectd_producer = Producer(bus_connection, exchange=collectd_exchange, auto_declare=True)
    collectd_marshaler = CollectdMarshaler(xivo_uuid)
    collectd_publisher = Publisher(collectd_producer, collectd_marshaler)

    remote_service_tracker = RemoteServiceTracker(config['consul'],
                                                  xivo_uuid,
                                                  config['rest_api']['http']['port'])

    thread_pool_executor = futures.ThreadPoolExecutor(max_workers=10)

    context.register('ami_18', AMI_1_8)
    context.register('ami_callback_handler', AMICallbackHandler.get_instance())
    context.register('ami_class', AMIClass)
    context.register('agent_availability_computer', AgentAvailabilityComputer)
    context.register('agent_availability_notifier', AgentAvailabilityNotifier)
    context.register('agent_availability_updater', AgentAvailabilityUpdater)
    context.register('agent_executor', AgentExecutor)
    context.register('agent_service_cti_parser', AgentServiceCTIParser)
    context.register('agent_service_manager', AgentServiceManager)
    context.register('agent_status_adapter', AgentStatusAdapter)
    context.register('agent_status_manager', AgentStatusManager)
    context.register('agent_status_parser', AgentStatusParser)
    context.register('agent_status_router', AgentStatusRouter)
    context.register('async_runner', AsyncRunner)
    context.register('agentd_client', AgentdClient(**config['agentd']))
    context.register('bridge_manager', BridgeManager)
    context.register('bridge_updater', BridgeUpdater)
    context.register('bridge_notifier', BridgeNotifier)
    context.register('bus_connection', bus_connection)
    context.register('bus_exchange', lambda: bus_exchange)
    context.register('bus_listener', bus_listener)
    context.register('bus_publisher', bus_publisher)
    context.register('broadcast_cti_group', new_broadcast_cti_group)
    context.register('cache_updater', CacheUpdater)
    context.register('call_form_dispatch_filter', DispatchFilter)
    context.register('call_form_result_handler', CallFormResultHandler)
    context.register('call_form_variable_aggregator', VariableAggregator)
    context.register('call_pickup_tracker', CallPickupTracker)
    context.register('call_notifier', CallNotifier)
    context.register('call_receiver', CallReceiver)
    context.register('call_storage', CallStorage)
    context.register('call_manager', CallManager)
    context.register('chat_publisher', ChatPublisher)
    context.register('channel_updater', ChannelUpdater)
    context.register('collectd_publisher', collectd_publisher)
    context.register('confd_client', ConfdClient(**config['confd']))
    context.register('cti_group_factory', CTIGroupFactory)
    context.register('cti_msg_codec', CTIMessageCodec)
    context.register('cti_provd_client', CTIProvdClient.new_from_config(config['provd']))
    context.register('cti_server', CTIServer)
    context.register('current_call_formatter', CurrentCallFormatter)
    context.register('current_call_manager', CurrentCallManager)
    context.register('current_call_notifier', CurrentCallNotifier)
    context.register('current_call_parser', CurrentCallParser)
    context.register('delta_computer', DeltaComputer)
    context.register('device_manager', DeviceManager)
    context.register('endpoint_status_notifier', EndpointStatusNotifier)
    context.register('endpoint_status_updater', EndpointStatusUpdater)
    context.register('endpoint_notifier', EndpointNotifier)
    context.register('flusher', Flusher)
    context.register('funckey_manager', FunckeyManager)
    context.register('innerdata', Safe)
    context.register('interface_ami', AMI)
    context.register('main_thread_proxy', MainThreadProxy)
    context.register('meetme_service_manager', MeetmeServiceManager)
    context.register('meetme_service_notifier', MeetmeServiceNotifier)
    context.register('people_cti_adapter', PeopleCTIAdapter)
    context.register('old_protocol_cti_adapter', OldProtocolCTIAdapter)
    context.register('presence_service_executor', PresenceServiceExecutor)
    context.register('presence_service_manager', PresenceServiceManager)
    context.register('pubsub', Pubsub)
    context.register('queue_entry_encoder', QueueEntryEncoder)
    context.register('queue_entry_manager', QueueEntryManager)
    context.register('queue_entry_notifier', QueueEntryNotifier)
    context.register('queue_statistics_manager', QueueStatisticsManager)
    context.register('queue_statistics_producer', QueueStatisticsProducer)
    context.register('queue_member_cti_subscriber', QueueMemberCTISubscriber)
    context.register('queue_member_cti_adapter', QueueMemberCTIAdapter)
    context.register('queue_member_indexer', QueueMemberIndexer)
    context.register('queue_member_manager', QueueMemberManager)
    context.register('queue_member_notifier', QueueMemberNotifier)
    context.register('queue_member_updater', QueueMemberUpdater)
    context.register('remote_service_tracker', remote_service_tracker)
    context.register('statistics_notifier', StatisticsNotifier)
    context.register('statistics_producer_initializer', StatisticsProducerInitializer)
    context.register('status_forwarder', StatusForwarder)
    context.register('task_queue', new_task_queue)
    context.register('task_scheduler', new_task_scheduler)
    context.register('token_renewer', TokenRenewer(auth_client))
    context.register('thread_pool_executor', thread_pool_executor)
    context.register('user_service_manager', UserServiceManager)
    context.register('user_service_notifier', UserServiceNotifier)
    context.register('xivo_uuid', lambda: xivo_uuid)