[asterisk-commits] wdoekes: trunk r375137 - in /trunk: cdr/ channels/ main/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 17 09:25:00 CDT 2012


Author: wdoekes
Date: Wed Oct 17 09:24:52 2012
New Revision: 375137

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=375137
Log:
Change a few warnings to debug and the inverse.

Remove the "RTP Read too short" warning for RTP keepalives. Remove the
the warning about the application delimiter switch from pipe to comma.
(You should've done this by now.) Make cdr_odbc report more when an
insert fails. Make chan_sip warn less when the peer wants SRTP (and we
don't) or sends a zero port to disable a media type.

Review: https://reviewboard.asterisk.org/r/2167
(closes issue ASTERISK-20538)

Modified:
    trunk/cdr/cdr_odbc.c
    trunk/channels/chan_sip.c
    trunk/main/pbx.c
    trunk/res/res_rtp_asterisk.c

Modified: trunk/cdr/cdr_odbc.c
URL: http://svnview.digium.com/svn/asterisk/trunk/cdr/cdr_odbc.c?view=diff&rev=375137&r1=375136&r2=375137
==============================================================================
--- trunk/cdr/cdr_odbc.c (original)
+++ trunk/cdr/cdr_odbc.c Wed Oct 17 09:24:52 2012
@@ -94,7 +94,7 @@
 	ODBC_res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
 
 	if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
-		ast_verb(11, "cdr_odbc: Failure in AllocStatement %d\n", ODBC_res);
+		ast_log(LOG_WARNING, "cdr_odbc: Failure in AllocStatement %d\n", ODBC_res);
 		SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 		return NULL;
 	}
@@ -139,7 +139,7 @@
 	ODBC_res = SQLExecDirect(stmt, (unsigned char *)sqlcmd, SQL_NTS);
 
 	if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
-		ast_verb(11, "cdr_odbc: Error in ExecDirect: %d\n", ODBC_res);
+		ast_log(LOG_WARNING, "cdr_odbc: Error in ExecDirect: %d, query is: %s\n", ODBC_res, sqlcmd);
 		SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 		return NULL;
 	}

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=375137&r1=375136&r2=375137
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Oct 17 09:24:52 2012
@@ -10032,7 +10032,7 @@
 				sprintf(offer->decline_m_line, "m=audio 0 %s %s", protocol, codecs);
 
 				if (x == 0) {
-					ast_log(LOG_WARNING, "Ignoring audio media offer because port number is zero\n");
+					ast_debug(1, "Ignoring audio media offer because port number is zero\n");
 					continue;
 				}
 
@@ -10114,7 +10114,7 @@
 				sprintf(offer->decline_m_line, "m=video 0 %s %s", protocol, codecs);
 
 				if (x == 0) {
-					ast_log(LOG_WARNING, "Ignoring video stream offer because port number is zero\n");
+					ast_debug(1, "Ignoring video stream offer because port number is zero\n");
 					continue;
 				}
 
@@ -10192,7 +10192,7 @@
 				sprintf(offer->decline_m_line, "m=text 0 %s %s", protocol, codecs);
 
 				if (x == 0) {
-					ast_log(LOG_WARNING, "Ignoring text stream offer because port number is zero\n");
+					ast_debug(1, "Ignoring text stream offer because port number is zero\n");
 					continue;
 				}
 
@@ -10255,7 +10255,7 @@
 				strcpy(offer->decline_m_line, "m=image 0 udptl t38");
 
 				if (x == 0) {
-					ast_log(LOG_WARNING, "Ignoring image stream offer because port number is zero\n");
+					ast_debug(1, "Ignoring image stream offer because port number is zero\n");
 					continue;
 				}
 
@@ -10600,7 +10600,7 @@
 			ast_sockaddr_set_port(isa, udptlportno);
 			ast_udptl_set_peer(p->udptl, isa);
 			if (debug)
-				ast_debug(1,"Peer T.38 UDPTL is at port %s\n", ast_sockaddr_stringify(isa));
+				ast_debug(1, "Peer T.38 UDPTL is at port %s\n", ast_sockaddr_stringify(isa));
 
 			/* verify the far max ifp can be calculated. this requires far max datagram to be set. */
 			if (!ast_udptl_get_far_max_datagram(p->udptl)) {
@@ -21269,7 +21269,7 @@
 		}
 		/* Send the feature code to the PBX as DTMF, just like the handset had sent it */
 		f.len = 100;
-		for (j=0; j < strlen(feat->exten); j++) {
+		for (j = 0; j < strlen(feat->exten); j++) {
 			f.subclass.integer = feat->exten[j];
 			ast_queue_frame(p->owner, &f);
 			if (sipdebug) {
@@ -21360,7 +21360,7 @@
 			ast_cli(a->fd, "SIP Debugging Disabled\n");
 			return CLI_SUCCESS;
 		}
-	} else if (a->argc == e->args +1) {/* ip/peer */
+	} else if (a->argc == e->args + 1) { /* ip/peer */
 		if (!strcasecmp(what, "ip"))
 			return sip_do_debug_ip(a->fd, a->argv[e->args]);
 		else if (!strcasecmp(what, "peer"))
@@ -27559,11 +27559,12 @@
 		accept = __get_header(req, "Accept", &start);
 		while (!found_supported && !ast_strlen_zero(accept)) {
 			found_supported = strcmp(accept, "application/simple-message-summary") ? 0 : 1;
-			if (!found_supported && (option_debug > 2)) {
-				ast_debug(1, "Received SIP mailbox subscription for unknown format: %s\n", accept);
+			if (!found_supported) {
+				ast_debug(3, "Received SIP mailbox subscription for unknown format: %s\n", accept);
 			}
 			accept = __get_header(req, "Accept", &start);
 		}
+		/* If !start, there is no Accept header at all */
 		if (start && !found_supported) {
 			/* Format requested that we do not support */
 			transmit_response(p, "406 Not Acceptable", req);
@@ -32823,7 +32824,7 @@
 static int setup_srtp(struct sip_srtp **srtp)
 {
 	if (!ast_rtp_engine_srtp_is_registered()) {
-		ast_log(LOG_ERROR, "No SRTP module loaded, can't setup SRTP session.\n");
+		ast_debug(1, "No SRTP module loaded, can't setup SRTP session.\n");
 		return -1;
 	}
 

Modified: trunk/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/pbx.c?view=diff&rev=375137&r1=375136&r2=375137
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Wed Oct 17 09:24:52 2012
@@ -1580,12 +1580,6 @@
 
 	if (app->module)
 		u = __ast_module_user_add(app->module, c);
-	if (strcasecmp(app->name, "system") && !ast_strlen_zero(data) &&
-			strchr(data, '|') && !strchr(data, ',') && !ast_opt_dont_warn) {
-		ast_log(LOG_WARNING, "The application delimiter is now the comma, not "
-			"the pipe.  Did you forget to convert your dialplan?  (%s(%s))\n",
-			app->name, (char *) data);
-	}
 	res = app->execute(c, S_OR(data, ""));
 	if (app->module && u)
 		__ast_module_user_remove(app->module, u);

Modified: trunk/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_rtp_asterisk.c?view=diff&rev=375137&r1=375136&r2=375137
==============================================================================
--- trunk/res/res_rtp_asterisk.c (original)
+++ trunk/res/res_rtp_asterisk.c Wed Oct 17 09:24:52 2012
@@ -3467,7 +3467,14 @@
 
 	/* Make sure the data that was read in is actually enough to make up an RTP packet */
 	if (res < hdrlen) {
-		ast_log(LOG_WARNING, "RTP Read too short\n");
+		/* If this is a keepalive containing only nulls, don't bother with a warning */
+		int i;
+		for (i = 0; i < res; ++i) {
+			if (rtp->rawdata[AST_FRIENDLY_OFFSET + i] != '\0') {
+				ast_log(LOG_WARNING, "RTP Read too short\n");
+				return &ast_null_frame;
+			}
+		}
 		return &ast_null_frame;
 	}
 




More information about the asterisk-commits mailing list