[asterisk-commits] oej: branch oej/pinefrog-rtcp-1.8 r382845 - in /team/oej/pinefrog-rtcp-1.8: ....

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 12 06:09:04 CDT 2013


Author: oej
Date: Tue Mar 12 06:08:59 2013
New Revision: 382845

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382845
Log:
Updating docs for CQR records in realtime plus adding more data to the database structure

Modified:
    team/oej/pinefrog-rtcp-1.8/CREDITS
    team/oej/pinefrog-rtcp-1.8/README.pinefrog-rtcp
    team/oej/pinefrog-rtcp-1.8/channels/chan_sip.c
    team/oej/pinefrog-rtcp-1.8/channels/sip/rtcp.c
    team/oej/pinefrog-rtcp-1.8/include/asterisk/rtp_engine.h
    team/oej/pinefrog-rtcp-1.8/res/res_rtp_asterisk.c

Modified: team/oej/pinefrog-rtcp-1.8/CREDITS
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-rtcp-1.8/CREDITS?view=diff&rev=382845&r1=382844&r2=382845
==============================================================================
--- team/oej/pinefrog-rtcp-1.8/CREDITS (original)
+++ team/oej/pinefrog-rtcp-1.8/CREDITS Tue Mar 12 06:08:59 2013
@@ -22,6 +22,9 @@
 
 Omnitor AB, Gunnar Hellström, for funding work with videocaps, T.140 RED,
 originate with video/text and many more contributions.
+
+Nordicom Norge AS, Kristiansand, Norway, for funding work with RTCP support
+and Call Quality Records.
 
 === WISHLIST CONTRIBUTERS ===
 Jeremy McNamara - SpeeX support
@@ -116,6 +119,7 @@
 	SIP presence support, SIP call state updates (dialog-info), 
 	QUEUE_EXISTS function, device state provider architecture,
 	multiparking (together with mvanbaak), meetme and parking device states,
+        RTCP improvements, Call Quality Records,
 	MiniVM - the small voicemail system, many documentation
 	updates/corrections, and many bug fixes.
 	oej(AT)edvina.net, http://edvina.net
@@ -217,7 +221,8 @@
 Viagenie, Canada - IPv6 support in socket layers and SIP implementation
 	Developers: Marc Blanchet, Simon Perreault and Jean-Philippe Dionne
 
-ClearIT AB, Sweden - res_mutestream, queue_exists and various other patches (developed by oej)
+ClearIT AB, Sweden - res_mutestream, queue_exists, RTCP improvements and various 
+        other patches (developed by oej)
 
 Despegar.com, Argentina - AstData API implementation, also sponsored by Google as part of the
 	gsoc/2009 program (developed by Eliel)

Modified: team/oej/pinefrog-rtcp-1.8/README.pinefrog-rtcp
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-rtcp-1.8/README.pinefrog-rtcp?view=diff&rev=382845&r1=382844&r2=382845
==============================================================================
--- team/oej/pinefrog-rtcp-1.8/README.pinefrog-rtcp (original)
+++ team/oej/pinefrog-rtcp-1.8/README.pinefrog-rtcp Tue Mar 12 06:08:59 2013
@@ -15,6 +15,9 @@
 to Asterisk 1.8 and hopefully (with some help) to Asterisk trunk to be integrated.
 The 1.4 code has been running in production for years in universities, call centers
 and service providers.
+
+The 1.8 port of Pinefrog is supported by Nordicom, Norway (http://www.nordicom.no). 
+The 1.4 work was sponsored by several companies, including ClearIT AB, Sweden.
 
 Status of 1.8 port
 ------------------
@@ -121,3 +124,45 @@
 - Nat traversal - Asterisk outside of NAT and inside (as client to external service)
 - Call hold
 - Call with music-on-hold
+
+Database structure
+-------------------
+Example database schema for MySQL:
+
+CREATE TABLE `astcqr` (
+  `channel` varchar(50) NOT NULL,
+  `uniqueid` varchar(35) NOT NULL,
+  `bridgedchannel` varchar(50) NOT NULL,
+  `bridgeduniqueid` varchar(35) NOT NULL,
+  `pvtcallid` varchar(80) NOT NULL,
+  `rtpmedia` varchar(50) NOT NULL,
+  `localssrc` varchar(50) NOT NULL,
+  `remotessrc` varchar(50) NOT NULL,
+  `rtt` varchar(10) NOT NULL,
+  `localjitter` varchar(10) NOT NULL,
+  `remotejitter` varchar(10) NOT NULL,
+  `sendformat` varchar(10) NOT NULL,
+  `receiveformat` varchar(10) NOT NULL,
+  `rtcpstatus` varchar(10) NOT NULL,
+  `duration` varchar(10) NOT NULL,
+  `packetsent` varchar(30) NOT NULL,
+  `packetreceived` varchar(30) NOT NULL,
+  `packetlossin` varchar(30) NOT NULL,
+  `packetlossout` varchar(30) NOT NULL,
+  `rttmax` varchar(12) NOT NULL,
+  `rttmin` varchar(12) NOT NULL,
+  `writetranslator` varchar(15) NOT NULL,
+  `readtranslator` varchar(15) NOT NULL,
+  `writecost` varchar(10) NOT NULL,
+  `readcost` varchar(10) NOT NULL,
+  `remoteip` varchar(25) NOT NULL,
+  KEY `ChannelUnique` (`channel`,`uniqueid`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='FOr pinefrog stats'
+
+Realtime configuration
+========================
+In extconfig.conf add
+
+rtpcqr => mysql,asterisk,astqos
+
+When you run "sip show settings"

Modified: team/oej/pinefrog-rtcp-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-rtcp-1.8/channels/chan_sip.c?view=diff&rev=382845&r1=382844&r2=382845
==============================================================================
--- team/oej/pinefrog-rtcp-1.8/channels/chan_sip.c (original)
+++ team/oej/pinefrog-rtcp-1.8/channels/chan_sip.c Tue Mar 12 06:08:59 2013
@@ -24560,6 +24560,7 @@
 
 
 		if (p->rtp && (quality = ast_rtp_instance_get_quality(p->rtp, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, quality_buf, sizeof(quality_buf)))) {
+			sip_rtcp_report(p, p->rtp, SDP_AUDIO, TRUE);
 			if (p->do_history) {
 				append_history(p, "RTCPaudio", "Quality:%s", quality);
 
@@ -24590,6 +24591,7 @@
 		}
 
 		if (p->vrtp && (quality = ast_rtp_instance_get_quality(p->vrtp, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, quality_buf, sizeof(quality_buf)))) {
+			sip_rtcp_report(p, p->rtp, SDP_VIDEO, TRUE);
 			if (p->do_history) {
 				append_history(p, "RTCPvideo", "Quality:%s", quality);
 			}

Modified: team/oej/pinefrog-rtcp-1.8/channels/sip/rtcp.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-rtcp-1.8/channels/sip/rtcp.c?view=diff&rev=382845&r1=382844&r2=382845
==============================================================================
--- team/oej/pinefrog-rtcp-1.8/channels/sip/rtcp.c (original)
+++ team/oej/pinefrog-rtcp-1.8/channels/sip/rtcp.c Tue Mar 12 06:08:59 2013
@@ -41,10 +41,11 @@
  */
 void sip_rtcp_set_data(struct sip_pvt *dialog, struct ast_rtp_instance *instance, enum media_type type)
 {
- 	int readtrans = FALSE, writetrans = FALSE;
 
 	if (dialog && dialog->owner) {
+ 		int readtrans = FALSE, writetrans = FALSE;
 		struct ast_channel *bridgepeer = ast_bridged_channel(dialog->owner);
+
 		if (bridgepeer) {
 			/* Store the bridged peer data while we have it */
 			ast_rtp_instance_set_bridged_chan(instance, dialog->owner->name, dialog->owner->uniqueid, S_OR(bridgepeer->name,""), S_OR(bridgepeer->uniqueid,""));
@@ -52,6 +53,7 @@
 		} else {
 			ast_rtp_instance_set_bridged_chan(instance, dialog->owner->name, dialog->owner->uniqueid, NULL, NULL);
 		}
+		ast_debug(1, "---- Setting channel name to %s\n", dialog->owner->name);
 
  		/* Try to find out if there's active transcoding */
 		/* Currently, the only media stream that has translation is the audio stream. At some point
@@ -68,8 +70,10 @@
 			if (writetrans) {
 				wtname = chan->writetrans->t->name;
 			}
-			ast_rtp_instance_set_translator(instance, rtname, readtrans ? chan->readtrans->t->cost : (const int) 0,
+			if (readtrans || writetrans) {
+				ast_rtp_instance_set_translator(instance, rtname, readtrans ? chan->readtrans->t->cost : (const int) 0,
 					wtname, writetrans ? chan->writetrans->t->cost : (const int) 0);
+			}
 		
 			if (option_debug > 1) {
  				if (readtrans && dialog->owner->readtrans->t) {
@@ -145,7 +149,7 @@
 			"\r\n", 
 			dialog->owner ? dialog->owner->name : "",
 			dialog->owner ? dialog->owner->uniqueid : "",
-			qual.bridgedchan[0] ? qual.bridgedchan : "" ,
+			qual.bridgedchannel[0] ? qual.bridgedchannel : "" ,
 			qual.bridgeduniqueid[0] ? qual.bridgeduniqueid : "",
 			reporttype == 1 ? "Final" : "Update",
 			qual.numberofreports == 0 ? "Inactive" : "Active",
@@ -243,8 +247,8 @@
 	sprintf(buf_remoteip,"%s", ast_inet_ntoa(qual->them.sin_addr));
 	sprintf(buf_inpacketloss, "%d", qual->rxploss);
 	sprintf(buf_outpacketloss, "%d", qual->txploss);
-	sprintf(buf_inpackets, "%d", 42);		/* Silly value. Need to check this */
-	sprintf(buf_outpackets, "%d", 42);
+	sprintf(buf_inpackets, "%d", qual->rxcount);		/* Silly value. Need to check this */
+	sprintf(buf_outpackets, "%d", qual->txcount);
 	//sprintf(buf_inpackets, "%d", qual->remote_count);	/* Do check again */
 	//sprintf(buf_outpackets, "%d", qual->local_count);
 
@@ -252,7 +256,7 @@
 	ast_log(LOG_CQR, "CQR Channel: %s Uid %s Bch %s Buid %s Pvt %s Media %s Lssrc %s Rssrc %s Rip %s Rtt %s:%s:%s Ljitter %s Rjitter %s Rtcpstatus %s Dur %s Pout %s Plossout %s Pin %s Plossin %s\n",
 		qual->channel[0] ? qual->channel : "",
 		qual->uniqueid[0] ? qual->uniqueid : "",
-		qual->bridgedchan[0] ? qual->bridgedchan : "" ,
+		qual->bridgedchannel[0] ? qual->bridgedchannel : "" ,
 		qual->bridgeduniqueid[0] ? qual->bridgeduniqueid : "",
 		dialog->callid,
 		buf_mediatype,
@@ -276,7 +280,7 @@
 CREATE TABLE `astcqr` (
   `channel` varchar(50) NOT NULL,
   `uniqueid` varchar(35) NOT NULL,
-  `bridgedchan` varchar(50) NOT NULL,
+  `bridgedchannel` varchar(50) NOT NULL,
   `bridgeduniqueid` varchar(35) NOT NULL,
   `pvtcallid` varchar(80) NOT NULL,
   `rtpmedia` varchar(50) NOT NULL,
@@ -307,7 +311,7 @@
 	ast_store_realtime("rtpcqr", 
 		"channel", qual->channel[0] ? qual->channel : "--no channel--",
 		"uniqueid", qual->uniqueid[0] ? qual->uniqueid : "--no uniqueid --",
-		"bridgedchan", qual->bridgedchan[0] ? qual->bridgedchan : "" ,
+		"bridgedchannel", qual->bridgedchannel[0] ? qual->bridgedchannel : "" ,
 		"bridgeduniqueid", qual->bridgeduniqueid[0] ? qual->bridgeduniqueid : "",
 		"pvtcallid", dialog->callid, 
 		"rtpmedia", buf_mediatype, 

Modified: team/oej/pinefrog-rtcp-1.8/include/asterisk/rtp_engine.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-rtcp-1.8/include/asterisk/rtp_engine.h?view=diff&rev=382845&r1=382844&r2=382845
==============================================================================
--- team/oej/pinefrog-rtcp-1.8/include/asterisk/rtp_engine.h (original)
+++ team/oej/pinefrog-rtcp-1.8/include/asterisk/rtp_engine.h Tue Mar 12 06:08:59 2013
@@ -310,7 +310,7 @@
 	unsigned int remote_rxcount;
 	char channel[AST_MAX_EXTENSION];	/*!< Name of channel */
 	char uniqueid[AST_MAX_EXTENSION];	/*!< uniqueid of channel */
-	char bridgedchan[AST_MAX_EXTENSION];	/*!< Name of bridged channel */
+	char bridgedchannel[AST_MAX_EXTENSION];	/*!< Name of bridged channel */
 	char bridgeduniqueid[AST_MAX_EXTENSION];	/*!< uniqueid of bridged channel */
 	unsigned int numberofreports;	  /*!< Number of reports received from remote end */
 	int lasttxformat;		  /*!< Last used codec on transmitted stream */

Modified: team/oej/pinefrog-rtcp-1.8/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-rtcp-1.8/res/res_rtp_asterisk.c?view=diff&rev=382845&r1=382844&r2=382845
==============================================================================
--- team/oej/pinefrog-rtcp-1.8/res/res_rtp_asterisk.c (original)
+++ team/oej/pinefrog-rtcp-1.8/res/res_rtp_asterisk.c Tue Mar 12 06:08:59 2013
@@ -91,6 +91,7 @@
 	SDES_NOTE	= 7,		/*!< Notice about the source */
 	SDES_PRIV	= 8,		/*!< SDES Private extensions */
 	SDES_H323_CADDR	= 9,		/*!< H.323 Callable address */
+	SDES_APSI	= 10,		/*!< Application Specific Identifier (RFC 6776) */
 };
 
 #define RTP_MTU		1200
@@ -281,7 +282,7 @@
 	double normdevrtt;
 	double stdevrtt;
 	unsigned int rtt_count;		/*! Number of reports received */
-	char bridgedchan[AST_MAX_EXTENSION];		/*!< Bridged channel name */
+	char bridgedchannel[AST_MAX_EXTENSION];		/*!< Bridged channel name */
 	char bridgeduniqueid[AST_MAX_EXTENSION];	/*!< Bridged channel uniqueid */
 	char channel[AST_MAX_EXTENSION];		/*!< Our channel name */
 	char uniqueid[AST_MAX_EXTENSION];	/*!< Our channel uniqueid */
@@ -2258,6 +2259,11 @@
 						ast_verbose(" --- SDES END \n");
 					}
 					break;
+				case SDES_APSI:
+					if (rtcp_debug_test_addr(&addr)) {
+						ast_verbose(" --- SDES APSI \n");
+					}
+					break;
 				}
 				j += 2 + sdeslength;	/* Header (1 byte) + length */
 				sdes += sdeslength;
@@ -3042,6 +3048,21 @@
 	if (!ast_strlen_zero(rtp->rtcp->writetranslator)) {
 		ast_copy_string(stats->writetranslator, rtp->rtcp->writetranslator, sizeof(stats->writetranslator));
 	}
+	if (!ast_strlen_zero(rtp->rtcp->readtranslator)) {
+		ast_copy_string(stats->readtranslator, rtp->rtcp->readtranslator, sizeof(stats->readtranslator));
+	}
+	if (!ast_strlen_zero(rtp->rtcp->channel)) {
+		ast_copy_string(stats->channel, rtp->rtcp->channel, sizeof(stats->channel));
+	}
+	if (!ast_strlen_zero(rtp->rtcp->bridgedchannel)) {
+		ast_copy_string(stats->bridgedchannel, rtp->rtcp->bridgedchannel, sizeof(stats->bridgedchannel));
+	}
+	if (!ast_strlen_zero(rtp->rtcp->uniqueid)) {
+		ast_copy_string(stats->uniqueid, rtp->rtcp->uniqueid, sizeof(stats->uniqueid));
+	}
+	if (!ast_strlen_zero(rtp->rtcp->bridgeduniqueid)) {
+		ast_copy_string(stats->bridgeduniqueid, rtp->rtcp->bridgeduniqueid, sizeof(stats->bridgeduniqueid));
+	}
 	return 0;
 }
 
@@ -3171,25 +3192,25 @@
 	/* If we already have data, don't replace it. 
 		NOTE: Should we replace it at a masquerade or something? Hmm.
 	*/
-	if (channel && !rtp->rtcp->channel[0]) {
-		ast_debug(1, "!!!!!! Setting channel name \n");
+	if (!ast_strlen_zero(channel) && !rtp->rtcp->channel[0]) {
+		ast_debug(1, "!!!!!! Setting channel name to %s\n", channel);
 		ast_copy_string(rtp->rtcp->channel, channel, sizeof(rtp->rtcp->channel));
 	}
-	if (uniqueid && !rtp->rtcp->uniqueid[0]) {
-		ast_debug(1, "!!!!!! Setting unique id \n");
+	if (!ast_strlen_zero(uniqueid) && !rtp->rtcp->uniqueid[0]) {
+		ast_debug(1, "!!!!!! Setting unique id to %s\n", uniqueid);
 		ast_copy_string(rtp->rtcp->uniqueid, uniqueid, sizeof(rtp->rtcp->uniqueid));
 	}
-	if (bridgedchan) {
-		ast_debug(1, "!!!!!! Setting bridged channel name \n");
-		ast_copy_string(rtp->rtcp->bridgedchan, bridgedchan, sizeof(rtp->rtcp->bridgedchan));
+	if (!ast_strlen_zero(bridgedchan)) {
+		ast_debug(1, "!!!!!! Setting bridged channel name to %s\n", bridgedchan);
+		ast_copy_string(rtp->rtcp->bridgedchannel, bridgedchan, sizeof(rtp->rtcp->bridgedchannel));
 	} else {
-		if(rtp->rtcp->bridgedchan[0] != '\0') {
-			ast_debug(1, "!!!!!! Keeping bridged channel name \n");
+		if(rtp->rtcp->bridgedchannel[0] != '\0') {
+			ast_debug(1, "!!!!!! Keeping bridged channel name %s\n", rtp->rtcp->bridgedchannel);
 		}
 		//rtp->rtcp->bridgedchan[0] = '\0';
 	}
-	if (bridgeduniqueid) {
-		ast_debug(1, "!!!!!! Setting bridged unique id \n");
+	if (!ast_strlen_zero(bridgeduniqueid)) {
+		ast_debug(1, "!!!!!! Setting bridged unique id to %s\n", bridgeduniqueid);
 		ast_copy_string(rtp->rtcp->bridgeduniqueid, bridgeduniqueid, sizeof(rtp->rtcp->bridgeduniqueid));
 	} else {
 		if(rtp->rtcp->bridgeduniqueid[0] != '\0') {




More information about the asterisk-commits mailing list