asterisk/res/res_aeap/logger.h
Kevin Harwell 272bac70dd res_aeap & res_speech_aeap: Add Asterisk External Application Protocol
Add framework to connect to, and read and write protocol based
messages from and to an external application using an Asterisk
External Application Protocol (AEAP). This has been divided into
several abstractions:

 1. transport - base communication layer (currently websocket only)
 2. message - AEAP description and data (currently JSON only)
 3. transaction - links/binds requests and responses
 4. aeap - transport, message, and transaction handler/manager

This patch also adds an AEAP implementation for speech to text.
Existing speech API callbacks for speech to text have been completed
making it possible for Asterisk to connect to a configured external
translator service and provide audio for STT. Results can also be
received from the external translator, and made available as speech
results in Asterisk.

Unit tests have also been created that test the AEAP framework, and
also the speech to text implementation.

ASTERISK-29726 #close

Change-Id: Iaa4b259f84aa63501e5fd2a6fb107f900b4d4ed2
2022-04-26 14:26:48 -05:00

61 lines
1.8 KiB
C

/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2021, Sangoma Technologies Corporation
*
* Kevin Harwell <kharwell@sangoma.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
#ifndef RES_AEAP_LOGGER_H
#define RES_AEAP_LOGGER_H
#include "asterisk.h"
#include "asterisk/logger.h"
#include "asterisk/strings.h"
/*!
* \brief Log an Asterisk external application message
*
* \param level The logging level
* \param obj The object being logged
* \param name Optional subsystem name
* \param fmt Format string
* \param ... Parameters for the format string
*/
#define aeap_log(level, obj, name, fmt, ...) \
ast_log(level, "AEAP%s%s (%p): " fmt "\n", ast_strlen_zero(name) ? "" : " ", \
ast_strlen_zero(name) ? "" : name, obj, ##__VA_ARGS__)
/*!
* \brief Log an Asterisk external application error
*
* \param obj The object being logged
* \param name Optional subsystem name
* \param fmt Format string
* \param ... Parameters for the format string
*/
#define aeap_error(obj, name, fmt, ...) aeap_log(LOG_ERROR, obj, name, fmt, ##__VA_ARGS__)
/*!
* \brief Log an Asterisk external application warning
*
* \param obj The object being logged
* \param name Optional subsystem name
* \param fmt Format string
* \param ... Parameters for the format string
*/
#define aeap_warn(obj, name, fmt, ...) aeap_log(LOG_WARNING, obj, name, fmt, ##__VA_ARGS__)
#endif /* RES_AEAP_LOGGER_H */