[asterisk-commits] russell: branch russell/chan_refcount r110022 - in /team/russell/chan_refcoun...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Mar 19 13:55:39 CDT 2008
Author: russell
Date: Wed Mar 19 13:55:39 2008
New Revision: 110022
URL: http://svn.digium.com/view/asterisk?view=rev&rev=110022
Log:
resolve, reset
Added:
team/russell/chan_refcount/build_tools/cflags-devmode.xml
- copied unchanged from r110020, trunk/build_tools/cflags-devmode.xml
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/
- copied from r110020, trunk/pbx/ael/ael-test/ael-ntest23/
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/extensions.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/extensions.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/qq.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/qq.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t1/
- copied from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t1/
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t1/a.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t1/a.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t1/b.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t1/b.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t1/c.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t1/c.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t2/
- copied from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t2/
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t2/d.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t2/d.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t2/e.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t2/e.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t2/f.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t2/f.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t3/
- copied from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t3/
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t3/g.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t3/g.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t3/h.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t3/h.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t3/i.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t3/i.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest23/t3/j.ael
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ael-ntest23/t3/j.ael
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-ntest23
- copied unchanged from r110020, trunk/pbx/ael/ael-test/ref.ael-ntest23
Removed:
team/russell/chan_refcount/main/minimime/
Modified:
team/russell/chan_refcount/ (props changed)
team/russell/chan_refcount/CHANGES
team/russell/chan_refcount/Makefile
team/russell/chan_refcount/acinclude.m4
team/russell/chan_refcount/apps/app_chanspy.c
team/russell/chan_refcount/apps/app_externalivr.c
team/russell/chan_refcount/apps/app_festival.c
team/russell/chan_refcount/apps/app_meetme.c
team/russell/chan_refcount/apps/app_minivm.c
team/russell/chan_refcount/apps/app_queue.c
team/russell/chan_refcount/apps/app_voicemail.c
team/russell/chan_refcount/build_tools/cflags.xml
team/russell/chan_refcount/build_tools/make_buildopts_h
team/russell/chan_refcount/build_tools/menuselect-deps.in
team/russell/chan_refcount/cdr/cdr_sqlite3_custom.c
team/russell/chan_refcount/channels/chan_agent.c
team/russell/chan_refcount/channels/chan_iax2.c
team/russell/chan_refcount/channels/chan_misdn.c
team/russell/chan_refcount/channels/chan_oss.c
team/russell/chan_refcount/channels/chan_sip.c
team/russell/chan_refcount/channels/chan_skinny.c
team/russell/chan_refcount/channels/chan_zap.c
team/russell/chan_refcount/channels/misdn/isdn_lib.c
team/russell/chan_refcount/channels/misdn/isdn_lib.h
team/russell/chan_refcount/codecs/log2comp.h
team/russell/chan_refcount/configs/queues.conf.sample
team/russell/chan_refcount/configs/res_ldap.conf.sample
team/russell/chan_refcount/configs/sip.conf.sample
team/russell/chan_refcount/configs/sip_notify.conf.sample
team/russell/chan_refcount/configure
team/russell/chan_refcount/configure.ac
team/russell/chan_refcount/contrib/init.d/rc.suse.asterisk
team/russell/chan_refcount/contrib/scripts/dbsep.cgi
team/russell/chan_refcount/doc/externalivr.txt
team/russell/chan_refcount/funcs/func_enum.c
team/russell/chan_refcount/include/asterisk/_private.h
team/russell/chan_refcount/include/asterisk/astmm.h
team/russell/chan_refcount/include/asterisk/astobj.h
team/russell/chan_refcount/include/asterisk/autoconfig.h.in
team/russell/chan_refcount/include/asterisk/channel.h
team/russell/chan_refcount/include/asterisk/dnsmgr.h
team/russell/chan_refcount/include/asterisk/extconf.h
team/russell/chan_refcount/include/asterisk/http.h
team/russell/chan_refcount/include/asterisk/pbx.h
team/russell/chan_refcount/include/asterisk/strings.h
team/russell/chan_refcount/include/asterisk/utils.h
team/russell/chan_refcount/include/jitterbuf.h
team/russell/chan_refcount/main/Makefile
team/russell/chan_refcount/main/asterisk.c
team/russell/chan_refcount/main/channel.c
team/russell/chan_refcount/main/cli.c
team/russell/chan_refcount/main/config.c
team/russell/chan_refcount/main/dial.c
team/russell/chan_refcount/main/features.c
team/russell/chan_refcount/main/http.c
team/russell/chan_refcount/main/jitterbuf.c
team/russell/chan_refcount/main/logger.c
team/russell/chan_refcount/main/manager.c
team/russell/chan_refcount/main/pbx.c
team/russell/chan_refcount/main/rtp.c
team/russell/chan_refcount/main/translate.c
team/russell/chan_refcount/main/utils.c
team/russell/chan_refcount/makeopts.in
team/russell/chan_refcount/res/ael/ael.flex
team/russell/chan_refcount/res/ael/ael_lex.c
team/russell/chan_refcount/res/res_agi.c
team/russell/chan_refcount/res/res_config_ldap.c
team/russell/chan_refcount/res/res_indications.c
team/russell/chan_refcount/res/res_musiconhold.c
team/russell/chan_refcount/res/res_phoneprov.c
team/russell/chan_refcount/res/res_realtime.c
team/russell/chan_refcount/utils/ael_main.c
team/russell/chan_refcount/utils/astman.c
team/russell/chan_refcount/utils/check_expr.c
team/russell/chan_refcount/utils/conf2ael.c
team/russell/chan_refcount/utils/extconf.c
team/russell/chan_refcount/utils/frame.c
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
automerge = *
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Mar 19 13:55:39 2008
@@ -1,1 +1,1 @@
-/trunk:1-104106,104108-108571
+/trunk:1-104106,104108-110021
Modified: team/russell/chan_refcount/CHANGES
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/CHANGES?view=diff&rev=110022&r1=110021&r2=110022
==============================================================================
--- team/russell/chan_refcount/CHANGES (original)
+++ team/russell/chan_refcount/CHANGES Wed Mar 19 13:55:39 2008
@@ -11,6 +11,12 @@
----------------------------------------
* Channels can now be configured using named sections in zapata.conf, just
like other channel drivers, including the use of templates.
+
+PBX Changes
+-----------
+ * It is now possible to specify a pattern match as a hint. Once a phone subscribes
+ to something that matches the pattern a hint will be created using the contents
+ and variables evaluated.
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 1.4.X to Asterisk 1.6.0 -------------
@@ -167,6 +173,8 @@
SIP session.
* Added TCP and TLS support for SIP. See doc/siptls.txt and configs/sip.conf.sample for
more information on how it is used.
+ * Added a new configuration option "authfailureevents" that enables manager events when
+ a peer can't authenticate properly.
IAX2 changes
------------
@@ -337,6 +345,9 @@
* Added a new parameter for member definition, called state_interface. This may be
used so that a member may be called via one interface but have a different interface's
device state reported.
+ * New configuration option: randomperiodicannounce. If a list of periodic announcements is
+ specified by the periodic-announce option, then one will be chosen randomly when it is time
+ to play a periodic announcment
MeetMe Changes
--------------
@@ -399,6 +410,8 @@
or NOCHANNEL if the given channel was not found.
* The silencethreshold setting that was previously configurable in multiple
applications is now settable globally via dsp.conf.
+ * Added ability to communicate over a TCP socket instead of forking a child process for the
+ ExternalIVR application.
Music On Hold Changes
---------------------
Modified: team/russell/chan_refcount/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/Makefile?view=diff&rev=110022&r1=110021&r2=110022
==============================================================================
--- team/russell/chan_refcount/Makefile (original)
+++ team/russell/chan_refcount/Makefile Wed Mar 19 13:55:39 2008
@@ -229,7 +229,7 @@
ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h
ifeq ($(AST_DEVMODE),yes)
- ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT)
+ ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT) -Wmissing-format-attribute -Wformat-security #-Wformat=2
endif
ifneq ($(findstring BSD,$(OSARCH)),)
@@ -350,7 +350,7 @@
@echo "****"
@exit 1
-menuselect.makeopts: menuselect/menuselect menuselect-tree
+menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts
menuselect/menuselect --check-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts
$(MOD_SUBDIRS_EMBED_LDSCRIPT):
@@ -445,7 +445,7 @@
@$(MAKE) -C sounds dist-clean
rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
rm -f makeopts.embed_rules
- rm -f config.log config.status
+ rm -f config.log config.status config.cache
rm -rf autom4te.cache
rm -f include/asterisk/autoconfig.h
rm -f include/asterisk/buildopts.h
@@ -847,7 +847,7 @@
menuselect/makeopts:
$(MAKE_MENUSELECT) makeopts
-menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml configure
+menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml build_tools/cflags-devmode.xml sounds/sounds.xml build_tools/embed_modules.xml configure
@echo "Generating input for menuselect ..."
@echo "<?xml version=\"1.0\"?>" > $@
@echo >> $@
@@ -855,6 +855,9 @@
@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SUBMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SUBMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
@cat build_tools/cflags.xml >> $@
+ @if [ "${AST_DEVMODE}" = "yes" ]; then \
+ cat build_tools/cflags-devmode.xml >> $@; \
+ fi
@cat build_tools/embed_modules.xml >> $@
@cat sounds/sounds.xml >> $@
@echo "</menu>" >> $@
Modified: team/russell/chan_refcount/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/acinclude.m4?view=diff&rev=110022&r1=110021&r2=110022
==============================================================================
--- team/russell/chan_refcount/acinclude.m4 (original)
+++ team/russell/chan_refcount/acinclude.m4 Wed Mar 19 13:55:39 2008
@@ -92,7 +92,7 @@
# AST_C_DEFINE_CHECK([package], [macro name], [header file], [version])
AC_DEFUN([AST_C_DEFINE_CHECK],
[
- if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
+ if test "x${PBX_$1}" != "x1"; then
AC_MSG_CHECKING([for $2 in $3])
saved_cppflags="${CPPFLAGS}"
if test "x${$1_DIR}" != "x"; then
@@ -114,10 +114,11 @@
AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
],
- [ AC_MSG_RESULT(no) ]
+ [ AC_MSG_RESULT(no) ]
)
CPPFLAGS="${saved_cppflags}"
fi
+ AC_SUBST(PBX_$1)
])
@@ -230,7 +231,10 @@
fi
CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
- AC_COMPILE_IFELSE(
+ saved_ldflags="${LDFLAGS}"
+ LDFLAGS="${$1_LIB}"
+
+ AC_LINK_IFELSE(
[ AC_LANG_PROGRAM( [ $5 ],
[ $6; ]
)],
@@ -240,6 +244,7 @@
[]
)
CPPFLAGS="${saved_cppflags}"
+ LDFLAGS="${saved_ldflags}"
else
PBX_$1=1
AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 libraries.])
Modified: team/russell/chan_refcount/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_chanspy.c?view=diff&rev=110022&r1=110021&r2=110022
==============================================================================
--- team/russell/chan_refcount/apps/app_chanspy.c (original)
+++ team/russell/chan_refcount/apps/app_chanspy.c Wed Mar 19 13:55:39 2008
@@ -249,8 +249,10 @@
struct ast_frame *f;
struct ast_silence_generator *silgen = NULL;
- if (ast_check_hangup(chan) || ast_check_hangup(spyee))
+ if (ast_check_hangup(chan) || ast_check_hangup(spyee)) {
+ ast_channel_unlock(spyee);
return 0;
+ }
name = ast_strdupa(spyee->name);
ast_verb(2, "Spying on channel %s\n", name);
@@ -561,8 +563,10 @@
res = ast_streamfile(chan, peer_name, chan->language);
if (!res)
res = ast_waitstream(chan, "");
- if (res)
+ if (res) {
+ chanspy_ds_free(peer_chanspy_ds);
break;
+ }
} else
res = ast_say_character_str(chan, peer_name, "", chan->language);
if ((num = atoi(ptr)))
@@ -577,6 +581,7 @@
goto exit;
} else if (res == -2) {
res = 0;
+ chanspy_ds_free(peer_chanspy_ds);
goto exit;
} else if (res > 1 && spec) {
snprintf(nameprefix, AST_NAME_STRLEN, "%s/%d", spec, res);
Modified: team/russell/chan_refcount/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_externalivr.c?view=diff&rev=110022&r1=110021&r2=110022
==============================================================================
--- team/russell/chan_refcount/apps/app_externalivr.c (original)
+++ team/russell/chan_refcount/apps/app_externalivr.c Wed Mar 19 13:55:39 2008
@@ -52,13 +52,13 @@
static const char *synopsis = "Interfaces with an external IVR application";
static const char *descrip =
-" ExternalIVR(command[,arg[,arg...]]): Forks a process to run the supplied command,\n"
-"and starts a generator on the channel. The generator's play list is\n"
-"controlled by the external application, which can add and clear entries\n"
-"via simple commands issued over its stdout. The external application\n"
-"will receive all DTMF events received on the channel, and notification\n"
-"if the channel is hung up. The application will not be forcibly terminated\n"
-"when the channel is hung up.\n"
+" ExternalIVR(command|ivr://ivrhost[,arg[,arg...]]): Either forks a process\n"
+"to run given command or makes a socket to connect to given host and starts\n"
+"a generator on the channel. The generator's play list is controlled by the\n"
+"external application, which can add and clear entries via simple commands\n"
+"issued over its stdout. The external application will receive all DTMF events\n"
+"received on the channel, and notification if the channel is hung up. The\n"
+"application will not be forcibly terminated when the channel is hung up.\n"
"See doc/externalivr.txt for a protocol specification.\n";
/* XXX the parser in gcc 2.95 gets confused if you don't put a space between 'name' and the comma */
Modified: team/russell/chan_refcount/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_festival.c?view=diff&rev=110022&r1=110021&r2=110022
==============================================================================
--- team/russell/chan_refcount/apps/app_festival.c (original)
+++ team/russell/chan_refcount/apps/app_festival.c Wed Mar 19 13:55:39 2008
@@ -327,11 +327,21 @@
if (!(cachedir = ast_variable_retrieve(cfg, "general", "cachedir"))) {
cachedir = "/tmp/";
}
+
+ data = ast_strdupa(vdata);
+ AST_STANDARD_APP_ARGS(args, data);
+
if (!(festivalcommand = ast_variable_retrieve(cfg, "general", "festivalcommand"))) {
- festivalcommand = "(tts_textasterisk \"%s\" 'file)(quit)\n";
+ const char *startcmd = "(tts_textasterisk \"";
+ const char *endcmd = "\" 'file)(quit)\n";
+
+ strln = strlen(startcmd) + strlen(args.text) + strlen(endcmd) + 1;
+ newfestivalcommand = alloca(strln);
+ snprintf(newfestivalcommand, strln, "%s%s%s", startcmd, args.text, endcmd);
+ festivalcommand = newfestivalcommand;
} else { /* This else parses the festivalcommand that we're sent from the config file for \n's, etc */
int i, j;
- newfestivalcommand = alloca(strlen(festivalcommand) + 1);
+ newfestivalcommand = alloca(strlen(festivalcommand) + strlen(args.text) + 1);
for (i = 0, j = 0; i < strlen(festivalcommand); i++) {
if (festivalcommand[i] == '\\' && festivalcommand[i + 1] == 'n') {
@@ -340,6 +350,10 @@
} else if (festivalcommand[i] == '\\') {
newfestivalcommand[j++] = festivalcommand[i + 1];
i++;
+ } else if (festivalcommand[i] == '%' && festivalcommand[i + 1] == 's') {
+ sprintf(&newfestivalcommand[j], "%s", args.text); /* we know it is big enough */
+ j += strlen(args.text);
+ i++;
} else
newfestivalcommand[j++] = festivalcommand[i];
}
@@ -347,9 +361,6 @@
festivalcommand = newfestivalcommand;
}
- data = ast_strdupa(vdata);
- AST_STANDARD_APP_ARGS(args, data);
-
if (args.interrupt && !strcasecmp(args.interrupt, "any"))
args.interrupt = AST_DIGIT_ANY;
@@ -440,7 +451,8 @@
} else {
ast_debug(1, "Passing text to festival...\n");
fs = fdopen(dup(fd), "wb");
- fprintf(fs, festivalcommand, args.text);
+
+ fprintf(fs, "%s", festivalcommand);
fflush(fs);
fclose(fs);
}
Modified: team/russell/chan_refcount/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_meetme.c?view=diff&rev=110022&r1=110021&r2=110022
==============================================================================
--- team/russell/chan_refcount/apps/app_meetme.c (original)
+++ team/russell/chan_refcount/apps/app_meetme.c Wed Mar 19 13:55:39 2008
@@ -955,9 +955,9 @@
int hr, min, sec;
int i = 0, total = 0;
time_t now;
- char *header_format = "%-14s %-14s %-10s %-8s %-8s %-6s\n";
- char *data_format = "%-12.12s %4.4d %4.4s %02d:%02d:%02d %-8s %-6s\n";
char cmdline[1024] = "";
+#define MC_HEADER_FORMAT "%-14s %-14s %-10s %-8s %-8s %-6s\n"
+#define MC_DATA_FORMAT "%-12.12s %4.4d %4.4s %02d:%02d:%02d %-8s %-6s\n"
switch (cmd) {
case CLI_INIT:
@@ -989,7 +989,7 @@
return CLI_SUCCESS;
}
if (!concise)
- ast_cli(a->fd, header_format, "Conf Num", "Parties", "Marked", "Activity", "Creation", "Locked");
+ ast_cli(a->fd, MC_HEADER_FORMAT, "Conf Num", "Parties", "Marked", "Activity", "Creation", "Locked");
AST_LIST_TRAVERSE(&confs, cnf, list) {
if (cnf->markedusers == 0)
strcpy(cmdline, "N/A ");
@@ -999,7 +999,7 @@
min = ((now - cnf->start) % 3600) / 60;
sec = (now - cnf->start) % 60;
if (!concise)
- ast_cli(a->fd, data_format, cnf->confno, cnf->users, cmdline, hr, min, sec, cnf->isdynamic ? "Dynamic" : "Static", cnf->locked ? "Yes" : "No");
+ ast_cli(a->fd, MC_DATA_FORMAT, cnf->confno, cnf->users, cmdline, hr, min, sec, cnf->isdynamic ? "Dynamic" : "Static", cnf->locked ? "Yes" : "No");
else {
ast_cli(a->fd, "%s!%d!%d!%02d:%02d:%02d!%d!%d\n",
cnf->confno,
Modified: team/russell/chan_refcount/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_minivm.c?view=diff&rev=110022&r1=110021&r2=110022
==============================================================================
--- team/russell/chan_refcount/apps/app_minivm.c (original)
+++ team/russell/chan_refcount/apps/app_minivm.c Wed Mar 19 13:55:39 2008
@@ -1560,10 +1560,10 @@
duration < global_vmminmessage ? "IGNORED" : "OK",
vmu->accountcode
);
- fprintf(txt, logbuf);
+ fprintf(txt, "%s", logbuf);
if (minivmlogfile) {
ast_mutex_lock(&minivmloglock);
- fprintf(minivmlogfile, logbuf);
+ fprintf(minivmlogfile, "%s", logbuf);
ast_mutex_unlock(&minivmloglock);
}
@@ -2475,7 +2475,7 @@
static char *handle_minivm_list_templates(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct minivm_template *this;
- char *output_format = "%-15s %-10s %-10s %-15.15s %-50s\n";
+#define HVLT_OUTPUT_FORMAT "%-15s %-10s %-10s %-15.15s %-50s\n"
int count = 0;
switch (cmd) {
@@ -2498,10 +2498,10 @@
AST_LIST_UNLOCK(&message_templates);
return CLI_FAILURE;
}
- ast_cli(a->fd, output_format, "Template name", "Charset", "Locale", "Attach media", "Subject");
- ast_cli(a->fd, output_format, "-------------", "-------", "------", "------------", "-------");
+ ast_cli(a->fd, HVLT_OUTPUT_FORMAT, "Template name", "Charset", "Locale", "Attach media", "Subject");
+ ast_cli(a->fd, HVLT_OUTPUT_FORMAT, "-------------", "-------", "------", "------------", "-------");
AST_LIST_TRAVERSE(&message_templates, this, list) {
- ast_cli(a->fd, output_format, this->name,
+ ast_cli(a->fd, HVLT_OUTPUT_FORMAT, this->name,
this->charset ? this->charset : "-",
this->locale ? this->locale : "-",
this->attachment ? "Yes" : "No",
@@ -2541,7 +2541,7 @@
static char *handle_minivm_show_users(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct minivm_account *vmu;
- char *output_format = "%-23s %-15s %-15s %-10s %-10s %-50s\n";
+#define HMSU_OUTPUT_FORMAT "%-23s %-15s %-15s %-10s %-10s %-50s\n"
int count = 0;
switch (cmd) {
@@ -2566,14 +2566,14 @@
AST_LIST_UNLOCK(&minivm_accounts);
return CLI_FAILURE;
}
- ast_cli(a->fd, output_format, "User", "E-Template", "P-template", "Zone", "Format", "Full name");
- ast_cli(a->fd, output_format, "----", "----------", "----------", "----", "------", "---------");
+ ast_cli(a->fd, HMSU_OUTPUT_FORMAT, "User", "E-Template", "P-template", "Zone", "Format", "Full name");
+ ast_cli(a->fd, HMSU_OUTPUT_FORMAT, "----", "----------", "----------", "----", "------", "---------");
AST_LIST_TRAVERSE(&minivm_accounts, vmu, list) {
char tmp[256] = "";
if ((a->argc == 3) || ((a->argc == 5) && !strcmp(a->argv[4], vmu->domain))) {
count++;
snprintf(tmp, sizeof(tmp), "%s@%s", vmu->username, vmu->domain);
- ast_cli(a->fd, output_format, tmp, vmu->etemplate ? vmu->etemplate : "-",
+ ast_cli(a->fd, HMSU_OUTPUT_FORMAT, tmp, vmu->etemplate ? vmu->etemplate : "-",
vmu->ptemplate ? vmu->ptemplate : "-",
vmu->zonetag ? vmu->zonetag : "-",
vmu->attachfmt ? vmu->attachfmt : "-",
@@ -2589,7 +2589,7 @@
static char *handle_minivm_show_zones(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct minivm_zone *zone;
- char *output_format = "%-15s %-20s %-45s\n";
+#define HMSZ_OUTPUT_FORMAT "%-15s %-20s %-45s\n"
char *res = CLI_SUCCESS;
switch (cmd) {
@@ -2608,10 +2608,10 @@
AST_LIST_LOCK(&minivm_zones);
if (!AST_LIST_EMPTY(&minivm_zones)) {
- ast_cli(a->fd, output_format, "Zone", "Timezone", "Message Format");
- ast_cli(a->fd, output_format, "----", "--------", "--------------");
+ ast_cli(a->fd, HMSZ_OUTPUT_FORMAT, "Zone", "Timezone", "Message Format");
+ ast_cli(a->fd, HMSZ_OUTPUT_FORMAT, "----", "--------", "--------------");
AST_LIST_TRAVERSE(&minivm_zones, zone, list) {
- ast_cli(a->fd, output_format, zone->name, zone->timezone, zone->msg_format);
+ ast_cli(a->fd, HMSZ_OUTPUT_FORMAT, zone->name, zone->timezone, zone->msg_format);
}
} else {
ast_cli(a->fd, "There are no voicemail zones currently defined\n");
Modified: team/russell/chan_refcount/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_queue.c?view=diff&rev=110022&r1=110021&r2=110022
==============================================================================
--- team/russell/chan_refcount/apps/app_queue.c (original)
+++ team/russell/chan_refcount/apps/app_queue.c Wed Mar 19 13:55:39 2008
@@ -466,6 +466,8 @@
int announcefrequency; /*!< How often to announce their position */
int minannouncefrequency; /*!< The minimum number of seconds between position announcements (def. 15) */
int periodicannouncefrequency; /*!< How often to play periodic announcement */
+ int numperiodicannounce; /*!< The number of periodic announcements configured */
+ int randomperiodicannounce; /*!< Are periodic announcments randomly chosen */
int roundingseconds; /*!< How many seconds do we round to? */
int holdtime; /*!< Current avg holdtime, based on recursive boxcar filter */
int callscompleted; /*!< Number of queue calls completed */
@@ -674,63 +676,31 @@
* Lock interface list find sc, iterate through each queues queue_member list for member to
* update state inside queues
*/
-static void *handle_statechange(struct statechange *sc)
-{
+static int update_status(const char *interface, const int status)
+{
+ struct member *cur;
+ struct ao2_iterator mem_iter, queue_iter;
struct call_queue *q;
- struct member *cur;
- struct ao2_iterator mem_iter;
- struct member_interface *curint;
- struct ao2_iterator queue_iter;
- char *loc;
- char *technology;
-
- technology = ast_strdupa(sc->dev);
- loc = strchr(technology, '/');
- if (loc) {
- *loc++ = '\0';
- } else {
- return NULL;
- }
-
- AST_LIST_LOCK(&interfaces);
- AST_LIST_TRAVERSE(&interfaces, curint, list) {
- char *interface;
- char *slash_pos;
- interface = ast_strdupa(curint->interface);
- if ((slash_pos = strchr(interface, '/')))
- if ((slash_pos = strchr(slash_pos + 1, '/')))
- *slash_pos = '\0';
-
- if (!strcasecmp(interface, sc->dev))
- break;
- }
- AST_LIST_UNLOCK(&interfaces);
-
- if (!curint) {
- ast_debug(3, "Device '%s/%s' changed to state '%d' (%s) but we don't care because they're not a member of any queue.\n", technology, loc, sc->state, devstate2str(sc->state));
- return NULL;
- }
-
- ast_debug(1, "Device '%s/%s' changed to state '%d' (%s)\n", technology, loc, sc->state, devstate2str(sc->state));
+
queue_iter = ao2_iterator_init(queues, 0);
while ((q = ao2_iterator_next(&queue_iter))) {
ao2_lock(q);
mem_iter = ao2_iterator_init(q->members, 0);
while ((cur = ao2_iterator_next(&mem_iter))) {
- char *interface;
+ char *tmp_interface;
char *slash_pos;
- interface = ast_strdupa(cur->state_interface);
+ tmp_interface = ast_strdupa(cur->state_interface);
if ((slash_pos = strchr(interface, '/')))
if ((slash_pos = strchr(slash_pos + 1, '/')))
*slash_pos = '\0';
- if (strcasecmp(sc->dev, interface)) {
+ if (strcasecmp(interface, tmp_interface)) {
ao2_ref(cur, -1);
continue;
}
- if (cur->status != sc->state) {
- cur->status = sc->state;
+ if (cur->status != status) {
+ cur->status = status;
if (q->maskmemberstatus) {
ao2_ref(cur, -1);
continue;
@@ -754,6 +724,49 @@
queue_unref(q);
ao2_unlock(q);
}
+
+ return 0;
+}
+
+/*! \brief set a member's status based on device state of that member's interface*/
+static void *handle_statechange(struct statechange *sc)
+{
+ struct member_interface *curint;
+ char *loc;
+ char *technology;
+
+ technology = ast_strdupa(sc->dev);
+ loc = strchr(technology, '/');
+ if (loc) {
+ *loc++ = '\0';
+ } else {
+ return NULL;
+ }
+
+ AST_LIST_LOCK(&interfaces);
+ AST_LIST_TRAVERSE(&interfaces, curint, list) {
+ char *interface;
+ char *slash_pos;
+ interface = ast_strdupa(curint->interface);
+ if ((slash_pos = strchr(interface, '/')))
+ if ((slash_pos = strchr(slash_pos + 1, '/')))
+ *slash_pos = '\0';
+
+ if (!strcasecmp(interface, sc->dev))
+ break;
+ }
+ AST_LIST_UNLOCK(&interfaces);
+
+ if (!curint) {
+ if (option_debug > 2)
+ ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s) but we don't care because they're not a member of any queue.\n", technology, loc, sc->state, devstate2str(sc->state));
+ return NULL;
+ }
+
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s)\n", technology, loc, sc->state, devstate2str(sc->state));
+
+ update_status(sc->dev, sc->state);
return NULL;
}
@@ -935,6 +948,8 @@
q->weight = 0;
q->timeoutrestart = 0;
q->periodicannouncefrequency = 0;
+ q->randomperiodicannounce = 0;
+ q->numperiodicannounce = 0;
if (!q->members) {
if (q->strategy == QUEUE_STRATEGY_LINEAR)
/* linear strategy depends on order, so we have to place all members in a single bucket */
@@ -1232,16 +1247,20 @@
while ((s = strsep(&buf, ",|"))) {
if (!q->sound_periodicannounce[i])
q->sound_periodicannounce[i] = ast_str_create(16);
- ast_str_set(&q->sound_periodicannounce[i], 0, s);
+ ast_str_set(&q->sound_periodicannounce[i], 0, "%s", s);
i++;
if (i == MAX_PERIODIC_ANNOUNCEMENTS)
break;
}
+ q->numperiodicannounce = i;
} else {
- ast_str_set(&q->sound_periodicannounce[0], 0, val);
+ ast_str_set(&q->sound_periodicannounce[0], 0, "%s", val);
+ q->numperiodicannounce = 1;
}
} else if (!strcasecmp(param, "periodic-announce-frequency")) {
q->periodicannouncefrequency = atoi(val);
+ } else if (!strcasecmp(param, "random-periodic-announce")) {
+ q->randomperiodicannounce = ast_true(val);
} else if (!strcasecmp(param, "retry")) {
q->retry = atoi(val);
if (q->retry <= 0)
@@ -1983,55 +2002,6 @@
}
}
-static int update_status(struct call_queue *q, struct member *member, int status)
-{
- struct member *cur;
- struct ao2_iterator mem_iter;
-
- /* Since a reload could have taken place, we have to traverse the list to
- be sure it's still valid */
- ao2_lock(q);
- mem_iter = ao2_iterator_init(q->members, 0);
- while ((cur = ao2_iterator_next(&mem_iter))) {
- if (member != cur) {
- ao2_ref(cur, -1);
- continue;
- }
-
- cur->status = status;
- if (!q->maskmemberstatus) {
- manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
- "Queue: %s\r\n"
- "Location: %s\r\n"
- "MemberName: %s\r\n"
- "Membership: %s\r\n"
- "Penalty: %d\r\n"
- "CallsTaken: %d\r\n"
- "LastCall: %d\r\n"
- "Status: %d\r\n"
- "Paused: %d\r\n",
- q->name, cur->interface, cur->membername, cur->dynamic ? "dynamic" : cur->realtime ? "realtime": "static",
- cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
- }
- ao2_ref(cur, -1);
- }
- ao2_unlock(q);
- return 0;
-}
-
-static int update_dial_status(struct call_queue *q, struct member *member, int status)
-{
- if (status == AST_CAUSE_BUSY)
- status = AST_DEVICE_BUSY;
- else if (status == AST_CAUSE_UNREGISTERED)
- status = AST_DEVICE_UNAVAILABLE;
- else if (status == AST_CAUSE_NOSUCHDRIVER)
- status = AST_DEVICE_INVALID;
- else
- status = AST_DEVICE_UNKNOWN;
- return update_status(q, member, status);
-}
-
/*!
* \brief traverse all defined queues which have calls waiting and contain this member
* \retval 0 if no other queue has precedence (higher weight)
@@ -2188,7 +2158,8 @@
if (qe->chan->cdr)
ast_cdr_busy(qe->chan->cdr);
tmp->stillgoing = 0;
- update_dial_status(qe->parent, tmp->member, status);
+
+ update_status(tmp->member->state_interface, ast_device_state(tmp->member->state_interface));
ao2_lock(qe->parent);
qe->parent->rrpos++;
@@ -2198,8 +2169,7 @@
(*busies)++;
return 0;
- } else if (status != tmp->oldstatus)
- update_dial_status(qe->parent, tmp->member, status);
+ }
tmp->chan->appl = "AppQueue";
tmp->chan->data = "(Outgoing Line)";
@@ -2388,10 +2358,10 @@
ast_moh_stop(qe->chan);
ast_verb(3, "Playing periodic announcement\n");
-
- /* Check to make sure we have a sound file. If not, reset to the first sound file */
- if (qe->last_periodic_announce_sound >= MAX_PERIODIC_ANNOUNCEMENTS ||
- !qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound] ||
+
+ if (qe->parent->randomperiodicannounce) {
+ qe->last_periodic_announce_sound = ((unsigned long) ast_random()) % qe->parent->numperiodicannounce;
+ } else if (qe->last_periodic_announce_sound >= qe->parent->numperiodicannounce ||
ast_strlen_zero(qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound]->str)) {
qe->last_periodic_announce_sound = 0;
}
@@ -2414,7 +2384,9 @@
qe->last_periodic_announce_time = now;
/* Update the current periodic announcement to the next announcement */
- qe->last_periodic_announce_sound++;
+ if (!qe->parent->randomperiodicannounce) {
+ qe->last_periodic_announce_sound++;
+ }
return res;
}
@@ -2566,8 +2538,6 @@
ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
/* Setup parameters */
o->chan = ast_request(tech, in->nativeformats, stuff, &status);
- if (status != o->oldstatus)
- update_dial_status(qe->parent, o->member, status);
if (!o->chan) {
ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s'\n", tech, stuff);
o->stillgoing = 0;
@@ -3280,8 +3250,8 @@
to = (qe->parent->timeout) ? qe->parent->timeout * 1000 : -1;
orig = to;
++qe->pending;
+ ao2_unlock(qe->parent);
ring_one(qe, outgoing, &numbusies);
- ao2_unlock(qe->parent);
if (use_weight)
ao2_unlock(queues);
lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed);
Modified: team/russell/chan_refcount/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_voicemail.c?view=diff&rev=110022&r1=110021&r2=110022
==============================================================================
--- team/russell/chan_refcount/apps/app_voicemail.c (original)
+++ team/russell/chan_refcount/apps/app_voicemail.c Wed Mar 19 13:55:39 2008
@@ -645,7 +645,6 @@
static char *pagersubject = NULL;
static char fromstring[100];
static char pagerfromstring[100];
-static char emailtitle[100];
static char charset[32] = "ISO-8859-1";
static unsigned char adsifdn[4] = "\x00\x00\x00\x0F";
@@ -2021,9 +2020,6 @@
ast = ast_channel_release(ast);
} else
ast_log(LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
- } else if (!ast_strlen_zero(emailtitle)) {
- fprintf(p, emailtitle, msgnum + 1, mailbox) ;
- fprintf(p, ENDL) ;
} else if (ast_test_flag((&globalflags), VM_PBXSKIP))
fprintf(p, "Subject: New message %d in mailbox %s" ENDL, msgnum + 1, mailbox);
else
@@ -7802,7 +7798,7 @@
static char *handle_voicemail_show_users(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct ast_vm_user *vmu;
- char *output_format = "%-10s %-5s %-25s %-10s %6s\n";
+#define HVSU_OUTPUT_FORMAT "%-10s %-5s %-25s %-10s %6s\n"
const char *context = NULL;
int users_counter = 0;
@@ -7840,7 +7836,7 @@
return CLI_FAILURE;
}
if (a->argc == 3)
- ast_cli(a->fd, output_format, "Context", "Mbox", "User", "Zone", "NewMsg");
+ ast_cli(a->fd, HVSU_OUTPUT_FORMAT, "Context", "Mbox", "User", "Zone", "NewMsg");
else {
int count = 0;
AST_LIST_TRAVERSE(&users, vmu, list) {
@@ -7848,7 +7844,7 @@
count++;
}
if (count) {
- ast_cli(a->fd, output_format, "Context", "Mbox", "User", "Zone", "NewMsg");
+ ast_cli(a->fd, HVSU_OUTPUT_FORMAT, "Context", "Mbox", "User", "Zone", "NewMsg");
} else {
ast_cli(a->fd, "No such voicemail context \"%s\"\n", context);
AST_LIST_UNLOCK(&users);
@@ -7863,7 +7859,7 @@
snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context);
inboxcount(tmp, &newmsgs, &oldmsgs);
snprintf(count, sizeof(count), "%d", newmsgs);
- ast_cli(a->fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count);
+ ast_cli(a->fd, HVSU_OUTPUT_FORMAT, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count);
users_counter++;
}
}
@@ -7876,7 +7872,7 @@
static char *handle_voicemail_show_zones(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct vm_zone *zone;
- char *output_format = "%-15s %-20s %-45s\n";
+#define HVSZ_OUTPUT_FORMAT "%-15s %-20s %-45s\n"
char *res = CLI_SUCCESS;
switch (cmd) {
@@ -7895,9 +7891,9 @@
AST_LIST_LOCK(&zones);
if (!AST_LIST_EMPTY(&zones)) {
- ast_cli(a->fd, output_format, "Zone", "Timezone", "Message Format");
+ ast_cli(a->fd, HVSZ_OUTPUT_FORMAT, "Zone", "Timezone", "Message Format");
AST_LIST_TRAVERSE(&zones, zone, list) {
- ast_cli(a->fd, output_format, zone->name, zone->timezone, zone->msg_format);
+ ast_cli(a->fd, HVSZ_OUTPUT_FORMAT, zone->name, zone->timezone, zone->msg_format);
}
} else {
ast_cli(a->fd, "There are no voicemail zones currently defined\n");
@@ -8017,6 +8013,7 @@
static void mwi_sub_event_cb(const struct ast_event *event, void *userdata)
{
const char *mailbox;
+ const char *context;
uint32_t uniqueid;
unsigned int len;
struct mwi_sub *mwi_sub;
@@ -8028,12 +8025,16 @@
return;
mailbox = ast_event_get_ie_str(event, AST_EVENT_IE_MAILBOX);
+ context = ast_event_get_ie_str(event, AST_EVENT_IE_CONTEXT);
uniqueid = ast_event_get_ie_uint(event, AST_EVENT_IE_UNIQUEID);
len = sizeof(*mwi_sub);
if (!ast_strlen_zero(mailbox))
len += strlen(mailbox);
+ if (!ast_strlen_zero(context))
+ len += strlen(context) + 1; /* Allow for seperator */
+
if (!(mwi_sub = ast_calloc(1, len)))
return;
@@ -8041,6 +8042,11 @@
if (!ast_strlen_zero(mailbox))
strcpy(mwi_sub->mailbox, mailbox);
+ if (!ast_strlen_zero(context)) {
+ strcat(mwi_sub->mailbox, "@");
+ strcat(mwi_sub->mailbox, context);
+ }
+
AST_RWLIST_WRLOCK(&mwi_subs);
AST_RWLIST_INSERT_TAIL(&mwi_subs, mwi_sub, entry);
AST_RWLIST_UNLOCK(&mwi_subs);
@@ -8048,8 +8054,6 @@
static void start_poll_thread(void)
{
- pthread_attr_t attr;
-
mwi_sub_sub = ast_event_subscribe(AST_EVENT_SUB, mwi_sub_event_cb, NULL,
AST_EVENT_IE_EVENTTYPE, AST_EVENT_IE_PLTYPE_UINT, AST_EVENT_MWI,
AST_EVENT_IE_END);
@@ -8063,9 +8067,7 @@
poll_thread_run = 1;
- pthread_attr_init(&attr);
- ast_pthread_create(&poll_thread, &attr, mb_poll_thread, NULL);
- pthread_attr_destroy(&attr);
+ ast_pthread_create(&poll_thread, NULL, mb_poll_thread, NULL);
}
static void stop_poll_thread(void)
@@ -8714,7 +8716,6 @@
}
memset(fromstring, 0, sizeof(fromstring));
memset(pagerfromstring, 0, sizeof(pagerfromstring));
- memset(emailtitle, 0, sizeof(emailtitle));
strcpy(charset, "ISO-8859-1");
if (emailbody) {
ast_free(emailbody);
@@ -8752,13 +8753,10 @@
memcpy(&adsisec[x], &tmpadsi[x], 1);
}
}
- if ((val = ast_variable_retrieve(cfg, "general", "adsiver")))
+ if ((val = ast_variable_retrieve(cfg, "general", "adsiver"))) {
[... 4456 lines stripped ...]
More information about the asterisk-commits
mailing list