[svn-commits] juggie: branch juggie/NoLossCDR r84014 - in /team/juggie/NoLossCDR: ./ apps/ ...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Sep 26 22:46:44 CDT 2007


Author: juggie
Date: Wed Sep 26 22:46:43 2007
New Revision: 84014

URL: http://svn.digium.com/view/asterisk?view=rev&rev=84014
Log:
Merged revisions 83409,83441,83471,83489,83506,83522,83537,83550,83580,83598,83664,83691,83704,83731,83747,83763,83782,83809,83824,83839,83854,83869,83888,83919,83952,83987 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/group/CDRfix5

........
r83409 | root | 2007-09-21 10:09:48 -0400 (Fri, 21 Sep 2007) | 1 line

automerge commit
........
r83441 | root | 2007-09-21 11:08:54 -0400 (Fri, 21 Sep 2007) | 1 line

automerge commit
........
r83471 | root | 2007-09-21 14:07:59 -0400 (Fri, 21 Sep 2007) | 1 line

automerge commit
........
r83489 | root | 2007-09-21 15:07:59 -0400 (Fri, 21 Sep 2007) | 1 line

automerge commit
........
r83506 | root | 2007-09-21 16:07:58 -0400 (Fri, 21 Sep 2007) | 1 line

automerge commit
........
r83522 | root | 2007-09-21 23:07:58 -0400 (Fri, 21 Sep 2007) | 1 line

automerge commit
........
r83537 | root | 2007-09-22 10:08:04 -0400 (Sat, 22 Sep 2007) | 1 line

automerge commit
........
r83550 | root | 2007-09-22 11:07:57 -0400 (Sat, 22 Sep 2007) | 1 line

automerge commit
........
r83580 | root | 2007-09-22 14:07:55 -0400 (Sat, 22 Sep 2007) | 1 line

automerge commit
........
r83598 | root | 2007-09-22 16:08:30 -0400 (Sat, 22 Sep 2007) | 1 line

automerge commit
........
r83664 | root | 2007-09-24 13:08:44 -0400 (Mon, 24 Sep 2007) | 1 line

automerge commit
........
r83691 | root | 2007-09-24 13:14:42 -0400 (Mon, 24 Sep 2007) | 1 line

automerge commit
........
r83704 | root | 2007-09-24 14:08:40 -0400 (Mon, 24 Sep 2007) | 1 line

automerge commit
........
r83731 | root | 2007-09-24 18:08:05 -0400 (Mon, 24 Sep 2007) | 1 line

automerge commit
........
r83747 | root | 2007-09-25 05:08:20 -0400 (Tue, 25 Sep 2007) | 1 line

automerge commit
........
r83763 | root | 2007-09-25 10:08:11 -0400 (Tue, 25 Sep 2007) | 1 line

automerge commit
........
r83782 | root | 2007-09-25 11:08:47 -0400 (Tue, 25 Sep 2007) | 1 line

automerge commit
........
r83809 | root | 2007-09-25 13:08:11 -0400 (Tue, 25 Sep 2007) | 1 line

automerge commit
........
r83824 | root | 2007-09-25 17:08:14 -0400 (Tue, 25 Sep 2007) | 1 line

automerge commit
........
r83839 | root | 2007-09-25 20:08:15 -0400 (Tue, 25 Sep 2007) | 1 line

automerge commit
........
r83854 | root | 2007-09-26 02:34:55 -0400 (Wed, 26 Sep 2007) | 1 line

automerge commit
........
r83869 | root | 2007-09-26 03:09:04 -0400 (Wed, 26 Sep 2007) | 1 line

automerge commit
........
r83888 | root | 2007-09-26 15:09:01 -0400 (Wed, 26 Sep 2007) | 1 line

automerge commit
........
r83919 | root | 2007-09-26 17:08:50 -0400 (Wed, 26 Sep 2007) | 1 line

automerge commit
........
r83952 | root | 2007-09-26 18:08:50 -0400 (Wed, 26 Sep 2007) | 1 line

automerge commit
........
r83987 | root | 2007-09-26 20:08:51 -0400 (Wed, 26 Sep 2007) | 1 line

automerge commit
........

Modified:
    team/juggie/NoLossCDR/   (props changed)
    team/juggie/NoLossCDR/Makefile
    team/juggie/NoLossCDR/apps/app_meetme.c
    team/juggie/NoLossCDR/apps/app_queue.c
    team/juggie/NoLossCDR/build_tools/make_defaults_h
    team/juggie/NoLossCDR/cdr/cdr_manager.c
    team/juggie/NoLossCDR/channels/chan_alsa.c
    team/juggie/NoLossCDR/channels/chan_h323.c
    team/juggie/NoLossCDR/channels/chan_iax2.c
    team/juggie/NoLossCDR/channels/chan_jingle.c
    team/juggie/NoLossCDR/channels/chan_mgcp.c
    team/juggie/NoLossCDR/channels/chan_misdn.c
    team/juggie/NoLossCDR/channels/chan_sip.c
    team/juggie/NoLossCDR/channels/chan_zap.c
    team/juggie/NoLossCDR/channels/misdn_config.c
    team/juggie/NoLossCDR/configs/sip.conf.sample
    team/juggie/NoLossCDR/configure
    team/juggie/NoLossCDR/configure.ac
    team/juggie/NoLossCDR/include/asterisk/autoconfig.h.in
    team/juggie/NoLossCDR/include/asterisk/channel.h
    team/juggie/NoLossCDR/include/asterisk/devicestate.h
    team/juggie/NoLossCDR/include/asterisk/event.h
    team/juggie/NoLossCDR/include/asterisk/file.h
    team/juggie/NoLossCDR/include/asterisk/jingle.h
    team/juggie/NoLossCDR/include/asterisk/sched.h
    team/juggie/NoLossCDR/main/app.c
    team/juggie/NoLossCDR/main/ast_expr2.c
    team/juggie/NoLossCDR/main/ast_expr2.fl
    team/juggie/NoLossCDR/main/ast_expr2.h
    team/juggie/NoLossCDR/main/ast_expr2.y
    team/juggie/NoLossCDR/main/ast_expr2f.c
    team/juggie/NoLossCDR/main/asterisk.c
    team/juggie/NoLossCDR/main/cdr.c
    team/juggie/NoLossCDR/main/channel.c
    team/juggie/NoLossCDR/main/db1-ast/hash/hash.c
    team/juggie/NoLossCDR/main/dnsmgr.c
    team/juggie/NoLossCDR/main/file.c
    team/juggie/NoLossCDR/main/manager.c
    team/juggie/NoLossCDR/main/rtp.c
    team/juggie/NoLossCDR/main/sched.c
    team/juggie/NoLossCDR/pbx/pbx_ael.c
    team/juggie/NoLossCDR/pbx/pbx_dundi.c
    team/juggie/NoLossCDR/res/ael/ael.tab.c
    team/juggie/NoLossCDR/res/ael/ael.y
    team/juggie/NoLossCDR/res/ael/pval.c
    team/juggie/NoLossCDR/res/res_config_pgsql.c
    team/juggie/NoLossCDR/res/res_jabber.c
    team/juggie/NoLossCDR/utils/   (props changed)
    team/juggie/NoLossCDR/utils/Makefile
    team/juggie/NoLossCDR/utils/ael_main.c
    team/juggie/NoLossCDR/utils/hashtest2.c

Propchange: team/juggie/NoLossCDR/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/juggie/NoLossCDR/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/juggie/NoLossCDR/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Sep 26 22:46:43 2007
@@ -1,1 +1,1 @@
-/team/group/CDRfix5:1-83397
+/team/group/CDRfix5:1-84013

Modified: team/juggie/NoLossCDR/Makefile
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/Makefile?view=diff&rev=84014&r1=84013&r2=84014
==============================================================================
--- team/juggie/NoLossCDR/Makefile (original)
+++ team/juggie/NoLossCDR/Makefile Wed Sep 26 22:46:43 2007
@@ -108,6 +108,8 @@
   ASTETCDIR=/var/etc/asterisk
   ASTLIBDIR=/opt/asterisk/lib
   ASTVARLIBDIR=/var/opt/asterisk
+  ASTDBDIR=$(ASTVARLIBDIR)
+  ASTKEYDIR=$(ASTVARLIBDIR)
   ASTSPOOLDIR=/var/spool/asterisk
   ASTLOGDIR=/var/log/asterisk
   ASTHEADERDIR=/opt/asterisk/include
@@ -128,9 +130,12 @@
 ifneq ($(findstring BSD,$(OSARCH)),)
   ASTVARLIBDIR=$(prefix)/share/asterisk
   ASTVARRUNDIR=$(localstatedir)/run/asterisk
+  ASTDBDIR=$(localstatedir)/db/asterisk
 else
   ASTVARLIBDIR=$(localstatedir)/lib/asterisk
-endif
+  ASTDBDIR=$(ASTVARLIBDIR)
+endif
+  ASTKEYDIR=$(ASTVARLIBDIR)
 endif
 ifeq ($(ASTDATADIR),)
   ASTDATADIR:=$(ASTVARLIBDIR)
@@ -556,6 +561,8 @@
 		echo "astetcdir => $(ASTETCDIR)" ; \
 		echo "astmoddir => $(MODULES_DIR)" ; \
 		echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
+		echo "astdbdir => $(ASTDBDIR)" ; \
+		echo "astkeydir => $(ASTKEYDIR)" ; \
 		echo "astdatadir => $(ASTDATADIR)" ; \
 		echo "astagidir => $(AGI_DIR)" ; \
 		echo "astspooldir => $(ASTSPOOLDIR)" ; \

Modified: team/juggie/NoLossCDR/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_meetme.c?view=diff&rev=84014&r1=84013&r2=84014
==============================================================================
--- team/juggie/NoLossCDR/apps/app_meetme.c (original)
+++ team/juggie/NoLossCDR/apps/app_meetme.c Wed Sep 26 22:46:43 2007
@@ -3149,6 +3149,81 @@
 	return meetmemute(s, m, 0);
 }
 
+static char mandescr_meetmelist[] =
+"Description: Lists all users in a particular MeetMe conference.\n"
+"MeetmeList will follow as separate events, followed by a final event called\n"
+"MeetmeListComplete.\n"
+"Variables:\n"
+"    *ActionId: <id>\n"
+"    *Conference: <confno>\n";
+
+static int action_meetmelist(struct mansession *s, const struct message *m)
+{
+	const char *actionid = astman_get_header(m, "ActionID");
+	const char *conference = astman_get_header(m, "Conference");
+	char idText[80] = "";
+	struct ast_conference *cnf;
+	struct ast_conf_user *user;
+	int total = 0;
+
+	if (!ast_strlen_zero(actionid))
+		snprintf(idText, sizeof(idText), "ActionID: %s\r\n", actionid);
+
+	if (AST_LIST_EMPTY(&confs)) {
+		astman_send_error(s, m, "No active conferences.");
+		return 0;
+	}
+
+	astman_send_listack(s, m, "Meetme user list will follow", "start");
+
+	/* Find the right conference */
+	AST_LIST_LOCK(&confs);
+	AST_LIST_TRAVERSE(&confs, cnf, list) {
+		/* If we ask for one particular, and this isn't it, skip it */
+		if (!ast_strlen_zero(conference) && strcmp(cnf->confno, conference))
+			continue;
+
+		/* Show all the users */
+		AST_LIST_TRAVERSE(&cnf->userlist, user, list) {
+			total++;
+			astman_append(s,
+			"Event: MeetmeList\r\n"
+			"%s"
+			"Conference: %s\r\n"
+			"UserNumber: %d\r\n"
+			"CallerIDNum: %s\r\n"
+			"CallerIDName: %s\r\n"
+			"Channel: %s\r\n"
+			"Admin: %s\r\n"
+			"Role: %s\r\n"
+			"MarkedUser: %s\r\n"
+			"Muted: %s\r\n"
+			"Talking: %s\r\n"
+			"\r\n",
+			idText,
+			cnf->confno,
+			user->user_no,
+			S_OR(user->chan->cid.cid_num, "<unknown>"),
+			S_OR(user->chan->cid.cid_name, "<no name>"),
+			user->chan->name,
+			user->userflags & CONFFLAG_ADMIN ? "Yes" : "No",
+			user->userflags & CONFFLAG_MONITOR ? "Listen only" : user->userflags & CONFFLAG_TALKER ? "Talk only" : "Talk and listen",
+			user->userflags & CONFFLAG_MARKEDUSER ? "Yes" : "No",
+			user->adminflags & ADMINFLAG_MUTED ? "By admin" : user->adminflags & ADMINFLAG_SELFMUTED ? "By self" : "No",
+			user->talking > 0 ? "Yes" : user->talking == 0 ? "No" : "Not monitored"); 
+		}
+	}
+	AST_LIST_UNLOCK(&confs);
+	/* Send final confirmation */
+	astman_append(s,
+	"Event: MeetmeListComplete\r\n"
+	"EventList: Complete\r\n"
+	"ListItems: %d\r\n"
+	"%s"
+	"\r\n", total, idText);
+	return 0;
+}
+
 static void *recordthread(void *args)
 {
 	struct ast_conference *cnf = args;
@@ -5026,6 +5101,7 @@
 	ast_cli_unregister_multiple(cli_meetme, ARRAY_LEN(cli_meetme));
 	res = ast_manager_unregister("MeetmeMute");
 	res |= ast_manager_unregister("MeetmeUnmute");
+	res |= ast_manager_unregister("MeetmeList");
 	res |= ast_unregister_application(app4);
 	res |= ast_unregister_application(app3);
 	res |= ast_unregister_application(app2);
@@ -5052,6 +5128,8 @@
 				    action_meetmemute, "Mute a Meetme user");
 	res |= ast_manager_register("MeetmeUnmute", EVENT_FLAG_CALL, 
 				    action_meetmeunmute, "Unmute a Meetme user");
+	res |= ast_manager_register2("MeetmeList", EVENT_FLAG_REPORTING, 
+				    action_meetmelist, "List participants in a conference", mandescr_meetmelist);
 	res |= ast_register_application(app4, channel_admin_exec, synopsis4, descrip4);
 	res |= ast_register_application(app3, admin_exec, synopsis3, descrip3);
 	res |= ast_register_application(app2, count_exec, synopsis2, descrip2);

Modified: team/juggie/NoLossCDR/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_queue.c?view=diff&rev=84014&r1=84013&r2=84014
==============================================================================
--- team/juggie/NoLossCDR/apps/app_queue.c (original)
+++ team/juggie/NoLossCDR/apps/app_queue.c Wed Sep 26 22:46:43 2007
@@ -884,6 +884,7 @@
 			ao2_ref(mem, -1);
 			ao2_unlock(q);
 			queue_unref(q);
+			ret = 1;
 			break;
 		}
 		ao2_unlock(q);
@@ -2858,16 +2859,28 @@
 				monitorfilename = pbx_builtin_getvar_helper(qe->chan, "MONITOR_FILENAME");
 				if (!monitorfilename) {
 					if (qe->chan->cdr)
-						ast_copy_string(tmpid, qe->chan->cdr->uniqueid, sizeof(tmpid)-1);
+						ast_copy_string(tmpid, qe->chan->cdr->uniqueid, sizeof(tmpid));
 					else
 						snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
 				} else {
-					ast_copy_string(tmpid2, monitorfilename, sizeof(tmpid2)-1);
-					for (p = tmpid2; *p ; p++) {
-						if (*p == '^' && *(p+1) == '{') {
-							*p = '$';
+					const char *m = monitorfilename;
+					for (p = tmpid2; p < tmpid2 + sizeof(tmpid2) - 1; p++, m++) {
+						switch (*m) {
+						case '^':
+							if (*(m + 1) == '{')
+								*p = '$';
+							break;
+						case ',':
+							*p++ = '\\';
+							/* Fall through */
+						default:
+							*p = *m;
 						}
+						if (*m == '\0')
+							break;
 					}
+					if (p == tmpid2 + sizeof(tmpid2))
+						tmpid2[sizeof(tmpid2) - 1] = '\0';
 
 					memset(tmpid, 0, sizeof(tmpid));
 					pbx_substitute_variables_helper(qe->chan, tmpid2, tmpid, sizeof(tmpid) - 1);
@@ -2877,40 +2890,42 @@
 				monitor_options = pbx_builtin_getvar_helper(qe->chan, "MONITOR_OPTIONS");
 
 				if (monitor_exec) {
-					ast_copy_string(meid2, monitor_exec, sizeof(meid2)-1);
-					for (p = meid2; *p ; p++) {
-						if (*p == '^' && *(p+1) == '{') {
-							*p = '$';
+					const char *m = monitor_exec;
+					for (p = meid2; p < meid2 + sizeof(meid2) - 1; p++, m++) {
+						switch (*m) {
+						case '^':
+							if (*(m + 1) == '{')
+								*p = '$';
+							break;
+						case ',':
+							*p++ = '\\';
+							/* Fall through */
+						default:
+							*p = *m;
 						}
+						if (*m == '\0')
+							break;
 					}
+					if (p == meid2 + sizeof(meid2))
+						meid2[sizeof(meid2) - 1] = '\0';
 
 					memset(meid, 0, sizeof(meid));
 					pbx_substitute_variables_helper(qe->chan, meid2, meid, sizeof(meid) - 1);
 				}
 	
-				snprintf(tmpid2, sizeof(tmpid2)-1, "%s.%s", tmpid, qe->parent->monfmt);
+				snprintf(tmpid2, sizeof(tmpid2), "%s.%s", tmpid, qe->parent->monfmt);
 
 				mixmonapp = pbx_findapp("MixMonitor");
-
-				if (strchr(tmpid2, '|')) {
-					ast_log(LOG_WARNING, "monitor-format (in queues.conf) and MONITOR_FILENAME cannot contain a '|'! Not recording.\n");
-					mixmonapp = NULL;
-				}
 
 				if (!monitor_options)
 					monitor_options = "";
 				
-				if (strchr(monitor_options, '|')) {
-					ast_log(LOG_WARNING, "MONITOR_OPTIONS cannot contain a '|'! Not recording.\n");
-					mixmonapp = NULL;
-				}
-
 				if (mixmonapp) {
 					if (!ast_strlen_zero(monitor_exec))
-						snprintf(mixmonargs, sizeof(mixmonargs)-1, "%s|b%s|%s", tmpid2, monitor_options, monitor_exec);
+						snprintf(mixmonargs, sizeof(mixmonargs), "%s,b%s,%s", tmpid2, monitor_options, monitor_exec);
 					else
-						snprintf(mixmonargs, sizeof(mixmonargs)-1, "%s|b%s", tmpid2, monitor_options);
-						
+						snprintf(mixmonargs, sizeof(mixmonargs), "%s,b%s", tmpid2, monitor_options);
+
 					ast_debug(1, "Arguments being passed to MixMonitor: %s\n", mixmonargs);
 					/* We purposely lock the CDR so that pbx_exec does not update the application data */
 					/* if (qe->chan->cdr)
@@ -2950,7 +2965,7 @@
 			}
 			
 			app = pbx_findapp("Macro");
-			
+
 			if (app) {
 				res = pbx_exec(qe->chan, app, macroexec);
 				ast_debug(1, "Macro exited with status %d\n", res);
@@ -2959,7 +2974,7 @@
 				ast_log(LOG_ERROR, "Could not find application Macro\n");
 				res = -1;
 			}
-		
+
 			if (ast_autoservice_stop(qe->chan) < 0) {
 				ast_log(LOG_ERROR, "Could not stop autoservice on calling channel\n");
 				res = -1;
@@ -2995,13 +3010,13 @@
 				ast_copy_string(qe->chan->exten, "s", sizeof(qe->chan->exten));
 				qe->chan->priority = 0;
 
-				gosub_argstart = strchr(gosubexec, '|');
+				gosub_argstart = strchr(gosubexec, ',');
 				if (gosub_argstart) {
 					*gosub_argstart = 0;
-					asprintf(&gosub_args, "%s|s|1(%s)", gosubexec, gosub_argstart + 1);
+					asprintf(&gosub_args, "%s,s,1(%s)", gosubexec, gosub_argstart + 1);
 					*gosub_argstart = '|';
 				} else {
-					asprintf(&gosub_args, "%s|s|1", gosubexec);
+					asprintf(&gosub_args, "%s,s,1", gosubexec);
 				}
 				if (gosub_args) {
 					res = pbx_exec(qe->chan, app, gosub_args);

Modified: team/juggie/NoLossCDR/build_tools/make_defaults_h
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/build_tools/make_defaults_h?view=diff&rev=84014&r1=84013&r2=84014
==============================================================================
--- team/juggie/NoLossCDR/build_tools/make_defaults_h (original)
+++ team/juggie/NoLossCDR/build_tools/make_defaults_h Wed Sep 26 22:46:43 2007
@@ -14,7 +14,7 @@
 #define AST_DATA_DIR   "${INSTALL_PATH}${ASTDATADIR}"
 #define AST_LOG_DIR    "${INSTALL_PATH}${ASTLOGDIR}"
 #define AST_AGI_DIR    "${INSTALL_PATH}${AGI_DIR}"
-#define AST_KEY_DIR    "${INSTALL_PATH}${ASTVARLIBDIR}/keys"
+#define AST_KEY_DIR    "${INSTALL_PATH}${ASTDATADIR}/keys"
 #define AST_DB         "${INSTALL_PATH}${ASTVARLIBDIR}/astdb"
 #define AST_TMP_DIR    "${INSTALL_PATH}${ASTSPOOLDIR}/tmp"
 

Modified: team/juggie/NoLossCDR/cdr/cdr_manager.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/cdr/cdr_manager.c?view=diff&rev=84014&r1=84013&r2=84014
==============================================================================
--- team/juggie/NoLossCDR/cdr/cdr_manager.c (original)
+++ team/juggie/NoLossCDR/cdr/cdr_manager.c Wed Sep 26 22:46:43 2007
@@ -52,12 +52,15 @@
 static int enablecdr = 0;
 struct ast_str *customfields;
 
+static int manager_log(struct ast_cdr *cdr);
+
 static int load_config(int reload)
 {
 	char *cat = NULL;
 	struct ast_config *cfg;
 	struct ast_variable *v;
 	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
+	int newenablecdr = 0;
 
 	cfg = ast_config_load(CONF_FILE, config_flags);
 	if (cfg == CONFIG_STATUS_FILEUNCHANGED)
@@ -71,6 +74,8 @@
 	if (!cfg) {
 		/* Standard configuration */
 		ast_log(LOG_WARNING, "Failed to load configuration file. Module not activated.\n");
+		if (enablecdr)
+			ast_cdr_unregister(name);
 		enablecdr = 0;
 		return 0;
 	}
@@ -79,9 +84,8 @@
 		if (!strcasecmp(cat, "general")) {
 			v = ast_variable_browse(cfg, cat);
 			while (v) {
-				if (!strcasecmp(v->name, "enabled")) {
-					enablecdr = ast_true(v->value);
-				}
+				if (!strcasecmp(v->name, "enabled"))
+					newenablecdr = ast_true(v->value);
 				
 				v = v->next;
 			}
@@ -105,6 +109,12 @@
 	}
 	
 	ast_config_destroy(cfg);
+
+	if (enablecdr && !newenablecdr)
+		ast_cdr_unregister(name);
+	else if (!enablecdr && newenablecdr)
+		ast_cdr_register(name, "Asterisk Manager Interface CDR Backend", manager_log);
+
 	return 1;
 }
 
@@ -178,18 +188,11 @@
 
 static int load_module(void)
 {
-	int res;
-
 	/* Configuration file */
 	if (!load_config(0))
 		return AST_MODULE_LOAD_DECLINE;
-	
-	res = ast_cdr_register(name, NULL, "Asterisk Manager Interface CDR Backend", manager_log, NULL, NULL);
-	if (res) {
-		ast_log(LOG_ERROR, "Unable to register Asterisk Call Manager CDR handling\n");
-	}
-	
-	return res;
+
+	return AST_MODULE_LOAD_SUCCESS;
 }
 
 static int reload(void)

Modified: team/juggie/NoLossCDR/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_alsa.c?view=diff&rev=84014&r1=84013&r2=84014
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_alsa.c (original)
+++ team/juggie/NoLossCDR/channels/chan_alsa.c Wed Sep 26 22:46:43 2007
@@ -368,7 +368,8 @@
 		ast_debug(1, "Opening device %s in %s mode\n", dev, (stream == SND_PCM_STREAM_CAPTURE) ? "read" : "write");
 	}
 
-	snd_pcm_hw_params_alloca(&hwparams);
+	hwparams = alloca(snd_pcm_hw_params_sizeof());
+	memset(hwparams, 0, snd_pcm_hw_params_sizeof());
 	snd_pcm_hw_params_any(handle, hwparams);
 
 	err = snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED);
@@ -419,7 +420,8 @@
 	if (err < 0)
 		ast_log(LOG_ERROR, "Couldn't set the new hw params: %s\n", snd_strerror(err));
 
-	snd_pcm_sw_params_alloca(&swparams);
+	swparams = alloca(snd_pcm_sw_params_sizeof());
+	memset(swparams, 0, snd_pcm_sw_params_sizeof());
 	snd_pcm_sw_params_current(handle, swparams);
 
 #if 1

Modified: team/juggie/NoLossCDR/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_h323.c?view=diff&rev=84014&r1=84013&r2=84014
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_h323.c (original)
+++ team/juggie/NoLossCDR/channels/chan_h323.c Wed Sep 26 22:46:43 2007
@@ -311,9 +311,9 @@
 	ast_free(peer);
 }
 
-static int oh323_simulate_dtmf_end(void *data)
-{
-	struct oh323_pvt *pvt = data;
+static int oh323_simulate_dtmf_end(const void *data)
+{
+	struct oh323_pvt *pvt = (struct oh323_pvt *)data;
 
 	if (pvt) {
 		ast_mutex_lock(&pvt->lock);

Modified: team/juggie/NoLossCDR/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_iax2.c?view=diff&rev=84014&r1=84013&r2=84014
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_iax2.c (original)
+++ team/juggie/NoLossCDR/channels/chan_iax2.c Wed Sep 26 22:46:43 2007
@@ -738,8 +738,8 @@
 	enum iax2_thread_type type;
 	enum iax2_thread_iostate iostate;
 #ifdef SCHED_MULTITHREADED
-	void (*schedfunc)(void *);
-	void *scheddata;
+	void (*schedfunc)(const void *);
+	const void *scheddata;
 #endif
 #ifdef DEBUG_SCHED_MULTITHREAD
 	char curfunc[80];
@@ -873,7 +873,7 @@
 static struct timeval lastused[IAX_MAX_CALLS];
 
 static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms);
-static int expire_registry(void *data);
+static int expire_registry(const void *data);
 static int iax2_answer(struct ast_channel *c);
 static int iax2_call(struct ast_channel *c, char *dest, int timeout);
 static int iax2_devicestate(void *data);
@@ -1075,7 +1075,7 @@
 }
 
 #ifdef SCHED_MULTITHREADED
-static int __schedule_action(void (*func)(void *data), void *data, const char *funcname)
+static int __schedule_action(void (*func)(const void *data), const void *data, const char *funcname)
 {
 	struct iax2_thread *thread = NULL;
 	static time_t lasterror;
@@ -1103,7 +1103,7 @@
 #define schedule_action(func, data) __schedule_action(func, data, __PRETTY_FUNCTION__)
 #endif
 
-static int iax2_sched_replace(int old_id, struct sched_context *con, int when, ast_sched_cb callback, void *data)
+static int iax2_sched_replace(int old_id, struct sched_context *con, int when, ast_sched_cb callback, const void *data)
 {
 	int res;
 
@@ -1113,7 +1113,7 @@
 	return res;
 }
 
-static int iax2_sched_add(struct sched_context *con, int when, ast_sched_cb callback, void *data)
+static int iax2_sched_add(struct sched_context *con, int when, ast_sched_cb callback, const void *data)
 {
 	int res;
 
@@ -1123,9 +1123,9 @@
 	return res;
 }
 
-static int send_ping(void *data);
-
-static void __send_ping(void *data)
+static int send_ping(const void *data);
+
+static void __send_ping(const void *data)
 {
 	int callno = (long)data;
 	ast_mutex_lock(&iaxsl[callno]);
@@ -1136,7 +1136,7 @@
 	ast_mutex_unlock(&iaxsl[callno]);
 }
 
-static int send_ping(void *data)
+static int send_ping(const void *data)
 {
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__send_ping, data))
@@ -1157,9 +1157,9 @@
 	return e;
 }
 
-static int send_lagrq(void *data);
-
-static void __send_lagrq(void *data)
+static int send_lagrq(const void *data);
+
+static void __send_lagrq(const void *data)
 {
 	int callno = (long)data;
 	/* Ping only if it's real not if it's bridged */
@@ -1171,7 +1171,7 @@
 	ast_mutex_unlock(&iaxsl[callno]);
 }
 
-static int send_lagrq(void *data)
+static int send_lagrq(const void *data)
 {
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__send_lagrq, data))
@@ -2178,12 +2178,12 @@
 	return 0;
 }
 
-static int attempt_transmit(void *data);
-static void __attempt_transmit(void *data)
+static int attempt_transmit(const void *data);
+static void __attempt_transmit(const void *data)
 {
 	/* Attempt to transmit the frame to the remote peer...
 	   Called without iaxsl held. */
-	struct iax_frame *f = data;
+	struct iax_frame *f = (struct iax_frame *)data;
 	int freeme = 0;
 	int callno = f->callno;
 	/* Make sure this call is still active */
@@ -2259,7 +2259,7 @@
 	}
 }
 
-static int attempt_transmit(void *data)
+static int attempt_transmit(const void *data)
 {
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__attempt_transmit, data))
@@ -2280,7 +2280,7 @@
 	} else if ((peer = find_peer(argv[3], 0))) {
 		if(ast_test_flag(peer, IAX_RTCACHEFRIENDS)) {
 			ast_set_flag(peer, IAX_RTAUTOCLEAR);
-			expire_registry((void *)peer->name);
+			expire_registry((const void *)peer->name);
 			ast_cli(fd, "OK peer %s was removed from the cache.\n", argv[3]);
 		} else {
 			ast_cli(fd, "SORRY peer %s is not eligible for this operation.\n", argv[3]);
@@ -2589,7 +2589,7 @@
 	}
 }
 
-static int get_from_jb(void *p);
+static int get_from_jb(const void *p);
 
 static void update_jbsched(struct chan_iax2_pvt *pvt)
 {
@@ -2608,7 +2608,7 @@
 		CALLNO_TO_PTR(pvt->callno));
 }
 
-static void __get_from_jb(void *p) 
+static void __get_from_jb(const void *p) 
 {
 	int callno = PTR_TO_CALLNO(p);
 	struct chan_iax2_pvt *pvt = NULL;
@@ -2684,7 +2684,7 @@
 	ast_mutex_unlock(&iaxsl[callno]);
 }
 
-static int get_from_jb(void *data)
+static int get_from_jb(const void *data)
 {
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__get_from_jb, data))
@@ -2906,7 +2906,7 @@
 		ast_copy_flags(peer, &globalflags, IAX_RTAUTOCLEAR|IAX_RTCACHEFRIENDS);
 		if (ast_test_flag(peer, IAX_RTAUTOCLEAR)) {
 			peer->expire = iax2_sched_replace(peer->expire, sched, 
-				(global_rtautoclear) * 1000, expire_registry, (void *) peer->name);
+				(global_rtautoclear) * 1000, expire_registry, (const void *)peer->name);
 		}
 		ao2_link(peers, peer_ref(peer));
 		if (ast_test_flag(peer, IAX_DYNAMIC))
@@ -3080,7 +3080,7 @@
 	return res;
 }
 
-static void __auto_congest(void *nothing)
+static void __auto_congest(const void *nothing)
 {
 	int callno = PTR_TO_CALLNO(nothing);
 	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_CONGESTION };
@@ -3093,7 +3093,7 @@
 	ast_mutex_unlock(&iaxsl[callno]);
 }
 
-static int auto_congest(void *data)
+static int auto_congest(const void *data)
 {
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__auto_congest, data))
@@ -5780,14 +5780,14 @@
 
 static int iax2_do_register(struct iax2_registry *reg);
 
-static void __iax2_do_register_s(void *data)
-{
-	struct iax2_registry *reg = data;
+static void __iax2_do_register_s(const void *data)
+{
+	struct iax2_registry *reg = (struct iax2_registry *)data;
 	reg->expire = -1;
 	iax2_do_register(reg);
 }
 
-static int iax2_do_register_s(void *data)
+static int iax2_do_register_s(const void *data)
 {
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__iax2_do_register_s, data))
@@ -6065,9 +6065,9 @@
 }
 static void prune_peers(void);
 
-static void __expire_registry(void *data)
-{
-	char *name = data;
+static void __expire_registry(const void *data)
+{
+	const char *name = data;
 	struct iax2_peer *peer = NULL;
 	struct iax2_peer tmp_peer = {
 		.name = name,
@@ -6100,7 +6100,7 @@
 	peer_unref(peer);
 }
 
-static int expire_registry(void *data)
+static int expire_registry(const void *data)
 {
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__expire_registry, data))
@@ -6136,7 +6136,7 @@
 					p->addr.sin_port = htons(atoi(c));
 					ast_device_state_changed("IAX2/%s", p->name); /* Activate notification */
 					p->expire = iax2_sched_replace(p->expire, sched, 
-						(p->expiry + 10) * 1000, expire_registry, (void *) p->name);
+						(p->expiry + 10) * 1000, expire_registry, (const void *)p->name);
 					if (iax2_regfunk)
 						iax2_regfunk(p->name, 1);
 					register_peer_exten(p, 1);
@@ -6240,7 +6240,7 @@
 		p->expiry = refresh;
 	}
 	if (p->expiry && sin->sin_addr.s_addr)
-		p->expire = iax2_sched_add(sched, (p->expiry + 10) * 1000, expire_registry, (void *)p->name);
+		p->expire = iax2_sched_add(sched, (p->expiry + 10) * 1000, expire_registry, (const void *)p->name);
 	iax_ie_append_str(&ied, IAX_IE_USERNAME, p->name);
 	iax_ie_append_int(&ied, IAX_IE_DATETIME, iax2_datetime(p->zonetag));
 	if (sin->sin_addr.s_addr) {
@@ -6385,7 +6385,7 @@
 	iax2_destroy_helper(iaxs[callno]);
 }
 
-static void __auth_reject(void *nothing)
+static void __auth_reject(const void *nothing)
 {
 	/* Called from IAX thread only, without iaxs lock */
 	int callno = (int)(long)(nothing);
@@ -6405,7 +6405,7 @@
 	ast_mutex_unlock(&iaxsl[callno]);
 }
 
-static int auth_reject(void *data)
+static int auth_reject(const void *data)
 {
 	int callno = (int)(long)(data);
 	ast_mutex_lock(&iaxsl[callno]);
@@ -6434,7 +6434,7 @@
 	return 0;
 }
 
-static void __auto_hangup(void *nothing)
+static void __auto_hangup(const void *nothing)
 {
 	/* Called from IAX thread only, without iaxs lock */
 	int callno = (int)(long)(nothing);
@@ -6449,7 +6449,7 @@
 	ast_mutex_unlock(&iaxsl[callno]);
 }
 
-static int auto_hangup(void *data)
+static int auto_hangup(const void *data)
 {
 	int callno = (int)(long)(data);
 	ast_mutex_lock(&iaxsl[callno]);
@@ -6497,15 +6497,15 @@
 	AST_LIST_UNLOCK(&frame_queue);
 }
 
-static void __iax2_poke_peer_s(void *data)
-{
-	struct iax2_peer *peer = data;
+static void __iax2_poke_peer_s(const void *data)
+{
+	struct iax2_peer *peer = (struct iax2_peer *)data;
 	iax2_poke_peer(peer, 0);
 }
 
-static int iax2_poke_peer_s(void *data)
-{
-	struct iax2_peer *peer = data;
+static int iax2_poke_peer_s(const void *data)
+{
+	struct iax2_peer *peer = (struct iax2_peer *)data;
 	peer->pokeexpire = -1;
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__iax2_poke_peer_s, data))
@@ -8961,9 +8961,9 @@
 	return RESULT_SUCCESS;
 }
 
-static void __iax2_poke_noanswer(void *data)
-{
-	struct iax2_peer *peer = data;
+static void __iax2_poke_noanswer(const void *data)
+{
+	struct iax2_peer *peer = (struct iax2_peer *)data;
 	if (peer->lastms > -1) {
 		ast_log(LOG_NOTICE, "Peer '%s' is now UNREACHABLE! Time: %d\n", peer->name, peer->lastms);
 		manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Unreachable\r\nTime: %d\r\n", peer->name, peer->lastms);
@@ -8980,9 +8980,9 @@
 	peer->pokeexpire = iax2_sched_add(sched, peer->pokefreqnotok, iax2_poke_peer_s, peer);
 }
 
-static int iax2_poke_noanswer(void *data)
-{
-	struct iax2_peer *peer = data;
+static int iax2_poke_noanswer(const void *data)
+{
+	struct iax2_peer *peer = (struct iax2_peer *)data;
 	peer->pokeexpire = -1;
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__iax2_poke_noanswer, data))

Modified: team/juggie/NoLossCDR/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_jingle.c?view=diff&rev=84014&r1=84013&r2=84014
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_jingle.c (original)
+++ team/juggie/NoLossCDR/channels/chan_jingle.c Wed Sep 26 22:46:43 2007
@@ -96,14 +96,15 @@
 static struct ast_jb_conf global_jbconf;
 
 enum jingle_protocol {
-	AJI_PROTOCOL_UDP = 1,
-	AJI_PROTOCOL_SSLTCP = 2,
+	AJI_PROTOCOL_UDP,
+	AJI_PROTOCOL_SSLTCP,
 };
 
 enum jingle_connect_type {
-	AJI_CONNECT_STUN = 1,
-	AJI_CONNECT_LOCAL = 2,
-	AJI_CONNECT_RELAY = 3,
+	AJI_CONNECT_HOST,
+	AJI_CONNECT_PRFLX,
+	AJI_CONNECT_RELAY,
+	AJI_CONNECT_SRFLX,
 };
 
 struct jingle_pvt {
@@ -132,17 +133,18 @@
 };
 
 struct jingle_candidate {
-	char name[100];
+	unsigned int component;          /*!< ex. : 1 for RTP, 2 for RTCP */
+	unsigned int foundation;         /*!< Function of IP, protocol, type */
+	unsigned int generation;
+	char ip[16];
+	unsigned int network;
+	unsigned int port;
+	unsigned int priority;
 	enum jingle_protocol protocol;
-	double preference;
-	char username[100];
 	char password[100];
 	enum jingle_connect_type type;
-	char network[6];
-	int generation;
-	char ip[16];
-	int port;
-	int receipt;
+	char ufrag[100];
+	unsigned int preference;
 	struct jingle_candidate *next;
 };
 
@@ -359,7 +361,7 @@
 		ast_aji_increment_mid(client->connection->mid);
 
 		iks_insert_attrib(jingle, "xmlns", JINGLE_NS);
-		iks_insert_attrib(jingle, "type", JINGLE_ACCEPT);
+		iks_insert_attrib(jingle, "action", JINGLE_ACCEPT);
 		iks_insert_attrib(jingle, "initiator", p->initiator ? client->connection->jid->full : p->from);
 		iks_insert_attrib(jingle, JINGLE_SID, tmp->sid);
 		iks_insert_node(iq, jingle);
@@ -593,14 +595,17 @@
 	struct sockaddr_in sin;
 	struct sockaddr_in dest;
 	struct in_addr us;
-	iks *iq, *jingle, *candidate;
-	char user[17], pass[17], preference[5], port[7];
+	struct in_addr externaddr;
+	iks *iq, *jingle, *content, *transport, *candidate;
+	char component[16], foundation[16], generation[16], network[16], pass[16], port[7], priority[16], user[16];
 
 
 	iq = iks_new("iq");
 	jingle = iks_new(JINGLE_NODE);
+	content = iks_new("content");
+	transport = iks_new("transport");
 	candidate = iks_new("candidate");
-	if (!iq || !jingle || !candidate) {
+	if (!iq || !jingle || !content || !transport || !candidate) {
 		ast_log(LOG_ERROR, "Memory allocation error\n");
 		goto safeout;
 	}
@@ -608,8 +613,11 @@
 	ours2 = ast_calloc(1, sizeof(*ours2));
 	if (!ours1 || !ours2)
 		goto safeout;
+
 	iks_insert_node(iq, jingle);
-	iks_insert_node(jingle, candidate);
+	iks_insert_node(jingle, content);
+	iks_insert_node(content, transport);
+	iks_insert_node(transport, candidate);
 
 	for (; p; p = p->next) {
 		if (!strcasecmp(p->sid, sid))
@@ -624,33 +632,41 @@
 	ast_rtp_get_us(p->rtp, &sin);
 	ast_find_ourip(&us, bindaddr);
 
-	/* Setup our jingle candidates */
-	ast_copy_string(ours1->name, "rtp", sizeof(ours1->name));
+	/* Setup our first jingle candidate */
+	ours1->component = 1;
+	ours1->foundation = (unsigned int)bindaddr.sin_addr.s_addr | AJI_CONNECT_HOST | AJI_PROTOCOL_UDP;
+	ours1->generation = 0;
+	ast_copy_string(ours1->ip, ast_inet_ntoa(us), sizeof(ours1->ip));
+	ours1->network = 0;
 	ours1->port = ntohs(sin.sin_port);
-	ours1->preference = 1;
+	ours1->priority = 1678246398;
+	ours1->protocol = AJI_PROTOCOL_UDP;
+	snprintf(pass, sizeof(pass), "%08lx%08lx", ast_random(), ast_random());
+	ast_copy_string(ours1->password, pass, sizeof(ours1->password));
+	ours1->type = AJI_CONNECT_HOST;
 	snprintf(user, sizeof(user), "%08lx%08lx", ast_random(), ast_random());
-	snprintf(pass, sizeof(pass), "%08lx%08lx", ast_random(), ast_random());
-	ast_copy_string(ours1->username, user, sizeof(ours1->username));
-	ast_copy_string(ours1->password, pass, sizeof(ours1->password));
-	ast_copy_string(ours1->ip, ast_inet_ntoa(us), sizeof(ours1->ip));
-	ours1->protocol = AJI_PROTOCOL_UDP;
-	ours1->type = AJI_CONNECT_LOCAL;
-	ours1->generation = 0;
+	ast_copy_string(ours1->ufrag, user, sizeof(ours1->ufrag));
 	p->ourcandidates = ours1;
 
 	if (!ast_strlen_zero(externip)) {
 		/* XXX We should really stun for this one not just go with externip XXX */
+		if (inet_aton(externip, &externaddr))
+			ast_log(LOG_WARNING, "Invalid extern IP : %s\n", externip);
+
+		ours2->component = 1;
+		ours2->foundation = (unsigned int)externaddr.s_addr | AJI_CONNECT_PRFLX | AJI_PROTOCOL_UDP;
+		ours2->generation = 0;
+		ast_copy_string(ours2->ip, externip, sizeof(ours2->ip));
+		ours2->network = 0;
+		ours2->port = ntohs(sin.sin_port);
+		ours2->priority = 1678246397;
+		ours2->protocol = AJI_PROTOCOL_UDP;
+		snprintf(pass, sizeof(pass), "%08lx%08lx", ast_random(), ast_random());
+		ast_copy_string(ours2->password, pass, sizeof(ours2->password));
+		ours2->type = AJI_CONNECT_PRFLX;
+
 		snprintf(user, sizeof(user), "%08lx%08lx", ast_random(), ast_random());
-		snprintf(pass, sizeof(pass), "%08lx%08lx", ast_random(), ast_random());
-		ast_copy_string(ours2->username, user, sizeof(ours2->username));
-		ast_copy_string(ours2->password, pass, sizeof(ours2->password));
-		ast_copy_string(ours2->ip, externip, sizeof(ours2->ip));
-		ast_copy_string(ours2->name, "rtp", sizeof(ours1->name));
-		ours2->port = ntohs(sin.sin_port);
-		ours2->preference = 0.9;
-		ours2->protocol = AJI_PROTOCOL_UDP;
-		ours2->type = AJI_CONNECT_STUN;
-		ours2->generation = 0;
+		ast_copy_string(ours2->ufrag, user, sizeof(ours2->ufrag));
 		ours1->next = ours2;
 		ours2 = NULL;
 	}
@@ -660,35 +676,57 @@
 
 
 	for (tmp = p->ourcandidates; tmp; tmp = tmp->next) {
-		snprintf(port, sizeof(port), "%d", tmp->port);
-		snprintf(preference, sizeof(preference), "%.2f", tmp->preference);
+		snprintf(component, sizeof(component), "%u", tmp->component);
+		snprintf(foundation, sizeof(foundation), "%u", tmp->foundation);
+		snprintf(generation, sizeof(generation), "%u", tmp->generation);
+		snprintf(network, sizeof(network), "%u", tmp->network);
+		snprintf(port, sizeof(port), "%u", tmp->port);
+		snprintf(priority, sizeof(priority), "%u", tmp->priority);
+
 		iks_insert_attrib(iq, "from", c->jid->full);
 		iks_insert_attrib(iq, "to", from);
 		iks_insert_attrib(iq, "type", "set");
 		iks_insert_attrib(iq, "id", c->mid);
 		ast_aji_increment_mid(c->mid);
-		iks_insert_attrib(jingle, "type", "candidates");
-		iks_insert_attrib(jingle, "id", sid);
+		iks_insert_attrib(jingle, "action", JINGLE_NEGOTIATE);
+		iks_insert_attrib(jingle, JINGLE_SID, sid);
 		iks_insert_attrib(jingle, "initiator", (p->initiator) ? c->jid->full : from);
 		iks_insert_attrib(jingle, "xmlns", JINGLE_NS);
-		iks_insert_attrib(candidate, "name", tmp->name);
-		iks_insert_attrib(candidate, "address", tmp->ip);
+		iks_insert_attrib(content, "creator", p->initiator ? "initiator" : "responder");
+		iks_insert_attrib(content, "name", "asterisk-audio-content");
+		iks_insert_attrib(transport, "xmlns", JINGLE_ICE_UDP_NS);
+		iks_insert_attrib(candidate, "component", component);
+		iks_insert_attrib(candidate, "foundation", foundation);
+		iks_insert_attrib(candidate, "generation", generation);
+		iks_insert_attrib(candidate, "ip", tmp->ip);
+		iks_insert_attrib(candidate, "network", network);
 		iks_insert_attrib(candidate, "port", port);
-		iks_insert_attrib(candidate, "username", tmp->username);
-		iks_insert_attrib(candidate, "password", tmp->password);
-		iks_insert_attrib(candidate, "preference", preference);
-		if (tmp->protocol == AJI_PROTOCOL_UDP)
+		iks_insert_attrib(candidate, "priority", priority);
+		switch (tmp->protocol) {
+		case AJI_PROTOCOL_UDP:
 			iks_insert_attrib(candidate, "protocol", "udp");
-		if (tmp->protocol == AJI_PROTOCOL_SSLTCP)
+			break;
+		case AJI_PROTOCOL_SSLTCP:
 			iks_insert_attrib(candidate, "protocol", "ssltcp");
-		if (tmp->type == AJI_CONNECT_STUN)
-			iks_insert_attrib(candidate, "type", "stun");
-		if (tmp->type == AJI_CONNECT_LOCAL)
-			iks_insert_attrib(candidate, "type", "local");
-		if (tmp->type == AJI_CONNECT_RELAY)
+			break;
+		}
+		iks_insert_attrib(candidate, "pwd", tmp->password);
+		switch (tmp->type) {
+		case AJI_CONNECT_HOST:
+			iks_insert_attrib(candidate, "type", "host");
+			break;
+		case AJI_CONNECT_PRFLX:
+			iks_insert_attrib(candidate, "type", "prflx");
+			break;
+		case AJI_CONNECT_RELAY:
 			iks_insert_attrib(candidate, "type", "relay");
-		iks_insert_attrib(candidate, "network", "0");
-		iks_insert_attrib(candidate, "generation", "0");
+			break;
+		case AJI_CONNECT_SRFLX:
+			iks_insert_attrib(candidate, "type", "srflx");
+			break;
+		}
+		iks_insert_attrib(candidate, "ufrag", tmp->ufrag);
+
 		iks_send(c->p, iq);
 	}
 	p->laststun = 0;
@@ -702,6 +740,10 @@
 		iks_delete(iq);
 	if (jingle)
 		iks_delete(jingle);
+	if (content)
+		iks_delete(content);
+	if (transport)
+		iks_delete(transport);
 	if (candidate)
 		iks_delete(candidate);
 	return 1;
@@ -851,29 +893,31 @@
 
 static int jingle_action(struct jingle *client, struct jingle_pvt *p, const char *action)
 {
-	iks *request, *session = NULL;
+	iks *iq, *jingle = NULL;
 	int res = -1;
 
-	request = iks_new("iq");
-	if (request) {
-		iks_insert_attrib(request, "type", "set");
-		iks_insert_attrib(request, "from", client->connection->jid->full);
-		iks_insert_attrib(request, "to", p->from);
-		iks_insert_attrib(request, "id", client->connection->mid);
+	iq = iks_new("iq");
+	jingle = iks_new("jingle");
+	
+	if (iq) {
+		iks_insert_attrib(iq, "type", "set");
+		iks_insert_attrib(iq, "from", client->connection->jid->full);
+		iks_insert_attrib(iq, "to", p->from);

[... 19498 lines stripped ...]



More information about the svn-commits mailing list