def get(self): user_uuid = get_token_user_uuid_from_request(self._auth_client) relocates = self._relocates_service.list_from_user(user_uuid) return { 'items': relocate_schema.dump(relocates, many=True).data }, 200
def put(self, switchboard_uuid, call_id): user_uuid = get_token_user_uuid_from_request(self._auth_client) call_id = self._service.answer_held_call(switchboard_uuid, call_id, user_uuid) return {'call_id': call_id}, 200
def post(self): request_body = user_transfer_request_schema.load( request.get_json(force=True)).data user_uuid = get_token_user_uuid_from_request(self._auth_client) transfer = self._transfers_service.create_from_user( request_body['initiator_call'], request_body['exten'], request_body['flow'], request_body['timeout'], user_uuid) return transfer.to_dict(), 201
def post(self): request_body = user_chat_request_schema.load( request.get_json(force=True)).data user_uuid = get_token_user_uuid_from_request(self._auth_client) self._chats_service.send_message(request_body, user_uuid) return '', 204
def post(self): request_body = user_call_request_schema.load( request.get_json(force=True)).data user_uuid = get_token_user_uuid_from_request(self.auth_client) call = self.calls_service.originate_user(request_body, user_uuid) return call_schema.dump(call).data, 201
def put(self): request_body = presence_request_schema.load( request.get_json(force=True)).data user_uuid = get_token_user_uuid_from_request(self._auth_client) self._presences_service.update_presence(user_uuid, request_body['presence']) return '', 204
def get(self): application_filter = request.args.get('application') application_instance_filter = request.args.get('application_instance') user_uuid = get_token_user_uuid_from_request(self.auth_client) calls = self.calls_service.list_calls_user( user_uuid, application_filter, application_instance_filter) return { 'items': call_schema.dump(calls, many=True).data, }, 200
def post(self): request_body = user_relocate_request_schema.load(request.get_json(force=True)).data user_uuid = get_token_user_uuid_from_request(self._auth_client) relocate = self._relocates_service.create_from_user(request_body['initiator_call'], request_body['destination'], request_body['location'], request_body['completions'], request_body['timeout'], user_uuid) result = relocate_schema.dump(relocate).data return result, 201
def _get_voicemail_id_from_request(auth_client, voicemails_service): user_uuid = get_token_user_uuid_from_request(auth_client) return voicemails_service.get_user_voicemail_id(user_uuid)
def get(self): user_uuid = get_token_user_uuid_from_request(self._auth_client) transfers = self._transfers_service.list_from_user(user_uuid) return {'items': [transfer.to_dict() for transfer in transfers]}, 200
def put(self, transfer_id): user_uuid = get_token_user_uuid_from_request(self._auth_client) self._transfers_service.complete_from_user(transfer_id, user_uuid) return '', 204
def delete(self, call_id): user_uuid = get_token_user_uuid_from_request(self.auth_client) self.calls_service.hangup_user(call_id, user_uuid) return None, 204
def put(self, relocate_uuid): user_uuid = get_token_user_uuid_from_request(self._auth_client) self._relocates_service.cancel_from_user(relocate_uuid, user_uuid) return '', 204
def get(self, relocate_uuid): user_uuid = get_token_user_uuid_from_request(self._auth_client) relocate = self._relocates_service.get_from_user(relocate_uuid, user_uuid) result = relocate_schema.dump(relocate).data return result, 200
def get(self): user_uuid = get_token_user_uuid_from_request(self._auth_client) xivo_uuid, status = self._presences_service.get_presence( None, user_uuid) return user_presence_body(xivo_uuid, user_uuid, status), 200
def get(self): args = UserChatListRequestSchema().load(request.args).data user_uuid = get_token_user_uuid_from_request(self._auth_client) history = self._chats_service.get_history(user_uuid, args) return UserChatListSchema().dump(history).data