From 065c3005ad920f5fe2cedcf062e38b8e28eeb015 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Fri, 30 Jun 2017 18:55:57 +0000 Subject: res_rtp_asterisk / res_pjsip: Add support for BUNDLE. BUNDLE is a specification used in WebRTC to allow multiple streams to use the same underlying transport. This reduces the number of ICE and DTLS negotiations that has to occur to 1 normally. This change implements this by adding support for it to the RTP SDP module in PJSIP. BUNDLE can be turned on using the "bundle" option and on an offer we will offer to bundle streams together. On an answer we will accept any bundle groups provided. Once accepted each stream is bundled to another RTP instance for transport. For the res_rtp_asterisk changes the ability to bundle an RTP instance to another based on the SSRC received from the remote side has been added. For outgoing traffic if an RTP instance is bundled to another we will use the other RTP instance for any transport related things. For incoming traffic received from the transport instance we look up the correct instance based on the SSRC and use it for any non-transport related data. ASTERISK-27118 Change-Id: I96c0920b9f9aca7382256484765a239017973c11 --- res/res_pjsip_t38.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'res/res_pjsip_t38.c') diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c index a032bb12f..877d48fb6 100644 --- a/res/res_pjsip_t38.c +++ b/res/res_pjsip_t38.c @@ -880,11 +880,20 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as static struct ast_frame *media_session_udptl_read_callback(struct ast_sip_session *session, struct ast_sip_session_media *session_media) { + struct ast_frame *frame; + if (!session_media->udptl) { return &ast_null_frame; } - return ast_udptl_read(session_media->udptl); + frame = ast_udptl_read(session_media->udptl); + if (!frame) { + return NULL; + } + + frame->stream_num = session_media->stream_num; + + return frame; } static int media_session_udptl_write_callback(struct ast_sip_session *session, struct ast_sip_session_media *session_media, struct ast_frame *frame) -- cgit v1.2.3