[asterisk-commits] oej: branch oej/pinefrog-1.4 r244228 - in /team/oej/pinefrog-1.4: ./ channels...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Feb 1 15:20:16 CST 2010
Author: oej
Date: Mon Feb 1 15:20:14 2010
New Revision: 244228
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=244228
Log:
Making sure we store away the bridged channel while we have it, to make sure that
we can correlate report data to both channels involved in the call. At report time,
the bridge is gone, so we need to make sure we have at least the last bridged
channel in there.
Modified:
team/oej/pinefrog-1.4/README.pinefrog-rtcp
team/oej/pinefrog-1.4/channels/chan_sip.c
team/oej/pinefrog-1.4/include/asterisk/rtp.h
team/oej/pinefrog-1.4/main/rtp.c
Modified: team/oej/pinefrog-1.4/README.pinefrog-rtcp
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-1.4/README.pinefrog-rtcp?view=diff&rev=244228&r1=244227&r2=244228
==============================================================================
--- team/oej/pinefrog-1.4/README.pinefrog-rtcp (original)
+++ team/oej/pinefrog-1.4/README.pinefrog-rtcp Mon Feb 1 15:20:14 2010
@@ -52,6 +52,7 @@
The different parts might have different properties.
- Document realtime storage format. Add missing fields.
- BUG: RTCP is halted during hold. It should not stop.
+- During HOLD, send RTCP SR reports without report block, only the header and no chunks
Done
----
Modified: team/oej/pinefrog-1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-1.4/channels/chan_sip.c?view=diff&rev=244228&r1=244227&r2=244228
==============================================================================
--- team/oej/pinefrog-1.4/channels/chan_sip.c (original)
+++ team/oej/pinefrog-1.4/channels/chan_sip.c Mon Feb 1 15:20:14 2010
@@ -13447,7 +13447,9 @@
if (p && p->owner) {
bridgepeer = ast_bridged_channel(p->owner);
-
+ if (bridgepeer) {
+ ast_rtcp_set_bridged(rtp, bridgepeer->name);
+ }
}
if (global_rtcpevents) {
@@ -13481,7 +13483,7 @@
"RTPOutPlPercent: %5.2f\r\n"
"\r\n",
p->owner ? p->owner->name : "",
- bridgepeer ? bridgepeer->name : "",
+ qual.bridgedchan,
endreport ? "Final" : "Update",
qual.numberofreports == 0 ? "Inactive" : "Active",
duration,
Modified: team/oej/pinefrog-1.4/include/asterisk/rtp.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-1.4/include/asterisk/rtp.h?view=diff&rev=244228&r1=244227&r2=244228
==============================================================================
--- team/oej/pinefrog-1.4/include/asterisk/rtp.h (original)
+++ team/oej/pinefrog-1.4/include/asterisk/rtp.h Mon Feb 1 15:20:14 2010
@@ -79,6 +79,7 @@
/*! \brief Data structure only used for RTCP reports */
struct ast_rtp_quality {
+ char bridgedchan[AST_MAX_EXTENSION]; /*!< Name of bridged channel */
unsigned int numberofreports; /*!< Number of reports received from remote end */
unsigned int local_ssrc; /*!< Our SSRC */
unsigned int local_lostpackets; /*!< Our lost packets */
@@ -193,6 +194,15 @@
void ast_rtcp_setcname(struct ast_rtp *rtp, const char *cname, size_t length);
+/*! \brief set the name of the bridged channel
+
+At the time when we write the report there might not be a bridge, so we need
+to store this so we can correlate the reports. If a channel changes bridge,
+it can be reset by first setting it to an empty string, then setting to
+a new name
+*/
+void ast_rtcp_set_bridged(struct ast_rtp *rtp, const char *bridged_name);
+
/*! \brief When changing sources, don't generate a new SSRC */
Modified: team/oej/pinefrog-1.4/main/rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-1.4/main/rtp.c?view=diff&rev=244228&r1=244227&r2=244228
==============================================================================
--- team/oej/pinefrog-1.4/main/rtp.c (original)
+++ team/oej/pinefrog-1.4/main/rtp.c Mon Feb 1 15:20:14 2010
@@ -277,6 +277,7 @@
double minrtt;
unsigned int rtt_count; /*! Number of reports received */
int sendfur;
+ char bridgedchan[AST_MAX_EXTENSION]; /*!< Bridged channel name */
};
@@ -1033,7 +1034,7 @@
}
i += 2; /* Advance past header and ssrc */
- if (rc == 0) { /* We're receiving a report with no reports, which is ok */
+ if (rc == 0 && pt == RTCP_PT_RR) { /* We're receiving a receiver report with no reports, which is ok */
position += (length + 1);
continue;
}
@@ -2355,6 +2356,28 @@
ast_log(LOG_DEBUG, "--- Copied CNAME %s to RTCP structure (length %d)\n", cname, (int) length);
}
+/*! \brief set the name of the bridged channel
+
+At the time when we write the report there might not be a bridge, so we need
+to store this so we can correlate the reports. If a channel changes bridge,
+it can be reset by first setting it to an empty string, then setting to
+a new name
+*/
+void ast_rtcp_set_bridged(struct ast_rtp *rtp, const char *bridged_name)
+{
+ if (!rtp) { /* For some reason, there's no RTP */
+ return;
+ }
+ if (!rtp->rtcp) { /* No RTCP? Strange */
+ return;
+ }
+ /* If we already have a bridged name, don't overwrite */
+ if (rtp->rtcp->bridgedchan[0]) {
+ return;
+ }
+ ast_copy_string(rtp->rtcp->bridgedchan, bridged_name, sizeof(rtp->rtcp->bridgedchan));
+}
+
int ast_rtp_settos(struct ast_rtp *rtp, int tos)
{
int res;
@@ -2509,6 +2532,9 @@
qual->rtt = rtp->rtcp->rtt;
qual->rttmax = rtp->rtcp->maxrtt;
qual->rttmin = rtp->rtcp->minrtt;
+ }
+ if (!ast_strlen_zero(rtp->rtcp->bridgedchan)) {
+ ast_copy_string(qual->bridgedchan, rtp->rtcp->bridgedchan, sizeof(rtp->rtcp->bridgedchan));
}
}
if (rtp->rtcp) {
More information about the asterisk-commits
mailing list