[svn-commits] oej: branch oej/pinepacketrequest r219262 - in /team/oej/pinepacketrequest: ....

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Sep 17 13:42:28 CDT 2009


Author: oej
Date: Thu Sep 17 13:42:24 2009
New Revision: 219262

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=219262
Log:
Reset and resolve and stuff

Modified:
    team/oej/pinepacketrequest/   (props changed)
    team/oej/pinepacketrequest/CHANGES
    team/oej/pinepacketrequest/apps/app_chanspy.c
    team/oej/pinepacketrequest/configs/extensions.conf.sample
    team/oej/pinepacketrequest/configure
    team/oej/pinepacketrequest/configure.ac
    team/oej/pinepacketrequest/include/asterisk/autoconfig.h.in
    team/oej/pinepacketrequest/include/asterisk/cdr.h
    team/oej/pinepacketrequest/main/channel.c
    team/oej/pinepacketrequest/main/config.c
    team/oej/pinepacketrequest/res/res_jabber.c

Propchange: team/oej/pinepacketrequest/
------------------------------------------------------------------------------
    automerge = http://www.codename-pineapple.org/

Propchange: team/oej/pinepacketrequest/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Sep 17 13:42:24 2009
@@ -1,1 +1,1 @@
-/trunk:1-218545
+/trunk:1-219231

Modified: team/oej/pinepacketrequest/CHANGES
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/CHANGES?view=diff&rev=219262&r1=219261&r2=219262
==============================================================================
--- team/oej/pinepacketrequest/CHANGES (original)
+++ team/oej/pinepacketrequest/CHANGES Thu Sep 17 13:42:24 2009
@@ -63,9 +63,11 @@
    exit the application.
  * The Voicemail application has been improved to automatically ignore messages
    that only contain silence.
- * The ChanSpy application now has the 's' option, which makes the application
+ * The ChanSpy application now has the 'S' option, which makes the application
    automatically exit once it hits a point where no more channels are available
    to spy on.
+ * The ChanSpy application also now has the 'E' option, which spies on a single
+   channel and exits when that channel hangs up.
 
 Dialplan Functions
 ------------------

Modified: team/oej/pinepacketrequest/apps/app_chanspy.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/apps/app_chanspy.c?view=diff&rev=219262&r1=219261&r2=219262
==============================================================================
--- team/oej/pinepacketrequest/apps/app_chanspy.c (original)
+++ team/oej/pinepacketrequest/apps/app_chanspy.c Thu Sep 17 13:42:24 2009
@@ -71,6 +71,11 @@
 						<para>Instead of whispering on a single channel barge in on both
 						channels involved in the call.</para>
 					</option>
+					<option name="c">
+						<argument name="digit" required="true">
+							<para>Specify a DTMF digit that can be used to spy on the next available channel.</para>
+						</argument>
+					</option>
 					<option name="d">
 						<para>Override the typical numeric DTMF functionality and instead
 						use DTMF to switch between spy modes.</para>
@@ -86,6 +91,15 @@
 							</enum>
 						</enumlist>
 					</option>
+					<option name="e">
+						<argument name="ext" required="true" />
+						<para>Enable <emphasis>enforced</emphasis> mode, so the spying channel can
+						only monitor extensions whose name is in the <replaceable>ext</replaceable> : delimited 
+						list.</para>
+					</option>
+					<option name="E">
+						<para>Exit when the spied-on channel hangs up.</para>
+					</option>
 					<option name="g">
 						<argument name="grp" required="true">
 							<para>Only spy on channels in which one or more of the groups
@@ -106,6 +120,9 @@
 						<argument name="mailbox" />
 						<argument name="context" />
 					</option>
+					<option name="o">
+						<para>Only listen to audio coming from this channel.</para>
+					</option>
 					<option name="q">
 						<para>Don't play a beep when beginning to spy on a channel, or speak the
 						selected channel name.</para>
@@ -119,6 +136,9 @@
 						<para>Skip the playback of the channel type (i.e. SIP, IAX, etc) when
 						speaking the selected channel name.</para>
 					</option>
+					<option name="S">
+						<para>Stop when no more channels are left to spy on.</para>
+					</option>
 					<option name="v">
 						<argument name="value" />
 						<para>Adjust the initial volume in the range from <literal>-4</literal> 
@@ -132,11 +152,10 @@
 						<para>Enable <literal>private whisper</literal> mode, so the spying channel can
 						talk to the spied-on channel but cannot listen to that channel.</para>
 					</option>
-					<option name="o">
-						<para>Only listen to audio coming from this channel.</para>
-					</option>
-					<option name="s">
-						<para>Stop when no more channels are left to spy on.</para>
+					<option name="x">
+						<argument name="digit" required="true">
+							<para>Specify a DTMF digit that can be used to exit the application.</para>
+						</argument>
 					</option>
 					<option name="X">
 						<para>Allow the user to exit ChanSpy to a valid single digit
@@ -144,22 +163,6 @@
 						specified by the <variable>SPY_EXIT_CONTEXT</variable> channel variable. The
 						name of the last channel that was spied on will be stored
 						in the <variable>SPY_CHANNEL</variable> variable.</para>
-					</option>
-					<option name="x">
-						<argument name="digit" required="true">
-							<para>Specify a DTMF digit that can be used to exit the application.</para>
-						</argument>
-					</option>
-					<option name="c">
-						<argument name="digit" required="true">
-							<para>Specify a DTMF digit that can be used to spy on the next available channel.</para>
-						</argument>
-					</option>
-					<option name="e">
-						<argument name="ext" required="true" />
-						<para>Enable <emphasis>enforced</emphasis> mode, so the spying channel can
-						only monitor extensions whose name is in the <replaceable>ext</replaceable> : delimited 
-						list.</para>
 					</option>
 				</optionlist>		
 			</parameter>
@@ -205,6 +208,11 @@
 						<para>Instead of whispering on a single channel barge in on both
 						channels involved in the call.</para>
 					</option>
+					<option name="c">
+						<argument name="digit" required="true">
+							<para>Specify a DTMF digit that can be used to spy on the next available channel.</para>
+						</argument>
+					</option>
 					<option name="d">
 						<para>Override the typical numeric DTMF functionality and instead
 						use DTMF to switch between spy modes.</para>
@@ -220,6 +228,15 @@
 							</enum>
 						</enumlist>
 					</option>
+					<option name="e">
+						<argument name="ext" required="true" />
+						<para>Enable <emphasis>enforced</emphasis> mode, so the spying channel can
+						only monitor extensions whose name is in the <replaceable>ext</replaceable> : delimited 
+						list.</para>
+					</option>
+					<option name="E">
+						<para>Exit when the spied-on channel hangs up.</para>
+					</option>
 					<option name="g">
 						<argument name="grp" required="true">
 							<para>Only spy on channels in which one or more of the groups
@@ -240,6 +257,9 @@
 						<argument name="mailbox" />
 						<argument name="context" />
 					</option>
+					<option name="o">
+						<para>Only listen to audio coming from this channel.</para>
+					</option>
 					<option name="q">
 						<para>Don't play a beep when beginning to spy on a channel, or speak the
 						selected channel name.</para>
@@ -253,6 +273,9 @@
 						<para>Skip the playback of the channel type (i.e. SIP, IAX, etc) when
 						speaking the selected channel name.</para>
 					</option>
+					<option name="S">
+						<para>Stop when there are no more extensions left to spy on.</para>
+					</option>
 					<option name="v">
 						<argument name="value" />
 						<para>Adjust the initial volume in the range from <literal>-4</literal> 
@@ -266,11 +289,10 @@
 						<para>Enable <literal>private whisper</literal> mode, so the spying channel can
 						talk to the spied-on channel but cannot listen to that channel.</para>
 					</option>
-					<option name="o">
-						<para>Only listen to audio coming from this channel.</para>
-					</option>
-					<option name="s">
-						<para>Stop when there are no more extensions left to spy on.</para>
+					<option name="x">
+						<argument name="digit" required="true">
+							<para>Specify a DTMF digit that can be used to exit the application.</para>
+						</argument>
 					</option>
 					<option name="X">
 						<para>Allow the user to exit ChanSpy to a valid single digit
@@ -278,22 +300,6 @@
 						specified by the <variable>SPY_EXIT_CONTEXT</variable> channel variable. The
 						name of the last channel that was spied on will be stored
 						in the <variable>SPY_CHANNEL</variable> variable.</para>
-					</option>
-					<option name="x">
-						<argument name="digit" required="true">
-							<para>Specify a DTMF digit that can be used to exit the application.</para>
-						</argument>
-					</option>
-					<option name="c">
-						<argument name="digit" required="true">
-							<para>Specify a DTMF digit that can be used to spy on the next available channel.</para>
-						</argument>
-					</option>
-					<option name="e">
-						<argument name="ext" required="true" />
-						<para>Enable <emphasis>enforced</emphasis> mode, so the spying channel can
-						only monitor extensions whose name is in the <replaceable>ext</replaceable> : delimited 
-						list.</para>
 					</option>
 				</optionlist>	
 			</parameter>
@@ -356,6 +362,7 @@
 	OPTION_DTMF_CYCLE        = (1 << 15),	/* Custom DTMF for cycling next avaliable channel, (default is '*') */
 	OPTION_DAHDI_SCAN        = (1 << 16),	/* Scan groups in DAHDIScan mode */
 	OPTION_STOP              = (1 << 17),
+	OPTION_EXITONHANGUP      = (1 << 18),   /* Hang up when the spied-on channel hangs up. */
 };
 
 enum {
@@ -370,23 +377,24 @@
 };
 
 AST_APP_OPTIONS(spy_opts, {
-	AST_APP_OPTION('q', OPTION_QUIET),
 	AST_APP_OPTION('b', OPTION_BRIDGED),
 	AST_APP_OPTION('B', OPTION_BARGE),
+	AST_APP_OPTION_ARG('c', OPTION_DTMF_CYCLE, OPT_ARG_CYCLE),
+	AST_APP_OPTION('d', OPTION_DTMF_SWITCH_MODES),
+	AST_APP_OPTION_ARG('e', OPTION_ENFORCED, OPT_ARG_ENFORCED),
+	AST_APP_OPTION('E', OPTION_EXITONHANGUP),
+	AST_APP_OPTION_ARG('g', OPTION_GROUP, OPT_ARG_GROUP),
+	AST_APP_OPTION_ARG('n', OPTION_NAME, OPT_ARG_NAME),
+	AST_APP_OPTION('o', OPTION_READONLY),
+	AST_APP_OPTION('q', OPTION_QUIET),
+	AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
+	AST_APP_OPTION('s', OPTION_NOTECH),
+	AST_APP_OPTION('S', OPTION_STOP),
+	AST_APP_OPTION_ARG('v', OPTION_VOLUME, OPT_ARG_VOLUME),
 	AST_APP_OPTION('w', OPTION_WHISPER),
 	AST_APP_OPTION('W', OPTION_PRIVATE),
-	AST_APP_OPTION_ARG('v', OPTION_VOLUME, OPT_ARG_VOLUME),
-	AST_APP_OPTION_ARG('g', OPTION_GROUP, OPT_ARG_GROUP),
-	AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
-	AST_APP_OPTION_ARG('e', OPTION_ENFORCED, OPT_ARG_ENFORCED),
-	AST_APP_OPTION('o', OPTION_READONLY),
-	AST_APP_OPTION('s', OPTION_STOP),
+	AST_APP_OPTION_ARG('x', OPTION_DTMF_EXIT, OPT_ARG_EXIT),
 	AST_APP_OPTION('X', OPTION_EXIT),
-	AST_APP_OPTION('s', OPTION_NOTECH),
-	AST_APP_OPTION_ARG('n', OPTION_NAME, OPT_ARG_NAME),
-	AST_APP_OPTION('d', OPTION_DTMF_SWITCH_MODES),
-	AST_APP_OPTION_ARG('x', OPTION_DTMF_EXIT, OPT_ARG_EXIT),
-	AST_APP_OPTION_ARG('c', OPTION_DTMF_CYCLE, OPT_ARG_CYCLE),
 });
 
 struct chanspy_translation_helper {
@@ -957,6 +965,8 @@
 						next_autochan = NULL;
 					}
 				}
+			} else if (res == 0 && ast_test_flag(flags, OPTION_EXITONHANGUP)) {
+				goto exit;
 			}
 		}
 
@@ -1089,6 +1099,10 @@
 	if (oldwf && ast_set_write_format(chan, oldwf) < 0)
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 
+	if (ast_test_flag(&flags, OPTION_EXITONHANGUP)) {
+		ast_verb(3, "Stopped spying due to the spied-on channel hanging up.\n");
+	}
+
 	return res;
 }
 

Modified: team/oej/pinepacketrequest/configs/extensions.conf.sample
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/configs/extensions.conf.sample?view=diff&rev=219262&r1=219261&r2=219262
==============================================================================
--- team/oej/pinepacketrequest/configs/extensions.conf.sample (original)
+++ team/oej/pinepacketrequest/configs/extensions.conf.sample Thu Sep 17 13:42:24 2009
@@ -106,6 +106,8 @@
 ; that includes contexts within other contexts. The #include command works
 ; in all asterisk configuration files.
 ;#include "filename.conf"
+;#include <filename.conf>
+;#include filename.conf
 ;
 ; You can execute a program or script that produces config files, and they
 ; will be inserted where you insert the #exec command. The #exec command
@@ -113,6 +115,9 @@
 ; activate them within asterisk.conf with the "execincludes" option.  They
 ; are otherwise considered a security risk.
 ;#exec /opt/bin/build-extra-contexts.sh
+;#exec /opt/bin/build-extra-contexts.sh --foo="bar"
+;#exec </opt/bin/build-extra-contexts.sh --foo="bar">
+;#exec "/opt/bin/build-extra-contexts.sh --foo=\"bar\""
 ;
 
 ; The "Globals" category contains global variables that can be referenced

Modified: team/oej/pinepacketrequest/configure.ac
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/configure.ac?view=diff&rev=219262&r1=219261&r2=219262
==============================================================================
--- team/oej/pinepacketrequest/configure.ac (original)
+++ team/oej/pinepacketrequest/configure.ac Thu Sep 17 13:42:24 2009
@@ -345,6 +345,7 @@
 AC_C_CONST
 AC_TYPE_UID_T
 AC_C_INLINE
+AC_TYPE_LONG_DOUBLE_WIDER
 AC_TYPE_MODE_T
 AC_TYPE_OFF_T
 AC_TYPE_PID_T
@@ -380,9 +381,17 @@
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv utime vasprintf getpeereid sysctl swapctl])
 
+# NOTE: we use AC_CHECK_LIB to get -lm into the arguments for later checks,
+# so that AC_CHECK_FUNCS can detect functions in that library.
+AC_CHECK_LIB([m], [sqrt])
 # BSD might not have exp2, and/or log2
-AC_CHECK_LIB([m], [sqrt])
-AC_CHECK_FUNCS([exp2l log2l exp10l log10l sinl cosl tanl asinl acosl atanl atan2l powl sqrtl rintl expl logl remainderl fmodl roundl truncl floorl ceill exp2 log2 exp10 log10 sin cos tan asin acos atan atan2 pow rint exp log remainder fmod round trunc floor ceil])
+AC_CHECK_FUNCS([exp2 log2 exp10 log10 sin cos tan asin acos atan atan2 pow rint exp log remainder fmod round trunc floor ceil])
+
+# Certain architectures don't really have long double, even though
+# AC_CHECK_FUNCS would otherwise find the following functions.
+if test "x${ac_cv_type_long_double_wider}" = "xyes" ; then
+	AC_CHECK_FUNCS([exp2l log2l exp10l log10l sinl cosl tanl asinl acosl atanl atan2l powl sqrtl rintl expl logl remainderl fmodl roundl truncl floorl ceill])
+fi
 
 AC_MSG_CHECKING(for timersub in time.h)
 AC_LINK_IFELSE(

Modified: team/oej/pinepacketrequest/include/asterisk/autoconfig.h.in
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/include/asterisk/autoconfig.h.in?view=diff&rev=219262&r1=219261&r2=219262
==============================================================================
--- team/oej/pinepacketrequest/include/asterisk/autoconfig.h.in (original)
+++ team/oej/pinepacketrequest/include/asterisk/autoconfig.h.in Thu Sep 17 13:42:24 2009
@@ -472,6 +472,10 @@
 
 /* Define to 1 if you have the `logl' function. */
 #undef HAVE_LOGL
+
+/* Define to 1 if the type `long double' works and has more range or precision
+   than `double'. */
+#undef HAVE_LONG_DOUBLE_WIDER
 
 /* Define to 1 if you have the libtool library. */
 #undef HAVE_LTDL

Modified: team/oej/pinepacketrequest/include/asterisk/cdr.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/include/asterisk/cdr.h?view=diff&rev=219262&r1=219261&r2=219262
==============================================================================
--- team/oej/pinepacketrequest/include/asterisk/cdr.h (original)
+++ team/oej/pinepacketrequest/include/asterisk/cdr.h Thu Sep 17 13:42:24 2009
@@ -124,6 +124,12 @@
 void ast_cdr_free_vars(struct ast_cdr *cdr, int recur);
 int ast_cdr_copy_vars(struct ast_cdr *to_cdr, struct ast_cdr *from_cdr);
 
+/*!
+ * \brief CDR backend callback
+ * \warning CDR backends should NOT attempt to access the channel associated
+ * with a CDR record.  This channel is not guaranteed to exist when the CDR
+ * backend is invoked.
+ */
 typedef int (*ast_cdrbe)(struct ast_cdr *cdr);
 
 /*! \brief Return TRUE if CDR subsystem is enabled */

Modified: team/oej/pinepacketrequest/main/channel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/main/channel.c?view=diff&rev=219262&r1=219261&r2=219262
==============================================================================
--- team/oej/pinepacketrequest/main/channel.c (original)
+++ team/oej/pinepacketrequest/main/channel.c Thu Sep 17 13:42:24 2009
@@ -2119,6 +2119,11 @@
 		ast_channel_unlock(chan);
 		return 0;
 	}
+	ast_channel_unlock(chan);
+
+	ao2_unlink(channels, chan);
+
+	ast_channel_lock(chan);
 	free_translation(chan);
 	/* Close audio stream */
 	if (chan->stream) {

Modified: team/oej/pinepacketrequest/main/config.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/main/config.c?view=diff&rev=219262&r1=219261&r2=219262
==============================================================================
--- team/oej/pinepacketrequest/main/config.c (original)
+++ team/oej/pinepacketrequest/main/config.c Thu Sep 17 13:42:24 2009
@@ -1062,18 +1062,28 @@
 			return 0;	/* XXX is this correct ? or we should return -1 ? */
 		}
 
+		cur = c;
 		/* Strip off leading and trailing "'s and <>'s */
-		while ((*c == '<') || (*c == '>') || (*c == '\"')) c++;
-		/* Get rid of leading mess */
-		cur = c;
+		if (*c == '"') {
+			/* Dequote */
+			while (*c) {
+				if (*c == '"') {
+					strcpy(c, c + 1); /* SAFE */
+					c--;
+				} else if (*c == '\\') {
+					strcpy(c, c + 1); /* SAFE */
+				}
+				c++;
+			}
+		} else if (*c == '<') {
+			/* C-style include */
+			if (*(c + strlen(c) - 1) == '>') {
+				cur++;
+				*(c + strlen(c) - 1) = '\0';
+			}
+		}
 		cur2 = cur;
-		while (!ast_strlen_zero(cur)) {
-			c = cur + strlen(cur) - 1;
-			if ((*c == '>') || (*c == '<') || (*c == '\"'))
-				*c = '\0';
-			else
-				break;
-		}
+
 		/* #exec </path/to/executable>
 		   We create a tmp file, then we #include it, then we delete it. */
 		if (!do_include) {

Modified: team/oej/pinepacketrequest/res/res_jabber.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/res/res_jabber.c?view=diff&rev=219262&r1=219261&r2=219262
==============================================================================
--- team/oej/pinepacketrequest/res/res_jabber.c (original)
+++ team/oej/pinepacketrequest/res/res_jabber.c Thu Sep 17 13:42:24 2009
@@ -192,14 +192,6 @@
  	need to read both files */
 #define JABBER_CONFIG "jabber.conf"
 
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
 /*-- Forward declarations */
 static void aji_buddy_destroy(struct aji_buddy *obj);
 static void aji_client_destroy(struct aji_client *obj);




More information about the svn-commits mailing list