[asterisk-commits] may: branch may/ooh323_ipv6_direct_rtp r307965 - in /team/may/ooh323_ipv6_dir...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 15 16:12:59 CST 2011


Author: may
Date: Tue Feb 15 16:12:55 2011
New Revision: 307965

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=307965
Log:
initial fill mediaInfo struct by zeroes.

Modified:
    team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c

Modified: team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c?view=diff&rev=307965&r1=307964&r2=307965
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c Tue Feb 15 16:12:55 2011
@@ -3854,8 +3854,10 @@
 	}
 
 	ast_rtp_instance_get_remote_address(*rtp, &tmp);
-	ast_verbose("ooh323_get_rtp_peer  %s -> %s:%d, %d\n", chan->name, ast_sockaddr_stringify_addr(&tmp),
+	if (gH323Debug) {
+		ast_verbose("ooh323_get_rtp_peer  %s -> %s:%d, %d\n", chan->name, ast_sockaddr_stringify_addr(&tmp),
 						ast_sockaddr_port(&tmp), res);
+	}
 	if (gH323Debug) {
 		ast_verbose("--- ooh323  get_rtp_peer, res = %d\n", (int) res);	
 	}
@@ -4003,7 +4005,8 @@
 
 int configure_local_rtp(struct ooh323_pvt *p, ooCallData *call)
 {
-	char lhost[INET6_ADDRSTRLEN], *lport=NULL;
+	char lhost[INET6_ADDRSTRLEN];
+	unsigned lport = 0;
 	struct ast_sockaddr tmp;
 	ooMediaInfo mediaInfo;
 	int x;
@@ -4014,7 +4017,7 @@
 	if (gH323Debug)
 		ast_verbose("---   configure_local_rtp\n");
 
-
+	memset(&mediaInfo, 0, sizeof(mediaInfo));
 	if (ast_parse_arg(call->localIP, PARSE_ADDR, &tmp)) {
 		ast_sockaddr_copy(&tmp, &bindaddr);
 	}
@@ -4068,7 +4071,7 @@
 		/* figure out our local RTP port and tell the H.323 stack about it*/
 		ast_rtp_instance_get_local_address(p->rtp, &tmp);
 		strncpy(lhost, ast_sockaddr_stringify_addr(&tmp), sizeof(lhost));
-		lport = ast_sockaddr_stringify_port(&tmp);
+		lport = ast_sockaddr_port(&tmp);
 
 		if (p->rtptimeout) {
 			ast_rtp_instance_set_timeout(p->rtp, p->rtptimeout);
@@ -4086,8 +4089,8 @@
 
 
 	ast_copy_string(mediaInfo.lMediaIP, lhost, sizeof(mediaInfo.lMediaIP));
-	mediaInfo.lMediaPort = atoi(lport);
-	mediaInfo.lMediaCntrlPort = mediaInfo.lMediaPort +1;
+	mediaInfo.lMediaPort = lport;
+	mediaInfo.lMediaCntrlPort = mediaInfo.lMediaPort + 1;
 	for (x = 0; ast_codec_pref_index(&p->prefs, x, &tmpfmt); x++) {
 		strcpy(mediaInfo.dir, "transmit");
 		mediaInfo.cap = ooh323_convertAsteriskCapToH323Cap(&tmpfmt);
@@ -4112,9 +4115,9 @@
 	if (p->udptl) {
 		ast_udptl_get_us(p->udptl, &tmp);
 		strncpy(lhost, ast_sockaddr_stringify_addr(&tmp), sizeof(lhost));
-		lport = ast_sockaddr_stringify_port(&tmp);
+		lport = ast_sockaddr_port(&tmp);
 		ast_copy_string(mediaInfo.lMediaIP, lhost, sizeof(mediaInfo.lMediaIP));
-		mediaInfo.lMediaPort = atoi(lport);
+		mediaInfo.lMediaPort = lport;
 		mediaInfo.lMediaCntrlPort = mediaInfo.lMediaPort +1;
 		mediaInfo.cap = OO_T38;
 		strcpy(mediaInfo.dir, "transmit");
@@ -4274,8 +4277,8 @@
 		ast_queue_control_data(p->owner, AST_CONTROL_T38_PARAMETERS, &parameters, sizeof(parameters));
 	}
 	if (gH323Debug)
-		ast_debug(1, "Receiving UDPTL  %s:%s\n", ast_sockaddr_stringify_host(&them),
-							ast_sockaddr_stringify_port(&them));
+		ast_debug(1, "Receiving UDPTL  %s:%d\n", ast_sockaddr_stringify_host(&them),
+							ast_sockaddr_port(&them));
 
 	ast_channel_unlock(p->owner);
 	ast_mutex_unlock(&p->lock);

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c?view=diff&rev=307965&r1=307964&r2=307965
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c Tue Feb 15 16:12:55 2011
@@ -87,6 +87,8 @@
          strcpy(pNewChannel->localIP, call->localIP);
       else
          strcpy(pNewChannel->localIP, pMediaInfo->lMediaIP);
+
+      OOTRACEDBGC5("Configured media info (%s, %s) %s:%d\n", call->callType, call->callToken, pNewChannel->localIP, pNewChannel->localRtcpPort);
    }
    else{
       OOTRACEDBGC3("Using default media info (%s, %s)\n", call->callType,




More information about the asterisk-commits mailing list