[asterisk-commits] oej: branch oej/no-premature-183 r177660 - /team/oej/no-premature-183/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 20 03:07:17 CST 2009


Author: oej
Date: Fri Feb 20 03:07:17 2009
New Revision: 177660

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=177660
Log:
A very crude way of stopping chan_sip from sending any media before it's
time (according to signalling).

Modified:
    team/oej/no-premature-183/channels/chan_sip.c

Modified: team/oej/no-premature-183/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/no-premature-183/channels/chan_sip.c?view=diff&rev=177660&r1=177659&r2=177660
==============================================================================
--- team/oej/no-premature-183/channels/chan_sip.c (original)
+++ team/oej/no-premature-183/channels/chan_sip.c Fri Feb 20 03:07:17 2009
@@ -536,6 +536,7 @@
 
 /* Global settings only apply to the channel */
 static int global_directrtpsetup;	/*!< Enable support for Direct RTP setup (no re-invites) */
+static int global_prematuremediafilter;	/*!< Enable/disable premature frames in a call (causing 183 early media) */
 static int global_limitonpeers;		/*!< Match call limit on peers only */
 static int global_rtautoclear;
 static int global_notifyringing;	/*!< Send notifications on ringing */
@@ -3802,10 +3803,12 @@
 				    !ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) &&
 				    !ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
 					ast_rtp_new_source(p->rtp);
-					p->invitestate = INV_EARLY_MEDIA;
-					transmit_response_with_sdp(p, "183 Session Progress", &p->initreq, XMIT_UNRELIABLE);
-					ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);
-				}
+					if (!global_prematuremediafilter) {
+						p->invitestate = INV_EARLY_MEDIA;
+						transmit_response_with_sdp(p, "183 Session Progress", &p->initreq, XMIT_UNRELIABLE);
+						ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);
+					}
+				} 
 				p->lastrtptx = time(NULL);
 				res = ast_rtp_write(p->rtp, frame);
 			}
@@ -11010,6 +11013,7 @@
 	print_codec_to_cli(fd, &default_prefs);
 	ast_cli(fd, "\n");
 	ast_cli(fd, "  T1 minimum:             %d\n", global_t1min);
+	ast_cli(fd, "  No premature media:     %s\n", global_prematuremediafilter ? "Yes" : "No");
 	ast_cli(fd, "  Relax DTMF:             %s\n", global_relaxdtmf ? "Yes" : "No");
 	ast_cli(fd, "  Compact SIP headers:    %s\n", compactheaders ? "Yes" : "No");
 	ast_cli(fd, "  RTP Keepalive:          %d %s\n", global_rtpkeepalive, global_rtpkeepalive ? "" : "(Disabled)" );
@@ -17746,6 +17750,7 @@
 	expiry = DEFAULT_EXPIRY;
 	global_notifyringing = DEFAULT_NOTIFYRINGING;
 	global_limitonpeers = FALSE;
+	global_prematuremediafilter = FALSE;
 	global_directrtpsetup = FALSE;		/* Experimental feature, disabled by default */
 	global_notifyhold = FALSE;
 	global_alwaysauthreject = 0;
@@ -17851,6 +17856,8 @@
 			ast_set2_flag(&global_flags[1], i || ast_true(v->value), SIP_PAGE2_RTAUTOCLEAR);
 		} else if (!strcasecmp(v->name, "usereqphone")) {
 			ast_set2_flag(&global_flags[0], ast_true(v->value), SIP_USEREQPHONE);	
+		} else if (!strcasecmp(v->name, "prematuremedia")) {
+			global_prematuremediafilter = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "relaxdtmf")) {
 			global_relaxdtmf = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "checkmwi")) {




More information about the asterisk-commits mailing list