diff options
author | Mark Michelson <mmichelson@digium.com> | 2017-03-07 14:13:02 -0600 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2017-03-15 10:39:05 -0500 |
commit | 7bc69753bc79fa47508c5d62e9bc27f41698bb41 (patch) | |
tree | 932a4bf50f0215f3a7d3d349eab20f36f38db9c2 /include | |
parent | 947f1ebf861254c2544d6f1956ca7f31d1d393f7 (diff) |
Add rtcp-mux support
This commit adds support for RFC 5761: Multiplexing RTP Data and Control
Packets on a Single Port. Specifically, it enables the feature when
using chan_pjsip.
A new option, "rtcp_mux" has been added to endpoint configuration in
pjsip.conf. If set, then Asterisk will attempt to use rtcp-mux with
whatever it communicates with. Asterisk follows the rules set forth in
RFC 5761 with regards to falling back to standard RTCP behavior if the
far end does not indicate support for rtcp-mux.
The lion's share of the changes in this commit are in
res_rtp_asterisk.c. This is because it was pretty much hard wired to
have an RTP and an RTCP transport. The strategy used here is that when
rtcp-mux is enabled, the current RTCP transport and its trappings (such
as DTLS SSL session) are freed, and the RTCP session instead just
mooches off the RTP session. This leads to a lot of specialized if
statements throughout.
ASTERISK-26732 #close
Reported by Dan Jenkins
Change-Id: If46a93ba1282418d2803e3fd7869374da8b77ab5
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/res_pjsip.h | 2 | ||||
-rw-r--r-- | include/asterisk/res_pjsip_session.h | 2 | ||||
-rw-r--r-- | include/asterisk/rtp_engine.h | 11 |
3 files changed, 15 insertions, 0 deletions
diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index d8e172fc5..b0e82f7e4 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -755,6 +755,8 @@ struct ast_sip_endpoint { char *contact_user; /*! Do we allow an asymmetric RTP codec? */ unsigned int asymmetric_rtp_codec; + /*! Use RTCP-MUX */ + unsigned int rtcp_mux; }; /*! diff --git a/include/asterisk/res_pjsip_session.h b/include/asterisk/res_pjsip_session.h index 7e65e6d7c..c41cc3ab9 100644 --- a/include/asterisk/res_pjsip_session.h +++ b/include/asterisk/res_pjsip_session.h @@ -83,6 +83,8 @@ struct ast_sip_session_media { int timeout_sched_id; /*! \brief Stream is on hold */ unsigned int held:1; + /*! \brief Does remote support rtcp_mux */ + unsigned int remote_rtcp_mux:1; /*! \brief Stream type this session media handles */ char stream_type[1]; }; diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h index c4a5b6b41..e8f3d78b4 100644 --- a/include/asterisk/rtp_engine.h +++ b/include/asterisk/rtp_engine.h @@ -237,6 +237,15 @@ enum ast_rtp_instance_stat { AST_RTP_INSTANCE_STAT_RXOCTETCOUNT, }; +enum ast_rtp_instance_rtcp { + /*! RTCP should not be sent/received */ + AST_RTP_INSTANCE_RTCP_DISABLED = 0, + /*! RTCP should be sent/received based on standard port rules */ + AST_RTP_INSTANCE_RTCP_STANDARD, + /*! RTCP should be sent/received on the same port as RTP */ + AST_RTP_INSTANCE_RTCP_MUX, +}; + /* Codes for RTP-specific data - not defined by our AST_FORMAT codes */ /*! DTMF (RFC2833) */ #define AST_RTP_DTMF (1 << 0) @@ -443,6 +452,8 @@ struct ast_rtp_engine_ice { void (*turn_request)(struct ast_rtp_instance *instance, enum ast_rtp_ice_component_type component, enum ast_transport transport, const char *server, unsigned int port, const char *username, const char *password); + /*! Callback to alter the number of ICE components on a session */ + void (*change_components)(struct ast_rtp_instance *instance, int num_components); }; /*! \brief DTLS setup types */ |