[asterisk-commits] oej: branch oej/teapot-1.8 r417182 - in /team/oej/teapot-1.8: ./ autoconf/ cd...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jun 24 06:50:18 CDT 2014
Author: oej
Date: Tue Jun 24 06:50:12 2014
New Revision: 417182
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=417182
Log:
Reset and resolve again
Modified:
team/oej/teapot-1.8/ (props changed)
team/oej/teapot-1.8/Makefile
team/oej/teapot-1.8/Makefile.rules
team/oej/teapot-1.8/autoconf/ast_ext_tool_check.m4
team/oej/teapot-1.8/cdr/cdr_sqlite3_custom.c
team/oej/teapot-1.8/cel/cel_sqlite3_custom.c
team/oej/teapot-1.8/channels/chan_sip.c
team/oej/teapot-1.8/channels/sip/reqresp_parser.c
team/oej/teapot-1.8/configs/extensions.lua.sample
team/oej/teapot-1.8/configs/features.conf.sample
team/oej/teapot-1.8/configure
team/oej/teapot-1.8/funcs/func_strings.c
team/oej/teapot-1.8/include/asterisk/autoconfig.h.in
team/oej/teapot-1.8/include/asterisk/tcptls.h
team/oej/teapot-1.8/main/http.c
team/oej/teapot-1.8/main/manager.c
team/oej/teapot-1.8/main/pbx.c
team/oej/teapot-1.8/main/test.c
team/oej/teapot-1.8/pbx/pbx_lua.c
team/oej/teapot-1.8/res/res_musiconhold.c
Propchange: team/oej/teapot-1.8/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jun 24 06:50:12 2014
@@ -1,1 +1,1 @@
-/branches/1.8:1-415907
+/branches/1.8:1-417181
Modified: team/oej/teapot-1.8/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/Makefile?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/Makefile (original)
+++ team/oej/teapot-1.8/Makefile Tue Jun 24 06:50:12 2014
@@ -176,7 +176,6 @@
_ASTCFLAGS+=-Werror
_ASTCFLAGS+=-Wunused
_ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
- _ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
_ASTCFLAGS+=-Wundef
_ASTCFLAGS+=-Wmissing-format-attribute
_ASTCFLAGS+=-Wformat=2
Modified: team/oej/teapot-1.8/Makefile.rules
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/Makefile.rules?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/Makefile.rules (original)
+++ team/oej/teapot-1.8/Makefile.rules Tue Jun 24 06:50:12 2014
@@ -82,6 +82,8 @@
# and if that doesn't fail then compile again with optimizer disabled
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),DONT_OPTIMIZEyes)
COMPILE_DOUBLE=yes
+else
+_ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
endif
ifeq ($(findstring BUILD_NATIVE,$(MENUSELECT_CFLAGS)),BUILD_NATIVE)
Modified: team/oej/teapot-1.8/autoconf/ast_ext_tool_check.m4
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/autoconf/ast_ext_tool_check.m4?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/autoconf/ast_ext_tool_check.m4 (original)
+++ team/oej/teapot-1.8/autoconf/ast_ext_tool_check.m4 Tue Jun 24 06:50:12 2014
@@ -5,39 +5,37 @@
# AST_EXT_TOOL_CHECK([package], [tool name], [--cflags], [--libs], [includes], [expression])
AC_DEFUN([AST_EXT_TOOL_CHECK],
[
- if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
- PBX_$1=0
- AC_PATH_TOOL(CONFIG_$1, $2, No, [${$1_DIR}/bin:$PATH])
- if test ! "x${CONFIG_$1}" = xNo; then
- if test x"$3" = x ; then A=--cflags ; else A="$3" ; fi
- $1_INCLUDE=$(${CONFIG_$1} $A)
- if test x"$4" = x ; then A=--libs ; else A="$4" ; fi
- $1_LIB=$(${CONFIG_$1} $A)
- if test x"$5" != x ; then
- saved_cppflags="${CPPFLAGS}"
- if test "x${$1_DIR}" != "x"; then
- $1_INCLUDE="-I${$1_DIR}/include"
+ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
+ PBX_$1=0
+ AC_PATH_TOOL(CONFIG_$1, $2, No, [${$1_DIR}/bin:$PATH])
+ if test ! "x${CONFIG_$1}" = xNo; then
+ if test x"$3" = x ; then A=--cflags ; else A="$3" ; fi
+ $1_INCLUDE=$(${CONFIG_$1} $A)
+ $1_INCLUDE=$(echo ${$1_INCLUDE} | $SED -e "s|-I|-I${$1_DIR}|g")
+
+ if test x"$4" = x ; then A=--libs ; else A="$4" ; fi
+ $1_LIB=$(${CONFIG_$1} $A)
+ $1_LIB=$(echo ${$1_LIB} | $SED -e "s|-L|-L${$1_DIR}|g")
+
+ if test x"$5" != x ; then
+ saved_cppflags="${CPPFLAGS}"
+ CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+
+ saved_libs="${LIBS}"
+ LIBS=${$1_LIB}
+
+ AC_LINK_IFELSE(
+ [ AC_LANG_PROGRAM( [ $5 ], [ $6; ])],
+ [ PBX_$1=1 AC_DEFINE([HAVE_$1], 1,
+ [Define if your system has the $1 headers.])],
+ []
+ )
+ CPPFLAGS="${saved_cppflags}"
+ LIBS="${saved_libs}"
+ else
+ PBX_$1=1
+ AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 libraries.])
+ fi
fi
- CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
-
- saved_libs="${LIBS}"
- LIBS="${$1_LIB}"
-
- AC_LINK_IFELSE(
- [ AC_LANG_PROGRAM( [ $5 ],
- [ $6; ]
- )],
- [ PBX_$1=1
- AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
- ],
- []
- )
- CPPFLAGS="${saved_cppflags}"
- LIBS="${saved_libs}"
- else
- PBX_$1=1
- AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 libraries.])
- fi
fi
- fi
])
Modified: team/oej/teapot-1.8/cdr/cdr_sqlite3_custom.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/cdr/cdr_sqlite3_custom.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/cdr/cdr_sqlite3_custom.c (original)
+++ team/oej/teapot-1.8/cdr/cdr_sqlite3_custom.c Tue Jun 24 06:50:12 2014
@@ -229,7 +229,6 @@
int res = 0;
char *error = NULL;
char *sql = NULL;
- int count = 0;
if (db == NULL) {
/* Should not have loaded, but be failsafe. */
@@ -265,16 +264,7 @@
ast_free(value_string);
}
- /* XXX This seems awful arbitrary... */
- for (count = 0; count < 5; count++) {
- res = sqlite3_exec(db, sql, NULL, NULL, &error);
- if (res != SQLITE_BUSY && res != SQLITE_LOCKED) {
- break;
- }
- usleep(200);
- }
-
- if (error) {
+ if (sqlite3_exec(db, sql, NULL, NULL, &error) != SQLITE_OK) {
ast_log(LOG_ERROR, "%s. SQL: %s.\n", error, sql);
sqlite3_free(error);
}
@@ -316,7 +306,7 @@
free_config(0);
return AST_MODULE_LOAD_DECLINE;
}
-
+ sqlite3_busy_timeout(db, 1000);
/* is the table there? */
sql = sqlite3_mprintf("SELECT COUNT(AcctId) FROM %q;", table);
res = sqlite3_exec(db, sql, NULL, NULL, NULL);
Modified: team/oej/teapot-1.8/cel/cel_sqlite3_custom.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/cel/cel_sqlite3_custom.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/cel/cel_sqlite3_custom.c (original)
+++ team/oej/teapot-1.8/cel/cel_sqlite3_custom.c Tue Jun 24 06:50:12 2014
@@ -231,7 +231,6 @@
{
char *error = NULL;
char *sql = NULL;
- int count = 0;
if (db == NULL) {
/* Should not have loaded, but be failsafe. */
@@ -266,18 +265,7 @@
ast_free(value_string);
}
- /* XXX This seems awful arbitrary... */
- for (count = 0; count < 5; count++) {
- int res = sqlite3_exec(db, sql, NULL, NULL, &error);
- if (res != SQLITE_BUSY && res != SQLITE_LOCKED) {
- break;
- }
- usleep(200);
- }
-
- ast_mutex_unlock(&lock);
-
- if (error) {
+ if (sqlite3_exec(db, sql, NULL, NULL, &error) != SQLITE_OK) {
ast_log(LOG_ERROR, "%s. SQL: %s.\n", error, sql);
sqlite3_free(error);
}
@@ -285,6 +273,7 @@
if (sql) {
sqlite3_free(sql);
}
+ ast_mutex_unlock(&lock);
return;
}
@@ -319,7 +308,7 @@
free_config();
return AST_MODULE_LOAD_DECLINE;
}
-
+ sqlite3_busy_timeout(db, 1000);
/* is the table there? */
sql = sqlite3_mprintf("SELECT COUNT(*) FROM %q;", table);
res = sqlite3_exec(db, sql, NULL, NULL, NULL);
Modified: team/oej/teapot-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/channels/chan_sip.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/channels/chan_sip.c (original)
+++ team/oej/teapot-1.8/channels/chan_sip.c Tue Jun 24 06:50:12 2014
@@ -2962,6 +2962,12 @@
goto cleanup;
}
+ /*
+ * We cannot let the stream exclusively wait for data to arrive.
+ * We have to wake up the task to send outgoing messages.
+ */
+ ast_tcptls_stream_set_exclusive_input(tcptls_session->stream_cookie, 0);
+
ast_tcptls_stream_set_timeout_sequence(tcptls_session->stream_cookie, ast_tvnow(),
tcptls_session->client ? -1 : (authtimeout * 1000));
Modified: team/oej/teapot-1.8/channels/sip/reqresp_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/channels/sip/reqresp_parser.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/channels/sip/reqresp_parser.c (original)
+++ team/oej/teapot-1.8/channels/sip/reqresp_parser.c Tue Jun 24 06:50:12 2014
@@ -2513,8 +2513,8 @@
if (testdataptr->expected_port && testdataptr->expected_port != via->port) {
ast_test_status_update(test, "TEST#%d FAILED: VIA = \"%s\"\n"
- "parsed port = \"%d\"\n"
- "expected = \"%d\"\n"
+ "parsed port = \"%u\"\n"
+ "expected = \"%u\"\n"
"failed to parse port\n",
i, testdataptr->in, via->port, testdataptr->expected_port);
res = AST_TEST_FAIL;
Modified: team/oej/teapot-1.8/configs/extensions.lua.sample
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/configs/extensions.lua.sample?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/configs/extensions.lua.sample (original)
+++ team/oej/teapot-1.8/configs/extensions.lua.sample Tue Jun 24 06:50:12 2014
@@ -85,6 +85,7 @@
--
-- app.Dial("DAHDI/1")
-- app.dial("DAHDI/1")
+-- app["dial"]("DAHDI/1")
--
-- More examples can be found below.
--
@@ -95,6 +96,24 @@
-- autoservice_stop() and the autoservice_status() function will return true if
-- an autoservice is currently running.
--
+-- Note about naming conflicts:
+-- Lua allows you to refer to table entries using the '.' notation,
+-- I.E. app.goto(something), only if the entry doesn't conflict with an Lua
+-- reserved word. In the 'goto' example, with Lua 5.1 or earlier, 'goto' is
+-- not a reserved word so you'd be calling the Asterisk dialplan application
+-- 'goto'. Lua 5.2 however, introduced the 'goto' control statement which
+-- makes 'goto' a reserved word. This casues the interpreter to fail parsing
+-- the file and pbx_lua.so will fail to load. The same applies to any use of
+-- Lua tables including extensions, channels and any tables you create.
+--
+-- There are two ways around this: Since Lua is case-sensitive, you can use
+-- capitalized names, I.E. app.Goto(something) to refer to the Asterisk apps,
+-- functions, etc. Or you can use the full syntax, I.E. app["goto"](something).
+-- Both syntaxes are backwards compatible with earlier Lua versions. To make
+-- your Lua dialplans easier to maintain and to reduce the chance of future
+-- conflicts you may want to use the app["goto"](something) syntax for all
+-- table accesses.
+--
function outgoing_local(c, e)
app.dial("DAHDI/1/" .. e, "", "")
@@ -142,7 +161,8 @@
end;
["1000"] = function()
- app.goto("default", "s", 1)
+-- See the naming conflict note above.
+ app['goto']("default", "s", 1)
end;
["1234"] = function()
Modified: team/oej/teapot-1.8/configs/features.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/configs/features.conf.sample?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/configs/features.conf.sample (original)
+++ team/oej/teapot-1.8/configs/features.conf.sample Tue Jun 24 06:50:12 2014
@@ -3,23 +3,51 @@
;
[general]
-parkext => 700 ; What extension to dial to park. Set per parking lot.
-;parkext_exclusive=yes ; Specify that the parkext created for this parking lot
- ; will only access this parking lot. (default is no)
-parkpos => 701-720 ; What extensions to park calls on. (defafult parking lot)
- ; These need to be numeric, as Asterisk starts from the start position
- ; and increments with one for the next parked call.
- ; Set per parking lot.
-context => parkedcalls ; Which context parked calls are in (default parking lot)
- ; Set per parking lot.
-;parkinghints = no ; Add hints priorities automatically for parking slots (default is no).
- ; Set per parking lot.
-;parkingtime => 45 ; Number of seconds a call can be parked before returning.
- ; Set per parking lot. (default is 45 seconds)
-
+
+; OPTIONS THAT CAN ONLY BE SET IN THE GENERAL CONTEXT
+
+;featuredigittimeout = 1000 ; Max time (ms) between digits for
+ ; feature activation (default is 1000 ms)
+
+; Pickup Options
+;
+;pickupexten = *8 ; Configure the pickup extension. (default is *8)
+;pickupsound = beep ; to indicate a successful pickup (default: no sound)
+;pickupfailsound = beeperr ; to indicate that the pickup failed (default: no sound)
+
+; Transfer Options
+;
+;transferdigittimeout => 3 ; Number of seconds to wait between digits when transferring a call
+ ; (default is 3 seconds)
+;xfersound = beep ; to indicate an attended transfer is complete
+;xferfailsound = beeperr ; to indicate a failed transfer
+;atxfernoanswertimeout = 15 ; Timeout for answer on attended transfer default is 15 seconds.
+;atxferloopdelay = 10 ; Number of seconds to sleep between retries (if atxferdropcall = no)
+;atxfercallbackretries = 2 ; Number of times to attempt to send the call back to the transferer.
+ ; By default, this is 2.
+;atxferdropcall = no ; If someone does an attended transfer, then hangs up before the transferred
+ ; caller is connected, then by default, the system will try to call back the
+ ; person that did the transfer. If this is set to "yes", the callback will
+ ; not be attempted and the transfer will just fail.
+ ; For atxferdropcall=no to work properly, you also need to
+ ; define ATXFER_NULL_TECH in main/features.c. The reason the
+ ; code is not enabled by default is spelled out in the comment
+ ; block near the top of main/features.c describing ATXFER_NULL_TECH.
+
+; Parking Options
+;
+; These options apply to all parking lots, including the default lot defined in
+; the general context.
+;
+;courtesytone = beep ; Sound file to play to when someone picks up a parked call
+ ; and also when the Touch Monitor is activated/deactivated.
+ ; Default is no tone.
+;parkedplay = caller ; Who to play courtesytone to when picking up a parked call.
+ ; One of: parked, caller, both (default is caller)
+;parkeddynamic = yes ; Enables dynamically created parkinglots. (default is no)
+;adsipark = yes ; if you want ADSI parking announcements
;comebacktoorigin = yes ; Setting this option configures the behavior of call parking when the
; parked call times out (See the parkingtime option). The default value is 'yes'.
- ; Operates on all parking lots.
;
; 'yes' - When the parked call times out, attempt to send the call back to the peer
; that parked this call. This is done by saving off the name of the channel
@@ -46,60 +74,44 @@
; During the timeout procedure, the following variable is set
; PARKINGSLOT - extension that the call was parked in prior to timing out
-;courtesytone = beep ; Sound file to play to when someone picks up a parked call
- ; and also when the Touch Monitor is activated/deactivated.
- ; Default is no tone.
-;parkedplay = caller ; Who to play courtesytone to when picking up a parked call.
- ; One of: parked, caller, both (default is caller)
- ; Operates on all parking lots.
+
+; OPTIONS THAT CAN BE SET PER PARKING LOT
+;
+; If these options are set in the general context, they will *only* apply to the default
+; parking lot. If set in any other lot, they will *only* apply to that lot.
+
+parkext => 700 ; What extension to dial to park. This option can take any alphanumeric string.
+ ; (default is 700 for all lots)
+;parkext_exclusive=yes ; Specify that the parkext created for this parking lot
+ ; will only access this parking lot. (default is no for all lots)
+parkpos => 701-750 ; What extensions to park calls on.
+ ; (default is 701-750 for the default lot and blank for custom lots)
+ ; These need to be numeric, as Asterisk starts from the start position
+ ; and increments with one for the next parked call. Hence, leading zeros
+ ; and non-numerical characters will be ignored.
+context => parkedcalls ; Which context parked calls are in (default is parkedcalls for the default lot and blank for custom lots)
+;parkinghints = no ; Add hints priorities automatically for parking slots (default is no for all lots).
+;parkingtime => 45 ; Number of seconds a call can be parked before returning.
+ ; (default is 45 for all lots)
;parkedcalltransfers = caller ; Enables or disables DTMF based transfers when picking up a parked call.
- ; one of: callee, caller, both, no (default is no)
- ; Set per parking lot.
+ ; one of: callee, caller, both, no (default is no for all lots)
;parkedcallreparking = caller ; Enables or disables DTMF based parking when picking up a parked call.
- ; one of: callee, caller, both, no (default is no)
- ; Set per parking lot.
+ ; one of: callee, caller, both, no (default is no for all lots)
;parkedcallhangup = caller ; Enables or disables DTMF based hangups when picking up a parked call.
- ; one of: callee, caller, both, no (default is no)
- ; Set per parking lot.
+ ; one of: callee, caller, both, no (default is no for all lots)
;parkedcallrecording = caller ; Enables or disables DTMF based one-touch recording when picking up a parked call.
- ; one of: callee, caller, both, no (default is no)
- ; Set per parking lot.
-;parkeddynamic = yes ; Enables dynamically created parkinglots. (default is no)
- ; Operates on all parking lots.
-;adsipark = yes ; if you want ADSI parking announcements
- ; Operates on all parking lots.
+ ; one of: callee, caller, both, no (default is no for all lots)
;findslot => next ; Continue to the 'next' free parking space.
- ; Defaults to 'first' available
- ; Set per parking lot.
+ ; (Default is 'first' for all lots)
;parkedmusicclass=default ; This is the MOH class to use for the parked channel
; as long as the class is not set on the channel directly
- ; using Set(CHANNEL(musicclass)=whatever) in the dialplan
- ; Set per parking lot.
-
-;transferdigittimeout => 3 ; Number of seconds to wait between digits when transferring a call
- ; (default is 3 seconds)
-;xfersound = beep ; to indicate an attended transfer is complete
-;xferfailsound = beeperr ; to indicate a failed transfer
-;pickupexten = *8 ; Configure the pickup extension. (default is *8)
-;pickupsound = beep ; to indicate a successful pickup (default: no sound)
-;pickupfailsound = beeperr ; to indicate that the pickup failed (default: no sound)
-;featuredigittimeout = 1000 ; Max time (ms) between digits for
- ; feature activation (default is 1000 ms)
-;atxfernoanswertimeout = 15 ; Timeout for answer on attended transfer default is 15 seconds.
-;atxferdropcall = no ; If someone does an attended transfer, then hangs up before the transferred
- ; caller is connected, then by default, the system will try to call back the
- ; person that did the transfer. If this is set to "yes", the callback will
- ; not be attempted and the transfer will just fail.
- ; For atxferdropcall=no to work properly, you also need to
- ; define ATXFER_NULL_TECH in main/features.c. The reason the
- ; code is not enabled by default is spelled out in the comment
- ; block near the top of main/features.c describing ATXFER_NULL_TECH.
-;atxferloopdelay = 10 ; Number of seconds to sleep between retries (if atxferdropcall = no)
-;atxfercallbackretries = 2 ; Number of times to attempt to send the call back to the transferer.
- ; By default, this is 2.
-
-;
-;*** Define another parking lot
+ ; using Set(CHANNEL(musicclass)=whatever) in the dialplan.
+ ; (Default is 'default' for default parking lot. Non-default parkinglots
+ ; don't specify a class so the class is picked by the channel put on hold
+ ; which has the 'default' class by default.)
+
+
+; EXAMPLE NON-DEFAULT PARKING LOT DEFINITION
;
; You can set parkinglot with the CHANNEL dialplan function
; or by setting 'parkinglot' directly in the channel configuration file.
@@ -113,10 +125,11 @@
;parkpos => 800-850
;findslot => next
+; EXAMPLE DTMF FEATURE MAP
+;
; Note that the DTMF features listed below only work when two channels have answered and are bridged together.
; They can not be used while the remote party is ringing or in progress. If you require this feature you can use
; chan_local in combination with Answer to accomplish it.
-
[featuremap]
;blindxfer => #1 ; Blind transfer (default is #) -- Make sure to set the T and/or t option in the Dial() or Queue() app call!
@@ -125,6 +138,10 @@
;atxfer => *2 ; Attended transfer -- Make sure to set the T and/or t option in the Dial() or Queue() app call!
;parkcall => #72 ; Park call (one step parking) -- Make sure to set the K and/or k option in the Dial() app call!
;automixmon => *3 ; One Touch Record a.k.a. Touch MixMonitor -- Make sure to set the X and/or x option in the Dial() or Queue() app call!
+
+
+; EXAMPLE DYNAMIC FEATURES APPLICATION MAP
+;
[applicationmap]
; Note that the DYNAMIC_FEATURES channel variable must be set to use the features
Modified: team/oej/teapot-1.8/funcs/func_strings.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/funcs/func_strings.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/funcs/func_strings.c (original)
+++ team/oej/teapot-1.8/funcs/func_strings.c Tue Jun 24 06:50:12 2014
@@ -1503,6 +1503,7 @@
AST_APP_ARG(var);
AST_APP_ARG(delimiter);
);
+ const char *stripped_var;
if (!(buf = ast_str_thread_get(&result_buf, 16)) ||
!(previous_value = ast_str_thread_get(&tmp_buf, 16))) {
@@ -1520,8 +1521,15 @@
ast_get_encoded_char(args.delimiter, delimiter, &unused);
}
- varsubst = ast_alloca(strlen(args.var) + 4);
- sprintf(varsubst, "${%s}", args.var);
+ /* UNSHIFT and PUSH act as ways of setting a variable, so we need to be
+ * sure to skip leading underscores if they appear. However, we only want
+ * to skip up to two since that is the maximum number that can be used to
+ * indicate variable inheritance. Any further underscores are part of the
+ * variable name.
+ */
+ stripped_var = args.var + MIN(strspn(args.var, "_"), 2);
+ varsubst = ast_alloca(strlen(stripped_var) + 4);
+ sprintf(varsubst, "${%s}", stripped_var);
ast_str_substitute_variables(&previous_value, 0, chan, varsubst);
if (!ast_str_strlen(previous_value)) {
Modified: team/oej/teapot-1.8/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/include/asterisk/autoconfig.h.in?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/include/asterisk/autoconfig.h.in (original)
+++ team/oej/teapot-1.8/include/asterisk/autoconfig.h.in Tue Jun 24 06:50:12 2014
@@ -1219,6 +1219,11 @@
/* Define to 1 if running on Darwin. */
#undef _DARWIN_UNLIMITED_SELECT
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
Modified: team/oej/teapot-1.8/include/asterisk/tcptls.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/include/asterisk/tcptls.h?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/include/asterisk/tcptls.h (original)
+++ team/oej/teapot-1.8/include/asterisk/tcptls.h Tue Jun 24 06:50:12 2014
@@ -180,6 +180,20 @@
* \return Nothing
*/
void ast_tcptls_stream_set_timeout_sequence(struct ast_tcptls_stream *stream, struct timeval start, int timeout);
+
+/*!
+ * \brief Set the TCP/TLS stream I/O if it can exclusively depend upon the set timeouts.
+ *
+ * \param stream TCP/TLS stream control data.
+ * \param exclusive_input TRUE if stream can exclusively wait for fd input.
+ * Otherwise, the stream will not wait for fd input. It will wait while
+ * trying to send data.
+ *
+ * \note The stream timeouts still need to be set.
+ *
+ * \return Nothing
+ */
+void ast_tcptls_stream_set_exclusive_input(struct ast_tcptls_stream *stream, int exclusive_input);
/*
* describes a server instance
Modified: team/oej/teapot-1.8/main/http.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/main/http.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/main/http.c (original)
+++ team/oej/teapot-1.8/main/http.c Tue Jun 24 06:50:12 2014
@@ -911,6 +911,9 @@
flags = fcntl(ser->fd, F_GETFL);
flags |= O_NONBLOCK;
fcntl(ser->fd, F_SETFL, flags);
+
+ /* We can let the stream wait for data to arrive. */
+ ast_tcptls_stream_set_exclusive_input(ser->stream_cookie, 1);
ast_tcptls_stream_set_timeout_inactivity(ser->stream_cookie, session_inactivity);
Modified: team/oej/teapot-1.8/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/main/manager.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/main/manager.c (original)
+++ team/oej/teapot-1.8/main/manager.c Tue Jun 24 06:50:12 2014
@@ -5129,6 +5129,12 @@
}
ao2_unlock(session);
+ /*
+ * We cannot let the stream exclusively wait for data to arrive.
+ * We have to wake up the task to send async events.
+ */
+ ast_tcptls_stream_set_exclusive_input(ser->stream_cookie, 0);
+
ast_tcptls_stream_set_timeout_sequence(ser->stream_cookie,
ast_tvnow(), authtimeout * 1000);
Modified: team/oej/teapot-1.8/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/main/pbx.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/main/pbx.c (original)
+++ team/oej/teapot-1.8/main/pbx.c Tue Jun 24 06:50:12 2014
@@ -6557,7 +6557,12 @@
e->command = "core show hints";
e->usage =
"Usage: core show hints\n"
- " List registered hints\n";
+ " List registered hints.\n"
+ " Hint details are shown in four columns. In order from left to right, they are:\n"
+ " 1. Hint extension URI.\n"
+ " 2. Mapped device state identifiers.\n"
+ " 3. Current extension state. The aggregate of mapped device states.\n"
+ " 4. Watchers - number of subscriptions and other entities watching this hint.\n";
return NULL;
case CLI_GENERATE:
return NULL;
@@ -6643,7 +6648,13 @@
e->command = "core show hint";
e->usage =
"Usage: core show hint <exten>\n"
- " List registered hint\n";
+ " List registered hint.\n"
+ " Hint details are shown in four columns. In order from left to right, they are:\n"
+ " 1. Hint extension URI.\n"
+ " 2. Mapped device state identifiers.\n"
+ " 3. Current extension state. The aggregate of mapped device states.\n"
+ " 4. Watchers - number of subscriptions and other entities watching this hint.\n";
+
return NULL;
case CLI_GENERATE:
return complete_core_show_hint(a->line, a->word, a->pos, a->n);
Modified: team/oej/teapot-1.8/main/test.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/main/test.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/main/test.c (original)
+++ team/oej/teapot-1.8/main/test.c Tue Jun 24 06:50:12 2014
@@ -185,7 +185,7 @@
return;
}
- fprintf(f, "\t<testcase time=\"%d.%d\" name=\"%s%s\"%s>\n",
+ fprintf(f, "\t<testcase time=\"%u.%u\" name=\"%s%s\"%s>\n",
test->time / 1000, test->time % 1000,
test->info.category, test->info.name,
test->state == AST_TEST_PASS ? "/" : "");
@@ -210,7 +210,7 @@
fprintf(f, "Description: %s\n", test->info.description);
fprintf(f, "Result: %s\n", test_result2str[test->state]);
if (test->state != AST_TEST_NOT_RUN) {
- fprintf(f, "Time: %d\n", test->time);
+ fprintf(f, "Time: %u\n", test->time);
}
if (test->state == AST_TEST_FAIL) {
fprintf(f, "Error Description: %s\n\n", S_OR(ast_str_buffer(test->status_str), "NA"));
@@ -296,7 +296,7 @@
(test->state == AST_TEST_FAIL) ? COLOR_RED : COLOR_GREEN,
0,
sizeof(result_buf));
- ast_cli(cli->fd, "END %s - %s Time: %s%dms Result: %s\n",
+ ast_cli(cli->fd, "END %s - %s Time: %s%ums Result: %s\n",
test->info.category,
test->info.name,
test->time ? "" : "<",
@@ -385,7 +385,7 @@
* http://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo
*/
fprintf(f_xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- fprintf(f_xml, "<testsuite errors=\"0\" time=\"%d.%d\" tests=\"%d\" "
+ fprintf(f_xml, "<testsuite errors=\"0\" time=\"%u.%u\" tests=\"%u\" "
"name=\"AsteriskUnitTests\">\n",
last_results.total_time / 1000, last_results.total_time % 1000,
last_results.total_tests);
@@ -398,11 +398,11 @@
if (f_txt) {
fprintf(f_txt, "Asterisk Version: %s\n", ast_get_version());
fprintf(f_txt, "Asterisk Version Number: %s\n", ast_get_version_num());
- fprintf(f_txt, "Number of Tests: %d\n", last_results.total_tests);
- fprintf(f_txt, "Number of Tests Executed: %d\n", (last_results.total_passed + last_results.total_failed));
- fprintf(f_txt, "Passed Tests: %d\n", last_results.total_passed);
- fprintf(f_txt, "Failed Tests: %d\n", last_results.total_failed);
- fprintf(f_txt, "Total Execution Time: %d\n", last_results.total_time);
+ fprintf(f_txt, "Number of Tests: %u\n", last_results.total_tests);
+ fprintf(f_txt, "Number of Tests Executed: %u\n", (last_results.total_passed + last_results.total_failed));
+ fprintf(f_txt, "Passed Tests: %u\n", last_results.total_passed);
+ fprintf(f_txt, "Failed Tests: %u\n", last_results.total_failed);
+ fprintf(f_txt, "Total Execution Time: %u\n", last_results.total_time);
}
/* export each individual test */
@@ -728,7 +728,7 @@
if (!(last_results.last_passed + last_results.last_failed)) {
ast_cli(a->fd, "--- No Tests Found! ---\n");
}
- ast_cli(a->fd, "\n%d Test(s) Executed %d Passed %d Failed\n",
+ ast_cli(a->fd, "\n%u Test(s) Executed %u Passed %u Failed\n",
(last_results.last_passed + last_results.last_failed),
last_results.last_passed,
last_results.last_failed);
Modified: team/oej/teapot-1.8/pbx/pbx_lua.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/pbx/pbx_lua.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/pbx/pbx_lua.c (original)
+++ team/oej/teapot-1.8/pbx/pbx_lua.c Tue Jun 24 06:50:12 2014
@@ -1526,6 +1526,9 @@
res = AST_MODULE_LOAD_DECLINE;
}
+ if (!res) {
+ ast_log(LOG_NOTICE, "Lua PBX Switch loaded.\n");
+ }
lua_close(L);
return res;
}
@@ -1535,6 +1538,7 @@
ast_context_destroy(NULL, registrar);
ast_unregister_switch(&lua_switch);
lua_free_extensions();
+ ast_log(LOG_NOTICE, "Lua PBX Switch unloaded.\n");
return 0;
}
@@ -1558,7 +1562,7 @@
return AST_MODULE_LOAD_SUCCESS;
}
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Lua PBX Switch",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Lua PBX Switch",
.load = load_module,
.unload = unload_module,
.reload = reload,
Modified: team/oej/teapot-1.8/res/res_musiconhold.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/res/res_musiconhold.c?view=diff&rev=417182&r1=417181&r2=417182
==============================================================================
--- team/oej/teapot-1.8/res/res_musiconhold.c (original)
+++ team/oej/teapot-1.8/res/res_musiconhold.c Tue Jun 24 06:50:12 2014
@@ -1320,7 +1320,7 @@
struct mohclass *mohclass = NULL;
struct moh_files_state *state = chan->music_state;
struct ast_variable *var = NULL;
- int res;
+ int res = 0;
int realtime_possible = ast_check_realtime("musiconhold");
/* The following is the order of preference for which class to use:
@@ -1518,10 +1518,12 @@
ast_set_flag(chan, AST_FLAG_MOH);
- if (mohclass->total_files) {
- res = ast_activate_generator(chan, &moh_file_stream, mohclass);
- } else {
- res = ast_activate_generator(chan, &mohgen, mohclass);
+ if (!state || !state->class || strcmp(mohclass->name, state->class->name)) {
+ if (mohclass->total_files) {
+ res = ast_activate_generator(chan, &moh_file_stream, mohclass);
+ } else {
+ res = ast_activate_generator(chan, &mohgen, mohclass);
+ }
}
mohclass = mohclass_unref(mohclass, "unreffing local reference to mohclass in local_ast_moh_start");
More information about the asterisk-commits
mailing list