[svn-commits] branch mogorman/asterisk-xmpp r21515 - /team/mogorman/asterisk-xmpp/rtp.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Apr 19 09:01:07 MST 2006


Author: markster
Date: Wed Apr 19 11:01:06 2006
New Revision: 21515

URL: http://svn.digium.com/view/asterisk?rev=21515&view=rev
Log:
Make stun debugging optional

Modified:
    team/mogorman/asterisk-xmpp/rtp.c

Modified: team/mogorman/asterisk-xmpp/rtp.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/rtp.c?rev=21515&r1=21514&r2=21515&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/rtp.c (original)
+++ team/mogorman/asterisk-xmpp/rtp.c Wed Apr 19 11:01:06 2006
@@ -68,7 +68,7 @@
 static int rtpstart = 0;		/*!< First port for RTP sessions (set in rtp.conf) */
 static int rtpend = 0;			/*!< Last port for RTP sessions (set in rtp.conf) */
 static int rtpdebug = 0;		/*!< Are we debugging? */
-static int stundebug = 1;		/*!< Are we debugging stun? */
+static int stundebug = 0;		/*!< Are we debugging stun? */
 static struct sockaddr_in rtpdebugaddr;	/*!< Debug packets to/from this host */
 #ifdef SO_NO_CHECK
 static int nochecksums = 0;
@@ -2076,6 +2076,26 @@
 	return RESULT_SUCCESS;
 }
 
+static int stun_do_debug(int fd, int argc, char *argv[])
+{
+	if(argc != 2) {
+		return RESULT_SHOWUSAGE;
+	}
+	stundebug = 1;
+	ast_cli(fd, "STUN Debugging Enabled\n");
+	return RESULT_SUCCESS;
+}
+   
+static int stun_no_debug(int fd, int argc, char *argv[])
+{
+	if(argc !=3)
+		return RESULT_SHOWUSAGE;
+	stundebug = 0;
+	ast_cli(fd,"STUN Debugging Disabled\n");
+	return RESULT_SUCCESS;
+}
+
+
 static char debug_usage[] =
   "Usage: rtp debug [ip host[:port]]\n"
   "       Enable dumping of all RTP packets to and from host.\n";
@@ -2084,6 +2104,15 @@
   "Usage: rtp no debug\n"
   "       Disable all RTP debugging\n";
 
+static char stun_debug_usage[] =
+  "Usage: stun debug\n"
+  "       Enable STUN (Simple Traversal of UDP through NATs) debugging\n";
+
+static char stun_no_debug_usage[] =
+  "Usage: stun no debug\n"
+  "       Disable STUN debugging\n";
+
+
 static struct ast_cli_entry  cli_debug_ip =
 {{ "rtp", "debug", "ip", NULL } , rtp_do_debug, "Enable RTP debugging on IP", debug_usage };
 
@@ -2092,6 +2121,12 @@
 
 static struct ast_cli_entry  cli_no_debug =
 {{ "rtp", "no", "debug", NULL } , rtp_no_debug, "Disable RTP debugging", no_debug_usage };
+
+static struct ast_cli_entry  cli_stun_debug =
+{{ "stun", "debug", NULL } , stun_do_debug, "Enable STUN debugging", stun_debug_usage };
+
+static struct ast_cli_entry  cli_stun_no_debug =
+{{ "stun", "no", "debug", NULL } , stun_no_debug, "Disable STUN debugging", stun_no_debug_usage };
 
 int ast_rtp_reload(void)
 {
@@ -2154,5 +2189,7 @@
 	ast_cli_register(&cli_debug);
 	ast_cli_register(&cli_debug_ip);
 	ast_cli_register(&cli_no_debug);
+	ast_cli_register(&cli_stun_debug);
+	ast_cli_register(&cli_stun_no_debug);
 	ast_rtp_reload();
 }



More information about the svn-commits mailing list