def notify(self, phone_id, status): event = CTIMessageFormatter.phone_hintstatus_update(phone_id, status) self._ctiserver.send_cti_event(event) bus_event = EndpointStatusUpdateEvent(config['uuid'], phone_id, status) self._bus_producer.publish_event( config['bus']['exchange_name'], config['bus']['routing_keys']['endpoint_status'], bus_event, )
def notify(self, phone_id, status): cti_event = CTIMessageFormatter.phone_hintstatus_update( phone_id, status) self._ctiserver.send_cti_event(cti_event) bus_event = EndpointStatusUpdateEvent(phone_id, status) user_id = self._innerdata.xod_config['phones'].keeplist[phone_id][ 'iduserfeatures'] user_uuid = self._innerdata.xod_config['users'].keeplist[str( user_id)]['uuid'] headers = {'user_uuid:{uuid}'.format(uuid=user_uuid): True} self._bus_publisher.publish(bus_event, headers=headers)
def test_update_phone_hinstatus(self): hint = 8 phone_id = '42' result = CTIMessageFormatter.phone_hintstatus_update(phone_id, hint) assert_that( result, equal_to({ 'class': 'getlist', 'listname': 'phones', 'function': 'updatestatus', 'tipbxid': 'xivo', 'tid': phone_id, 'status': { 'hintstatus': hint } }))