[asterisk-commits] oej: branch oej/blackberry-a-rtcp-sdp-support-1.8 r412068 - /team/oej/blackbe...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 10 04:19:45 CDT 2014
Author: oej
Date: Thu Apr 10 04:19:35 2014
New Revision: 412068
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=412068
Log:
Handling the case when a=rtcp arrives early
Modified:
team/oej/blackberry-a-rtcp-sdp-support-1.8/res/res_rtp_asterisk.c
Modified: team/oej/blackberry-a-rtcp-sdp-support-1.8/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/blackberry-a-rtcp-sdp-support-1.8/res/res_rtp_asterisk.c?view=diff&rev=412068&r1=412067&r2=412068
==============================================================================
--- team/oej/blackberry-a-rtcp-sdp-support-1.8/res/res_rtp_asterisk.c (original)
+++ team/oej/blackberry-a-rtcp-sdp-support-1.8/res/res_rtp_asterisk.c Thu Apr 10 04:19:35 2014
@@ -175,6 +175,8 @@
struct io_context *io;
void *data;
struct ast_rtcp *rtcp;
+ unsigned int rtcpport; /*!< temporary storage for a=rtcp */
+
struct ast_rtp *bridged; /*!< Who we are Packet bridged to */
enum strict_rtp_state strict_rtp_state; /*!< Current state that strict RTP protection is in */
@@ -2605,7 +2607,10 @@
if (rtp->rtcp) {
ast_debug(1, "Setting RTCP address on RTP instance '%p'\n", instance);
ast_sockaddr_copy(&rtp->rtcp->them, addr);
- if (!ast_sockaddr_isnull(addr)) {
+ if (rtp->rtcpport) {
+ /* Port was set with a=rtcp in sdp */
+ ast_sockaddr_set_port(&rtp->rtcp->them, rtp->rtcpport);
+ } if (!ast_sockaddr_isnull(addr)) {
ast_sockaddr_set_port(&rtp->rtcp->them,
ast_sockaddr_port(addr) + 1);
}
@@ -2624,6 +2629,11 @@
static void ast_rtp_remote_rtcp_port_set(struct ast_rtp_instance *instance, unsigned int port)
{
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
+ if (!rtp->rtcp) {
+ /* We have no rtcp active yet. */
+ rtp->rtcpport = port;
+ return;
+ }
if (!ast_sockaddr_isnull(&rtp->rtcp->them)) {
ast_sockaddr_set_port(&rtp->rtcp->them, port);
ast_debug(1, "Setting RTCP port on RTP instance '%p' to %d\n", instance, port);
More information about the asterisk-commits
mailing list