[asterisk-commits] irroot: branch irroot/app_queue_skill r333500 - in /team/irroot/app_queue_ski...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Aug 28 03:49:21 CDT 2011


Author: irroot
Date: Sun Aug 28 03:49:18 2011
New Revision: 333500

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=333500
Log:
resolve conflict, enable automerge

Modified:
    team/irroot/app_queue_skill/   (props changed)
    team/irroot/app_queue_skill/build_tools/cflags-devmode.xml
    team/irroot/app_queue_skill/build_tools/cflags.xml
    team/irroot/app_queue_skill/build_tools/mkpkgconfig
    team/irroot/app_queue_skill/channels/chan_dahdi.c
    team/irroot/app_queue_skill/channels/sig_pri.h

Propchange: team/irroot/app_queue_skill/
            ('svnmerge-integrated' removed)

Modified: team/irroot/app_queue_skill/build_tools/cflags-devmode.xml
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/build_tools/cflags-devmode.xml?view=diff&rev=333500&r1=333499&r2=333500
==============================================================================
--- team/irroot/app_queue_skill/build_tools/cflags-devmode.xml (original)
+++ team/irroot/app_queue_skill/build_tools/cflags-devmode.xml Sun Aug 28 03:49:18 2011
@@ -22,9 +22,4 @@
 		</member>
 		<member name="TEST_FRAMEWORK" displayname="Enable Test Framework API">
 		</member>
-		<member name="BETTER_BACKTRACES" displayname="Use libbfd to generate better inline backtraces">
-			<depend>BFD</depend>
-			<depend>DLADDR</depend>
-			<defaultenabled>no</defaultenabled>
-		</member>
 	</category>

Modified: team/irroot/app_queue_skill/build_tools/cflags.xml
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/build_tools/cflags.xml?view=diff&rev=333500&r1=333499&r2=333500
==============================================================================
--- team/irroot/app_queue_skill/build_tools/cflags.xml (original)
+++ team/irroot/app_queue_skill/build_tools/cflags.xml Sun Aug 28 03:49:18 2011
@@ -16,6 +16,11 @@
 			<defaultenabled>no</defaultenabled>
 		</member>
 		<member name="LOW_MEMORY" displayname="Optimize for Low Memory Usage">
+		</member>
+		<member name="BETTER_BACKTRACES" displayname="Use libbfd (GPL) to generate better inline backtraces">
+			<depend>BFD</depend>
+			<depend>DLADDR</depend>
+			<defaultenabled>no</defaultenabled>
 		</member>
 		<member name="USE_HOARD_ALLOCATOR" displayname="Use the Hoard Memory Allocator instead of the default system one">
 			<defaultenabled>no</defaultenabled>

Modified: team/irroot/app_queue_skill/build_tools/mkpkgconfig
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/build_tools/mkpkgconfig?view=diff&rev=333500&r1=333499&r2=333500
==============================================================================
--- team/irroot/app_queue_skill/build_tools/mkpkgconfig (original)
+++ team/irroot/app_queue_skill/build_tools/mkpkgconfig Sun Aug 28 03:49:18 2011
@@ -1,5 +1,5 @@
 #!/bin/sh
-PPATH=$1
+PPATH="$1"
 ## Make sure we were called from Makefile
 
 if [ "x$ASTERISKVERSIONNUM" = "x" ]; then
@@ -9,7 +9,7 @@
 
 ## Create a pkgconfig spec file for 3rd party modules (pkg-config asterisk --cflags)
 
-if [ ! -d $PPATH ]; then
+if [ ! -d "$PPATH" ]; then
   exit
 fi
 
@@ -29,7 +29,7 @@
   ${EXTREGEX} 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g'`
 
 
-cat <<EOF > $PPATH/asterisk.pc
+cat <<EOF > "$PPATH/asterisk.pc"
 install_prefix=$INSTALL_PREFIX
 version_number=$ASTERISKVERSIONNUM
 etcdir=$ASTETCDIR

Modified: team/irroot/app_queue_skill/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/channels/chan_dahdi.c?view=diff&rev=333500&r1=333499&r2=333500
==============================================================================
--- team/irroot/app_queue_skill/channels/chan_dahdi.c (original)
+++ team/irroot/app_queue_skill/channels/chan_dahdi.c Sun Aug 28 03:49:18 2011
@@ -175,11 +175,12 @@
 		<syntax>
 			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
 			<parameter name="DAHDIChannel" required="true">
-				<para>DAHDI channel name to transfer.</para>
+				<para>DAHDI channel number to transfer.</para>
 			</parameter>
 		</syntax>
 		<description>
-			<para>Transfer a DAHDI channel.</para>
+			<para>Simulate a flash hook event by the user connected to the channel.</para>
+			<note><para>Valid only for analog channels.</para></note>
 		</description>
 	</manager>
 	<manager name="DAHDIHangup" language="en_US">
@@ -189,11 +190,12 @@
 		<syntax>
 			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
 			<parameter name="DAHDIChannel" required="true">
-				<para>DAHDI channel name to hangup.</para>
+				<para>DAHDI channel number to hangup.</para>
 			</parameter>
 		</syntax>
 		<description>
-			<para>Hangup a DAHDI channel.</para>
+			<para>Simulate an on-hook event by the user connected to the channel.</para>
+			<note><para>Valid only for analog channels.</para></note>
 		</description>
 	</manager>
 	<manager name="DAHDIDialOffhook" language="en_US">
@@ -202,10 +204,15 @@
 		</synopsis>
 		<syntax>
 			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
-			<parameter name="DAHDIChannel" required="true" />
-			<parameter name="Number" required="true" />
+			<parameter name="DAHDIChannel" required="true">
+				<para>DAHDI channel number to dial digits.</para>
+			</parameter>
+			<parameter name="Number" required="true">
+				<para>Digits to dial.</para>
+			</parameter>
 		</syntax>
 		<description>
+			<para>Generate DTMF control frames to the bridged peer.</para>
 		</description>
 	</manager>
 	<manager name="DAHDIDNDon" language="en_US">
@@ -214,9 +221,13 @@
 		</synopsis>
 		<syntax>
 			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
-			<parameter name="DAHDIChannel" required="true" />
+			<parameter name="DAHDIChannel" required="true">
+				<para>DAHDI channel number to set DND on.</para>
+			</parameter>
 		</syntax>
 		<description>
+			<para>Equivalent to the CLI command "dahdi set dnd <variable>channel</variable> on".</para>
+			<note><para>Feature only supported by analog channels.</para></note>
 		</description>
 	</manager>
 	<manager name="DAHDIDNDoff" language="en_US">
@@ -225,22 +236,27 @@
 		</synopsis>
 		<syntax>
 			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
-			<parameter name="DAHDIChannel" required="true" />
+			<parameter name="DAHDIChannel" required="true">
+				<para>DAHDI channel number to set DND off.</para>
+			</parameter>
 		</syntax>
 		<description>
+			<para>Equivalent to the CLI command "dahdi set dnd <variable>channel</variable> off".</para>
+			<note><para>Feature only supported by analog channels.</para></note>
 		</description>
 	</manager>
 	<manager name="DAHDIShowChannels" language="en_US">
 		<synopsis>
-			Show status DAHDI channels.
+			Show status of DAHDI channels.
 		</synopsis>
 		<syntax>
 			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
 			<parameter name="DAHDIChannel">
-				<para>Specify the specific channel to show.  Show all channels if zero or not present.</para>
+				<para>Specify the specific channel number to show.  Show all channels if zero or not present.</para>
 			</parameter>
 		</syntax>
 		<description>
+			<para>Similar to the CLI command "dahdi show channels".</para>
 		</description>
 	</manager>
 	<manager name="DAHDIRestart" language="en_US">
@@ -251,6 +267,7 @@
 			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
 		</syntax>
 		<description>
+			<para>Equivalent to the CLI command "dahdi restart".</para>
 		</description>
 	</manager>
 	<manager name="PRIShowSpans" language="en_US">
@@ -264,6 +281,7 @@
 			</parameter>
 		</syntax>
 		<description>
+			<para>Similar to the CLI command "pri show spans".</para>
 		</description>
 	</manager>
  ***/
@@ -8992,6 +9010,22 @@
 		return &p->subs[idx].f;
 	}
 
+	/*
+	 * If we have a fake_event, fake an exception to handle it only
+	 * if this channel owns the private.
+	 */
+	if (p->fake_event && p->owner == ast) {
+		if (analog_lib_handles(p->sig, p->radio, p->oprmode)) {
+			struct analog_pvt *analog_p = p->sig_pvt;
+
+			f = analog_exception(analog_p, ast);
+		} else {
+			f = __dahdi_exception(ast);
+		}
+		ast_mutex_unlock(&p->lock);
+		return f;
+	}
+
 	if (ast->rawreadformat.id == AST_FORMAT_SLINEAR) {
 		if (!p->subs[idx].linear) {
 			p->subs[idx].linear = 1;
@@ -9222,10 +9256,6 @@
 			break;
 		}
 	}
-
-	/* If we have a fake_event, trigger exception to handle it */
-	if (p->fake_event)
-		ast_set_flag(ast, AST_FLAG_EXCEPTION);
 
 	ast_mutex_unlock(&p->lock);
 	return f;
@@ -12525,6 +12555,9 @@
 #endif	/* defined(HAVE_PRI_CALL_WAITING) */
 						pris[span].pri.transfer = conf->chan.transfer;
 						pris[span].pri.facilityenable = conf->pri.pri.facilityenable;
+#if defined(HAVE_PRI_L2_PERSISTENCE)
+						pris[span].pri.l2_persistence = conf->pri.pri.l2_persistence;
+#endif	/* defined(HAVE_PRI_L2_PERSISTENCE) */
 #if defined(HAVE_PRI_AOC_EVENTS)
 						pris[span].pri.aoc_passthrough_flag = conf->pri.pri.aoc_passthrough_flag;
 						pris[span].pri.aoce_delayhangup = conf->pri.pri.aoce_delayhangup;
@@ -15444,7 +15477,7 @@
 		ast_cli(a->fd, "No DAHDI found. Unable to open /dev/dahdi/ctl: %s\n", strerror(errno));
 		return CLI_FAILURE;
 	}
-	ast_cli(a->fd, FORMAT2, "Description", "Alarms", "IRQ", "bpviol", "CRC4", "Framing", "Coding", "Options", "LBO");
+	ast_cli(a->fd, FORMAT2, "Description", "Alarms", "IRQ", "bpviol", "CRC", "Framing", "Coding", "Options", "LBO");
 
 	for (span = 1; span < DAHDI_MAX_SPANS; ++span) {
 		s.spanno = span;
@@ -15777,16 +15810,37 @@
 	return p;
 }
 
+/*!
+ * \internal
+ * \brief Get private struct using given numeric channel string.
+ *
+ * \param channel Numeric channel number string get private struct.
+ *
+ * \retval pvt on success.
+ * \retval NULL on error.
+ */
+static struct dahdi_pvt *find_channel_from_str(const char *channel)
+{
+	int chan_num;
+
+	if (sscanf(channel, "%30d", &chan_num) != 1) {
+		/* Not numeric string. */
+		return NULL;
+	}
+
+	return find_channel(chan_num);
+}
+
 static int action_dahdidndon(struct mansession *s, const struct message *m)
 {
-	struct dahdi_pvt *p = NULL;
+	struct dahdi_pvt *p;
 	const char *channel = astman_get_header(m, "DAHDIChannel");
 
 	if (ast_strlen_zero(channel)) {
 		astman_send_error(s, m, "No channel specified");
 		return 0;
 	}
-	p = find_channel(atoi(channel));
+	p = find_channel_from_str(channel);
 	if (!p) {
 		astman_send_error(s, m, "No such channel");
 		return 0;
@@ -15798,14 +15852,14 @@
 
 static int action_dahdidndoff(struct mansession *s, const struct message *m)
 {
-	struct dahdi_pvt *p = NULL;
+	struct dahdi_pvt *p;
 	const char *channel = astman_get_header(m, "DAHDIChannel");
 
 	if (ast_strlen_zero(channel)) {
 		astman_send_error(s, m, "No channel specified");
 		return 0;
 	}
-	p = find_channel(atoi(channel));
+	p = find_channel_from_str(channel);
 	if (!p) {
 		astman_send_error(s, m, "No such channel");
 		return 0;
@@ -15817,18 +15871,22 @@
 
 static int action_transfer(struct mansession *s, const struct message *m)
 {
-	struct dahdi_pvt *p = NULL;
+	struct dahdi_pvt *p;
 	const char *channel = astman_get_header(m, "DAHDIChannel");
 
 	if (ast_strlen_zero(channel)) {
 		astman_send_error(s, m, "No channel specified");
 		return 0;
 	}
-	p = find_channel(atoi(channel));
+	p = find_channel_from_str(channel);
 	if (!p) {
 		astman_send_error(s, m, "No such channel");
 		return 0;
 	}
+	if (!analog_lib_handles(p->sig, 0, 0)) {
+		astman_send_error(s, m, "Channel signaling is not analog");
+		return 0;
+	}
 	dahdi_fake_event(p,TRANSFER);
 	astman_send_ack(s, m, "DAHDITransfer");
 	return 0;
@@ -15836,18 +15894,22 @@
 
 static int action_transferhangup(struct mansession *s, const struct message *m)
 {
-	struct dahdi_pvt *p = NULL;
+	struct dahdi_pvt *p;
 	const char *channel = astman_get_header(m, "DAHDIChannel");
 
 	if (ast_strlen_zero(channel)) {
 		astman_send_error(s, m, "No channel specified");
 		return 0;
 	}
-	p = find_channel(atoi(channel));
+	p = find_channel_from_str(channel);
 	if (!p) {
 		astman_send_error(s, m, "No such channel");
 		return 0;
 	}
+	if (!analog_lib_handles(p->sig, 0, 0)) {
+		astman_send_error(s, m, "Channel signaling is not analog");
+		return 0;
+	}
 	dahdi_fake_event(p,HANGUP);
 	astman_send_ack(s, m, "DAHDIHangup");
 	return 0;
@@ -15855,7 +15917,7 @@
 
 static int action_dahdidialoffhook(struct mansession *s, const struct message *m)
 {
-	struct dahdi_pvt *p = NULL;
+	struct dahdi_pvt *p;
 	const char *channel = astman_get_header(m, "DAHDIChannel");
 	const char *number = astman_get_header(m, "Number");
 	int i;
@@ -15868,7 +15930,7 @@
 		astman_send_error(s, m, "No number specified");
 		return 0;
 	}
-	p = find_channel(atoi(channel));
+	p = find_channel_from_str(channel);
 	if (!p) {
 		astman_send_error(s, m, "No such channel");
 		return 0;
@@ -15892,9 +15954,11 @@
 	const char *dahdichannel = astman_get_header(m, "DAHDIChannel");
 	char idText[256] = "";
 	int channels = 0;
-	int dahdichanquery = -1;
-	if (!ast_strlen_zero(dahdichannel)) {
-		dahdichanquery = atoi(dahdichannel);
+	int dahdichanquery;
+
+	if (!dahdichannel || sscanf(dahdichannel, "%30d", &dahdichanquery) != 1) {
+		/* Not numeric string. */
+		dahdichanquery = -1;
 	}
 
 	astman_send_ack(s, m, "DAHDI channel status will follow");
@@ -16946,7 +17010,7 @@
 	struct dahdi_pvt *tmp;
 	int y;
 	int found_pseudo = 0;
-	char dahdichan[MAX_CHANLIST_LEN] = {};
+	struct ast_variable *dahdichan = NULL;
 
 	for (; v; v = v->next) {
 		if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))
@@ -16979,8 +17043,9 @@
 			if (!parse_buffers_policy(v->value, &confp->chan.faxbuf_no, &confp->chan.faxbuf_policy)) {
 				confp->chan.usefaxbuffers = 1;
 			}
-		} else if (!strcasecmp(v->name, "dahdichan")) {
-			ast_copy_string(dahdichan, v->value, sizeof(dahdichan));
+ 		} else if (!strcasecmp(v->name, "dahdichan")) {
+			/* Only process the last dahdichan value. */
+			dahdichan = v;
 		} else if (!strcasecmp(v->name, "usedistinctiveringdetection")) {
 			usedistinctiveringdetection = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "distinctiveringaftercid")) {
@@ -17720,6 +17785,16 @@
 			} else if (!strcasecmp(v->name, "datetime_send")) {
 				confp->pri.pri.datetime_send = dahdi_datetime_send_option(v->value);
 #endif	/* defined(HAVE_PRI_DATETIME_SEND) */
+#if defined(HAVE_PRI_L2_PERSISTENCE)
+			} else if (!strcasecmp(v->name, "layer2_persistence")) {
+				if (!strcasecmp(v->value, "keep_up")) {
+					confp->pri.pri.l2_persistence = PRI_L2_PERSISTENCE_KEEP_UP;
+				} else if (!strcasecmp(v->value, "leave_down")) {
+					confp->pri.pri.l2_persistence = PRI_L2_PERSISTENCE_LEAVE_DOWN;
+				} else {
+					confp->pri.pri.l2_persistence = PRI_L2_PERSISTENCE_DEFAULT;
+				}
+#endif	/* defined(HAVE_PRI_L2_PERSISTENCE) */
 #endif /* HAVE_PRI */
 #if defined(HAVE_SS7)
 			} else if (!strcasecmp(v->name, "ss7type")) {
@@ -18043,11 +18118,17 @@
 		confp->chan.vars = NULL;
 	}
 
-	if (dahdichan[0]) {
-		/* The user has set 'dahdichan' */
-		/*< \todo pass proper line number instead of 0 */
-		if (build_channels(confp, dahdichan, reload, 0, &found_pseudo)) {
-			return -1;
+	if (dahdichan) {
+		/* Process the deferred dahdichan value. */
+		if (build_channels(confp, dahdichan->value, reload, dahdichan->lineno,
+			&found_pseudo)) {
+			if (confp->ignore_failed_channels) {
+				ast_log(LOG_WARNING,
+					"Dahdichan '%s' failure ignored: ignore_failed_channels.\n",
+					dahdichan->value);
+			} else {
+				return -1;
+			}
 		}
 	}
 
@@ -18063,7 +18144,7 @@
 
 	/*< \todo why check for the pseudo in the per-channel section.
 	 * Any actual use for manual setup of the pseudo channel? */
-	if (!found_pseudo && reload != 1) {
+	if (!found_pseudo && reload != 1 && !(options & PROC_DAHDI_OPT_NOCHAN)) {
 		/* use the default configuration for a channel, so
 		   that any settings from real configured channels
 		   don't "leak" into the pseudo channel config
@@ -18123,6 +18204,7 @@
 	struct ast_config *ucfg;
 	struct ast_variable *v;
 	struct ast_flags config_flags = { reload == 1 ? CONFIG_FLAG_FILEUNCHANGED : 0 };
+	const char *chans;
 	const char *cat;
 	int res;
 
@@ -18236,7 +18318,9 @@
 	mwimonitornotify[0] = '\0';
 
 	v = ast_variable_browse(cfg, "channels");
-	if ((res = process_dahdi(base_conf, "", v, reload, 0))) {
+	if ((res = process_dahdi(base_conf,
+		"" /* Must be empty for the channels category.  Silly voicemail mailbox. */,
+		v, reload, 0))) {
 		ast_mutex_unlock(&iflock);
 		ast_config_destroy(cfg);
 		if (ucfg) {
@@ -18257,6 +18341,12 @@
 			continue;
 		}
 
+		chans = ast_variable_retrieve(ucfg, cat, "dahdichan");
+		if (ast_strlen_zero(chans)) {
+			/* Section is useless without a dahdichan value present. */
+			continue;
+		}
+
 		/* Copy base_conf to conf. */
 		deep_copy_dahdi_chan_conf(conf, base_conf);
 
@@ -18273,11 +18363,11 @@
 	ast_config_destroy(cfg);
 
 	if (ucfg) {
-		const char *chans;
-
-		/* Reset base_conf, so things don't leak from dahdi_chan.conf */
+		/* Reset base_conf, so things don't leak from chan_dahdi.conf */
 		deep_copy_dahdi_chan_conf(base_conf, default_conf);
-		process_dahdi(base_conf, "", ast_variable_browse(ucfg, "general"), 1, 0);
+		process_dahdi(base_conf,
+			"" /* Must be empty for the general category.  Silly voicemail mailbox. */,
+			ast_variable_browse(ucfg, "general"), 1, 0);
 
 		for (cat = ast_category_browse(ucfg, NULL); cat ; cat = ast_category_browse(ucfg, cat)) {
 			if (!strcasecmp(cat, "general")) {
@@ -18285,8 +18375,8 @@
 			}
 
 			chans = ast_variable_retrieve(ucfg, cat, "dahdichan");
-
 			if (ast_strlen_zero(chans)) {
+				/* Section is useless without a dahdichan value present. */
 				continue;
 			}
 

Modified: team/irroot/app_queue_skill/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/channels/sig_pri.h?view=diff&rev=333500&r1=333499&r2=333500
==============================================================================
--- team/irroot/app_queue_skill/channels/sig_pri.h (original)
+++ team/irroot/app_queue_skill/channels/sig_pri.h Sun Aug 28 03:49:18 2011
@@ -405,6 +405,10 @@
 	int qsigchannelmapping;							/*!< QSIG channel mapping type */
 	int discardremoteholdretrieval;					/*!< shall remote hold or remote retrieval notifications be discarded? */
 	int facilityenable;								/*!< Enable facility IEs */
+#if defined(HAVE_PRI_L2_PERSISTENCE)
+	/*! Layer 2 persistence option. */
+	int l2_persistence;
+#endif	/* defined(HAVE_PRI_L2_PERSISTENCE) */
 	int dchan_logical_span[SIG_PRI_NUM_DCHANS];		/*!< Logical offset the DCHAN sits in */
 	int fds[SIG_PRI_NUM_DCHANS];					/*!< FD's for d-channels */
 




More information about the asterisk-commits mailing list