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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 22 06:35:28 CDT 2013


Author: oej
Date: Wed May 22 06:35:23 2013
New Revision: 389475

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389475
Log:
Adding tons of debug to see what's going on

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=389475&r1=389474&r2=389475
==============================================================================
--- 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 Wed May 22 06:35:23 2013
@@ -7564,10 +7564,13 @@
 	 * 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));
@@ -7830,12 +7833,18 @@
 	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:
@@ -7957,6 +7966,7 @@
 
 	/* 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;
 	}
@@ -9722,6 +9732,7 @@
 	/* 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) {
@@ -9735,6 +9746,7 @@
 			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));
 			}
 
@@ -9760,6 +9772,7 @@
 			/* 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");
@@ -20881,6 +20894,7 @@
 				ast_queue_control(p->owner, AST_CONTROL_PROGRESS);
 			}
 			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
@@ -30097,6 +30111,7 @@
 
 		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);
@@ -30110,6 +30125,7 @@
 			 * 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=389475&r1=389474&r2=389475
==============================================================================
--- 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 Wed May 22 06:35:23 2013
@@ -2641,6 +2641,7 @@
 
 	/* 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;
 		
@@ -2655,7 +2656,10 @@
 		/* 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;
@@ -3989,10 +3993,12 @@
 			}
 			/* Clear the exception flag */
 			ast_clear_flag(chan, AST_FLAG_EXCEPTION);
-		} else if (chan->tech && chan->tech->read)
+		} else if (chan->tech && chan->tech->read) {
+			ast_debug(4, "====> Reading on channel %s\n", chan->name);
 			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=389475&r1=389474&r2=389475
==============================================================================
--- 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 Wed May 22 06:35:23 2013
@@ -1728,6 +1728,7 @@
 
 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=389475&r1=389474&r2=389475
==============================================================================
--- 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 Wed May 22 06:35:23 2013
@@ -523,10 +523,12 @@
 	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();
@@ -544,6 +546,8 @@
 		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 */
@@ -573,6 +577,8 @@
 			return -1;
 		}
 	}
+
+	ast_debug(3, "=====> New RTP instance created. Port %d\n", x);
 
 	/* Record any information we may need */
 	rtp->sched = sched;
@@ -2141,7 +2147,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,
@@ -2162,6 +2168,8 @@
 
 	/* 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