[asterisk-commits] oej: branch group/pinefool-poor-mans-plc-1.4 r383670 - in /team/group/pinefoo...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 25 07:52:31 CDT 2013


Author: oej
Date: Mon Mar 25 07:52:26 2013
New Revision: 383670

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383670
Log:
- Remove not needed setting in RTP.conf (we now set it in sip.conf). 
- Add new settings for "expose packet loss over bridge".
- Add PLC status in sip show peer etc

Developers interested in RTP PLC in other channels are invited to use the new API call to
enable it.

Modified:
    team/group/pinefool-poor-mans-plc-1.4/channels/chan_sip.c
    team/group/pinefool-poor-mans-plc-1.4/configs/rtp.conf.sample
    team/group/pinefool-poor-mans-plc-1.4/main/rtp.c

Modified: team/group/pinefool-poor-mans-plc-1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pinefool-poor-mans-plc-1.4/channels/chan_sip.c?view=diff&rev=383670&r1=383669&r2=383670
==============================================================================
--- team/group/pinefool-poor-mans-plc-1.4/channels/chan_sip.c (original)
+++ team/group/pinefool-poor-mans-plc-1.4/channels/chan_sip.c Mon Mar 25 07:52:26 2013
@@ -11794,6 +11794,7 @@
 		ast_cli(fd, "  T38 pt RTP   : %s\n", ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT_RTP)?"Yes":"No");
 		ast_cli(fd, "  T38 pt TCP   : %s\n", ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT_TCP)?"Yes":"No");
 #endif
+		ast_cli(fd, "  RTP PLC      : %s\n", ast_test_flag(&peer->flags[1], SIP_PAGE2_POORMANSPLC) ? "Yes" : "No");
 		ast_cli(fd, "  CanReinvite  : %s\n", ast_test_flag(&peer->flags[0], SIP_CAN_REINVITE)?"Yes":"No");
 		ast_cli(fd, "  PromiscRedir : %s\n", ast_test_flag(&peer->flags[0], SIP_PROMISCREDIR)?"Yes":"No");
 		ast_cli(fd, "  User=Phone   : %s\n", ast_test_flag(&peer->flags[0], SIP_USEREQPHONE)?"Yes":"No");
@@ -12055,6 +12056,7 @@
 	ast_cli(fd, "  IP ToS SIP:             %s\n", ast_tos2str(global_tos_sip));
 	ast_cli(fd, "  IP ToS RTP audio:       %s\n", ast_tos2str(global_tos_audio));
 	ast_cli(fd, "  IP ToS RTP video:       %s\n", ast_tos2str(global_tos_video));
+	ast_cli(fd, "  RTP PLC:                %s\n", ast_test_flag(&global_flags[1], SIP_PAGE2_POORMANSPLC) ? "Yes" : "No");
 	ast_cli(fd, "  T38 fax pt UDPTL:       %s\n", ast_test_flag(&global_flags[1], SIP_PAGE2_T38SUPPORT_UDPTL) ? "Yes" : "No");
 #ifdef WHEN_WE_HAVE_T38_FOR_OTHER_TRANSPORTS
 	ast_cli(fd, "  T38 fax pt RTP:         %s\n", ast_test_flag(&global_flags[1], SIP_PAGE2_T38SUPPORT_RTP) ? "Yes" : "No");
@@ -12405,6 +12407,7 @@
 			ast_cli(fd, "  Promiscuous Redir:      %s\n", ast_test_flag(&cur->flags[0], SIP_PROMISCREDIR) ? "Yes" : "No");
 			ast_cli(fd, "  Route:                  %s\n", cur->route ? cur->route->hop : "N/A");
 			ast_cli(fd, "  DTMF Mode:              %s\n", dtmfmode2str(ast_test_flag(&cur->flags[0], SIP_DTMF)));
+			ast_cli(fd, "  RTP PLC:                %s\n", ast_test_flag(&cur->flags[1], SIP_PAGE2_POORMANSPLC) ? "Yes" : "No");
 			ast_cli(fd, "  SIP Options:            ");
 			if (cur->sipoptions) {
 				int x;

Modified: team/group/pinefool-poor-mans-plc-1.4/configs/rtp.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/group/pinefool-poor-mans-plc-1.4/configs/rtp.conf.sample?view=diff&rev=383670&r1=383669&r2=383670
==============================================================================
--- team/group/pinefool-poor-mans-plc-1.4/configs/rtp.conf.sample (original)
+++ team/group/pinefool-poor-mans-plc-1.4/configs/rtp.conf.sample Mon Mar 25 07:52:26 2013
@@ -21,5 +21,9 @@
 ; rtcpinterval = 5000 	; Milliseconds between rtcp reports 
 			;(min 500, max 60000, default 5000)
 ;
-; PLC - packet loss concealment
-plc=yes
+; The "Donthidepacketloss" is a setting that is disabled by default in this release.
+; Asterisk by default resequences RTP packets, so that if we receive packets 20,21,23,24
+; they will be renumbered as 20,21,22,23. If you set this setting to "yes" there will
+; be a gap in the outbound sequence numbers as well, which in most cases will help
+; both codecs and jitter buffers/PLC functions in the receiving end - a phone or a gateway.
+donthidepacketloss = no

Modified: team/group/pinefool-poor-mans-plc-1.4/main/rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pinefool-poor-mans-plc-1.4/main/rtp.c?view=diff&rev=383670&r1=383669&r2=383670
==============================================================================
--- team/group/pinefool-poor-mans-plc-1.4/main/rtp.c (original)
+++ team/group/pinefool-poor-mans-plc-1.4/main/rtp.c Mon Mar 25 07:52:26 2013
@@ -78,6 +78,7 @@
 static int dtmftimeout = DEFAULT_DTMF_TIMEOUT;
 
 static int poormansplc;			/*!< Are we using poor man's packet loss concealment? */
+static int donthidepacketloss;		/*!< Do not hide packet loss on outbound RTP - default off */
 static int rtpstart;			/*!< First port for RTP sessions (set in rtp.conf) */
 static int rtpend;			/*!< Last port for RTP sessions (set in rtp.conf) */
 static int rtpdebug;			/*!< Are we debugging? */
@@ -2857,7 +2858,7 @@
 		return 0;
 	}
 	
-	if (rtp->prev_frame_seqno > 0 && f->seqno && f->seqno != (rtp->prev_frame_seqno + 1)) {
+	if (donthidepacketloss && rtp->prev_frame_seqno > 0 && f->seqno && f->seqno != (rtp->prev_frame_seqno + 1)) {
 		/* We have incoming packet loss and need to signal that outbound. */
 		unsigned int loss = f->seqno - rtp->prev_frame_seqno - 1;
 		if (option_debug > 2) {
@@ -4035,6 +4036,7 @@
 	const char *s;
 
 	poormansplc = 0;
+	donthidepacketloss = 0;
 	rtpstart = 5000;
 	rtpend = 31000;
 	dtmftimeout = DEFAULT_DTMF_TIMEOUT;
@@ -4074,10 +4076,10 @@
 				ast_log(LOG_WARNING, "Disabling RTP checksums is not supported on this operating system!\n");
 #endif
 		}
-		if ((s = ast_variable_retrieve(cfg, "general", "plc"))) {
-			poormansplc = ast_true(s);
+		if ((s = ast_variable_retrieve(cfg, "general", "donthidepacketloss"))) {
+			donthidepacketloss = ast_true(s);
 			if (option_debug > 1) {
-				ast_log(LOG_DEBUG, "*** Poor man's PLC is turned %s\n", poormansplc ? "on" : "off" );
+				ast_log(LOG_DEBUG, "*** Hiding packet loss on outbound RTP stream?  %s\n", donthidepacketloss ? "on" : "off" );
 			}
 		}
 		if ((s = ast_variable_retrieve(cfg, "general", "dtmftimeout"))) {




More information about the asterisk-commits mailing list