summaryrefslogtreecommitdiff
path: root/res/res_rtp_asterisk.c
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-01-27 07:04:52 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-01-27 07:04:52 -0600
commit6f645a6d4e508ad6960fbb9825d4d26694b8087c (patch)
tree1500e4c70a785800c8f6ae90b30f2da4d0ff26ac /res/res_rtp_asterisk.c
parent08bc42201d9b3d9f9c402d2dc9ae3c3de961ff89 (diff)
parent1061539b75811d9115dcbc0be46967515bd9e2d1 (diff)
Merge "media: Add experimental support for RTCP feedback."
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r--res/res_rtp_asterisk.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 750e1ef0c..c4608db6c 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -4323,6 +4323,29 @@ static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance *instance)
rtcp_report,
message_blob);
ast_json_unref(message_blob);
+
+ /* Return an AST_FRAME_RTCP frame with the ast_rtp_rtcp_report
+ * object as a its data */
+ rtp->f.frametype = AST_FRAME_RTCP;
+ rtp->f.data.ptr = rtp->rawdata + AST_FRIENDLY_OFFSET;
+ memcpy(rtp->f.data.ptr, rtcp_report, sizeof(struct ast_rtp_rtcp_report));
+ rtp->f.datalen = sizeof(struct ast_rtp_rtcp_report);
+ if (rc > 0) {
+ /* There's always a single report block stored, here */
+ struct ast_rtp_rtcp_report *rtcp_report2;
+ report_block = rtp->f.data.ptr + rtp->f.datalen + sizeof(struct ast_rtp_rtcp_report_block *);
+ memcpy(report_block, rtcp_report->report_block[report_counter-1], sizeof(struct ast_rtp_rtcp_report_block));
+ rtcp_report2 = (struct ast_rtp_rtcp_report *)rtp->f.data.ptr;
+ rtcp_report2->report_block[report_counter-1] = report_block;
+ rtp->f.datalen += sizeof(struct ast_rtp_rtcp_report_block);
+ }
+ rtp->f.offset = AST_FRIENDLY_OFFSET;
+ rtp->f.samples = 0;
+ rtp->f.mallocd = 0;
+ rtp->f.delivery.tv_sec = 0;
+ rtp->f.delivery.tv_usec = 0;
+ rtp->f.src = "RTP";
+ f = &rtp->f;
break;
case RTCP_PT_FUR:
/* Handle RTCP FIR as FUR */