[asterisk-commits] oej: branch group/rana-early-media-is-gone-1.8 r389541 - in /team/group/rana-...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 23 04:20:56 CDT 2013


Author: oej
Date: Thu May 23 04:20:49 2013
New Revision: 389541

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389541
Log:
Resetting

Modified:
    team/group/rana-early-media-is-gone-1.8/channels/chan_sip.c
    team/group/rana-early-media-is-gone-1.8/main/channel.c
    team/group/rana-early-media-is-gone-1.8/main/rtp_engine.c
    team/group/rana-early-media-is-gone-1.8/res/res_rtp_asterisk.c

Modified: team/group/rana-early-media-is-gone-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/rana-early-media-is-gone-1.8/channels/chan_sip.c?view=diff&rev=389541&r1=389540&r2=389541
==============================================================================
--- team/group/rana-early-media-is-gone-1.8/channels/chan_sip.c (original)
+++ team/group/rana-early-media-is-gone-1.8/channels/chan_sip.c Thu May 23 04:20:49 2013
@@ -7564,13 +7564,10 @@
 	 * UDPTL is created as needed in the lifetime of a dialog, its file
 	 * descriptor is set in initialize_udptl */
 	if (i->rtp) {
-		ast_debug(3, "===> Setting file descriptors on channel \n");
 		ast_channel_set_fd(tmp, 0, ast_rtp_instance_fd(i->rtp, 0));
 		ast_channel_set_fd(tmp, 1, ast_rtp_instance_fd(i->rtp, 1));
 		ast_rtp_instance_set_write_format(i->rtp, fmt);
 		ast_rtp_instance_set_read_format(i->rtp, fmt);
-	} else {
-		ast_debug(3, "===> NOT Setting file descriptors for RTP on channel \n");
 	}
 	if (needvideo && i->vrtp) {
 		ast_channel_set_fd(tmp, 2, ast_rtp_instance_fd(i->vrtp, 0));
@@ -7833,18 +7830,12 @@
 	struct ast_frame *f;
 	
 	if (!p->rtp) {
-
-		ast_debug(4, "===> Trying to read, but no RTP allocated - %s\n", ast->name);
 		/* We have no RTP allocated for this channel */
 		return &ast_null_frame;
 	}
-	if (ast->fdno != 8) {
-		ast_debug(5, "===> Read audio fd %-2.2d for  %s\n", ast->fdno, ast->name);
-	}
 
 	switch(ast->fdno) {
 	case 0:
-		ast_debug(4, "===> Read audio for  %s\n", ast->name);
 		f = ast_rtp_instance_read(p->rtp, 0);	/* RTP Audio */
 		break;
 	case 1:
@@ -7966,7 +7957,6 @@
 
 	/* Only allow audio through if they sent progress with SDP, or if the channel is actually answered */
 	if (fr && fr->frametype == AST_FRAME_VOICE && p->invitestate != INV_EARLY_MEDIA && ast->_state != AST_STATE_UP) {
-		ast_debug(3, "====> SIP_READ Throwing away audio \n");
 		ast_frfree(fr);
 		fr = &ast_null_frame;
 	}
@@ -9732,7 +9722,6 @@
 	/* Setup audio address and port */
 	if (p->rtp) {
 		if (portno > 0) {
-			ast_debug(4, "====> Setting address and port to send to \n");
 			ast_sockaddr_set_port(sa, portno);
 			ast_rtp_instance_set_remote_address(p->rtp, sa);
 			if (debug) {
@@ -9746,7 +9735,6 @@
 			ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 1);
 			/* Ensure audio RTCP reads are enabled */
 			if (p->owner) {
-				ast_debug(3, "====> Setting RTCP read fd on channel \n");
 				ast_channel_set_fd(p->owner, 1, ast_rtp_instance_fd(p->rtp, 1));
 			}
 
@@ -9772,7 +9760,6 @@
 			/* Silence RTCP while audio RTP is inactive */
 			ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 0);
 		} else {
-			ast_debug(4, "====> Disabling RTP \n");
 			ast_rtp_instance_stop(p->rtp);
 			if (debug)
 				ast_verbose("Peer doesn't provide audio\n");
@@ -20892,9 +20879,9 @@
 			if (!req->ignore && p->owner) {
 				/* Queue a progress frame */
 				ast_queue_control(p->owner, AST_CONTROL_PROGRESS);
+				ast_debug(3, "---> Queuing progress \n");
 			}
 			ast_rtp_instance_activate(p->rtp);
-			ast_debug(3, "==========> ACTIVATING RTP on this channel %s\n", p->callid);
 		} else {
 			/* Alcatel PBXs are known to send 183s with no SDP after sending
 			 * a 100 Trying response. We're just going to treat this sort of thing
@@ -22985,6 +22972,9 @@
 	enum st_refresher tmp_st_ref = SESSION_TIMER_REFRESHER_AUTO; /* Session-Timer refresher     */
 	int dlg_min_se = -1;
 	int dlg_max_se = global_max_se;
+	char unsupported[256] = { 0, };
+	int start = 0;
+
 	struct {
 		char exten[AST_MAX_EXTENSION];
 		char context[AST_MAX_CONTEXT];
@@ -22994,29 +22984,40 @@
 
 	/* Find out what they support */
 	if (!p->sipoptions) {
-		const char *supported = get_header(req, "Supported");
-		if (!ast_strlen_zero(supported)) {
-			p->sipoptions = parse_sip_options(supported, NULL, 0);
-		}
+		int start = 0;
+		const char *supported = NULL;
+		/* The Supported: header can be repeated in the same SIP message */
+
+		do {
+			supported = __get_header(req, "Supported", &start);
+			if (!ast_strlen_zero(supported)) {
+				p->sipoptions |= parse_sip_options(supported, NULL, 0);
+			}
+		} while (!ast_strlen_zero(supported));
 	}
 
 	/* Find out what they require */
-	required = get_header(req, "Require");
-	if (!ast_strlen_zero(required)) {
-		char unsupported[256] = { 0, };
-		required_profile = parse_sip_options(required, unsupported, ARRAY_LEN(unsupported));
-
-		/* If there are any options required that we do not support,
-		 * then send a 420 with only those unsupported options listed */
-		if (!ast_strlen_zero(unsupported)) {
-			transmit_response_with_unsupported(p, "420 Bad extension (unsupported)", req, unsupported);
-			ast_log(LOG_WARNING, "Received SIP INVITE with unsupported required extension: required:%s unsupported:%s\n", required, unsupported);
-			p->invitestate = INV_COMPLETED;
-			if (!p->lastinvite)
-				sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
-			res = -1;
-			goto request_invite_cleanup;
-		}
+
+	do {
+		/* The Require: header can be repeated in the same SIP message */
+		required = __get_header(req, "Require", &start);
+		if (!ast_strlen_zero(required)) {
+			required_profile |= parse_sip_options(required, unsupported, ARRAY_LEN(unsupported));
+		}
+	} while (!ast_strlen_zero(required));
+
+	/* If there are any options required that we do not support,
+	 * then send a 420 with only those unsupported options listed */
+
+	if (!ast_strlen_zero(unsupported)) {
+		transmit_response_with_unsupported(p, "420 Bad extension (unsupported)", req, unsupported);
+		ast_log(LOG_WARNING, "Received SIP INVITE with unsupported required extension: required:%s unsupported:%s\n", required, unsupported);
+		p->invitestate = INV_COMPLETED;
+		if (!p->lastinvite) {
+			sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+		}
+		res = -1;
+		goto request_invite_cleanup;
 	}
 
 	/* The option tags may be present in Supported: or Require: headers.
@@ -30111,7 +30112,6 @@
 
 		if (p->rtp) {
 			/* Prevent audio RTCP reads */
-			ast_debug(3, "====> DISABLING AUDIO RTCP READ on channel \n");
 			ast_channel_set_fd(chan, 1, -1);
 			/* Silence RTCP while audio RTP is inactive */
 			ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 0);
@@ -30125,7 +30125,6 @@
 			 * from a reinvite */
 			ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 1);
 			/* Enable audio RTCP reads */
-			ast_debug(3, "====> Enabling AUDIO RTCP READ on channel \n");
 			ast_channel_set_fd(chan, 1, ast_rtp_instance_fd(p->rtp, 1));
 		}
 	}

Modified: team/group/rana-early-media-is-gone-1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/group/rana-early-media-is-gone-1.8/main/channel.c?view=diff&rev=389541&r1=389540&r2=389541
==============================================================================
--- team/group/rana-early-media-is-gone-1.8/main/channel.c (original)
+++ team/group/rana-early-media-is-gone-1.8/main/channel.c Thu May 23 04:20:49 2013
@@ -2641,7 +2641,6 @@
 
 	/* If this new fd is valid, add it to the epoll */
 	if (fd > -1) {
-		ast_debug(3, "===> Adding fd %d to channel %s for epoll listening \n", which, chan->name);
 		if (!aed && (!(aed = ast_calloc(1, sizeof(*aed)))))
 			return;
 		
@@ -2656,10 +2655,7 @@
 		/* We don't have to keep around this epoll data structure now */
 		free(aed);
 		chan->epfd_data[which] = NULL;
-		ast_debug(3, "===> Not Adding fd %d to channel %s for epoll listening \n", which , chan->name);
-	}
-#else
-	ast_debug(3, "===> No EPOLL: Adding fd %d to channel %s for listening \n", which, chan->name);
+	}
 #endif
 	chan->fds[which] = fd;
 	return;
@@ -3993,14 +3989,10 @@
 			}
 			/* Clear the exception flag */
 			ast_clear_flag(chan, AST_FLAG_EXCEPTION);
-		} else if (chan->tech && chan->tech->read) {
-			if (chan->fdno != 8) {
-				ast_debug(4, "====> Reading on channel %s\n", chan->name);
-			}
+		} else if (chan->tech && chan->tech->read)
 			f = chan->tech->read(chan);
-		} else {
+		else
 			ast_log(LOG_WARNING, "No read routine on channel %s\n", chan->name);
-		}
 	}
 
 	/*

Modified: team/group/rana-early-media-is-gone-1.8/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/team/group/rana-early-media-is-gone-1.8/main/rtp_engine.c?view=diff&rev=389541&r1=389540&r2=389541
==============================================================================
--- team/group/rana-early-media-is-gone-1.8/main/rtp_engine.c (original)
+++ team/group/rana-early-media-is-gone-1.8/main/rtp_engine.c Thu May 23 04:20:49 2013
@@ -1728,7 +1728,6 @@
 
 int ast_rtp_instance_activate(struct ast_rtp_instance *instance)
 {
-	ast_debug(3, "========> Activating sir, just activating - Implemented ? %s \n", instance->engine->activate ? "yes" : "no" );
 	return instance->engine->activate ? instance->engine->activate(instance) : 0;
 }
 

Modified: team/group/rana-early-media-is-gone-1.8/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/group/rana-early-media-is-gone-1.8/res/res_rtp_asterisk.c?view=diff&rev=389541&r1=389540&r2=389541
==============================================================================
--- team/group/rana-early-media-is-gone-1.8/res/res_rtp_asterisk.c (original)
+++ team/group/rana-early-media-is-gone-1.8/res/res_rtp_asterisk.c Thu May 23 04:20:49 2013
@@ -523,12 +523,10 @@
 	struct ast_rtp *rtp = NULL;
 	int x, startplace;
 
-
 	/* Create a new RTP structure to hold all of our data */
 	if (!(rtp = ast_calloc(1, sizeof(*rtp)))) {
 		return -1;
 	}
-
 
 	/* Set default parameters on the newly created RTP structure */
 	rtp->ssrc = ast_random();
@@ -546,8 +544,6 @@
 		ast_debug(1, "Failed to create a new socket for RTP instance '%p'\n", instance);
 		ast_free(rtp);
 		return -1;
-	} else {
-		ast_debug(3, "==== > Created new socket for RTP stream \n");
 	}
 
 	/* Now actually find a free RTP port to use */
@@ -577,8 +573,6 @@
 			return -1;
 		}
 	}
-
-	ast_debug(3, "=====> New RTP instance created. Port %d\n", x);
 
 	/* Record any information we may need */
 	rtp->sched = sched;
@@ -2147,7 +2141,7 @@
 	if (rtp->sending_digit) {
 		ast_rtp_dtmf_continuation(instance);
 	}
-	ast_debug(4, "====> Going to read \n");
+
 	/* Actually read in the data from the socket */
 	if ((res = rtp_recvfrom(instance, rtp->rawdata + AST_FRIENDLY_OFFSET,
 				sizeof(rtp->rawdata) - AST_FRIENDLY_OFFSET, 0,
@@ -2168,8 +2162,6 @@
 
 	/* Get fields and verify this is an RTP packet */
 	seqno = ntohl(rtpheader[0]);
-
-	ast_debug(3, "=====> read audio from socket Seqno %d\n", seqno);
 
 	ast_rtp_instance_get_remote_address(instance, &remote_address);
 




More information about the asterisk-commits mailing list