[svn-commits] mmichelson: branch group/CCSS_Monitor_Restructure r243062 - in /team/group/CC...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon Jan 25 17:43:35 CST 2010
Author: mmichelson
Date: Mon Jan 25 17:43:30 2010
New Revision: 243062
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=243062
Log:
Big manual merge. wtf?
Modified:
team/group/CCSS_Monitor_Restructure/ (props changed)
team/group/CCSS_Monitor_Restructure/addons/chan_ooh323.c
team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooCalls.c
team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooCmdChannel.c
team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooStackCmds.c
team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooStackCmds.h
team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/oochannels.c
team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooh323.c
team/group/CCSS_Monitor_Restructure/build_tools/cflags.xml
team/group/CCSS_Monitor_Restructure/build_tools/menuselect-deps.in
team/group/CCSS_Monitor_Restructure/configure
team/group/CCSS_Monitor_Restructure/configure.ac
team/group/CCSS_Monitor_Restructure/include/asterisk/autoconfig.h.in
team/group/CCSS_Monitor_Restructure/include/asterisk/pbx.h
team/group/CCSS_Monitor_Restructure/main/Makefile
team/group/CCSS_Monitor_Restructure/main/manager.c
team/group/CCSS_Monitor_Restructure/main/pbx.c
team/group/CCSS_Monitor_Restructure/makeopts.in
team/group/CCSS_Monitor_Restructure/pbx/Makefile
team/group/CCSS_Monitor_Restructure/res/Makefile
team/group/CCSS_Monitor_Restructure/res/res_calendar.c
team/group/CCSS_Monitor_Restructure/res/res_phoneprov.c
team/group/CCSS_Monitor_Restructure/tests/test_ast_format_str_reduce.c
team/group/CCSS_Monitor_Restructure/tests/test_heap.c
team/group/CCSS_Monitor_Restructure/tests/test_sched.c
team/group/CCSS_Monitor_Restructure/tests/test_skel.c
team/group/CCSS_Monitor_Restructure/tests/test_substitution.c
Propchange: team/group/CCSS_Monitor_Restructure/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/group/CCSS_Monitor_Restructure/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jan 25 17:43:30 2010
@@ -1,1 +1,1 @@
-/trunk:1-242364
+/trunk:1-243061
Modified: team/group/CCSS_Monitor_Restructure/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/addons/chan_ooh323.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/addons/chan_ooh323.c (original)
+++ team/group/CCSS_Monitor_Restructure/addons/chan_ooh323.c Mon Jan 25 17:43:30 2010
@@ -902,6 +902,10 @@
if(p->callerid_name)
free(p->callerid_name);
p->callerid_name = strdup(ast->connected.id.name);
+ } else if (ast->connected.id.number) {
+ if(p->callerid_name)
+ free(p->callerid_name);
+ p->callerid_name = strdup(ast->connected.id.number);
} else {
ast->connected.id.name = strdup(gCallerID);
if(p->callerid_name)
@@ -1204,6 +1208,13 @@
break;
case AST_CONTROL_SRCUPDATE:
ast_rtp_instance_new_source(p->rtp);
+ break;
+
+ case AST_CONTROL_CONNECTED_LINE:
+ if (gH323Debug)
+ ast_log(LOG_DEBUG, "Sending connected line info for %s (%s)\n",
+ callToken, ast->connected.id.name);
+ ooSetANI(callToken, ast->connected.id.name);
break;
case AST_CONTROL_T38_PARAMETERS:
Modified: team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooCalls.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooCalls.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooCalls.c (original)
+++ team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooCalls.c Mon Jan 25 17:43:30 2010
@@ -371,10 +371,11 @@
}
}
- pctxt = call->msgctxt;
- freeContext(pctxt);
- free(pctxt);
- call->msgctxt = NULL;
+ if ((pctxt = call->msgctxt) != NULL) {
+ freeContext(pctxt);
+ free(pctxt);
+ call->msgctxt = NULL;
+ }
/* May !!!! Fix it !! */
/* free(pctxt); */
Modified: team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooCmdChannel.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooCmdChannel.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooCmdChannel.c (original)
+++ team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooCmdChannel.c Mon Jan 25 17:43:30 2010
@@ -402,6 +402,15 @@
ooSendRequestMode(call, *(int *)cmd.param2);
break;
+ case OO_CMD_SETANI:
+ OOTRACEINFO3("Processing SetANI command %s, ani is %s\n",
+ (char *)cmd.param1, (char *)cmd.param2);
+ if(cmd.param2) {
+ strncpy(call->ourCallerId, cmd.param2, sizeof(call->ourCallerId)-1);
+ call->ourCallerId[sizeof(call->ourCallerId)-1] = '\0';
+ }
+ break;
+
default: OOTRACEERR1("ERROR:Unknown command\n");
}
}
Modified: team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooStackCmds.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooStackCmds.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooStackCmds.c (original)
+++ team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooStackCmds.c Mon Jan 25 17:43:30 2010
@@ -494,6 +494,54 @@
return OO_STKCMD_SUCCESS;
}
+OOStkCmdStat ooSetANI(const char *callToken, const char* ani)
+{
+ OOStackCommand cmd;
+ OOH323CallData *call;
+
+ if(!callToken)
+ {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(!(call = ooFindCallByToken(callToken))) {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(call->CmdChan == 0)
+ {
+ if(ooCreateCallCmdConnection(call) != OO_OK)
+ return OO_STKCMD_CONNECTIONERR;
+ }
+
+ memset(&cmd, 0, sizeof(OOStackCommand));
+ cmd.type = OO_CMD_SETANI;
+
+ cmd.param1 = (void*) malloc(strlen(callToken)+1);
+ cmd.param2 = (void*) malloc(strlen(ani)+1);
+ if(!cmd.param1 || !cmd.param2)
+ {
+ if(cmd.param1) free(cmd.param1); /* Release memory */
+ if(cmd.param2) free(cmd.param2);
+ return OO_STKCMD_MEMERR;
+ }
+ strcpy((char*)cmd.param1, callToken);
+ cmd.plen1 = strlen(callToken);
+ strcpy((char*)cmd.param2, ani);
+ cmd.plen2 = strlen(ani);
+
+ if(ooWriteCallStackCommand(call,&cmd) != OO_OK)
+ {
+ free(cmd.param1);
+ free(cmd.param2);
+ return OO_STKCMD_WRITEERR;
+ }
+ free(cmd.param1);
+ free(cmd.param2);
+
+ return OO_STKCMD_SUCCESS;
+}
+
OOStkCmdStat ooRequestChangeMode(const char *callToken, int isT38Mode)
{
OOStackCommand cmd;
Modified: team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooStackCmds.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooStackCmds.h?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooStackCmds.h (original)
+++ team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooStackCmds.h Mon Jan 25 17:43:30 2010
@@ -67,7 +67,8 @@
OO_CMD_MANUALRINGBACK, /*!< Send Alerting - ringback */
OO_CMD_MANUALPROGRESS, /*!< Send progress */
OO_CMD_STOPMONITOR, /*!< Stop the event monitor */
- OO_CMD_REQMODE /*!< Request new mode */
+ OO_CMD_REQMODE, /*!< Request new mode */
+ OO_CMD_SETANI /*! <Set conncted info */
} OOStackCmdID;
@@ -176,6 +177,8 @@
int ooGenerateOutgoingCallToken (char *callToken, size_t size);
+EXTERN OOStkCmdStat ooSetANI(const char *callToken, const char* ani);
+
#ifdef __cplusplus
}
#endif
Modified: team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/oochannels.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/oochannels.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/oochannels.c (original)
+++ team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/oochannels.c Mon Jan 25 17:43:30 2010
@@ -748,8 +748,9 @@
ast_mutex_lock(&call->Lock);
ooEndCall(call);
ast_mutex_unlock(&call->Lock);
- ooStopMonitorCallChannels(call);
}
+ if(call->callState >= OO_CALL_CLEARED)
+ ooStopMonitorCallChannels(call);
}
return OO_OK;
@@ -1124,7 +1125,7 @@
finishPrint();
removeEventHandler(pctxt);
if(ret == OO_OK) {
- ooHandleH2250Message(call, pmsg);
+ ret = ooHandleH2250Message(call, pmsg);
}
return ret;
}
Modified: team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooh323.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooh323.c (original)
+++ team/group/CCSS_Monitor_Restructure/addons/ooh323c/src/ooh323.c Mon Jan 25 17:43:30 2010
@@ -1533,6 +1533,17 @@
OOTimer *pTimer=NULL;
int type = q931Msg->messageType;
struct timespec ts;
+
+/* checking of message validity for first/next messages of calls */
+
+ if (!strcmp(call->callType, "incoming")) {
+ if ((call->callState != OO_CALL_CREATED && type == Q931SetupMsg) ||
+ (call->callState == OO_CALL_CREATED && type != Q931SetupMsg)) {
+ ooFreeQ931Message(call->msgctxt, q931Msg);
+ return OO_FAILED;
+ }
+ }
+
switch(type)
{
case Q931SetupMsg: /* SETUP message is received */
@@ -1583,6 +1594,8 @@
ooSendCallProceeding(call);/* Send call proceeding message*/
ret = ooH323CallAdmitted (call);
}
+
+ call->callState = OO_CALL_CONNECTING;
} /* end ret == OO_OK */
break;
Modified: team/group/CCSS_Monitor_Restructure/build_tools/cflags.xml
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/build_tools/cflags.xml?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/build_tools/cflags.xml (original)
+++ team/group/CCSS_Monitor_Restructure/build_tools/cflags.xml Mon Jan 25 17:43:30 2010
@@ -9,6 +9,11 @@
<defaultenabled>yes</defaultenabled>
</member>
<member name="DEBUG_FD_LEAKS" displayname="Enable File Descriptor Leak Detection">
+ </member>
+ <member name="REBUILD_PARSERS" displayname="Rebuild AEL and expression parsers from bison/flex source files">
+ <depend>bison</depend>
+ <depend>flex</depend>
+ <defaultenabled>no</defaultenabled>
</member>
<member name="LOW_MEMORY" displayname="Optimize for Low Memory Usage">
</member>
Modified: team/group/CCSS_Monitor_Restructure/build_tools/menuselect-deps.in
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/build_tools/menuselect-deps.in?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/build_tools/menuselect-deps.in (original)
+++ team/group/CCSS_Monitor_Restructure/build_tools/menuselect-deps.in Mon Jan 25 17:43:30 2010
@@ -1,8 +1,10 @@
ALSA=@PBX_ALSA@
BLUETOOTH=@PBX_BLUETOOTH@
CRYPTO=@PBX_CRYPTO@
+BISON=@PBX_BISON@
CURL=@PBX_CURL@
DAHDI=@PBX_DAHDI@
+FLEX=@PBX_FLEX@
FREETDS=@PBX_FREETDS@
GENERIC_ODBC=@PBX_GENERIC_ODBC@
GMIME=@PBX_GMIME@
Modified: team/group/CCSS_Monitor_Restructure/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/configure.ac?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/configure.ac (original)
+++ team/group/CCSS_Monitor_Restructure/configure.ac Mon Jan 25 17:43:30 2010
@@ -183,6 +183,8 @@
fi
AC_SUBST(GNU_LD)
+AC_PATH_PROG([BISON], [bison], :)
+AC_PATH_PROG([FLEX], [flex], :)
AC_PATH_PROG([GREP], [grep], :)
AC_PATH_PROG([FIND], [find], :)
AC_PATH_PROG([COMPRESS], [compress], :)
@@ -207,6 +209,49 @@
fi
fi
AC_SUBST(DOWNLOAD)
+
+AC_CACHE_CHECK([for bison that supports parse-param], [ac_cv_path_BISON2], [
+ if test "x$BISON" != "x:" ; then
+ # Create a temporary directory $tmp in $TMPDIR (default /tmp).
+ # Use mktemp if possible; otherwise fall back on mkdir,
+ # with $RANDOM to make collisions less likely.
+ : ${TMPDIR=/tmp}
+ {
+ tmp=`
+ (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
+ ` &&
+ test -n "$tmp" && test -d "$tmp"
+ } || {
+ tmp=$TMPDIR/foo$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+ } || exit $?
+ cat >$tmp/test.y <<__EOL__
+%parse-param {struct parse_io *parseio}
+%%
+file : { \$\$ = parseio->pval = 1; }
+ ;
+%%
+__EOL__
+ ${BISON} -o ${tmp}/test.tab.c ${tmp}/test.y >/dev/null 2>&1
+ if test -e "${tmp}/test.tab.c"; then
+ ac_cv_path_BISON2=${BISON}
+ fi
+ rm -rf ${tmp}
+ fi
+ ])
+if test "x${ac_cv_path_BISON2}" = "x" ; then
+ BISON=:
+ PBX_BISON=0
+else
+ PBX_BISON=1
+fi
+AC_SUBST(PBX_BISON)
+if test "x${FLEX}" = "x:" ; then
+ PBX_FLEX=0
+else
+ PBX_FLEX=1
+fi
+AC_SUBST(PBX_FLEX)
AC_CHECK_TOOL([SOXMIX], [soxmix], [:])
if test "${SOXMIX}" != ":" ; then
Modified: team/group/CCSS_Monitor_Restructure/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/include/asterisk/autoconfig.h.in?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/include/asterisk/autoconfig.h.in (original)
+++ team/group/CCSS_Monitor_Restructure/include/asterisk/autoconfig.h.in Mon Jan 25 17:43:30 2010
@@ -953,7 +953,7 @@
/* Define to 1 if you have the `strtoq' function. */
#undef HAVE_STRTOQ
-/* Define to 1 if `struct stat' is a member of `st_blksize'. */
+/* Define to 1 if `st_blksize' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
/* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -1284,11 +1284,11 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+
+/* Define to 1 if the C compiler supports function prototypes. */
+#undef PROTOTYPES
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
@@ -1308,6 +1308,11 @@
/* Define to the type of arg 5 for `select'. */
#undef SELECT_TYPE_ARG5
+
+/* Define to 1 if the `setvbuf' function takes the buffering type as its
+ second argument and the buffer pointer as the third, as on System V before
+ release 3. */
+#undef SETVBUF_REVERSED
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
@@ -1329,46 +1334,50 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
-/* Enable extensions on AIX 3, Interix. */
+/* Define to 1 if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
-/* Enable threading extensions on Solaris. */
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Enable extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
-/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
-#undef _LARGEFILE_SOURCE
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
- this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
+
+/* Define like PROTOTYPES; this can be used by system headers. */
+#undef __PROTOTYPES
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
Modified: team/group/CCSS_Monitor_Restructure/include/asterisk/pbx.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/include/asterisk/pbx.h?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/include/asterisk/pbx.h (original)
+++ team/group/CCSS_Monitor_Restructure/include/asterisk/pbx.h Mon Jan 25 17:43:30 2010
@@ -990,8 +990,10 @@
* \brief Add a variable to the channel variable stack, removing the most recently set value for the same name.
* \note Will lock the channel. May also be used to set a channel dialplan function to a particular value.
* \see ast_func_write
- */
-void pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value);
+ * \return -1 if the dialplan function fails to be set
+ * \version 1.8 changed the function to return an error code
+ */
+int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value);
/*!
* \brief Retrieve the value of a builtin variable or variable from the channel variable stack.
Modified: team/group/CCSS_Monitor_Restructure/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/Makefile?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/Makefile (original)
+++ team/group/CCSS_Monitor_Restructure/main/Makefile Mon Jan 25 17:43:30 2010
@@ -11,7 +11,7 @@
# the GNU General Public License
#
--include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps $(ASTTOPDIR)/makeopts.embed_rules
+-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps $(ASTTOPDIR)/makeopts.embed_rules $(ASTTOPDIR)/makeopts
all: asterisk
@@ -101,16 +101,26 @@
db1-ast/libdb1.a: CHECK_SUBDIR
_ASTCFLAGS="$(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS) -Wno-strict-aliasing" $(MAKE) -C db1-ast libdb1.a
+ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
+ast_expr2.c ast_expr2.h: ast_expr2.y
+else
ast_expr2.c ast_expr2.h:
- bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
+endif
+ $(ECHO_PREFIX) echo " [BISON] $< -> $@"
+ $(CMD_PREFIX) $(BISON) -o $@ -d --name-prefix=ast_yy ast_expr2.y
+ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
+ast_expr2f.c: ast_expr2.fl
+else
ast_expr2f.c:
- flex -o $@ ast_expr2.fl
- sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' $@ > $@.fix
- echo "#include \"asterisk.h\"" > $@
- echo >> $@
- cat $@.fix >> $@
- rm $@.fix
+endif
+ $(ECHO_PREFIX) echo " [FLEX] $< -> $@"
+ $(CMD_PREFIX) $(FLEX) -o $@ ast_expr2.fl
+ $(CMD_PREFIX) sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' $@ > $@.fix
+ $(CMD_PREFIX) echo "#include \"asterisk.h\"" > $@
+ $(CMD_PREFIX) echo >> $@
+ $(CMD_PREFIX) cat $@.fix >> $@
+ $(CMD_PREFIX) rm $@.fix
ast_expr2f.o: _ASTCFLAGS+=-Wno-unused
Modified: team/group/CCSS_Monitor_Restructure/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/manager.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/manager.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/manager.c Mon Jan 25 17:43:30 2010
@@ -2800,7 +2800,8 @@
const char *name = astman_get_header(m, "Channel");
const char *varname = astman_get_header(m, "Variable");
const char *varval = astman_get_header(m, "Value");
-
+ int res = 0;
+
if (ast_strlen_zero(varname)) {
astman_send_error(s, m, "No variable specified");
return 0;
@@ -2813,14 +2814,16 @@
}
}
- pbx_builtin_setvar_helper(c, varname, S_OR(varval, ""));
+ res = pbx_builtin_setvar_helper(c, varname, S_OR(varval, ""));
if (c) {
c = ast_channel_unref(c);
}
-
- astman_send_ack(s, m, "Variable Set");
-
+ if (res == 0) {
+ astman_send_ack(s, m, "Variable Set");
+ } else {
+ astman_send_error(s, m, "Variable not set");
+ }
return 0;
}
Modified: team/group/CCSS_Monitor_Restructure/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/pbx.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/pbx.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/pbx.c Mon Jan 25 17:43:30 2010
@@ -9407,7 +9407,7 @@
ast_rwlock_unlock(&globalslock);
}
-void pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
+int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
{
struct ast_var_t *newvariable;
struct varshead *headp;
@@ -9416,8 +9416,7 @@
if (name[strlen(name) - 1] == ')') {
char *function = ast_strdupa(name);
- ast_func_write(chan, function, value);
- return;
+ return ast_func_write(chan, function, value);
}
if (chan) {
@@ -9462,6 +9461,7 @@
ast_channel_unlock(chan);
else
ast_rwlock_unlock(&globalslock);
+ return 0;
}
int pbx_builtin_setvar(struct ast_channel *chan, const char *data)
Modified: team/group/CCSS_Monitor_Restructure/makeopts.in
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/makeopts.in?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/makeopts.in (original)
+++ team/group/CCSS_Monitor_Restructure/makeopts.in Mon Jan 25 17:43:30 2010
@@ -8,6 +8,8 @@
INSTALL=@INSTALL@
AWK=@AWK@
+BISON=@BISON@
+FLEX=@FLEX@
GREP=@GREP@
AR=@AR@
RANLIB=@RANLIB@
Modified: team/group/CCSS_Monitor_Restructure/pbx/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/pbx/Makefile?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/pbx/Makefile (original)
+++ team/group/CCSS_Monitor_Restructure/pbx/Makefile Mon Jan 25 17:43:30 2010
@@ -9,7 +9,7 @@
# the GNU General Public License
#
--include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
+-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps $(ASTTOPDIR)/makeopts
MODULE_PREFIX=pbx
MENUSELECT_CATEGORY=PBX
Modified: team/group/CCSS_Monitor_Restructure/res/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/res/Makefile?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/res/Makefile (original)
+++ team/group/CCSS_Monitor_Restructure/res/Makefile Mon Jan 25 17:43:30 2010
@@ -45,12 +45,22 @@
$(if $(filter res_ael_share,$(EMBEDDED_MODS)),modules.link,res_ael_share.so): ael/ael_lex.o ael/ael.tab.o ael/pval.o
+ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
+ael/ael_lex.c: ael/ael.flex
+else
ael/ael_lex.c:
- (cd ael; flex ael.flex; sed -e "/begin standard C headers/i#include \"asterisk.h\"" ael_lex.c > zz; mv zz ael_lex.c)
- (cd ael; sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' ael_lex.c > zz; mv zz ael_lex.c)
+endif
+ $(ECHO_PREFIX) echo " [FLEX] $< -> $@"
+ $(CMD_PREFIX) (cd ael; $(FLEX) ael.flex; sed -e "/begin standard C headers/i#include \"asterisk.h\"" ael_lex.c > zz; mv zz ael_lex.c)
+ $(CMD_PREFIX) (cd ael; sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' ael_lex.c > zz; mv zz ael_lex.c)
+ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
+ael/ael.tab.c ael/ael.tab.h: ael/ael.y
+else
ael/ael.tab.c ael/ael.tab.h:
- (cd ael; bison -v -d ael.y)
+endif
+ $(ECHO_PREFIX) echo " [BISON] $< -> $@"
+ $(CMD_PREFIX) (cd ael; $(BISON) -v -d ael.y)
ael/pval.o: ael/pval.c
Modified: team/group/CCSS_Monitor_Restructure/res/res_calendar.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/res/res_calendar.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/res/res_calendar.c (original)
+++ team/group/CCSS_Monitor_Restructure/res/res_calendar.c Mon Jan 25 17:43:30 2010
@@ -1647,14 +1647,14 @@
static int load_module(void)
{
+ if (!(calendars = ao2_container_alloc(CALENDAR_BUCKETS, calendar_hash_fn, calendar_cmp_fn))) {
+ ast_log(LOG_ERROR, "Unable to allocate calendars container!\n");
+ return AST_MODULE_LOAD_FAILURE;
+ }
+
if (load_config(NULL)) {
/* We don't have calendar support enabled */
- return 0;
- }
-
- if (!(calendars = ao2_container_alloc(CALENDAR_BUCKETS, calendar_hash_fn, calendar_cmp_fn))) {
- ast_log(LOG_ERROR, "Unable to allocate calendars container!\n");
- return -1;
+ return AST_MODULE_LOAD_DECLINE;
}
ast_mutex_init(&refreshlock);
@@ -1663,7 +1663,7 @@
if (!(sched = sched_context_create())) {
ast_log(LOG_ERROR, "Unable to create sched context\n");
- return -1;
+ return AST_MODULE_LOAD_FAILURE;
}
if (ast_pthread_create_background(&refresh_thread, NULL, do_refresh, NULL) < 0) {
@@ -1682,7 +1682,7 @@
/* Since other modules depend on this, disable unloading */
ast_module_ref(ast_module_info->self);
- return 0;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Asterisk Calendar integration",
.load = load_module,
Modified: team/group/CCSS_Monitor_Restructure/res/res_phoneprov.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/res/res_phoneprov.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/res/res_phoneprov.c (original)
+++ team/group/CCSS_Monitor_Restructure/res/res_phoneprov.c Mon Jan 25 17:43:30 2010
@@ -514,6 +514,7 @@
ast_free(file);
}
+ http_header = ast_str_create(80);
ast_str_set(&http_header, 0, "Content-type: %s\r\n",
route->file->mime_type);
@@ -522,6 +523,7 @@
if (tmp) {
ast_free(tmp);
}
+ ast_free(http_header);
goto out500;
}
ast_str_append(&result, 0, "%s", ast_str_buffer(tmp));
Modified: team/group/CCSS_Monitor_Restructure/tests/test_ast_format_str_reduce.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/tests/test_ast_format_str_reduce.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/tests/test_ast_format_str_reduce.c (original)
+++ team/group/CCSS_Monitor_Restructure/tests/test_ast_format_str_reduce.c Mon Jan 25 17:43:30 2010
@@ -24,7 +24,7 @@
*/
/*** MODULEINFO
- <defaultenabled>no</defaultenabled>
+ <depend>TEST_FRAMEWORK</depend>
***/
#include "asterisk.h"
Modified: team/group/CCSS_Monitor_Restructure/tests/test_heap.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/tests/test_heap.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/tests/test_heap.c (original)
+++ team/group/CCSS_Monitor_Restructure/tests/test_heap.c Mon Jan 25 17:43:30 2010
@@ -24,7 +24,7 @@
*/
/*** MODULEINFO
- <defaultenabled>no</defaultenabled>
+ <depend>TEST_FRAMEWORK</depend>
***/
#include "asterisk.h"
Modified: team/group/CCSS_Monitor_Restructure/tests/test_sched.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/tests/test_sched.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/tests/test_sched.c (original)
+++ team/group/CCSS_Monitor_Restructure/tests/test_sched.c Mon Jan 25 17:43:30 2010
@@ -24,7 +24,7 @@
*/
/*** MODULEINFO
- <defaultenabled>no</defaultenabled>
+ <depend>TEST_FRAMEWORK</depend>
***/
#include "asterisk.h"
Modified: team/group/CCSS_Monitor_Restructure/tests/test_skel.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/tests/test_skel.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/tests/test_skel.c (original)
+++ team/group/CCSS_Monitor_Restructure/tests/test_skel.c Mon Jan 25 17:43:30 2010
@@ -27,7 +27,7 @@
*/
/*** MODULEINFO
- <defaultenabled>no</defaultenabled>
+ <depend>TEST_FRAMEWORK</depend>
***/
#include "asterisk.h"
Modified: team/group/CCSS_Monitor_Restructure/tests/test_substitution.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/tests/test_substitution.c?view=diff&rev=243062&r1=243061&r2=243062
==============================================================================
--- team/group/CCSS_Monitor_Restructure/tests/test_substitution.c (original)
+++ team/group/CCSS_Monitor_Restructure/tests/test_substitution.c Mon Jan 25 17:43:30 2010
@@ -26,7 +26,7 @@
*/
/*** MODULEINFO
- <defaultenabled>no</defaultenabled>
+ <depend>TEST_FRAMEWORK</depend>
***/
#include "asterisk.h"
@@ -42,57 +42,66 @@
#include "asterisk/strings.h"
#include "asterisk/stringfields.h"
#include "asterisk/threadstorage.h"
-#include "asterisk/cli.h"
-
-AST_THREADSTORAGE(buf_buf);
-AST_THREADSTORAGE(var_buf);
-
-static void test_chan_integer(int fd, struct ast_channel *c, int *ifield, const char *expression)
+#include "asterisk/test.h"
+
+static enum ast_test_result_state test_chan_integer(void *status, struct ast_str **err,
+ struct ast_channel *c, int *ifield, const char *expression)
{
int i, okay = 1, value1 = -1, value2 = -1;
char workspace[4096];
- struct ast_str *str = ast_str_thread_get(&buf_buf, 16);
+ struct ast_str *str = ast_str_create(16);
for (i = 0; i < 256; i++) {
*ifield = i;
ast_str_substitute_variables(&str, 0, c, expression);
pbx_substitute_variables_helper(c, expression, workspace, sizeof(workspace));
if (sscanf(workspace, "%d", &value1) != 1 || value1 != i || sscanf(ast_str_buffer(str), "%d", &value2) != 1 || value2 != i) {
- ast_cli(fd, "%s != %s and/or %d != %d != %d\n", ast_str_buffer(str), workspace, value1, value2, i);
+ ast_str_set(err, 0, "%s != %s and/or %d != %d != %d\n", ast_str_buffer(str), workspace, value1, value2, i);
okay = 0;
break;
}
}
- ast_cli(fd, "Testing '%s' . . . . . %s\n", expression, okay ? "passed" : "FAILED");
-}
-
-static void test_chan_string(int fd, struct ast_channel *c, char *cfield, size_t cfieldsize, const char *expression)
+ ast_test_status_update(status, "Testing '%s' . . . . . %s\n", expression, okay ? "passed" : "FAILED");
+
+ ast_free(str);
+
+ return okay ? AST_TEST_PASS : AST_TEST_FAIL;
+}
+
+static enum ast_test_result_state test_chan_string(void *status, struct ast_str **err,
+ struct ast_channel *c, char *cfield, size_t cfieldsize,
+ const char *expression)
{
const char *values[] = { "one", "three", "reallylongdinosaursoundingthingwithwordsinit" };
int i, okay = 1;
char workspace[4096];
- struct ast_str *str = ast_str_thread_get(&buf_buf, 16);
+ struct ast_str *str = ast_str_create(16);
for (i = 0; i < ARRAY_LEN(values); i++) {
ast_copy_string(cfield, values[i], cfieldsize);
ast_str_substitute_variables(&str, 0, c, expression);
pbx_substitute_variables_helper(c, expression, workspace, sizeof(workspace));
if (strcmp(cfield, ast_str_buffer(str)) != 0 || strcmp(cfield, workspace) != 0) {
- ast_cli(fd, "%s != %s != %s\n", cfield, ast_str_buffer(str), workspace);
+ ast_str_set(err, 0, "%s != %s != %s\n", cfield, ast_str_buffer(str), workspace);
okay = 0;
break;
}
}
- ast_cli(fd, "Testing '%s' . . . . . %s\n", expression, okay ? "passed" : "FAILED");
-}
-
-static void test_chan_variable(int fd, struct ast_channel *c, const char *varname)
+ ast_test_status_update(status, "Testing '%s' . . . . . %s\n", expression, okay ? "passed" : "FAILED");
+
+ ast_free(str);
+
+ return okay ? AST_TEST_PASS : AST_TEST_FAIL;
+}
+
+static enum ast_test_result_state test_chan_variable(void *status, struct ast_str **err,
+ struct ast_channel *c, const char *varname)
{
const char *values[] = { "one", "three", "reallylongdinosaursoundingthingwithwordsinit" };
int i, okay = 1;
char workspace[4096];
- struct ast_str *str = ast_str_thread_get(&buf_buf, 16);
- struct ast_str *var = ast_str_thread_get(&var_buf, 16);
+ struct ast_str *str = ast_str_create(16);
+ struct ast_str *var = ast_str_create(16);
ast_str_set(&var, 0, "${%s}", varname);
for (i = 0; i < ARRAY_LEN(values); i++) {
@@ -100,118 +109,167 @@
ast_str_substitute_variables(&str, 0, c, ast_str_buffer(var));
pbx_substitute_variables_helper(c, ast_str_buffer(var), workspace, sizeof(workspace));
if (strcmp(values[i], ast_str_buffer(str)) != 0 || strcmp(values[i], workspace) != 0) {
- ast_cli(fd, "%s != %s != %s\n", values[i], ast_str_buffer(str), workspace);
+ ast_str_set(err, 0, "%s != %s != %s\n", values[i], ast_str_buffer(str), workspace);
okay = 0;
break;
}
}
- ast_cli(fd, "Testing '%s' . . . . . %s\n", ast_str_buffer(var), okay ? "passed" : "FAILED");
-}
-
-static void test_chan_function(int fd, struct ast_channel *c, const char *expression)
+ ast_test_status_update(status, "Testing '%s' . . . . . %s\n", ast_str_buffer(var), okay ? "passed" : "FAILED");
+
+ ast_free(str);
+ ast_free(var);
+
+ return okay ? AST_TEST_PASS : AST_TEST_FAIL;
+}
+
+static enum ast_test_result_state test_chan_function(void *status, struct ast_str **err,
+ struct ast_channel *c, const char *expression)
{
int okay = 1;
char workspace[4096];
- struct ast_str *str = ast_str_thread_get(&buf_buf, 16);
+ struct ast_str *str = ast_str_create(16);
ast_str_substitute_variables(&str, 0, c, expression);
pbx_substitute_variables_helper(c, expression, workspace, sizeof(workspace));
if (strcmp(workspace, ast_str_buffer(str)) != 0) {
- ast_cli(fd, "%s != %s\n", ast_str_buffer(str), workspace);
+ ast_str_set(err, 0, "test_chan_function, expr: '%s' ... %s != %s\n",
+ expression, ast_str_buffer(str), workspace);
okay = 0;
}
- ast_cli(fd, "Testing '%s' . . . . . %s\n", expression, okay ? "passed" : "FAILED");
-}
-
-static void test_2way_function(int fd, struct ast_channel *c, const char *encode1, const char *encode2, const char *decode1, const char *decode2)
-{
- struct ast_str *str = ast_str_thread_get(&buf_buf, 16), *expression = ast_str_alloca(120);
+ ast_test_status_update(status, "Testing '%s' . . . . . %s\n", expression, okay ? "passed" : "FAILED");
+
+ ast_free(str);
+
+ return okay ? AST_TEST_PASS : AST_TEST_FAIL;
+}
+
+static enum ast_test_result_state test_2way_function(void *status, struct ast_str **err,
+ struct ast_channel *c, const char *encode1, const char *encode2,
+ const char *decode1, const char *decode2)
+{
+ struct ast_str *str = ast_str_create(16), *expression = ast_str_alloca(120);
+ int okay;
ast_str_set(&expression, 0, "%s%s%s", encode1, "foobarbaz", encode2);
ast_str_substitute_variables(&str, 0, c, ast_str_buffer(expression));
ast_str_set(&expression, 0, "%s%s%s", decode1, ast_str_buffer(str), decode2);
ast_str_substitute_variables(&str, 0, c, ast_str_buffer(expression));
- ast_cli(fd, "Testing '%s%s' and '%s%s' . . . . . %s\n", encode1, encode2, decode1, decode2, !strcmp(ast_str_buffer(str), "foobarbaz") ? "passed" : "FAILED");
- if (strcmp(ast_str_buffer(str), "foobarbaz")) {
- ast_cli(fd, " '%s' != 'foobarbaz'\n", ast_str_buffer(str));
- }
-}
-
-static void test_expected_result(int fd, struct ast_channel *c, const char *expression, const char *result)
-{
- struct ast_str *str = ast_str_thread_get(&buf_buf, 16);
+
+ okay = !strcmp(ast_str_buffer(str), "foobarbaz");
+
+ ast_test_status_update(status, "Testing '%s%s' and '%s%s' . . . . . %s\n",
+ encode1, encode2, decode1, decode2,
+ okay ? "passed" : "FAILED");
+
+ if (!okay) {
+ ast_str_set(err, 0, " '%s' != 'foobarbaz'\n", ast_str_buffer(str));
+ }
+
+ ast_free(str);
+
+ return okay ? AST_TEST_PASS : AST_TEST_FAIL;
+}
+
+static enum ast_test_result_state test_expected_result(void *status, struct ast_str **err,
+ struct ast_channel *c, const char *expression, const char *result)
+{
+ struct ast_str *str = ast_str_create(16);
+ int okay;
+
ast_str_substitute_variables(&str, 0, c, expression);
- ast_cli(fd, "Testing '%s' ('%s') == '%s' . . . . . %s\n", ast_str_buffer(str), expression, result, !strcmp(ast_str_buffer(str), result) ? "passed" : "FAILED");
-}
-
-static char *handle_cli_test_substitution(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+ okay = !strcmp(ast_str_buffer(str), result);
+
+ ast_test_status_update(status, "Testing '%s' ('%s') == '%s' . . . . . %s\n",
+ ast_str_buffer(str), expression, result,
+ okay ? "passed" : "FAILED");
+
+ if (!okay) {
+ ast_test_status_update(status, "test_expected_result: '%s' != '%s'\n",
+ ast_str_buffer(str), result);
+ }
+
+ ast_free(str);
+
+ return okay ? AST_TEST_PASS : AST_TEST_FAIL;
+}
+
+AST_TEST_DEFINE(test_substitution)
{
struct ast_channel *c;
int i;
+ enum ast_test_result_state res = AST_TEST_PASS;
switch (cmd) {
- case CLI_INIT:
- e->command = "test substitution";
- e->usage = ""
- "Usage: test substitution\n"
- " Test variable and function substitution.\n";
- return NULL;
- case CLI_GENERATE:
- return NULL;
- }
-
- if (a->argc != e->args) {
- return CLI_SHOWUSAGE;
- }
-
- ast_cli(a->fd, "Testing variable substitution ...\n");
+ case TEST_INIT:
+ info->name = "test_substitution";
+ info->category = "main/pbx/";
+ info->summary = "Test variable and function substitution";
+ info->description =
+ "This test executes a variety of variable and function substitutions "
+ "and ensures that the expected results are received.";
+ return AST_TEST_NOT_RUN;
+ case TEST_EXECUTE:
+ break;
+ }
+
+ ast_test_status_update(&args->status_update, "Testing variable substitution ...\n");
+
c = ast_dummy_channel_alloc();
[... 120 lines stripped ...]
More information about the svn-commits
mailing list