[asterisk-commits] murf: branch group/CDRfix5 r77850 - in /team/group/CDRfix5: ./ apps/ build_to...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jul 31 21:45:23 CDT 2007
Author: murf
Date: Tue Jul 31 21:45:22 2007
New Revision: 77850
URL: http://svn.digium.com/view/asterisk?view=rev&rev=77850
Log:
Merged revisions 77819-77821,77825,77828-77829,77833-77834,77838,77847 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r77819 | kpfleming | 2007-07-31 08:54:46 -0600 (Tue, 31 Jul 2007) | 3 lines
umm... let's build with --enable-dev-mode, mmkay?
................
r77820 | kpfleming | 2007-07-31 08:55:37 -0600 (Tue, 31 Jul 2007) | 2 lines
use a different method for overriding the send_digit_begin pointer, as the old one fails to compile on my 64-bit system with gcc-4.1 and --enable-dev-mode turned on
................
r77821 | kpfleming | 2007-07-31 09:01:27 -0600 (Tue, 31 Jul 2007) | 2 lines
there is no use in having functions that have no code in them, and hide the locking info when DEBUG_THREADS is enabled... i could have fixed this to be dependent on DEBUG_THREADS, but it would be just as easy for someone to add their test/debugging code to the macros as it would have been to the functions
................
r77825 | mmichelson | 2007-07-31 09:22:32 -0600 (Tue, 31 Jul 2007) | 14 lines
Merged revisions 77824 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r77824 | mmichelson | 2007-07-31 10:21:22 -0500 (Tue, 31 Jul 2007) | 6 lines
This patch makes Asterisk send 100 Trying provisional responses upon receipt of re-invites. This makes it so that if there are two or more Asterisk
servers between endpoints, the Asterisk servers will not keep retransmitting the re-invites.
(closes issue #10274, reported by cstadlmann, patched by me with approval from file)
........
................
r77828 | kpfleming | 2007-07-31 09:54:29 -0600 (Tue, 31 Jul 2007) | 10 lines
Merged revisions 77827 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r77827 | kpfleming | 2007-07-31 10:53:42 -0500 (Tue, 31 Jul 2007) | 2 lines
DETECT_DEADLOCKS can't be enabled without DEBUG_THREADS or it does nothing
........
................
r77829 | murf | 2007-07-31 09:59:01 -0600 (Tue, 31 Jul 2007) | 1 line
thanks to Russel, for pointing out that the dialoglist_lock/unlock routines also need to be macros if DETECT_DEADLOCKS is set
................
r77833 | file | 2007-07-31 10:21:34 -0600 (Tue, 31 Jul 2007) | 10 lines
Merged revisions 77831 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r77831 | file | 2007-07-31 13:17:09 -0300 (Tue, 31 Jul 2007) | 2 lines
Add a flag to the speech API that allows an engine to set whether it received results or not.
........
................
r77834 | tilghman | 2007-07-31 10:44:25 -0600 (Tue, 31 Jul 2007) | 3 lines
Add func_lock, which creates dialplan mutexes, and note that the Macro apps are now deprecated.
(Closes issue #10264)
................
r77838 | tilghman | 2007-07-31 12:50:06 -0600 (Tue, 31 Jul 2007) | 2 lines
Add some documentation detailing an aspect of dialplan functions, as requested by Russell
................
r77847 | murf | 2007-07-31 15:33:37 -0600 (Tue, 31 Jul 2007) | 17 lines
Merged revisions 77844 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r77844 | murf | 2007-07-31 14:59:10 -0600 (Tue, 31 Jul 2007) | 9 lines
Merged revisions 77842 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r77842 | murf | 2007-07-31 13:19:35 -0600 (Tue, 31 Jul 2007) | 1 line
This probably isn't super-general, but it's a first stab at using kill -11 to generate a core file instead of gcore.
........
................
................
Added:
team/group/CDRfix5/funcs/func_lock.c
- copied unchanged from r77847, trunk/funcs/func_lock.c
Modified:
team/group/CDRfix5/ (props changed)
team/group/CDRfix5/CHANGES
team/group/CDRfix5/UPGRADE.txt
team/group/CDRfix5/apps/app_senddtmf.c
team/group/CDRfix5/build_tools/cflags.xml
team/group/CDRfix5/channels/chan_sip.c
team/group/CDRfix5/contrib/scripts/ast_grab_core
team/group/CDRfix5/include/asterisk/speech.h
team/group/CDRfix5/res/res_speech.c
Propchange: team/group/CDRfix5/
------------------------------------------------------------------------------
automerge = yes
Propchange: team/group/CDRfix5/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/group/CDRfix5/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jul 31 21:45:22 2007
@@ -1,1 +1,1 @@
-/trunk:1-77811
+/trunk:1-77849
Modified: team/group/CDRfix5/CHANGES
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/CHANGES?view=diff&rev=77850&r1=77849&r2=77850
==============================================================================
--- team/group/CDRfix5/CHANGES (original)
+++ team/group/CDRfix5/CHANGES Tue Jul 31 21:45:22 2007
@@ -33,6 +33,10 @@
* MailboxExists converted to dialplan function
* A new option to Dial() for telling IP phones not to count the call
as "missed" when dial times out and cancels.
+ * Added LOCK(), TRYLOCK(), and UNLOCK(), which provide a single level dialplan
+ mutex. No deadlocks are possible, as LOCK() only allows a single lock to be
+ held for any given channel. Also, locks are automatically freed when a
+ channel is hung up.
CLI Changes
-----------
Modified: team/group/CDRfix5/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/UPGRADE.txt?view=diff&rev=77850&r1=77849&r2=77850
==============================================================================
--- team/group/CDRfix5/UPGRADE.txt (original)
+++ team/group/CDRfix5/UPGRADE.txt Tue Jul 31 21:45:22 2007
@@ -71,6 +71,11 @@
* DISA()'s fifth argument is now an options argument. If you have previously
used 'NOANSWER' in this argument, you'll need to convert that to the new
option 'n'.
+* Macro() is now deprecated. If you need subroutines, you should use the
+ Gosub()/Return() applications. To replace MacroExclusive(), we have
+ introduced dialplan functions LOCK(), TRYLOCK(), and UNLOCK(). You may use
+ these functions in any location where you desire to ensure that only one
+ channel is executing that path at any one time.
CDR:
Modified: team/group/CDRfix5/apps/app_senddtmf.c
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/apps/app_senddtmf.c?view=diff&rev=77850&r1=77849&r2=77850
==============================================================================
--- team/group/CDRfix5/apps/app_senddtmf.c (original)
+++ team/group/CDRfix5/apps/app_senddtmf.c Tue Jul 31 21:45:22 2007
@@ -66,7 +66,7 @@
AST_APP_ARG(timeout);
);
- if (ast_strlen_zero(data)) {
+ if (ast_strlen_zero(vdata)) {
ast_log(LOG_WARNING, "SendDTMF requires an argument (digits or *#aAbBcCdD)\n");
return 0;
}
Modified: team/group/CDRfix5/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/build_tools/cflags.xml?view=diff&rev=77850&r1=77849&r2=77850
==============================================================================
--- team/group/CDRfix5/build_tools/cflags.xml (original)
+++ team/group/CDRfix5/build_tools/cflags.xml Tue Jul 31 21:45:22 2007
@@ -8,6 +8,7 @@
<member name="DEBUG_THREADLOCALS" displayname="Enable Thread-Local-Storage Debugging">
</member>
<member name="DETECT_DEADLOCKS" displayname="Detect Deadlocks">
+ <depend>DEBUG_THREADS</depend>
</member>
<member name="DO_CRASH" displayname="Crash on fatal errors">
</member>
Modified: team/group/CDRfix5/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/channels/chan_sip.c?view=diff&rev=77850&r1=77849&r2=77850
==============================================================================
--- team/group/CDRfix5/channels/chan_sip.c (original)
+++ team/group/CDRfix5/channels/chan_sip.c Tue Jul 31 21:45:22 2007
@@ -1136,6 +1136,7 @@
/*! \brief Protect the SIP dialog list (of sip_pvt's) */
AST_MUTEX_DEFINE_STATIC(dialoglock);
+#ifndef DETECT_DEADLOCKS
/*! \brief hide the way the list is locked/unlocked */
static void dialoglist_lock(void)
{
@@ -1146,6 +1147,12 @@
{
ast_mutex_unlock(&dialoglock);
}
+#else
+/* we don't want to HIDE the information about where the lock was requested if trying to debug
+ * deadlocks! So, just make these macros! */
+#define dialoglist_lock(x) ast_mutex_lock(&dialoglock)
+#define dialoglist_unlock(x) ast_mutex_unlock(&dialoglock)
+#endif
/*!
* when we create or delete references, make sure to use these
@@ -1841,24 +1848,8 @@
get_codec: sip_get_codec,
};
-#ifndef DETECT_DEADLOCKS
-/*! \brief Helper function to lock, hiding the underlying locking mechanism. */
-static void sip_pvt_lock(struct sip_pvt *pvt)
-{
- ast_mutex_lock(&pvt->pvt_lock);
-}
-
-/*! \brief Helper function to unlock pvt, hiding the underlying locking mechanism. */
-static void sip_pvt_unlock(struct sip_pvt *pvt)
-{
- ast_mutex_unlock(&pvt->pvt_lock);
-}
-#else
-/* we don't want to HIDE the information about where the lock was requested if trying to debug
- * deadlocks! So, just make these macros! */
#define sip_pvt_lock(x) ast_mutex_lock(&x->pvt_lock)
#define sip_pvt_unlock(x) ast_mutex_unlock(&x->pvt_lock)
-#endif
/*!
* helper functions to unreference various types of objects.
@@ -14751,6 +14742,8 @@
case AST_STATE_UP:
ast_debug(2, "%s: This call is UP.... \n", c->name);
+ transmit_response(p, "100 Trying", req);
+
if (p->t38.state == T38_PEER_REINVITE) {
struct ast_channel *bridgepeer = NULL;
struct sip_pvt *bridgepvt = NULL;
@@ -18686,11 +18679,11 @@
return AST_MODULE_LOAD_DECLINE;
/* Prepare the version that does not require DTMF BEGIN frames.
- * We need to use tricks such as memcopy and casts because the variable
+ * We need to use tricks such as memcpy and casts because the variable
* has const fields.
*/
memcpy(&sip_tech_info, &sip_tech, sizeof(sip_tech));
- *((void **)&sip_tech_info.send_digit_begin) = NULL;
+ memset((void *) &sip_tech_info.send_digit_begin, 0, sizeof(sip_tech_info.send_digit_begin));
/* Make sure we can register our sip channel type */
if (ast_channel_register(&sip_tech)) {
Modified: team/group/CDRfix5/contrib/scripts/ast_grab_core
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/contrib/scripts/ast_grab_core?view=diff&rev=77850&r1=77849&r2=77850
==============================================================================
--- team/group/CDRfix5/contrib/scripts/ast_grab_core (original)
+++ team/group/CDRfix5/contrib/scripts/ast_grab_core Tue Jul 31 21:45:22 2007
@@ -3,8 +3,19 @@
# lame quickie script to snarf a core of a hung asterisk process.
# bugs to ast_grab_core, blinky-lights.org (derrick daugherty)
+# we have found that gcore doesn't yield as useful a core file
+# as that yielded by a signal-caused core dump. So we are going to change
+# the strategy to sending a SEGV signal to the asterisk process,
+# and have it 'burn to the ground', leaving behind a core file.
+# the main difference is that you cannot control where the
+# core file will end up. We will assume that safe_asterisk was
+# used to start asterisk, and the core file should therefore end
+# up in /tmp (because safe_asterisk cd's there before starting asterisk).
+# if this is not the case, set DUMPDIR to the place where the core
+# file can be found.
+
DATE=`date +%Y%m%d%H%M`
-DUMPDIR=/var/tmp
+DUMPDIR=/tmp
HOSTNAME=`hostname`
ADMINEMAIL="root at localhost"
@@ -27,20 +38,16 @@
echo \*\*\* WARNING \*\*\* process to STOP while memory is dumped to disk.
echo
-/usr/bin/gdb > /dev/null << EOF
- attach ${PID}
- gcore ${DUMPDIR}/asterisk_${DATE}.core.${PID}
- detach
- quit
-EOF
+/bin/kill -11 ${PID}
-echo Snarfed! ${DUMPDIR}/asterisk_${DATE}.core.${PID}
+echo Snarfed! ${DUMPDIR}/core.${PID}
echo
echo Trying for a backtrace of the captured core.
-/usr/bin/gdb /usr/sbin/asterisk ${DUMPDIR}/asterisk_${DATE}.core.${PID} > ${DUMPDIR}/gdb_dump.${PID}.txt 2> /dev/null << EOF
+/usr/bin/gdb /usr/sbin/asterisk ${DUMPDIR}/core.${PID} > ${DUMPDIR}/gdb_dump.${PID}.txt 2> /dev/null << EOF
set prompt \n
+set print pretty\n
echo --------------------------------------------------------------------------------\n
echo INFO THREAD
info thread
@@ -56,7 +63,7 @@
echo Notifying admins of the core.
-/usr/bin/mail -s "${HOSTNAME} core dumped at ${DUMPDIR}/asterisk_${DATE}.core.${PID}" ${ADMINEMAIL} < /tmp/gdb_dump.${PID}
+/usr/bin/mail -s "${HOSTNAME} core dumped at ${DUMPDIR}/core.${PID}" ${ADMINEMAIL} < ${DUMPDIR}/gdb_dump.${PID}.txt
echo Done.
echo
echo Reproducible deadlocks should be posted with a full backtrace and instructions
Modified: team/group/CDRfix5/include/asterisk/speech.h
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/include/asterisk/speech.h?view=diff&rev=77850&r1=77849&r2=77850
==============================================================================
--- team/group/CDRfix5/include/asterisk/speech.h (original)
+++ team/group/CDRfix5/include/asterisk/speech.h Tue Jul 31 21:45:22 2007
@@ -29,8 +29,9 @@
/* Speech structure flags */
enum ast_speech_flags {
- AST_SPEECH_QUIET = (1 << 0), /* Quiet down output... they are talking */
- AST_SPEECH_SPOKE = (1 << 1), /* Speaker spoke! */
+ AST_SPEECH_QUIET = (1 << 0), /* Quiet down output... they are talking */
+ AST_SPEECH_SPOKE = (1 << 1), /* Speaker spoke! */
+ AST_SPEECH_HAVE_RESULTS = (1 << 2), /* Results are present */
};
/* Speech structure states - in order of expected change */
Modified: team/group/CDRfix5/res/res_speech.c
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/res/res_speech.c?view=diff&rev=77850&r1=77849&r2=77850
==============================================================================
--- team/group/CDRfix5/res/res_speech.c (original)
+++ team/group/CDRfix5/res/res_speech.c Tue Jul 31 21:45:22 2007
@@ -92,7 +92,7 @@
/*! \brief Return the results of a recognition from the speech structure */
struct ast_speech_result *ast_speech_results_get(struct ast_speech *speech)
{
- return (speech->engine->get ? speech->engine->get(speech) : NULL);
+ return ((speech->engine->get && ast_test_flag(speech, AST_SPEECH_HAVE_RESULTS)) ? speech->engine->get(speech) : NULL);
}
/*! \brief Free a list of results */
@@ -128,6 +128,7 @@
/* Clear any flags that may affect things */
ast_clear_flag(speech, AST_SPEECH_SPOKE);
ast_clear_flag(speech, AST_SPEECH_QUIET);
+ ast_clear_flag(speech, AST_SPEECH_HAVE_RESULTS);
/* If results are on the structure, free them since we are starting again */
if (speech->results) {
More information about the asterisk-commits
mailing list