|
|
|
@ -80,6 +80,7 @@ static struct ast_json *custom_fields_to_params(const struct ast_variable *varia
|
|
|
|
|
* receiving a response the returned result is guaranteed to be pass/fail based upon
|
|
|
|
|
* a response handler's result.
|
|
|
|
|
*
|
|
|
|
|
* \param aeap Pointer to an Asterisk external application object
|
|
|
|
|
* \param name The name of the request to send
|
|
|
|
|
* \param json The core json request data
|
|
|
|
|
* \param data Optional user data to associate with request/response
|
|
|
|
@ -87,7 +88,7 @@ static struct ast_json *custom_fields_to_params(const struct ast_variable *varia
|
|
|
|
|
* \returns 0 on success, -1 on error
|
|
|
|
|
*/
|
|
|
|
|
static int speech_aeap_send_request(struct ast_aeap *aeap, const char *name,
|
|
|
|
|
struct ast_json *json, void *obj)
|
|
|
|
|
struct ast_json *json, void *data)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* Wait for a response. Also since we're blocking,
|
|
|
|
@ -96,7 +97,7 @@ static int speech_aeap_send_request(struct ast_aeap *aeap, const char *name,
|
|
|
|
|
struct ast_aeap_tsx_params tsx_params = {
|
|
|
|
|
.timeout = 1000,
|
|
|
|
|
.wait = 1,
|
|
|
|
|
.obj = obj,
|
|
|
|
|
.obj = data,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* "steals" the json ref */
|
|
|
|
@ -116,7 +117,9 @@ static int speech_aeap_send_request(struct ast_aeap *aeap, const char *name,
|
|
|
|
|
*
|
|
|
|
|
* Basic structure of the JSON message to send:
|
|
|
|
|
*
|
|
|
|
|
* { param: [<param>, ...] }
|
|
|
|
|
\verbatim
|
|
|
|
|
{ param: [<param>, ...] }
|
|
|
|
|
\endverbatim
|
|
|
|
|
*
|
|
|
|
|
* \param speech The speech engine
|
|
|
|
|
* \param param The name of the parameter to retrieve
|
|
|
|
@ -146,7 +149,9 @@ struct speech_param {
|
|
|
|
|
*
|
|
|
|
|
* Basic structure of the JSON message to send:
|
|
|
|
|
*
|
|
|
|
|
* { params: { <name> : <value> } }
|
|
|
|
|
\verbatim
|
|
|
|
|
{ params: { <name> : <value> } }
|
|
|
|
|
\endverbatim
|
|
|
|
|
*
|
|
|
|
|
* \param speech The speech engine
|
|
|
|
|
* \param name The name of the parameter to set
|
|
|
|
@ -238,13 +243,15 @@ static int handle_results(struct ast_aeap *aeap, struct ast_json_iter *iter,
|
|
|
|
|
*
|
|
|
|
|
* Basic structure of the expected JSON message to received:
|
|
|
|
|
*
|
|
|
|
|
* {
|
|
|
|
|
* response: "get"
|
|
|
|
|
* "params" : { <name>: <value> | [ <results> ] }
|
|
|
|
|
* }
|
|
|
|
|
\verbatim
|
|
|
|
|
{
|
|
|
|
|
response: "get"
|
|
|
|
|
"params" : { <name>: <value> | [ <results> ] }
|
|
|
|
|
}
|
|
|
|
|
\endverbatim
|
|
|
|
|
*
|
|
|
|
|
* \param speech The speech engine
|
|
|
|
|
* \param param The name of the parameter to retrieve
|
|
|
|
|
* \param aeap Pointer to an Asterisk external application object
|
|
|
|
|
* \param message The received message
|
|
|
|
|
* \param data User data passed to the response handler
|
|
|
|
|
*
|
|
|
|
|
* \returns 0 on success, -1 on error
|
|
|
|
@ -351,17 +358,19 @@ static struct ast_aeap_params speech_aeap_params = {
|
|
|
|
|
*
|
|
|
|
|
* Basic structure of the JSON message to send:
|
|
|
|
|
*
|
|
|
|
|
* {
|
|
|
|
|
* "request": "setup"
|
|
|
|
|
* "codecs": [
|
|
|
|
|
* {
|
|
|
|
|
* "name": <name>,
|
|
|
|
|
* "attributes": { <name>: <value>, ..., }
|
|
|
|
|
* },
|
|
|
|
|
* ...,
|
|
|
|
|
* ],
|
|
|
|
|
* "params": { <name>: <value>, ..., }
|
|
|
|
|
* }
|
|
|
|
|
\verbatim
|
|
|
|
|
{
|
|
|
|
|
"request": "setup"
|
|
|
|
|
"codecs": [
|
|
|
|
|
{
|
|
|
|
|
"name": <name>,
|
|
|
|
|
"attributes": { <name>: <value>, ..., }
|
|
|
|
|
},
|
|
|
|
|
...,
|
|
|
|
|
],
|
|
|
|
|
"params": { <name>: <value>, ..., }
|
|
|
|
|
}
|
|
|
|
|
\endverbatim
|
|
|
|
|
*
|
|
|
|
|
* \param speech The speech engine
|
|
|
|
|
* \param format The format codec to use
|
|
|
|
|