[asterisk-commits] jpeeler: branch jpeeler/sip-dnsmgr r109544 - in /team/jpeeler/sip-dnsmgr: ./ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 18 12:00:36 CDT 2008


Author: jpeeler
Date: Tue Mar 18 12:00:35 2008
New Revision: 109544

URL: http://svn.digium.com/view/asterisk?view=rev&rev=109544
Log:
resolved conflicts

Added:
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/
      - copied from r109475, trunk/pbx/ael/ael-test/ael-ntest23/
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/extensions.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/extensions.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/qq.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/qq.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t1/
      - copied from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t1/
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t1/a.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t1/a.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t1/b.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t1/b.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t1/c.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t1/c.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t2/
      - copied from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t2/
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t2/d.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t2/d.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t2/e.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t2/e.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t2/f.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t2/f.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t3/
      - copied from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t3/
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t3/g.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t3/g.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t3/h.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t3/h.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t3/i.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t3/i.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ael-ntest23/t3/j.ael
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ael-ntest23/t3/j.ael
    team/jpeeler/sip-dnsmgr/pbx/ael/ael-test/ref.ael-ntest23
      - copied unchanged from r109475, trunk/pbx/ael/ael-test/ref.ael-ntest23
Removed:
    team/jpeeler/sip-dnsmgr/main/minimime/
Modified:
    team/jpeeler/sip-dnsmgr/   (props changed)
    team/jpeeler/sip-dnsmgr/CHANGES
    team/jpeeler/sip-dnsmgr/Makefile
    team/jpeeler/sip-dnsmgr/acinclude.m4
    team/jpeeler/sip-dnsmgr/apps/app_festival.c
    team/jpeeler/sip-dnsmgr/apps/app_meetme.c
    team/jpeeler/sip-dnsmgr/apps/app_minivm.c
    team/jpeeler/sip-dnsmgr/apps/app_queue.c
    team/jpeeler/sip-dnsmgr/apps/app_voicemail.c
    team/jpeeler/sip-dnsmgr/build_tools/cflags.xml
    team/jpeeler/sip-dnsmgr/build_tools/make_buildopts_h
    team/jpeeler/sip-dnsmgr/build_tools/menuselect-deps.in
    team/jpeeler/sip-dnsmgr/cdr/cdr_sqlite3_custom.c
    team/jpeeler/sip-dnsmgr/channels/chan_iax2.c
    team/jpeeler/sip-dnsmgr/channels/chan_misdn.c
    team/jpeeler/sip-dnsmgr/channels/chan_sip.c
    team/jpeeler/sip-dnsmgr/channels/chan_skinny.c
    team/jpeeler/sip-dnsmgr/channels/misdn/isdn_lib.c
    team/jpeeler/sip-dnsmgr/channels/misdn/isdn_lib.h
    team/jpeeler/sip-dnsmgr/configs/sip.conf.sample
    team/jpeeler/sip-dnsmgr/configs/sip_notify.conf.sample
    team/jpeeler/sip-dnsmgr/configure
    team/jpeeler/sip-dnsmgr/configure.ac
    team/jpeeler/sip-dnsmgr/funcs/func_enum.c
    team/jpeeler/sip-dnsmgr/include/asterisk/astobj.h
    team/jpeeler/sip-dnsmgr/include/asterisk/autoconfig.h.in
    team/jpeeler/sip-dnsmgr/include/asterisk/extconf.h
    team/jpeeler/sip-dnsmgr/include/asterisk/pbx.h
    team/jpeeler/sip-dnsmgr/include/asterisk/strings.h
    team/jpeeler/sip-dnsmgr/include/asterisk/utils.h
    team/jpeeler/sip-dnsmgr/include/jitterbuf.h
    team/jpeeler/sip-dnsmgr/main/Makefile
    team/jpeeler/sip-dnsmgr/main/asterisk.c
    team/jpeeler/sip-dnsmgr/main/cli.c
    team/jpeeler/sip-dnsmgr/main/features.c
    team/jpeeler/sip-dnsmgr/main/http.c
    team/jpeeler/sip-dnsmgr/main/jitterbuf.c
    team/jpeeler/sip-dnsmgr/main/logger.c
    team/jpeeler/sip-dnsmgr/main/manager.c
    team/jpeeler/sip-dnsmgr/main/pbx.c
    team/jpeeler/sip-dnsmgr/main/rtp.c
    team/jpeeler/sip-dnsmgr/main/translate.c
    team/jpeeler/sip-dnsmgr/main/utils.c
    team/jpeeler/sip-dnsmgr/makeopts.in
    team/jpeeler/sip-dnsmgr/res/ael/ael.flex
    team/jpeeler/sip-dnsmgr/res/ael/ael_lex.c
    team/jpeeler/sip-dnsmgr/res/res_agi.c
    team/jpeeler/sip-dnsmgr/res/res_config_ldap.c
    team/jpeeler/sip-dnsmgr/res/res_indications.c
    team/jpeeler/sip-dnsmgr/res/res_phoneprov.c
    team/jpeeler/sip-dnsmgr/res/res_realtime.c
    team/jpeeler/sip-dnsmgr/utils/ael_main.c
    team/jpeeler/sip-dnsmgr/utils/astman.c
    team/jpeeler/sip-dnsmgr/utils/check_expr.c
    team/jpeeler/sip-dnsmgr/utils/conf2ael.c
    team/jpeeler/sip-dnsmgr/utils/extconf.c
    team/jpeeler/sip-dnsmgr/utils/frame.c

Propchange: team/jpeeler/sip-dnsmgr/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/jpeeler/sip-dnsmgr/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/jpeeler/sip-dnsmgr/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/jpeeler/sip-dnsmgr/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar 18 12:00:35 2008
@@ -1,1 +1,1 @@
-/trunk:1-109072
+/trunk:1-109496

Modified: team/jpeeler/sip-dnsmgr/CHANGES
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/CHANGES?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/CHANGES (original)
+++ team/jpeeler/sip-dnsmgr/CHANGES Tue Mar 18 12:00:35 2008
@@ -167,6 +167,8 @@
      SIP session.
   * Added TCP and TLS support for SIP.  See doc/siptls.txt and configs/sip.conf.sample for
      more information on how it is used.
+  * Added a new configuration option "authfailureevents" that enables manager events when
+    a peer can't authenticate properly. 
 
 IAX2 changes
 ------------

Modified: team/jpeeler/sip-dnsmgr/Makefile
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/Makefile?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/Makefile (original)
+++ team/jpeeler/sip-dnsmgr/Makefile Tue Mar 18 12:00:35 2008
@@ -229,7 +229,7 @@
 ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h
 
 ifeq ($(AST_DEVMODE),yes)
-  ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT)
+  ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT) -Wmissing-format-attribute -Wformat-security #-Wformat=2
 endif
 
 ifneq ($(findstring BSD,$(OSARCH)),)
@@ -445,7 +445,7 @@
 	@$(MAKE) -C sounds dist-clean
 	rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
 	rm -f makeopts.embed_rules
-	rm -f config.log config.status
+	rm -f config.log config.status config.cache
 	rm -rf autom4te.cache
 	rm -f include/asterisk/autoconfig.h
 	rm -f include/asterisk/buildopts.h

Modified: team/jpeeler/sip-dnsmgr/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/acinclude.m4?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/acinclude.m4 (original)
+++ team/jpeeler/sip-dnsmgr/acinclude.m4 Tue Mar 18 12:00:35 2008
@@ -92,7 +92,7 @@
 # AST_C_DEFINE_CHECK([package], [macro name], [header file], [version])
 AC_DEFUN([AST_C_DEFINE_CHECK],
 [
-    if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
+    if test "x${PBX_$1}" != "x1"; then
 	AC_MSG_CHECKING([for $2 in $3])
 	saved_cppflags="${CPPFLAGS}"
 	if test "x${$1_DIR}" != "x"; then
@@ -114,10 +114,11 @@
 		AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
 		AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
 	    ],
-	    [       AC_MSG_RESULT(no) ] 
+	    [   AC_MSG_RESULT(no) ] 
 	)
 	CPPFLAGS="${saved_cppflags}"
     fi
+    AC_SUBST(PBX_$1)
 ])
 
 

Modified: team/jpeeler/sip-dnsmgr/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/apps/app_festival.c?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/apps/app_festival.c (original)
+++ team/jpeeler/sip-dnsmgr/apps/app_festival.c Tue Mar 18 12:00:35 2008
@@ -327,11 +327,21 @@
 	if (!(cachedir = ast_variable_retrieve(cfg, "general", "cachedir"))) {
 		cachedir = "/tmp/";
 	}
+
+	data = ast_strdupa(vdata);
+	AST_STANDARD_APP_ARGS(args, data);
+
 	if (!(festivalcommand = ast_variable_retrieve(cfg, "general", "festivalcommand"))) {
-		festivalcommand = "(tts_textasterisk \"%s\" 'file)(quit)\n";
+		const char *startcmd = "(tts_textasterisk \"";
+		const char *endcmd = "\" 'file)(quit)\n";
+
+		strln = strlen(startcmd) + strlen(args.text) + strlen(endcmd) + 1;
+		newfestivalcommand = alloca(strln);
+		snprintf(newfestivalcommand, strln, "%s%s%s", startcmd, args.text, endcmd);
+		festivalcommand = newfestivalcommand;
 	} else { /* This else parses the festivalcommand that we're sent from the config file for \n's, etc */
 		int i, j;
-		newfestivalcommand = alloca(strlen(festivalcommand) + 1);
+		newfestivalcommand = alloca(strlen(festivalcommand) + strlen(args.text) + 1);
 
 		for (i = 0, j = 0; i < strlen(festivalcommand); i++) {
 			if (festivalcommand[i] == '\\' && festivalcommand[i + 1] == 'n') {
@@ -340,6 +350,10 @@
 			} else if (festivalcommand[i] == '\\') {
 				newfestivalcommand[j++] = festivalcommand[i + 1];
 				i++;
+			} else if (festivalcommand[i] == '%' && festivalcommand[i + 1] == 's') {
+				sprintf(&newfestivalcommand[j], "%s", args.text); /* we know it is big enough */
+				j += strlen(args.text);
+				i++;
 			} else
 				newfestivalcommand[j++] = festivalcommand[i];
 		}
@@ -347,9 +361,6 @@
 		festivalcommand = newfestivalcommand;
 	}
 	
-	data = ast_strdupa(vdata);
-	AST_STANDARD_APP_ARGS(args, data);
-
 	if (args.interrupt && !strcasecmp(args.interrupt, "any"))
 		args.interrupt = AST_DIGIT_ANY;
 
@@ -440,7 +451,8 @@
 	} else {
 		ast_debug(1, "Passing text to festival...\n");
 		fs = fdopen(dup(fd), "wb");
-		fprintf(fs, festivalcommand, args.text);
+
+		fprintf(fs, "%s", festivalcommand);
 		fflush(fs);
 		fclose(fs);
 	}

Modified: team/jpeeler/sip-dnsmgr/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/apps/app_meetme.c?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/apps/app_meetme.c (original)
+++ team/jpeeler/sip-dnsmgr/apps/app_meetme.c Tue Mar 18 12:00:35 2008
@@ -955,9 +955,9 @@
 	int hr, min, sec;
 	int i = 0, total = 0;
 	time_t now;
-	char *header_format = "%-14s %-14s %-10s %-8s  %-8s  %-6s\n";
-	char *data_format = "%-12.12s   %4.4d	      %4.4s       %02d:%02d:%02d  %-8s  %-6s\n";
 	char cmdline[1024] = "";
+#define MC_HEADER_FORMAT "%-14s %-14s %-10s %-8s  %-8s  %-6s\n"
+#define MC_DATA_FORMAT "%-12.12s   %4.4d	      %4.4s       %02d:%02d:%02d  %-8s  %-6s\n"
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -989,7 +989,7 @@
 			return CLI_SUCCESS;
 		}
 		if (!concise)
-			ast_cli(a->fd, header_format, "Conf Num", "Parties", "Marked", "Activity", "Creation", "Locked");
+			ast_cli(a->fd, MC_HEADER_FORMAT, "Conf Num", "Parties", "Marked", "Activity", "Creation", "Locked");
 		AST_LIST_TRAVERSE(&confs, cnf, list) {
 			if (cnf->markedusers == 0)
 				strcpy(cmdline, "N/A ");
@@ -999,7 +999,7 @@
 			min = ((now - cnf->start) % 3600) / 60;
 			sec = (now - cnf->start) % 60;
 			if (!concise)
-				ast_cli(a->fd, data_format, cnf->confno, cnf->users, cmdline, hr, min, sec, cnf->isdynamic ? "Dynamic" : "Static", cnf->locked ? "Yes" : "No");
+				ast_cli(a->fd, MC_DATA_FORMAT, cnf->confno, cnf->users, cmdline, hr, min, sec, cnf->isdynamic ? "Dynamic" : "Static", cnf->locked ? "Yes" : "No");
 			else {
 				ast_cli(a->fd, "%s!%d!%d!%02d:%02d:%02d!%d!%d\n", 
 					cnf->confno, 

Modified: team/jpeeler/sip-dnsmgr/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/apps/app_minivm.c?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/apps/app_minivm.c (original)
+++ team/jpeeler/sip-dnsmgr/apps/app_minivm.c Tue Mar 18 12:00:35 2008
@@ -1560,10 +1560,10 @@
 			duration < global_vmminmessage ? "IGNORED" : "OK",
 			vmu->accountcode
 		); 
-		fprintf(txt, logbuf);
+		fprintf(txt, "%s", logbuf);
 		if (minivmlogfile) {
 			ast_mutex_lock(&minivmloglock);
-			fprintf(minivmlogfile, logbuf);
+			fprintf(minivmlogfile, "%s", logbuf);
 			ast_mutex_unlock(&minivmloglock);
 		}
 
@@ -2475,7 +2475,7 @@
 static char *handle_minivm_list_templates(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct minivm_template *this;
-	char *output_format = "%-15s %-10s %-10s %-15.15s %-50s\n";
+#define HVLT_OUTPUT_FORMAT "%-15s %-10s %-10s %-15.15s %-50s\n"
 	int count = 0;
 
 	switch (cmd) {
@@ -2498,10 +2498,10 @@
 		AST_LIST_UNLOCK(&message_templates);
 		return CLI_FAILURE;
 	}
-	ast_cli(a->fd, output_format, "Template name", "Charset", "Locale", "Attach media", "Subject");
-	ast_cli(a->fd, output_format, "-------------", "-------", "------", "------------", "-------");
+	ast_cli(a->fd, HVLT_OUTPUT_FORMAT, "Template name", "Charset", "Locale", "Attach media", "Subject");
+	ast_cli(a->fd, HVLT_OUTPUT_FORMAT, "-------------", "-------", "------", "------------", "-------");
 	AST_LIST_TRAVERSE(&message_templates, this, list) {
-		ast_cli(a->fd, output_format, this->name, 
+		ast_cli(a->fd, HVLT_OUTPUT_FORMAT, this->name, 
 			this->charset ? this->charset : "-", 
 			this->locale ? this->locale : "-",
 			this->attachment ? "Yes" : "No",
@@ -2541,7 +2541,7 @@
 static char *handle_minivm_show_users(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct minivm_account *vmu;
-	char *output_format = "%-23s %-15s %-15s %-10s %-10s %-50s\n";
+#define HMSU_OUTPUT_FORMAT "%-23s %-15s %-15s %-10s %-10s %-50s\n"
 	int count = 0;
 
 	switch (cmd) {
@@ -2566,14 +2566,14 @@
 		AST_LIST_UNLOCK(&minivm_accounts);
 		return CLI_FAILURE;
 	}
-	ast_cli(a->fd, output_format, "User", "E-Template", "P-template", "Zone", "Format", "Full name");
-	ast_cli(a->fd, output_format, "----", "----------", "----------", "----", "------", "---------");
+	ast_cli(a->fd, HMSU_OUTPUT_FORMAT, "User", "E-Template", "P-template", "Zone", "Format", "Full name");
+	ast_cli(a->fd, HMSU_OUTPUT_FORMAT, "----", "----------", "----------", "----", "------", "---------");
 	AST_LIST_TRAVERSE(&minivm_accounts, vmu, list) {
 		char tmp[256] = "";
 		if ((a->argc == 3) || ((a->argc == 5) && !strcmp(a->argv[4], vmu->domain))) {
 			count++;
 			snprintf(tmp, sizeof(tmp), "%s@%s", vmu->username, vmu->domain);
-			ast_cli(a->fd, output_format, tmp, vmu->etemplate ? vmu->etemplate : "-", 
+			ast_cli(a->fd, HMSU_OUTPUT_FORMAT, tmp, vmu->etemplate ? vmu->etemplate : "-", 
 				vmu->ptemplate ? vmu->ptemplate : "-",
 				vmu->zonetag ? vmu->zonetag : "-", 
 				vmu->attachfmt ? vmu->attachfmt : "-",
@@ -2589,7 +2589,7 @@
 static char *handle_minivm_show_zones(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct minivm_zone *zone;
-	char *output_format = "%-15s %-20s %-45s\n";
+#define HMSZ_OUTPUT_FORMAT "%-15s %-20s %-45s\n"
 	char *res = CLI_SUCCESS;
 
 	switch (cmd) {
@@ -2608,10 +2608,10 @@
 
 	AST_LIST_LOCK(&minivm_zones);
 	if (!AST_LIST_EMPTY(&minivm_zones)) {
-		ast_cli(a->fd, output_format, "Zone", "Timezone", "Message Format");
-		ast_cli(a->fd, output_format, "----", "--------", "--------------");
+		ast_cli(a->fd, HMSZ_OUTPUT_FORMAT, "Zone", "Timezone", "Message Format");
+		ast_cli(a->fd, HMSZ_OUTPUT_FORMAT, "----", "--------", "--------------");
 		AST_LIST_TRAVERSE(&minivm_zones, zone, list) {
-			ast_cli(a->fd, output_format, zone->name, zone->timezone, zone->msg_format);
+			ast_cli(a->fd, HMSZ_OUTPUT_FORMAT, zone->name, zone->timezone, zone->msg_format);
 		}
 	} else {
 		ast_cli(a->fd, "There are no voicemail zones currently defined\n");

Modified: team/jpeeler/sip-dnsmgr/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/apps/app_queue.c?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/apps/app_queue.c (original)
+++ team/jpeeler/sip-dnsmgr/apps/app_queue.c Tue Mar 18 12:00:35 2008
@@ -1232,13 +1232,13 @@
 			while ((s = strsep(&buf, ",|"))) {
 				if (!q->sound_periodicannounce[i])
 					q->sound_periodicannounce[i] = ast_str_create(16);
-				ast_str_set(&q->sound_periodicannounce[i], 0, s);
+				ast_str_set(&q->sound_periodicannounce[i], 0, "%s", s);
 				i++;
 				if (i == MAX_PERIODIC_ANNOUNCEMENTS)
 					break;
 			}
 		} else {
-			ast_str_set(&q->sound_periodicannounce[0], 0, val);
+			ast_str_set(&q->sound_periodicannounce[0], 0, "%s", val);
 		}
 	} else if (!strcasecmp(param, "periodic-announce-frequency")) {
 		q->periodicannouncefrequency = atoi(val);

Modified: team/jpeeler/sip-dnsmgr/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/apps/app_voicemail.c?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/apps/app_voicemail.c (original)
+++ team/jpeeler/sip-dnsmgr/apps/app_voicemail.c Tue Mar 18 12:00:35 2008
@@ -645,7 +645,6 @@
 static char *pagersubject = NULL;
 static char fromstring[100];
 static char pagerfromstring[100];
-static char emailtitle[100];
 static char charset[32] = "ISO-8859-1";
 
 static unsigned char adsifdn[4] = "\x00\x00\x00\x0F";
@@ -2021,9 +2020,6 @@
 			ast_channel_free(ast);
 		} else
 			ast_log(LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
-	} else	if (!ast_strlen_zero(emailtitle)) {
-		fprintf(p, emailtitle, msgnum + 1, mailbox) ;
-		fprintf(p, ENDL) ;
 	} else if (ast_test_flag((&globalflags), VM_PBXSKIP))
 		fprintf(p, "Subject: New message %d in mailbox %s" ENDL, msgnum + 1, mailbox);
 	else
@@ -7802,7 +7798,7 @@
 static char *handle_voicemail_show_users(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct ast_vm_user *vmu;
-	char *output_format = "%-10s %-5s %-25s %-10s %6s\n";
+#define HVSU_OUTPUT_FORMAT "%-10s %-5s %-25s %-10s %6s\n"
 	const char *context = NULL;
 	int users_counter = 0;
 
@@ -7840,7 +7836,7 @@
 		return CLI_FAILURE;
 	}
 	if (a->argc == 3)
-		ast_cli(a->fd, output_format, "Context", "Mbox", "User", "Zone", "NewMsg");
+		ast_cli(a->fd, HVSU_OUTPUT_FORMAT, "Context", "Mbox", "User", "Zone", "NewMsg");
 	else {
 		int count = 0;
 		AST_LIST_TRAVERSE(&users, vmu, list) {
@@ -7848,7 +7844,7 @@
 				count++;
 		}
 		if (count) {
-			ast_cli(a->fd, output_format, "Context", "Mbox", "User", "Zone", "NewMsg");
+			ast_cli(a->fd, HVSU_OUTPUT_FORMAT, "Context", "Mbox", "User", "Zone", "NewMsg");
 		} else {
 			ast_cli(a->fd, "No such voicemail context \"%s\"\n", context);
 			AST_LIST_UNLOCK(&users);
@@ -7863,7 +7859,7 @@
 			snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context);
 			inboxcount(tmp, &newmsgs, &oldmsgs);
 			snprintf(count, sizeof(count), "%d", newmsgs);
-			ast_cli(a->fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count);
+			ast_cli(a->fd, HVSU_OUTPUT_FORMAT, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count);
 			users_counter++;
 		}
 	}
@@ -7876,7 +7872,7 @@
 static char *handle_voicemail_show_zones(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct vm_zone *zone;
-	char *output_format = "%-15s %-20s %-45s\n";
+#define HVSZ_OUTPUT_FORMAT "%-15s %-20s %-45s\n"
 	char *res = CLI_SUCCESS;
 
 	switch (cmd) {
@@ -7895,9 +7891,9 @@
 
 	AST_LIST_LOCK(&zones);
 	if (!AST_LIST_EMPTY(&zones)) {
-		ast_cli(a->fd, output_format, "Zone", "Timezone", "Message Format");
+		ast_cli(a->fd, HVSZ_OUTPUT_FORMAT, "Zone", "Timezone", "Message Format");
 		AST_LIST_TRAVERSE(&zones, zone, list) {
-			ast_cli(a->fd, output_format, zone->name, zone->timezone, zone->msg_format);
+			ast_cli(a->fd, HVSZ_OUTPUT_FORMAT, zone->name, zone->timezone, zone->msg_format);
 		}
 	} else {
 		ast_cli(a->fd, "There are no voicemail zones currently defined\n");
@@ -8720,7 +8716,6 @@
 		}
 		memset(fromstring, 0, sizeof(fromstring));
 		memset(pagerfromstring, 0, sizeof(pagerfromstring));
-		memset(emailtitle, 0, sizeof(emailtitle));
 		strcpy(charset, "ISO-8859-1");
 		if (emailbody) {
 			ast_free(emailbody);
@@ -8758,13 +8753,10 @@
 				memcpy(&adsisec[x], &tmpadsi[x], 1);
 			}
 		}
-		if ((val = ast_variable_retrieve(cfg, "general", "adsiver")))
+		if ((val = ast_variable_retrieve(cfg, "general", "adsiver"))) {
 			if (atoi(val)) {
 				adsiver = atoi(val);
 			}
-		if ((val = ast_variable_retrieve(cfg, "general", "emailtitle"))) {
-			ast_log(LOG_NOTICE, "Keyword 'emailtitle' is DEPRECATED, please use 'emailsubject' instead.\n");
-			ast_copy_string(emailtitle, val, sizeof(emailtitle));
 		}
 		if ((val = ast_variable_retrieve(cfg, "general", "emailsubject")))
 			emailsubject = ast_strdup(val);

Modified: team/jpeeler/sip-dnsmgr/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/build_tools/cflags.xml?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/build_tools/cflags.xml (original)
+++ team/jpeeler/sip-dnsmgr/build_tools/cflags.xml Tue Mar 18 12:00:35 2008
@@ -1,5 +1,9 @@
 	<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" remove_on_change=".lastclean">
 		<member name="DONT_OPTIMIZE" displayname="Disable Optimizations by the Compiler">
+		</member>
+		<member name="ENABLE_UPLOADS" displayname="Enable HTTP uploads">
+			<defaultenabled>yes</defaultenabled>
+			<depend>gmime</depend>
 		</member>
 		<member name="DEBUG_THREADS" displayname="Enable Thread Debugging">
 		</member>

Modified: team/jpeeler/sip-dnsmgr/build_tools/make_buildopts_h
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/build_tools/make_buildopts_h?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/build_tools/make_buildopts_h (original)
+++ team/jpeeler/sip-dnsmgr/build_tools/make_buildopts_h Tue Mar 18 12:00:35 2008
@@ -7,11 +7,11 @@
  */
 
 END
-TMP=`${GREP} MENUSELECT_CFLAGS menuselect.makeopts | sed 's/MENUSELECT_CFLAGS\=//g' | sed 's/-D//g'`
+TMP=`${GREP} -e ^MENUSELECT_CFLAGS menuselect.makeopts | sed 's/MENUSELECT_CFLAGS\=//g' | sed 's/-D//g'`
 for x in ${TMP}; do
 	echo "#define ${x} 1"
 done
-TMP=`${GREP} MENUSELECT_BUILD_DEPS menuselect.makeopts | sed 's/MENUSELECT_BUILD_DEPS\=//g'`
+TMP=`${GREP} -e ^MENUSELECT_BUILD_DEPS menuselect.makeopts | sed 's/MENUSELECT_BUILD_DEPS\=//g'`
 for x in ${TMP}; do
 	x2=`echo ${x} | tr a-z A-Z`
 	echo "#define AST_MODULE_${x2} 1"

Modified: team/jpeeler/sip-dnsmgr/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/build_tools/menuselect-deps.in?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/build_tools/menuselect-deps.in (original)
+++ team/jpeeler/sip-dnsmgr/build_tools/menuselect-deps.in Tue Mar 18 12:00:35 2008
@@ -2,6 +2,7 @@
 CRYPTO=@PBX_CRYPTO@
 CURL=@PBX_CURL@
 FREETDS=@PBX_FREETDS@
+GMIME=@PBX_GMIME@
 GNU_LD=@GNU_LD@
 GSM=@PBX_GSM@
 GTK2=@PBX_GTK2@

Modified: team/jpeeler/sip-dnsmgr/cdr/cdr_sqlite3_custom.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/cdr/cdr_sqlite3_custom.c?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/cdr/cdr_sqlite3_custom.c (original)
+++ team/jpeeler/sip-dnsmgr/cdr/cdr_sqlite3_custom.c Tue Mar 18 12:00:35 2008
@@ -102,7 +102,7 @@
 			return -1;
 		}
 		if (!column_string->used)
-			ast_str_set(&column_string, 0, escaped);
+			ast_str_set(&column_string, 0, "%s", escaped);
 		else
 			ast_str_append(&column_string, 0, ",%s", escaped);
 		sqlite3_free(escaped);

Modified: team/jpeeler/sip-dnsmgr/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/channels/chan_iax2.c?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/channels/chan_iax2.c (original)
+++ team/jpeeler/sip-dnsmgr/channels/chan_iax2.c Tue Mar 18 12:00:35 2008
@@ -788,7 +788,7 @@
 	ast_log(LOG_WARNING, "%s", data);
 }
 
-static void jb_error_output(const char *fmt, ...)
+static void __attribute__((format (printf, 1, 2))) jb_error_output(const char *fmt, ...)
 {
 	va_list args;
 	char buf[1024];
@@ -797,10 +797,10 @@
 	vsnprintf(buf, sizeof(buf), fmt, args);
 	va_end(args);
 
-	ast_log(LOG_ERROR, buf);
-}
-
-static void jb_warning_output(const char *fmt, ...)
+	ast_log(LOG_ERROR, "%s", buf);
+}
+
+static void __attribute__((format (printf, 1, 2))) jb_warning_output(const char *fmt, ...)
 {
 	va_list args;
 	char buf[1024];
@@ -809,10 +809,10 @@
 	vsnprintf(buf, sizeof(buf), fmt, args);
 	va_end(args);
 
-	ast_log(LOG_WARNING, buf);
-}
-
-static void jb_debug_output(const char *fmt, ...)
+	ast_log(LOG_WARNING, "%s", buf);
+}
+
+static void __attribute__((format (printf, 1, 2))) jb_debug_output(const char *fmt, ...)
 {
 	va_list args;
 	char buf[1024];
@@ -821,7 +821,7 @@
 	vsnprintf(buf, sizeof(buf), fmt, args);
 	va_end(args);
 
-	ast_verbose(buf);
+	ast_verbose("%s", buf);
 }
 
 /*!
@@ -5173,11 +5173,12 @@
 {
 	int x;
 	int numchans = 0;
+#define ACN_FORMAT1 "%-25.25s %4d %4d %4d %5d %3d %5d %4d %6d %4d %4d %5d %3d %5d %4d %6d\n"
+#define ACN_FORMAT2 "%s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n"
 	for (x=0;x<IAX_MAX_CALLS;x++) {
 		ast_mutex_lock(&iaxsl[x]);
 		if (iaxs[x]) {
 			int localjitter, localdelay, locallost, locallosspct, localdropped, localooo;
-			char *fmt;
 			jb_info jbinfo;
 			
 			if(ast_test_flag(iaxs[x], IAX_USEJITTERBUF)) {
@@ -5196,13 +5197,9 @@
 				localdropped = 0;
 				localooo = -1;
 			}
-			if (limit_fmt)
-				fmt = "%-25.25s %4d %4d %4d %5d %3d %5d %4d %6d %4d %4d %5d %3d %5d %4d %6d\n";
-			else
-				fmt = "%s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n";
 			if (s)
 				
-				astman_append(s, fmt,
+				astman_append(s, limit_fmt ? ACN_FORMAT1 : ACN_FORMAT2,
 					      iaxs[x]->owner ? iaxs[x]->owner->name : "(None)",
 					      iaxs[x]->pingtime,
 					      localjitter, 
@@ -5220,7 +5217,7 @@
 					      iaxs[x]->remote_rr.ooo,
 					      iaxs[x]->remote_rr.packets/1000);
 			else
-				ast_cli(fd, fmt,
+				ast_cli(fd, limit_fmt ? ACN_FORMAT1 : ACN_FORMAT2,
 					iaxs[x]->owner ? iaxs[x]->owner->name : "(None)",
 					iaxs[x]->pingtime,
 					localjitter, 

Modified: team/jpeeler/sip-dnsmgr/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/channels/chan_misdn.c?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/channels/chan_misdn.c (original)
+++ team/jpeeler/sip-dnsmgr/channels/chan_misdn.c Tue Mar 18 12:00:35 2008
@@ -285,7 +285,8 @@
 
 static int *misdn_ports;
 
-static void chan_misdn_log(int level, int port, char *tmpl, ...);
+static void chan_misdn_log(int level, int port, char *tmpl, ...)
+	__attribute__ ((format (printf, 3, 4)));
 
 static struct ast_channel *misdn_new(struct chan_list *cl, int state,  char *exten, char *callerid, int format, int port, int c);
 static void send_digit_to_chan(struct chan_list *cl, char digit );
@@ -464,11 +465,11 @@
 			else if (fac->u.AOCDcur.freeOfCharge)
 				chan_misdn_log(1,bc->port," --> AOCD currency: free of charge\n");
 			else if (fac->u.AOCDchu.billingId >= 0)
-				chan_misdn_log(1,bc->port," --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%d billingId:%d\n",
+				chan_misdn_log(1,bc->port," --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%s billingId:%d\n",
 						fac->u.AOCDcur.currency, fac->u.AOCDcur.currencyAmount, fac->u.AOCDcur.multiplier,
 						(fac->u.AOCDcur.typeOfChargingInfo == 0) ? "subTotal" : "total", fac->u.AOCDcur.billingId);
 			else
-				chan_misdn_log(1,bc->port," --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%d\n",
+				chan_misdn_log(1,bc->port," --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%s\n",
 						fac->u.AOCDcur.currency, fac->u.AOCDcur.currencyAmount, fac->u.AOCDcur.multiplier,
 						(fac->u.AOCDcur.typeOfChargingInfo == 0) ? "subTotal" : "total");
 			break;
@@ -4705,7 +4706,7 @@
 		int res;
 		int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples);
 
-		chan_misdn_log(9, bc->port, "TONE_GEN: len:%d\n");
+		chan_misdn_log(9, bc->port, "TONE_GEN: len:%d\n", tone_len);
 
 		if (!ast)
 			break;
@@ -4960,7 +4961,7 @@
 #endif
 		break;
 		default:
-			chan_misdn_log(0, bc->port," --> not yet handled: facility type:%p\n", bc->fac_in.Function);
+			chan_misdn_log(0, bc->port," --> not yet handled: facility type:%d\n", bc->fac_in.Function);
 		}
 		
 		break;
@@ -5603,7 +5604,7 @@
 		jb->state_buffer = wp - rp;
 	else
 		jb->state_buffer = jb->size - rp + wp;
-	chan_misdn_log(9, 0, "misdn_jb_fill: written:%d | Bufferstatus:%d p:%x\n", len, jb->state_buffer, jb);
+	chan_misdn_log(9, 0, "misdn_jb_fill: written:%d | Bufferstatus:%d p:%p\n", len, jb->state_buffer, jb);
 
 	if (jb->state_full) {
 		jb->wp = wp;
@@ -5669,11 +5670,11 @@
 			jb->state_buffer = wp - rp;
 		else
 			jb->state_buffer = jb->size - rp + wp;
-		chan_misdn_log(9, 0, "misdn_jb_empty: read:%d | Bufferstatus:%d p:%x\n", len, jb->state_buffer, jb);
+		chan_misdn_log(9, 0, "misdn_jb_empty: read:%d | Bufferstatus:%d p:%p\n", len, jb->state_buffer, jb);
 
 		jb->rp = rp;
 	} else
-		chan_misdn_log(9, 0, "misdn_jb_empty: Wait...requested:%d p:%x\n", len, jb);
+		chan_misdn_log(9, 0, "misdn_jb_empty: Wait...requested:%d p:%p\n", len, jb);
 
 	ast_mutex_unlock(&jb->mutexjb);
 
@@ -5709,7 +5710,7 @@
 	va_end(ap);
 
 	if (level == -1)
-		ast_log(LOG_WARNING, buf);
+		ast_log(LOG_WARNING, "%s", buf);
 
 	else if (misdn_debug_only[port] ? 
 			(level == 1 && misdn_debug[port]) || (level == misdn_debug[port]) 

Modified: team/jpeeler/sip-dnsmgr/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/channels/chan_sip.c?view=diff&rev=109544&r1=109543&r2=109544
==============================================================================
--- team/jpeeler/sip-dnsmgr/channels/chan_sip.c (original)
+++ team/jpeeler/sip-dnsmgr/channels/chan_sip.c Tue Mar 18 12:00:35 2008
@@ -244,6 +244,8 @@
 #define DEFAULT_MAX_SE               1800             /*!< Session-Timer Default Session-Expires period (RFC 4028) */
 #define DEFAULT_MIN_SE               90               /*!< Session-Timer Default Min-SE period (RFC 4028) */
 
+#define SDP_MAX_RTPMAP_CODECS        32               /*!< Maximum number of codecs allowed in received SDP */
+
 /*! \brief Global jitterbuffer configuration - by default, jb is disabled */
 static struct ast_jb_conf default_jbconf =
 {
@@ -705,6 +707,7 @@
 static char global_sdpowner[AST_MAX_EXTENSION];	/*!< SDP owner name for the SIP channel */
 static int allow_external_domains;	/*!< Accept calls to external SIP domains? */
 static int global_callevents;		/*!< Whether we send manager events or not */
+static int global_authfailureevents;		/*!< Whether we send authentication failure manager events or not. Default no. */
 static int global_t1;			/*!< T1 time */
 static int global_t1min;		/*!< T1 roundtrip time minimum */
 static int global_timer_b;    /*!< Timer B - RFC 3261 Section 17.1.1.2 */
@@ -2633,7 +2636,7 @@
 }
 
 /*! \brief Append to SIP dialog history with arg list  */
-static void append_history_va(struct sip_pvt *p, const char *fmt, va_list ap)
+static __attribute__((format (printf, 2, 0))) void append_history_va(struct sip_pvt *p, const char *fmt, va_list ap)
 {
 	char buf[80], *c = buf; /* max history length */
 	struct sip_history *hist;
@@ -6336,7 +6339,7 @@
 	int numberofmediastreams = 0;
 	int debug = sip_debug_test_pvt(p);
 		
-	int found_rtpmap_codecs[32];
+	int found_rtpmap_codecs[SDP_MAX_RTPMAP_CODECS];
 	int last_rtpmap_codec=0;
 
 	char buf[SIPBUFSIZE];
@@ -6686,36 +6689,41 @@
 		} else if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) == 2) {
 			/* We have a rtpmap to handle */
 
-			/* Note: should really look at the 'freq' and '#chans' params too */
-			/* Note: This should all be done in the context of the m= above */
-			if (!strncasecmp(mimeSubtype, "H26", 3) || !strncasecmp(mimeSubtype, "MP4", 3)) {         /* Video */
-				if(ast_rtp_set_rtpmap_type(newvideortp, codec, "video", mimeSubtype, 0) != -1) {
-					if (debug)
-						ast_verbose("Found video description format %s for ID %d\n", mimeSubtype, codec);
-					found_rtpmap_codecs[last_rtpmap_codec] = codec;
-					last_rtpmap_codec++;
-				} else {
-					ast_rtp_unset_m_type(newvideortp, codec);
-					if (debug) 
-						ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
+			if (last_rtpmap_codec < SDP_MAX_RTPMAP_CODECS) {
+				/* Note: should really look at the 'freq' and '#chans' params too */
+				/* Note: This should all be done in the context of the m= above */
+				if (!strncasecmp(mimeSubtype, "H26", 3) || !strncasecmp(mimeSubtype, "MP4", 3)) {         /* Video */
+					if(ast_rtp_set_rtpmap_type(newvideortp, codec, "video", mimeSubtype, 0) != -1) {
+						if (debug)
+							ast_verbose("Found video description format %s for ID %d\n", mimeSubtype, codec);
+						found_rtpmap_codecs[last_rtpmap_codec] = codec;
+						last_rtpmap_codec++;
+					} else {
+						ast_rtp_unset_m_type(newvideortp, codec);
+						if (debug) 
+							ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
+					}
+				} else if (!strncasecmp(mimeSubtype, "T140", 4)) { /* Text */
+					if (p->trtp) {
+						/* ast_verbose("Adding t140 mimeSubtype to textrtp struct\n"); */
+						ast_rtp_set_rtpmap_type(newtextrtp, codec, "text", mimeSubtype, 0);
+					}
+				} else {                                          /* Must be audio?? */
+					if(ast_rtp_set_rtpmap_type(newaudiortp, codec, "audio", mimeSubtype,
+								   ast_test_flag(&p->flags[0], SIP_G726_NONSTANDARD) ? AST_RTP_OPT_G726_NONSTANDARD : 0) != -1) {
+						if (debug)
+							ast_verbose("Found audio description format %s for ID %d\n", mimeSubtype, codec);
+						found_rtpmap_codecs[last_rtpmap_codec] = codec;
+						last_rtpmap_codec++;
+					} else {
+						ast_rtp_unset_m_type(newaudiortp, codec);
+						if (debug) 
+							ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
+					}
 				}
-			} else if (!strncasecmp(mimeSubtype, "T140", 4)) { /* Text */
-				if (p->trtp) {
-					/* ast_verbose("Adding t140 mimeSubtype to textrtp struct\n"); */
-					ast_rtp_set_rtpmap_type(newtextrtp, codec, "text", mimeSubtype, 0);
-				}
-			} else {                                          /* Must be audio?? */
-				if(ast_rtp_set_rtpmap_type(newaudiortp, codec, "audio", mimeSubtype,
-						ast_test_flag(&p->flags[0], SIP_G726_NONSTANDARD) ? AST_RTP_OPT_G726_NONSTANDARD : 0) != -1) {
-					if (debug)
-						ast_verbose("Found audio description format %s for ID %d\n", mimeSubtype, codec);
-					found_rtpmap_codecs[last_rtpmap_codec] = codec;
-					last_rtpmap_codec++;
-				} else {
-					ast_rtp_unset_m_type(newaudiortp, codec);
-					if (debug) 
-						ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
-				}
+			} else {
+				if (debug)
+					ast_verbose("Discarded description format %s for ID %d\n", mimeSubtype, codec);
 			}
 
 		}
@@ -9879,7 +9887,7 @@
 	/* Saving TCP connections is useless, we won't be able to reconnect */
 	if (!peer->rt_fromcontact && (peer->socket.type & SIP_TRANSPORT_UDP)) 
 		ast_db_put("SIP/Registry", peer->name, data);
-	manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Registered\r\n", peer->name);
+	manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Registered\r\nAddress: %s\r\nPort: %d\r\n", peer->name,  ast_inet_ntoa(peer->addr.sin_addr), ntohs(peer->addr.sin_port));
 
 	/* Is this a new IP address for us? */
 	if (inaddrcmp(&peer->addr, &oldsin)) {
@@ -10431,7 +10439,7 @@
 			case PARSE_REGISTER_UPDATE:
 				/* Say OK and ask subsystem to retransmit msg counter */
 				transmit_response_with_date(p, "200 OK", req);
-				manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Registered\r\n", peer->name);
+				manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Registered\r\nAddress: %s\r\nPort: %d\r\n", peer->name, ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
 				peer->lastmsgssent = -1;
 				res = 0;
 				break;
@@ -10446,6 +10454,9 @@
 		case AUTH_SECRET_FAILED:
 			/* Wrong password in authentication. Go away, don't try again until you fixed it */
 			transmit_response(p, "403 Forbidden (Bad auth)", &p->initreq);
+			if (global_authfailureevents)
+				manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Rejected\r\nCause: AUTH_SECRET_FAILED\r\nAddress: %s\r\nPort: %d\r\n", 
+					name, ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
 			break;
 		case AUTH_USERNAME_MISMATCH:
 			/* Username and digest username does not match. 
@@ -10453,6 +10464,9 @@
 			   users to use the same authentication user name until we support
 			   proper authentication by digest auth name */
 			transmit_response(p, "403 Authentication user name does not match account name", &p->initreq);
+			if (global_authfailureevents)
+				manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Rejected\r\nCause: AUTH_USERNAME_MISMATCH\r\nAddress: %s\r\nPort: %d\r\n", 
+					name, ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
 			break;
 		case AUTH_NOT_FOUND:
 		case AUTH_PEER_NOT_DYNAMIC:
@@ -10461,10 +10475,17 @@
 				transmit_fake_auth_response(p, &p->initreq, 1);
 			} else {
 				/* URI not found */
-				if (res == AUTH_PEER_NOT_DYNAMIC)
+				if (res == AUTH_PEER_NOT_DYNAMIC) {
 					transmit_response(p, "403 Forbidden", &p->initreq);
+					if (global_authfailureevents)
+						manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Rejected\r\nCause: AUTH_PEER_NOT_DYNAMIC\r\nAddress: %s\r\nPort: %d\r\n", 
+							name, ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
+					}
 				else
 					transmit_response(p, "404 Not found", &p->initreq);
+					if (global_authfailureevents)

[... 1747 lines stripped ...]



More information about the asterisk-commits mailing list