ARI Outbound Websockets

Asterisk can now establish websocket sessions _to_ your ARI applications
as well as accepting websocket sessions _from_ them.
Full details: http://s.asterisk.net/ari-outbound-ws

Code change summary:
* Added an ast_vector_string_join() function,
* Added ApplicationRegistered and ApplicationUnregistered ARI events.
* Converted res/ari/config.c to use sorcery to process ari.conf.
* Added the "outbound-websocket" ARI config object.
* Refactored res/ari/ari_websockets.c to handle outbound websockets.
* Refactored res/ari/cli.c for the sorcery changeover.
* Updated res/res_stasis.c for the sorcery changeover.
* Updated apps/app_stasis.c to allow initiating per-call outbound websockets.
* Added CLI commands to manage ARI websockets.
* Added the new "outbound-websocket" object to ari.conf.sample.
* Moved the ARI XML documentation out of res_ari.c into res/ari/ari_doc.xml

UserNote: Asterisk can now establish websocket sessions _to_ your ARI applications
as well as accepting websocket sessions _from_ them.
Full details: http://s.asterisk.net/ari-outbound-ws

(cherry picked from commit 87097b3dd1)
This commit is contained in:
George Joseph
2025-03-28 06:54:21 -06:00
parent 32e749517f
commit b1f6c7689c
15 changed files with 2948 additions and 963 deletions

View File

@@ -403,6 +403,25 @@ char *ast_read_line_from_buffer(char **buffer)
return start;
}
char *ast_vector_string_join(struct ast_vector_string *vec, const char *delim)
{
struct ast_str *buf = ast_str_create(256);
char *rtn;
int i;
if (!buf) {
return NULL;
}
for (i = 0; i < AST_VECTOR_SIZE(vec); i++) {
ast_str_append(&buf, 0, "%s%s", AST_VECTOR_GET(vec, i), delim);
}
ast_str_truncate(buf, -strlen(delim));
rtn = ast_strdup(ast_str_buffer(buf));
ast_free(buf);
return rtn;
}
int ast_vector_string_split(struct ast_vector_string *dest,
const char *input, const char *delim, int flags,
int (*excludes_cmp)(const char *s1, const char *s2))