ACN: Changes specific to the core

Allow passing a topology from the called channel back to the
calling channel.

 * Added a new function ast_queue_answer() that accepts a stream
   topology and queues an ANSWER CONTROL frame with it as the
   data.  This allows the called channel to indicate its resolved
   topology.

 * Added a new virtual function to the channel tech structure
   answer_with_stream_topology() that allows the calling channel
   to receive the called channel's topology.  Added
   ast_raw_answer_with_stream_topology() that invokes that virtual
   function.

 * Modified app_dial.c and features.c to grab the topology from the
   ANSWER frame queued by the answering channel and send it to
   the calling channel with ast_raw_answer_with_stream_topology().

 * Modified frame.c to automatically cleanup the reference
   to the topology on ANSWER frames.

Added a few debugging messages to stream.c.

Change-Id: I0115d2ed68d6bae0f87e85abcf16c771bdaf992c
This commit is contained in:
George Joseph
2020-07-20 13:39:14 -06:00
committed by Friendly Automation
parent 3040edcbb1
commit 647c53c41f
7 changed files with 155 additions and 10 deletions

View File

@@ -138,6 +138,8 @@ static void __frame_free(struct ast_frame *fr, int cache)
|| fr->frametype == AST_FRAME_VIDEO
|| fr->frametype == AST_FRAME_IMAGE) {
ao2_cleanup(fr->subclass.format);
} else if (fr->frametype == AST_FRAME_CONTROL && fr->subclass.integer == AST_CONTROL_ANSWER) {
ao2_cleanup(fr->subclass.topology);
}
AST_LIST_INSERT_HEAD(&frames->list, fr, frame_list);
@@ -160,6 +162,8 @@ static void __frame_free(struct ast_frame *fr, int cache)
|| fr->frametype == AST_FRAME_VIDEO
|| fr->frametype == AST_FRAME_IMAGE) {
ao2_cleanup(fr->subclass.format);
} else if (fr->frametype == AST_FRAME_CONTROL && fr->subclass.integer == AST_CONTROL_ANSWER) {
ao2_cleanup(fr->subclass.topology);
}
ast_free(fr);
@@ -218,6 +222,8 @@ struct ast_frame *__ast_frisolate(struct ast_frame *fr, const char *file, int li
if ((fr->frametype == AST_FRAME_VOICE) || (fr->frametype == AST_FRAME_VIDEO) ||
(fr->frametype == AST_FRAME_IMAGE)) {
ao2_bump(out->subclass.format);
} else if (fr->frametype == AST_FRAME_VOICE && fr->subclass.integer == AST_CONTROL_ANSWER) {
ao2_bump(out->subclass.topology);
}
out->datalen = fr->datalen;
out->samples = fr->samples;
@@ -348,7 +354,10 @@ struct ast_frame *__ast_frdup(const struct ast_frame *f, const char *file, int l
if ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_VIDEO) ||
(f->frametype == AST_FRAME_IMAGE)) {
ao2_bump(out->subclass.format);
} else if (f->frametype == AST_FRAME_CONTROL && f->subclass.integer == AST_CONTROL_ANSWER) {
ao2_bump(out->subclass.topology);
}
out->datalen = f->datalen;
out->samples = f->samples;
out->delivery = f->delivery;