[asterisk-commits] jpeeler: branch jpeeler/chan_dahdi r119069 - in /team/jpeeler/chan_dahdi: ./ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 29 14:34:14 CDT 2008


Author: jpeeler
Date: Thu May 29 14:34:13 2008
New Revision: 119069

URL: http://svn.digium.com/view/asterisk?view=rev&rev=119069
Log:
sync with trunk

Added:
    team/jpeeler/chan_dahdi/channels/chan_phone.h
      - copied unchanged from r119015, trunk/channels/chan_phone.h
Removed:
    team/jpeeler/chan_dahdi/channels/DialTone.h
Modified:
    team/jpeeler/chan_dahdi/   (props changed)
    team/jpeeler/chan_dahdi/CHANGES
    team/jpeeler/chan_dahdi/apps/app_chanspy.c
    team/jpeeler/chan_dahdi/apps/app_forkcdr.c
    team/jpeeler/chan_dahdi/apps/app_milliwatt.c
    team/jpeeler/chan_dahdi/apps/app_queue.c
    team/jpeeler/chan_dahdi/apps/app_voicemail.c
    team/jpeeler/chan_dahdi/channels/chan_agent.c
    team/jpeeler/chan_dahdi/channels/chan_alsa.c
    team/jpeeler/chan_dahdi/channels/chan_iax2.c
    team/jpeeler/chan_dahdi/channels/chan_jingle.c
    team/jpeeler/chan_dahdi/channels/chan_mgcp.c
    team/jpeeler/chan_dahdi/channels/chan_phone.c
    team/jpeeler/chan_dahdi/channels/chan_sip.c
    team/jpeeler/chan_dahdi/channels/chan_skinny.c
    team/jpeeler/chan_dahdi/configs/sip.conf.sample
    team/jpeeler/chan_dahdi/include/asterisk/compat.h
    team/jpeeler/chan_dahdi/include/asterisk/jingle.h
    team/jpeeler/chan_dahdi/include/asterisk/lock.h
    team/jpeeler/chan_dahdi/main/asterisk.c
    team/jpeeler/chan_dahdi/main/cdr.c
    team/jpeeler/chan_dahdi/main/cli.c
    team/jpeeler/chan_dahdi/main/features.c
    team/jpeeler/chan_dahdi/main/utils.c
    team/jpeeler/chan_dahdi/utils/check_expr.c

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

Propchange: team/jpeeler/chan_dahdi/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 29 14:34:13 2008
@@ -1,1 +1,1 @@
-/trunk:1-118370
+/trunk:1-119068

Modified: team/jpeeler/chan_dahdi/CHANGES
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/CHANGES?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/CHANGES (original)
+++ team/jpeeler/chan_dahdi/CHANGES Thu May 29 14:34:13 2008
@@ -97,6 +97,7 @@
    the register line.
  * Added support for T140 RED - redundancy in T.140 to prevent text loss due to
    lost packets.
+ * Added t38pt_usertpsource option. See sip.conf.sample for details.
 
 IAX Changes
 -----------

Modified: team/jpeeler/chan_dahdi/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/apps/app_chanspy.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/apps/app_chanspy.c (original)
+++ team/jpeeler/chan_dahdi/apps/app_chanspy.c Thu May 29 14:34:13 2008
@@ -218,6 +218,7 @@
 	AST_APP_OPTION('d', OPTION_DTMF_SWITCH_MODES),
 });
 
+int next_unique_id_to_use = 0;
 
 struct chanspy_translation_helper {
 	/* spy data */
@@ -294,6 +295,7 @@
 
 struct chanspy_ds {
 	struct ast_channel *chan;
+	char unique_id[20];
 	ast_mutex_t lock;
 };
 
@@ -546,7 +548,7 @@
 		chan = chanspy_ds->chan;
 
 		ast_channel_lock(chan);
-		if ((datastore = ast_channel_datastore_find(chan, &chanspy_ds_info, NULL))) {
+		if ((datastore = ast_channel_datastore_find(chan, &chanspy_ds_info, chanspy_ds->unique_id))) {
 			ast_channel_datastore_remove(chan, datastore);
 			/* chanspy_ds->chan is NULL after this call */
 			chanspy_ds_destroy(datastore->data);
@@ -567,7 +569,7 @@
 
 	ast_mutex_lock(&chanspy_ds->lock);
 
-	if (!(datastore = ast_channel_datastore_alloc(&chanspy_ds_info, NULL))) {
+	if (!(datastore = ast_channel_datastore_alloc(&chanspy_ds_info, chanspy_ds->unique_id))) {
 		ast_mutex_unlock(&chanspy_ds->lock);
 		chanspy_ds = chanspy_ds_free(chanspy_ds);
 		ast_channel_unlock(chan);
@@ -642,6 +644,8 @@
 	}
 
 	ast_mutex_init(&chanspy_ds.lock);
+
+	snprintf(chanspy_ds.unique_id, sizeof(chanspy_ds.unique_id), "%d", ast_atomic_fetchadd_int(&next_unique_id_to_use, +1));
 
 	if (chan->_state != AST_STATE_UP)
 		ast_answer(chan);

Modified: team/jpeeler/chan_dahdi/apps/app_forkcdr.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/apps/app_forkcdr.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/apps/app_forkcdr.c (original)
+++ team/jpeeler/chan_dahdi/apps/app_forkcdr.c Thu May 29 14:34:13 2008
@@ -34,6 +34,7 @@
 #include "asterisk/channel.h"
 #include "asterisk/pbx.h"
 #include "asterisk/cdr.h"
+#include "asterisk/app.h"
 #include "asterisk/module.h"
 
 static char *app = "ForkCDR";
@@ -43,10 +44,51 @@
 "  ForkCDR([options]):  Causes the Call Data Record to fork an additional\n"
 "cdr record starting from the time of the fork call\n"
 "  Options:\n"
-"    v  - If the option is passed all cdr variables will be passed along also.\n";
+"    a  - update the answer time on the NEW CDR just after it's been inited..\n"
+"         The new CDR may have been answered already, the reset that forkcdr.\n"
+"         does will erase the answer time. This will bring it back, but.\n"
+"         the answer time will be a copy of the fork/start time. It will.\n"
+"         only do this if the initial cdr was indeed already answered..\n"
+"    D -  Copy the disposition forward from the old cdr, after the .\n"
+"         init..\n"
+"    d -  Clear the dstchannel on the new CDR after reset..\n"
+"    e -  end the original CDR. Do this after all the necc. data.\n"
+"         is copied from the original CDR to the new forked CDR..\n"
+"    R -  do NOT reset the new cdr..\n"
+"    s(name=val) - Set the CDR var 'name' in the original CDR, with value.\n"
+"                  'val'.\n"
+"    v  - When the new CDR is forked, it gets a copy of the vars attached\n"
+"         to the current CDR. The vars attached to the original CDR are removed\n"
+"         unless this option is specified.\n";
 
 
-static void ast_cdr_fork(struct ast_channel *chan) 
+enum {
+	OPT_SETANS =            (1 << 0),
+	OPT_SETDISP =           (1 << 1),
+	OPT_RESETDEST =         (1 << 2),
+	OPT_ENDCDR =            (1 << 3),
+	OPT_NORESET =           (1 << 4),
+	OPT_KEEPVARS =          (1 << 5),
+	OPT_VARSET =            (1 << 6),
+};
+
+enum {
+	OPT_ARG_VARSET = 0,
+	/* note: this entry _MUST_ be the last one in the enum */
+	OPT_ARG_ARRAY_SIZE,
+};
+
+AST_APP_OPTIONS(forkcdr_exec_options, {
+	AST_APP_OPTION('a', OPT_SETANS),
+	AST_APP_OPTION('d', OPT_SETDISP),
+	AST_APP_OPTION('D', OPT_RESETDEST),
+	AST_APP_OPTION('e', OPT_ENDCDR),
+	AST_APP_OPTION('R', OPT_NORESET),
+	AST_APP_OPTION_ARG('s', OPT_VARSET, OPT_ARG_VARSET),
+	AST_APP_OPTION('v', OPT_KEEPVARS),
+});
+
+static void ast_cdr_fork(struct ast_channel *chan, struct ast_flags optflags, char *set) 
 {
 	struct ast_cdr *cdr;
 	struct ast_cdr *newcdr;
@@ -61,27 +103,66 @@
 		return;
 	
 	ast_cdr_append(cdr, newcdr);
-	ast_cdr_reset(newcdr, &flags);
-	
+
+	if (!ast_test_flag(&optflags, OPT_NORESET))
+		ast_cdr_reset(newcdr, &flags);
+		
 	if (!ast_test_flag(cdr, AST_CDR_FLAG_KEEP_VARS))
 		ast_cdr_free_vars(cdr, 0);
 	
+	if (!ast_strlen_zero(set)) {
+		char *varname = ast_strdupa(set), *varval;
+		varval = strchr(varname,'=');
+		if (varval) {
+			*varval = 0;
+			varval++;
+			ast_cdr_setvar(cdr, varname, varval, 0);
+		}
+	}
+	
+	if (ast_test_flag(&optflags, OPT_SETANS) && !ast_tvzero(cdr->answer))
+		newcdr->answer = newcdr->start;
+
+	if (ast_test_flag(&optflags, OPT_SETDISP))
+		newcdr->disposition = cdr->disposition;
+	
+	if (ast_test_flag(&optflags, OPT_RESETDEST))
+		newcdr->dstchannel[0] = 0;
+	
+	if (ast_test_flag(&optflags, OPT_ENDCDR))
+		ast_cdr_end(cdr);
+
 	ast_set_flag(cdr, AST_CDR_FLAG_CHILD | AST_CDR_FLAG_LOCKED);
 }
 
 static int forkcdr_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
+	char *argcopy = NULL;
+	struct ast_flags flags = {0};
+	char *opts[OPT_ARG_ARRAY_SIZE];
+	AST_DECLARE_APP_ARGS(arglist,
+		AST_APP_ARG(options);
+	);
 
 	if (!chan->cdr) {
 		ast_log(LOG_WARNING, "Channel does not have a CDR\n");
 		return 0;
 	}
 
+	argcopy = ast_strdupa(data);
+
+	AST_STANDARD_APP_ARGS(arglist, argcopy);
+
+	if (!ast_strlen_zero(arglist.options)) {
+		ast_app_parse_options(forkcdr_exec_options, &flags, opts, arglist.options);
+	} else
+		opts[OPT_ARG_VARSET] = 0;
+	
 	if (!ast_strlen_zero(data))
-		ast_set2_flag(chan->cdr, strchr(data, 'v'), AST_CDR_FLAG_KEEP_VARS);
+		ast_set2_flag(chan->cdr, ast_test_flag(&flags, OPT_KEEPVARS), AST_CDR_FLAG_KEEP_VARS);
 	
-	ast_cdr_fork(chan);
+	ast_cdr_fork(chan, flags, opts[OPT_ARG_VARSET]);
 
 	return res;
 }

Modified: team/jpeeler/chan_dahdi/apps/app_milliwatt.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/apps/app_milliwatt.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/apps/app_milliwatt.c (original)
+++ team/jpeeler/chan_dahdi/apps/app_milliwatt.c Thu May 29 14:34:13 2008
@@ -25,19 +25,28 @@
  * \ingroup applications
  */
 
+/*** MODULEINFO
+	<depend>res_indications</depend>
+ ***/
+
 #include "asterisk.h"
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include "asterisk/module.h"
 #include "asterisk/channel.h"
+#include "asterisk/pbx.h"
 
 static char *app = "Milliwatt";
 
-static char *synopsis = "Generate a Constant 1000Hz tone at 0dbm (mu-law)";
+static char *synopsis = "Generate a Constant 1004Hz tone at 0dbm (mu-law)";
 
 static char *descrip = 
-"Milliwatt(): Generate a Constant 1000Hz tone at 0dbm (mu-law)\n";
+"   Milliwatt([options]): Generate a Constant 1004Hz tone at 0dbm.\n"
+"Previous versions of this application generated the tone at 1000Hz.  If for\n"
+"some reason you would prefer that behavior, supply the 'o' option to get the\n"
+"old behavior.\n"
+"";
 
 static char digital_milliwatt[] = {0x1e,0x0b,0x0b,0x1e,0x9e,0x8b,0x8b,0x9e} ;
 
@@ -74,6 +83,7 @@
 		ast_log(LOG_WARNING, "Only doing %d samples (%d requested)\n", maxsamples, samples);
 		samples = maxsamples;
 	}
+
 	len = samples * sizeof (buf[0]);
 	wf.datalen = len;
 	wf.samples = samples;
@@ -92,33 +102,56 @@
 	return 0;
 }
 
-static struct ast_generator milliwattgen = 
-{
+static struct ast_generator milliwattgen = {
 	alloc: milliwatt_alloc,
 	release: milliwatt_release,
 	generate: milliwatt_generate,
 };
 
-static int milliwatt_exec(struct ast_channel *chan, void *data)
+static int old_milliwatt_exec(struct ast_channel *chan)
 {
-
 	ast_set_write_format(chan, AST_FORMAT_ULAW);
 	ast_set_read_format(chan, AST_FORMAT_ULAW);
 
-
-	if (chan->_state != AST_STATE_UP)
+	if (chan->_state != AST_STATE_UP) {
 		ast_answer(chan);
+	}
 
 	if (ast_activate_generator(chan,&milliwattgen,"milliwatt") < 0) {
 		ast_log(LOG_WARNING,"Failed to activate generator on '%s'\n",chan->name);
 		return -1;
 	}
 
-	while(!ast_safe_sleep(chan, 10000));
+	while (!ast_safe_sleep(chan, 10000))
+		;
 
 	ast_deactivate_generator(chan);
 
 	return -1;
+}
+
+static int milliwatt_exec(struct ast_channel *chan, void *data)
+{
+	const char *options = data;
+	struct ast_app *playtones_app;
+	int res = -1;
+
+	if (!ast_strlen_zero(options) && strchr(options, 'o')) {
+		return old_milliwatt_exec(chan);
+	}
+
+	if (!(playtones_app = pbx_findapp("Playtones"))) {
+		ast_log(LOG_ERROR, "The Playtones application is required to run Milliwatt()\n");
+		return -1;
+	}
+
+	res = pbx_exec(chan, playtones_app, "1004/1000");
+
+	while (!res) {
+		res = ast_safe_sleep(chan, 10000);
+	}
+
+	return res;
 }
 
 static int unload_module(void)

Modified: team/jpeeler/chan_dahdi/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/apps/app_queue.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/apps/app_queue.c (original)
+++ team/jpeeler/chan_dahdi/apps/app_queue.c Thu May 29 14:34:13 2008
@@ -3438,11 +3438,15 @@
 		set_queue_variables(qe);
 		ao2_unlock(qe->parent);
 		
+		ast_channel_lock(qe->chan);
+		if ((monitorfilename = pbx_builtin_getvar_helper(qe->chan, "MONITOR_FILENAME"))) {
+				monitorfilename = ast_strdupa(monitorfilename);
+		}
+		ast_channel_unlock(qe->chan);
 		/* Begin Monitoring */
 		if (qe->parent->monfmt && *qe->parent->monfmt) {
 			if (!qe->parent->montype) {
 				ast_debug(1, "Starting Monitor as requested.\n");
-				monitorfilename = pbx_builtin_getvar_helper(qe->chan, "MONITOR_FILENAME");
 				if (pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC") || pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC_ARGS"))
 					which = qe->chan;
 				else
@@ -3457,75 +3461,79 @@
 					ast_monitor_start(which, qe->parent->monfmt, tmpid, 1, X_REC_IN | X_REC_OUT);
 				}
 			} else {
-				ast_debug(1, "Starting MixMonitor as requested.\n");
-				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));
-					else
-						snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
-				} else {
-					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';
-
-					pbx_substitute_variables_helper(qe->chan, tmpid2, tmpid, sizeof(tmpid) - 1);
-				}
-
-				monitor_exec = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC");
-				monitor_options = pbx_builtin_getvar_helper(qe->chan, "MONITOR_OPTIONS");
-
-				if (monitor_exec) {
-					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';
-
-					pbx_substitute_variables_helper(qe->chan, meid2, meid, sizeof(meid) - 1);
-				}
-	
-				snprintf(tmpid2, sizeof(tmpid2), "%s.%s", tmpid, qe->parent->monfmt);
-
 				mixmonapp = pbx_findapp("MixMonitor");
-
-				if (!monitor_options)
-					monitor_options = "";
 				
 				if (mixmonapp) {
+					ast_debug(1, "Starting MixMonitor as requested.\n");
+					if (!monitorfilename) {
+						if (qe->chan->cdr)
+							ast_copy_string(tmpid, qe->chan->cdr->uniqueid, sizeof(tmpid));
+						else
+							snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
+					} else {
+						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';
+
+						pbx_substitute_variables_helper(qe->chan, tmpid2, tmpid, sizeof(tmpid) - 1);
+					}
+
+					ast_channel_lock(qe->chan);
+					if ((monitor_exec = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC"))) {
+							monitor_exec = ast_strdupa(monitor_exec);
+					}
+					if ((monitor_options = pbx_builtin_getvar_helper(qe->chan, "MONITOR_OPTIONS"))) {
+							monitor_options = ast_strdupa(monitor_options);
+					} else {
+						monitor_options = "";
+					}
+					ast_channel_unlock(qe->chan);
+
+					if (monitor_exec) {
+						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';
+
+						pbx_substitute_variables_helper(qe->chan, meid2, meid, sizeof(meid) - 1);
+					}
+	
+					snprintf(tmpid2, sizeof(tmpid2), "%s.%s", tmpid, qe->parent->monfmt);
+
 					if (!ast_strlen_zero(monitor_exec))
 						snprintf(mixmonargs, sizeof(mixmonargs), "%s,b%s,%s", tmpid2, monitor_options, monitor_exec);
 					else
 						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)
@@ -3534,9 +3542,9 @@
 					if (qe->chan->cdr)
 						ast_clear_flag(qe->chan->cdr, AST_CDR_FLAG_LOCKED);
 
-				} else
+				} else {
 					ast_log(LOG_WARNING, "Asked to run MixMonitor on this call, but cannot find the MixMonitor app!\n");
-
+				}
 			}
 		}
 		/* Drop out of the queue at this point, to prepare for next caller */
@@ -4449,6 +4457,7 @@
 		qe.expire = 0;
 
 	/* Get the priority from the variable ${QUEUE_PRIO} */
+	ast_channel_lock(chan);
 	user_priority = pbx_builtin_getvar_helper(chan, "QUEUE_PRIO");
 	if (user_priority) {
 		if (sscanf(user_priority, "%d", &prio) == 1) {
@@ -4488,6 +4497,7 @@
 	} else {
 		min_penalty = 0;
 	}
+	ast_channel_unlock(chan);
 
 	if (args.options && (strchr(args.options, 'r')))
 		ringing = 1;

Modified: team/jpeeler/chan_dahdi/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/apps/app_voicemail.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/apps/app_voicemail.c (original)
+++ team/jpeeler/chan_dahdi/apps/app_voicemail.c Thu May 29 14:34:13 2008
@@ -522,6 +522,7 @@
 	"             the greeting.  Context defaults to the current context.\n"
 	"    g(#) - Use the specified amount of gain when recording the voicemail\n"
 	"           message. The units are whole-number decibels (dB).\n"
+	"           Only works on supported technologies, which is DAHDI only.\n"
 	"    s    - Skip the playback of instructions for leaving a message to the\n"
 	"           calling party.\n"
 	"    u    - Play the 'unavailable' greeting.\n"

Modified: team/jpeeler/chan_dahdi/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/channels/chan_agent.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/channels/chan_agent.c (original)
+++ team/jpeeler/chan_dahdi/channels/chan_agent.c Thu May 29 14:34:13 2008
@@ -1520,9 +1520,7 @@
 					ast_mutex_lock(&p->lock);
 
 					while (p->owner && ast_channel_trylock(p->owner)) {
-						ast_mutex_unlock(&p->lock);
-						usleep(1);
-						ast_mutex_lock(&p->lock);
+						DEADLOCK_AVOIDANCE(&p->lock);
 					}
 					if (p->owner) {
 						ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT);
@@ -1530,9 +1528,7 @@
 					}
 
 					while (p->chan && ast_channel_trylock(p->chan)) {
-						ast_mutex_unlock(&p->lock);
-						usleep(1);
-						ast_mutex_lock(&p->lock);
+						DEADLOCK_AVOIDANCE(&p->lock);
 					}
 					if (p->chan) {
 						ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);

Modified: team/jpeeler/chan_dahdi/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/channels/chan_alsa.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/channels/chan_alsa.c (original)
+++ team/jpeeler/chan_dahdi/channels/chan_alsa.c Thu May 29 14:34:13 2008
@@ -297,9 +297,7 @@
 static void grab_owner(void)
 {
 	while (alsa.owner && ast_channel_trylock(alsa.owner)) {
-		ast_mutex_unlock(&alsalock);
-		usleep(1);
-		ast_mutex_lock(&alsalock);
+		DEADLOCK_AVOIDANCE(&alsalock);
 	}
 }
 

Modified: team/jpeeler/chan_dahdi/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/channels/chan_iax2.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/channels/chan_iax2.c (original)
+++ team/jpeeler/chan_dahdi/channels/chan_iax2.c Thu May 29 14:34:13 2008
@@ -1474,13 +1474,13 @@
 #define NEW_ALLOW 	1
 #define NEW_FORCE 	2
 
-static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur, int full_frame)
+static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur, int check_dcallno)
 {
 	if ((cur->addr.sin_addr.s_addr == sin->sin_addr.s_addr) &&
 		(cur->addr.sin_port == sin->sin_port)) {
 		/* This is the main host */
 		if ( (cur->peercallno == 0 || cur->peercallno == callno) &&
-			 (full_frame ? dcallno == cur->callno : 1) ) {
+			 (check_dcallno ? dcallno == cur->callno : 1) ) {
 			/* That's us.  Be sure we keep track of the peer call number */
 			return 1;
 		}
@@ -1592,7 +1592,7 @@
 /*
  * \note Calling this function while holding another pvt lock can cause a deadlock.
  */
-static int __find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int sockfd, int return_locked, int full_frame)
+static int __find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int sockfd, int return_locked, int check_dcallno)
 {
 	int res = 0;
 	int x;
@@ -1606,7 +1606,7 @@
 				.callno = dcallno,
 				.peercallno = callno,
 				/* hack!! */
-				.frames_received = full_frame,
+				.frames_received = check_dcallno,
 			};
 
 			memcpy(&tmp_pvt.addr, sin, sizeof(tmp_pvt.addr));
@@ -1626,7 +1626,7 @@
 			ast_mutex_lock(&iaxsl[x]);
 			if (iaxs[x]) {
 				/* Look for an exact match */
-				if (match(sin, callno, dcallno, iaxs[x], full_frame)) {
+				if (match(sin, callno, dcallno, iaxs[x], check_dcallno)) {
 					res = x;
 				}
 			}
@@ -1637,7 +1637,7 @@
 			ast_mutex_lock(&iaxsl[x]);
 			if (iaxs[x]) {
 				/* Look for an exact match */
-				if (match(sin, callno, dcallno, iaxs[x], full_frame)) {
+				if (match(sin, callno, dcallno, iaxs[x], check_dcallno)) {
 					res = x;
 				}
 			}
@@ -1746,9 +1746,7 @@
 		if (iaxs[callno] && iaxs[callno]->owner) {
 			if (ast_channel_trylock(iaxs[callno]->owner)) {
 				/* Avoid deadlock by pausing and trying again */
-				ast_mutex_unlock(&iaxsl[callno]);
-				usleep(1);
-				ast_mutex_lock(&iaxsl[callno]);
+				DEADLOCK_AVOIDANCE(&iaxsl[callno]);
 			} else {
 				ast_queue_frame(iaxs[callno]->owner, f);
 				ast_channel_unlock(iaxs[callno]->owner);
@@ -1779,9 +1777,7 @@
 		if (iaxs[callno] && iaxs[callno]->owner) {
 			if (ast_channel_trylock(iaxs[callno]->owner)) {
 				/* Avoid deadlock by pausing and trying again */
-				ast_mutex_unlock(&iaxsl[callno]);
-				usleep(1);
-				ast_mutex_lock(&iaxsl[callno]);
+				DEADLOCK_AVOIDANCE(&iaxsl[callno]);
 			} else {
 				ast_queue_hangup(iaxs[callno]->owner);
 				ast_channel_unlock(iaxs[callno]->owner);
@@ -1813,9 +1809,7 @@
 		if (iaxs[callno] && iaxs[callno]->owner) {
 			if (ast_channel_trylock(iaxs[callno]->owner)) {
 				/* Avoid deadlock by pausing and trying again */
-				ast_mutex_unlock(&iaxsl[callno]);
-				usleep(1);
-				ast_mutex_lock(&iaxsl[callno]);
+				DEADLOCK_AVOIDANCE(&iaxsl[callno]);
 			} else {
 				ast_queue_control_data(iaxs[callno]->owner, control, data, datalen);
 				ast_channel_unlock(iaxs[callno]->owner);
@@ -3773,9 +3767,7 @@
 {
 	ast_mutex_lock(&iaxsl[callno0]);
 	while (ast_mutex_trylock(&iaxsl[callno1])) {
-		ast_mutex_unlock(&iaxsl[callno0]);
-		usleep(10);
-		ast_mutex_lock(&iaxsl[callno0]);
+		DEADLOCK_AVOIDANCE(&iaxsl[callno0]);
 	}
 }
 
@@ -3969,9 +3961,7 @@
 		/* We don't know the remote side's call number, yet.  :( */
 		int count = 10;
 		while (count-- && pvt && !pvt->peercallno) {
-			ast_mutex_unlock(&iaxsl[callno]);
-			usleep(1);
-			ast_mutex_lock(&iaxsl[callno]);
+			DEADLOCK_AVOIDANCE(&iaxsl[callno]);
 			pvt = iaxs[callno];
 		}
 		if (!pvt->peercallno) {
@@ -8008,8 +7998,10 @@
 		f.subclass = 0;
 	}
 
-	if (!fr->callno)
-		fr->callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, fd, ntohs(mh->callno) & IAX_FLAG_FULL);
+	if (!fr->callno) {
+		fr->callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, fd, 
+			(ntohs(mh->callno) & IAX_FLAG_FULL) && f.frametype == AST_FRAME_IAX && f.subclass == IAX_COMMAND_ACK);
+	}
 
 	if (fr->callno > 0)
 		ast_mutex_lock(&iaxsl[fr->callno]);
@@ -8156,12 +8148,11 @@
 		     (f.frametype != AST_FRAME_IAX))) {
 			unsigned char x;
 			int call_to_destroy;
-			/* XXX This code is not very efficient.  Surely there is a better way which still
-			       properly handles boundary conditions? XXX */
 			/* First we have to qualify that the ACKed value is within our window */
-			for (x=iaxs[fr->callno]->rseqno; x != iaxs[fr->callno]->oseqno; x++)
-				if (fr->iseqno == x)
-					break;
+			if (iaxs[fr->callno]->rseqno >= iaxs[fr->callno]->oseqno || (fr->iseqno >= iaxs[fr->callno]->rseqno && fr->iseqno < iaxs[fr->callno]->oseqno))
+				x = fr->iseqno;
+			else 
+				x = iaxs[fr->callno]->oseqno;
 			if ((x != iaxs[fr->callno]->oseqno) || (iaxs[fr->callno]->oseqno == fr->iseqno)) {
 				/* The acknowledgement is within our window.  Time to acknowledge everything
 				   that it says to */
@@ -8285,9 +8276,7 @@
 						int orignative;
 retryowner:
 						if (ast_channel_trylock(iaxs[fr->callno]->owner)) {
-							ast_mutex_unlock(&iaxsl[fr->callno]);
-							usleep(1);
-							ast_mutex_lock(&iaxsl[fr->callno]);
+							DEADLOCK_AVOIDANCE(&iaxsl[fr->callno]);
 							if (iaxs[fr->callno] && iaxs[fr->callno]->owner) goto retryowner;
 						}
 						if (iaxs[fr->callno]) {
@@ -8729,9 +8718,7 @@
 						ast_verb(3, "Format for call is %s\n", ast_getformatname(iaxs[fr->callno]->owner->nativeformats));
 retryowner2:
 						if (ast_channel_trylock(iaxs[fr->callno]->owner)) {
-							ast_mutex_unlock(&iaxsl[fr->callno]);
-							usleep(1);
-							ast_mutex_lock(&iaxsl[fr->callno]);
+							DEADLOCK_AVOIDANCE(&iaxsl[fr->callno]);
 							if (iaxs[fr->callno] && iaxs[fr->callno]->owner) goto retryowner2;
 						}
 						
@@ -9909,7 +9896,11 @@
  		peer_unref(peer);
 
 	/* And send the poke */
-	send_command(iaxs[peer->callno], AST_FRAME_IAX, IAX_COMMAND_POKE, 0, NULL, 0, -1);
+	ast_mutex_lock(&iaxsl[peer->callno]);
+	if (iaxs[peer->callno]) {
+		send_command(iaxs[peer->callno], AST_FRAME_IAX, IAX_COMMAND_POKE, 0, NULL, 0, -1);
+	}
+	ast_mutex_unlock(&iaxsl[peer->callno]);
 
 	return 0;
 }

Modified: team/jpeeler/chan_dahdi/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/channels/chan_jingle.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/channels/chan_jingle.c (original)
+++ team/jpeeler/chan_dahdi/channels/chan_jingle.c Thu May 29 14:34:13 2008
@@ -111,7 +111,9 @@
 	char cid_name[80];               /*!< Caller ID name */
 	char exten[80];                  /*!< Called extension */
 	struct ast_channel *owner;       /*!< Master Channel */
+	char audio_content_name[100];    /*!< name attribute of content tag */
 	struct ast_rtp *rtp;             /*!< RTP audio session */
+	char video_content_name[100];    /*!< name attribute of content tag */
 	struct ast_rtp *vrtp;            /*!< RTP video session */
 	int jointcapability;             /*!< Supported capability at both ends (codecs ) */
 	int peercapability;
@@ -956,7 +958,7 @@
 	struct jingle_pvt *p, *tmp = client->p;
 	struct ast_channel *chan;
 	int res;
-	iks *payload_type;
+	iks *codec, *content, *description;
 
 	/* Make sure our new call doesn't exist yet */
 	while (tmp) {
@@ -974,45 +976,74 @@
 		return -1;
 	}
 	chan = jingle_new(client, p, AST_STATE_DOWN, pak->from->user);
-	if (chan) {
-		ast_mutex_lock(&p->lock);
-		ast_copy_string(p->them, pak->from->full, sizeof(p->them));
-		if (iks_find_attrib(pak->query, JINGLE_SID)) {
-			ast_copy_string(p->sid, iks_find_attrib(pak->query, JINGLE_SID),
-							sizeof(p->sid));
-		}
-
-		payload_type = iks_child(iks_child(iks_child(iks_child(pak->x))));
-		while (payload_type) {
-			ast_rtp_set_m_type(p->rtp, atoi(iks_find_attrib(payload_type, "id")));
-			ast_rtp_set_rtpmap_type(p->rtp, atoi(iks_find_attrib(payload_type, "id")), "audio", iks_find_attrib(payload_type, "name"), 0);
-			payload_type = iks_next(payload_type);
-		}
-
-		ast_mutex_unlock(&p->lock);
-		ast_setstate(chan, AST_STATE_RING);
-		res = ast_pbx_start(chan);
-
-		switch (res) {
-		case AST_PBX_FAILED:
-			ast_log(LOG_WARNING, "Failed to start PBX :(\n");
-			jingle_response(client, pak, "service-unavailable", NULL);
-			break;
-		case AST_PBX_CALL_LIMIT:
-			ast_log(LOG_WARNING, "Failed to start PBX (call limit reached) \n");
-			jingle_response(client, pak, "service-unavailable", NULL);
-			break;
-		case AST_PBX_SUCCESS:
-			jingle_response(client, pak, NULL, NULL);
-			jingle_create_candidates(client, p,
-						 iks_find_attrib(pak->query, JINGLE_SID),
-						 iks_find_attrib(pak->x, "from"));
-			/* nothing to do */
-			break;
-		}
-	} else {
+	if (!chan) {
 		jingle_free_pvt(client, p);
-	}
+		return -1;
+	}
+	ast_mutex_lock(&p->lock);
+	ast_copy_string(p->them, pak->from->full, sizeof(p->them));
+	if (iks_find_attrib(pak->query, JINGLE_SID)) {
+		ast_copy_string(p->sid, iks_find_attrib(pak->query, JINGLE_SID),
+				sizeof(p->sid));
+	}
+	
+	/* content points to the first <content/> tag */	
+	content = iks_child(iks_child(pak->x));
+	while (content) {
+		description = iks_find_with_attrib(content, "description", "xmlns", JINGLE_AUDIO_RTP_NS);
+		if (description) {
+			/* audio content found */
+			codec = iks_child(iks_child(content));
+		        ast_copy_string(p->audio_content_name, iks_find_attrib(content, "name"), sizeof(p->audio_content_name));
+
+			while (codec) {
+				ast_rtp_set_m_type(p->rtp, atoi(iks_find_attrib(codec, "id")));
+				ast_rtp_set_rtpmap_type(p->rtp, atoi(iks_find_attrib(codec, "id")), "audio", iks_find_attrib(codec, "name"), 0);
+				codec = iks_next(codec);
+			}
+		}
+		
+		description = NULL;
+		codec = NULL;
+
+		description = iks_find_with_attrib(content, "description", "xmlns", JINGLE_VIDEO_RTP_NS);
+		if (description) {
+			/* video content found */
+			codec = iks_child(iks_child(content));
+		        ast_copy_string(p->video_content_name, iks_find_attrib(content, "name"), sizeof(p->video_content_name));
+
+			while (codec) {
+				ast_rtp_set_m_type(p->rtp, atoi(iks_find_attrib(codec, "id")));
+				ast_rtp_set_rtpmap_type(p->rtp, atoi(iks_find_attrib(codec, "id")), "audio", iks_find_attrib(codec, "name"), 0);
+				codec = iks_next(codec);
+			}
+		}
+		
+		content = iks_next(content);
+	}
+
+	ast_mutex_unlock(&p->lock);
+	ast_setstate(chan, AST_STATE_RING);
+	res = ast_pbx_start(chan);
+	
+	switch (res) {
+	case AST_PBX_FAILED:
+		ast_log(LOG_WARNING, "Failed to start PBX :(\n");
+		jingle_response(client, pak, "service-unavailable", NULL);
+		break;
+	case AST_PBX_CALL_LIMIT:
+		ast_log(LOG_WARNING, "Failed to start PBX (call limit reached) \n");
+		jingle_response(client, pak, "service-unavailable", NULL);
+		break;
+	case AST_PBX_SUCCESS:
+		jingle_response(client, pak, NULL, NULL);
+		jingle_create_candidates(client, p,
+					 iks_find_attrib(pak->query, JINGLE_SID),
+					 iks_find_attrib(pak->x, "from"));
+		/* nothing to do */
+		break;
+	}
+
 	return 1;
 }
 
@@ -1316,6 +1347,8 @@
 	payload_pcmu = iks_new("payload-type");
 	payload_eg711u = iks_new("payload-type");
 
+	ast_copy_string(p->audio_content_name, "asterisk-audio-content", sizeof(p->audio_content_name));
+
 	iks_insert_attrib(iq, "type", "set");
 	iks_insert_attrib(iq, "to", p->them);
 	iks_insert_attrib(iq, "from", client->jid->full);
@@ -1325,8 +1358,10 @@
 	iks_insert_attrib(jingle, JINGLE_SID, p->sid);
 	iks_insert_attrib(jingle, "initiator", client->jid->full);
 	iks_insert_attrib(jingle, "xmlns", JINGLE_NS);
+
+	/* For now, we only send one audio based content */
 	iks_insert_attrib(content, "creator", "initiator");
-	iks_insert_attrib(content, "name", "asterisk-audio-content");
+	iks_insert_attrib(content, "name", p->audio_content_name);
 	iks_insert_attrib(content, "profile", "RTP/AVP");
 	iks_insert_attrib(description, "xmlns", JINGLE_AUDIO_RTP_NS);
 	iks_insert_attrib(transport, "xmlns", JINGLE_ICE_UDP_NS);
@@ -1334,7 +1369,6 @@
 	iks_insert_attrib(payload_pcmu, "name", "PCMU");
 	iks_insert_attrib(payload_eg711u, "id", "100");
 	iks_insert_attrib(payload_eg711u, "name", "EG711U");
-
 	iks_insert_node(description, payload_pcmu);
 	iks_insert_node(description, payload_eg711u);
 	iks_insert_node(content, description);

Modified: team/jpeeler/chan_dahdi/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/channels/chan_mgcp.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/channels/chan_mgcp.c (original)
+++ team/jpeeler/chan_dahdi/channels/chan_mgcp.c Thu May 29 14:34:13 2008
@@ -596,9 +596,7 @@
 				ast_channel_unlock(sub->owner);
 				break;
 			} else {
-				ast_mutex_unlock(&sub->lock);
-				usleep(1);
-				ast_mutex_lock(&sub->lock);
+				DEADLOCK_AVOIDANCE(&sub->lock);
 			}
 		} else
 			break;
@@ -614,9 +612,7 @@
 				ast_channel_unlock(sub->owner);
 				break;
 			} else {
-				ast_mutex_unlock(&sub->lock);
-				usleep(1);
-				ast_mutex_lock(&sub->lock);
+				DEADLOCK_AVOIDANCE(&sub->lock);
 			}
 		} else
 			break;

Modified: team/jpeeler/chan_dahdi/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/channels/chan_phone.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/channels/chan_phone.c (original)
+++ team/jpeeler/chan_dahdi/channels/chan_phone.c Thu May 29 14:34:13 2008
@@ -59,7 +59,7 @@
 #include "asterisk/stringfields.h"
 #include "asterisk/musiconhold.h"
 
-#include "DialTone.h"
+#include "chan_phone.h"
 
 #ifdef QTI_PHONEJACK_TJ_PCI	/* check for the newer quicknet driver v.3.1.0 which has this symbol */
 #define QNDRV_VER 310

Modified: team/jpeeler/chan_dahdi/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/channels/chan_sip.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/channels/chan_sip.c (original)
+++ team/jpeeler/chan_dahdi/channels/chan_sip.c Thu May 29 14:34:13 2008
@@ -1010,11 +1010,12 @@
 #define SIP_PAGE2_RFC2833_COMPENSATE    (1 << 25)	/*!< DP: Compensate for buggy RFC2833 implementations */
 #define SIP_PAGE2_BUGGY_MWI		(1 << 26)	/*!< DP: Buggy CISCO MWI fix */
 #define SIP_PAGE2_REGISTERTRYING        (1 << 29)       /*!< DP: Send 100 Trying on REGISTER attempts */
+#define SIP_PAGE2_UDPTL_DESTINATION     (1 << 30)       /*!< DP: Use source IP of RTP as destination if NAT is enabled */
 
 #define SIP_PAGE2_FLAGS_TO_COPY \
 	(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_VIDEOSUPPORT | \
 	SIP_PAGE2_T38SUPPORT | SIP_PAGE2_RFC2833_COMPENSATE | SIP_PAGE2_BUGGY_MWI | \
-	SIP_PAGE2_TEXTSUPPORT )
+	SIP_PAGE2_TEXTSUPPORT | SIP_PAGE2_UDPTL_DESTINATION)
 
 /*@}*/ 
 
@@ -6078,6 +6079,7 @@
 			ast_udptl_setqos(p->udptl, global_tos_audio, global_cos_audio);
 		p->maxcallbitrate = default_maxcallbitrate;
 		p->autoframing = global_autoframing;
+		ast_rtp_codec_setpref(p->rtp, &p->prefs);
 	}
 
 	if (useglobal_nat && sin) {
@@ -6888,6 +6890,16 @@
 	if (p->udptl) {
 		if (udptlportno > 0) {
 			sin.sin_port = htons(udptlportno);
+			if (ast_test_flag(&p->flags[0], SIP_NAT) && ast_test_flag(&p->flags[1], SIP_PAGE2_UDPTL_DESTINATION)) {
+				struct sockaddr_in peer;
+				ast_rtp_get_peer(p->rtp, &peer);
+				if (peer.sin_addr.s_addr) {
+					memcpy(&sin.sin_addr, &peer.sin_addr, sizeof(&sin.sin_addr));
+					if (debug) {
+						ast_log(LOG_DEBUG, "Peer T.38 UDPTL is set behind NAT and with destination, destination address now %s\n", ast_inet_ntoa(sin.sin_addr));
+					}
+				}
+			}
 			ast_udptl_set_peer(p->udptl, &sin);
 			if (debug)
 				ast_debug(1, "Peer T.38 UDPTL is at port %s:%d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
@@ -6989,23 +7001,20 @@
 					ast_debug(1, "Can't read framing from SDP: %s\n", a);
 				}
 			}
-			if (framing && last_rtpmap_codec) {
-				if (p->autoframing) {
-					struct ast_codec_pref *pref = ast_rtp_codec_getpref(p->rtp);
-					int codec_n;
-					int format = 0;
-					for (codec_n = 0; codec_n < last_rtpmap_codec; codec_n++) {
-						format = ast_rtp_codec_getformat(found_rtpmap_codecs[codec_n]);
-						if (!format)	/* non-codec or not found */
-							continue;
-						ast_debug(1, "Setting framing for %d to %ld\n", format, framing);
-						ast_codec_pref_setsize(pref, format, framing);
-					}
-					ast_rtp_codec_setpref(p->rtp, pref);
+			if (framing && p->autoframing) {
+				struct ast_codec_pref *pref = ast_rtp_codec_getpref(p->rtp);
+				int codec_n;
+				int format = 0;
+				for (codec_n = 0; codec_n < MAX_RTP_PT; codec_n++) {
+					format = ast_rtp_codec_getformat(codec_n);
+					if (!format)	/* non-codec or not found */
+						continue;
+					if (option_debug)
+						ast_log(LOG_DEBUG, "Setting framing for %d to %ld\n", format, framing);
+					ast_codec_pref_setsize(pref, format, framing);
 				}
+				ast_rtp_codec_setpref(p->rtp, pref);
 			}
-			memset(&found_rtpmap_codecs, 0, sizeof(found_rtpmap_codecs));
-			last_rtpmap_codec = 0;
 			continue;
 			
 		} else if (!strncmp(a, red_fmtp, strlen(red_fmtp))) {
@@ -20457,6 +20466,9 @@
 	} else if (!strcasecmp(v->name, "buggymwi")) {
 		ast_set_flag(&mask[1], SIP_PAGE2_BUGGY_MWI);
 		ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_BUGGY_MWI);
+	} else if (!strcasecmp(v->name, "t38pt_usertpsource")) {
+		ast_set_flag(&mask[1], SIP_PAGE2_UDPTL_DESTINATION);
+		ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_UDPTL_DESTINATION);
 	} else
 		res = 0;
 

Modified: team/jpeeler/chan_dahdi/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi/channels/chan_skinny.c?view=diff&rev=119069&r1=119068&r2=119069
==============================================================================
--- team/jpeeler/chan_dahdi/channels/chan_skinny.c (original)
+++ team/jpeeler/chan_dahdi/channels/chan_skinny.c Thu May 29 14:34:13 2008
@@ -63,7 +63,6 @@
 #include "asterisk/utils.h"
 #include "asterisk/dsp.h"
 #include "asterisk/stringfields.h"
-#include "asterisk/astobj.h"
 #include "asterisk/abstract_jb.h"
 #include "asterisk/threadstorage.h"
 #include "asterisk/devicestate.h"
@@ -88,9 +87,9 @@
 	SKINNY_CODEC_H263 = 101
 };
 
-#define DEFAULT_SKINNY_PORT	2000
-#define DEFAULT_SKINNY_BACKLOG	2
-#define SKINNY_MAX_PACKET	1000
+#define DEFAULT_SKINNY_PORT 2000
+#define DEFAULT_SKINNY_BACKLOG 2
+#define SKINNY_MAX_PACKET 1000
 
 static unsigned int tos = 0;
 static unsigned int tos_audio = 0;
@@ -100,9 +99,9 @@
 static unsigned int cos_video = 0;
 
 static int keep_alive = 120;
-static char vmexten[AST_MAX_EXTENSION];		/* Voicemail pilot number */
-static char used_context[AST_MAX_EXTENSION];		/* Voicemail pilot number */
-static char regcontext[AST_MAX_CONTEXT];	/* Context for auto-extension */
+static char vmexten[AST_MAX_EXTENSION];      /* Voicemail pilot number */

[... 1113 lines stripped ...]



More information about the asterisk-commits mailing list