[asterisk-commits] russell: branch russell/chan_console r84955 - in /team/russell/chan_console: ...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Oct 7 22:19:41 CDT 2007
Author: russell
Date: Sun Oct 7 22:19:39 2007
New Revision: 84955
URL: http://svn.digium.com/view/asterisk?view=rev&rev=84955
Log:
resolve, reset
Added:
team/russell/chan_console/channels/chan_usbradio.c
- copied unchanged from r84939, trunk/channels/chan_usbradio.c
team/russell/chan_console/channels/xpmr/
- copied from r84939, trunk/channels/xpmr/
team/russell/chan_console/channels/xpmr/sinetabx.h
- copied unchanged from r84939, trunk/channels/xpmr/sinetabx.h
team/russell/chan_console/channels/xpmr/xpmr.c
- copied unchanged from r84939, trunk/channels/xpmr/xpmr.c
team/russell/chan_console/channels/xpmr/xpmr.h
- copied unchanged from r84939, trunk/channels/xpmr/xpmr.h
team/russell/chan_console/channels/xpmr/xpmr_coef.h
- copied unchanged from r84939, trunk/channels/xpmr/xpmr_coef.h
team/russell/chan_console/doc/ss7.txt
- copied unchanged from r84939, trunk/doc/ss7.txt
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/
- copied from r84939, trunk/pbx/ael/ael-test/ael-ntest22/
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/extensions.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/extensions.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/qq.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/qq.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t1/
- copied from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t1/
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t1/a.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t1/a.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t1/b.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t1/b.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t1/c.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t1/c.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t2/
- copied from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t2/
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t2/d.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t2/d.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t2/e.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t2/e.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t2/f.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t2/f.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t3/
- copied from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t3/
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t3/g.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t3/g.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t3/h.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t3/h.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t3/i.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t3/i.ael
team/russell/chan_console/pbx/ael/ael-test/ael-ntest22/t3/j.ael
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ael-ntest22/t3/j.ael
team/russell/chan_console/pbx/ael/ael-test/ref.ael-ntest22
- copied unchanged from r84939, trunk/pbx/ael/ael-test/ref.ael-ntest22
team/russell/chan_console/utils/clicompat.c
- copied unchanged from r84939, trunk/utils/clicompat.c
team/russell/chan_console/utils/hashtest2.c
- copied unchanged from r84939, trunk/utils/hashtest2.c
Modified:
team/russell/chan_console/ (props changed)
team/russell/chan_console/CHANGES
team/russell/chan_console/LICENSE
team/russell/chan_console/Makefile
team/russell/chan_console/Makefile.rules
team/russell/chan_console/UPGRADE.txt
team/russell/chan_console/apps/app_adsiprog.c
team/russell/chan_console/apps/app_authenticate.c
team/russell/chan_console/apps/app_db.c
team/russell/chan_console/apps/app_dial.c
team/russell/chan_console/apps/app_disa.c
team/russell/chan_console/apps/app_flash.c
team/russell/chan_console/apps/app_meetme.c
team/russell/chan_console/apps/app_minivm.c
team/russell/chan_console/apps/app_playback.c
team/russell/chan_console/apps/app_queue.c
team/russell/chan_console/apps/app_sms.c
team/russell/chan_console/apps/app_system.c
team/russell/chan_console/apps/app_voicemail.c
team/russell/chan_console/apps/app_zapscan.c
team/russell/chan_console/build_tools/make_defaults_h
team/russell/chan_console/build_tools/menuselect-deps.in
team/russell/chan_console/build_tools/prep_tarball
team/russell/chan_console/cdr/cdr_csv.c
team/russell/chan_console/cdr/cdr_manager.c
team/russell/chan_console/cdr/cdr_pgsql.c
team/russell/chan_console/cdr/cdr_sqlite3_custom.c
team/russell/chan_console/channels/Makefile
team/russell/chan_console/channels/chan_agent.c
team/russell/chan_console/channels/chan_alsa.c
team/russell/chan_console/channels/chan_features.c
team/russell/chan_console/channels/chan_gtalk.c
team/russell/chan_console/channels/chan_h323.c
team/russell/chan_console/channels/chan_iax2.c
team/russell/chan_console/channels/chan_jingle.c
team/russell/chan_console/channels/chan_local.c
team/russell/chan_console/channels/chan_mgcp.c
team/russell/chan_console/channels/chan_misdn.c
team/russell/chan_console/channels/chan_sip.c
team/russell/chan_console/channels/chan_skinny.c
team/russell/chan_console/channels/chan_zap.c
team/russell/chan_console/channels/iax2-parser.c
team/russell/chan_console/channels/misdn/chan_misdn_config.h
team/russell/chan_console/channels/misdn/isdn_lib.c
team/russell/chan_console/channels/misdn_config.c
team/russell/chan_console/codecs/g722/Makefile
team/russell/chan_console/codecs/gsm/src/long_term.c
team/russell/chan_console/codecs/gsm/src/lpc.c
team/russell/chan_console/configs/http.conf.sample
team/russell/chan_console/configs/jabber.conf.sample
team/russell/chan_console/configs/misdn.conf.sample
team/russell/chan_console/configs/musiconhold.conf.sample
team/russell/chan_console/configs/queues.conf.sample
team/russell/chan_console/configs/res_config_sqlite.conf
team/russell/chan_console/configs/sip.conf.sample
team/russell/chan_console/configs/skinny.conf.sample
team/russell/chan_console/configs/voicemail.conf.sample
team/russell/chan_console/configs/zapata.conf.sample
team/russell/chan_console/configure.ac
team/russell/chan_console/contrib/scripts/safe_asterisk
team/russell/chan_console/doc/CODING-GUIDELINES
team/russell/chan_console/doc/modules.txt
team/russell/chan_console/doc/res_config_sqlite.txt
team/russell/chan_console/doc/tex/extensions.tex
team/russell/chan_console/funcs/func_curl.c
team/russell/chan_console/funcs/func_lock.c
team/russell/chan_console/funcs/func_shell.c
team/russell/chan_console/funcs/func_strings.c
team/russell/chan_console/include/asterisk.h
team/russell/chan_console/include/asterisk/agi.h
team/russell/chan_console/include/asterisk/channel.h
team/russell/chan_console/include/asterisk/devicestate.h
team/russell/chan_console/include/asterisk/doxyref.h
team/russell/chan_console/include/asterisk/event.h
team/russell/chan_console/include/asterisk/file.h
team/russell/chan_console/include/asterisk/jabber.h
team/russell/chan_console/include/asterisk/jingle.h
team/russell/chan_console/include/asterisk/localtime.h
team/russell/chan_console/include/asterisk/lock.h
team/russell/chan_console/include/asterisk/module.h
team/russell/chan_console/include/asterisk/pbx.h
team/russell/chan_console/include/asterisk/res_odbc.h
team/russell/chan_console/include/asterisk/sched.h
team/russell/chan_console/include/asterisk/threadstorage.h
team/russell/chan_console/include/asterisk/utils.h
team/russell/chan_console/main/app.c
team/russell/chan_console/main/ast_expr2.c
team/russell/chan_console/main/ast_expr2.fl
team/russell/chan_console/main/ast_expr2.h
team/russell/chan_console/main/ast_expr2.y
team/russell/chan_console/main/ast_expr2f.c
team/russell/chan_console/main/asterisk.c
team/russell/chan_console/main/astmm.c
team/russell/chan_console/main/astobj2.c
team/russell/chan_console/main/cdr.c
team/russell/chan_console/main/channel.c
team/russell/chan_console/main/cli.c
team/russell/chan_console/main/config.c
team/russell/chan_console/main/db.c
team/russell/chan_console/main/db1-ast/hash/hash.c
team/russell/chan_console/main/dnsmgr.c
team/russell/chan_console/main/dsp.c
team/russell/chan_console/main/file.c
team/russell/chan_console/main/frame.c
team/russell/chan_console/main/http.c
team/russell/chan_console/main/logger.c
team/russell/chan_console/main/manager.c
team/russell/chan_console/main/minimime/minimime.c
team/russell/chan_console/main/minimime/mm_mem.c
team/russell/chan_console/main/minimime/tests/create.c
team/russell/chan_console/main/minimime/tests/parse.c
team/russell/chan_console/main/pbx.c
team/russell/chan_console/main/rtp.c
team/russell/chan_console/main/say.c
team/russell/chan_console/main/sched.c
team/russell/chan_console/main/stdtime/localtime.c
team/russell/chan_console/main/stdtime/tzfile.h
team/russell/chan_console/main/translate.c
team/russell/chan_console/main/utils.c
team/russell/chan_console/makeopts.in
team/russell/chan_console/pbx/ael/ael-test/ref.ael-ntest10
team/russell/chan_console/pbx/ael/ael-test/ref.ael-test1
team/russell/chan_console/pbx/ael/ael-test/ref.ael-test18
team/russell/chan_console/pbx/ael/ael-test/ref.ael-test19
team/russell/chan_console/pbx/ael/ael-test/ref.ael-test2
team/russell/chan_console/pbx/ael/ael-test/ref.ael-test3
team/russell/chan_console/pbx/ael/ael-test/ref.ael-test4
team/russell/chan_console/pbx/ael/ael-test/ref.ael-test5
team/russell/chan_console/pbx/ael/ael-test/ref.ael-test8
team/russell/chan_console/pbx/ael/ael-test/ref.ael-vtest13
team/russell/chan_console/pbx/ael/ael-test/ref.ael-vtest17
team/russell/chan_console/pbx/dundi-parser.c
team/russell/chan_console/pbx/pbx_ael.c
team/russell/chan_console/pbx/pbx_config.c
team/russell/chan_console/pbx/pbx_dundi.c
team/russell/chan_console/pbx/pbx_spool.c
team/russell/chan_console/res/Makefile
team/russell/chan_console/res/ael/ael.flex
team/russell/chan_console/res/ael/ael.tab.c
team/russell/chan_console/res/ael/ael.y
team/russell/chan_console/res/ael/ael_lex.c
team/russell/chan_console/res/ael/pval.c
team/russell/chan_console/res/res_adsi.c
team/russell/chan_console/res/res_agi.c
team/russell/chan_console/res/res_config_odbc.c
team/russell/chan_console/res/res_config_pgsql.c
team/russell/chan_console/res/res_config_sqlite.c
team/russell/chan_console/res/res_features.c
team/russell/chan_console/res/res_jabber.c
team/russell/chan_console/res/res_musiconhold.c
team/russell/chan_console/res/res_odbc.c
team/russell/chan_console/res/res_realtime.c
team/russell/chan_console/utils/ (props changed)
team/russell/chan_console/utils/Makefile
team/russell/chan_console/utils/ael_main.c
team/russell/chan_console/utils/check_expr.c
Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Oct 7 22:19:39 2007
@@ -1,1 +1,1 @@
-/trunk:1-82057
+/trunk:1-84954
Modified: team/russell/chan_console/CHANGES
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/CHANGES?view=diff&rev=84955&r1=84954&r2=84955
==============================================================================
--- team/russell/chan_console/CHANGES (original)
+++ team/russell/chan_console/CHANGES Sun Oct 7 22:19:39 2007
@@ -1,4 +1,4 @@
--------------------------------------------------------------------------------
+------------------------------------------------------------------------------
--- Functionality changes since Asterisk 1.4-beta was branched ----------------
-------------------------------------------------------------------------------
@@ -50,6 +50,7 @@
* New CLI command "core show settings"
* Added 'core show channels count' CLI command.
* Added the ability to set the core debug and verbose values on a per-file basis.
+ * Added 'queue pause member' and 'queue unpause member' CLI commands
SIP changes
-----------
@@ -81,7 +82,10 @@
* Added rtpdest option to CHANNEL() dialplan function.
* Added SIPREFERRINGCONTEXT and SIPREFERREDBYHDR variables which are set when a transfer takes place.
* SIP now adds a header to the CANCEL if the call was answered by another phone
- in the same dial command, or if the new c option in dial() is used.
+ in the same dial command, or if the new c option in dial() is used.
+ * The new default is that 100 Trying is not sent on REGISTER attempts as the RFC specifically
+ states it is not needed. For phones, however, that do require it the registertrying option
+ has been added so it can be enabled.
IAX2 changes
------------
@@ -217,6 +221,7 @@
those carriers that transmit CID via dtmf after a polarity change.
* CID matching information is now shown when doing 'dialplan show'.
* Added zap show version CLI command to chan_zap.
+ * Added setvar support to zapata.conf channel entries.
H.323 Changes
-------------
Modified: team/russell/chan_console/LICENSE
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/LICENSE?view=diff&rev=84955&r1=84954&r2=84955
==============================================================================
--- team/russell/chan_console/LICENSE (original)
+++ team/russell/chan_console/LICENSE Sun Oct 7 22:19:39 2007
@@ -32,7 +32,7 @@
would strongly encourage you to make the same exception that we do).
Specific permission is also granted to link Asterisk with OpenSSL and
-OpenH323.
+OpenH323 and distribute the resulting binary files.
In addition, Asterisk implements two management/control protocols: the
Asterisk Manager Interface (AMI) and the Asterisk Gateway Interface
Modified: team/russell/chan_console/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/Makefile?view=diff&rev=84955&r1=84954&r2=84955
==============================================================================
--- team/russell/chan_console/Makefile (original)
+++ team/russell/chan_console/Makefile Sun Oct 7 22:19:39 2007
@@ -108,6 +108,8 @@
ASTETCDIR=/var/etc/asterisk
ASTLIBDIR=/opt/asterisk/lib
ASTVARLIBDIR=/var/opt/asterisk
+ ASTDBDIR=$(ASTVARLIBDIR)
+ ASTKEYDIR=$(ASTVARLIBDIR)
ASTSPOOLDIR=/var/spool/asterisk
ASTLOGDIR=/var/log/asterisk
ASTHEADERDIR=/opt/asterisk/include
@@ -128,9 +130,12 @@
ifneq ($(findstring BSD,$(OSARCH)),)
ASTVARLIBDIR=$(prefix)/share/asterisk
ASTVARRUNDIR=$(localstatedir)/run/asterisk
+ ASTDBDIR=$(localstatedir)/db/asterisk
else
ASTVARLIBDIR=$(localstatedir)/lib/asterisk
-endif
+ ASTDBDIR=$(ASTVARLIBDIR)
+endif
+ ASTKEYDIR=$(ASTVARLIBDIR)
endif
ifeq ($(ASTDATADIR),)
ASTDATADIR:=$(ASTVARLIBDIR)
@@ -255,6 +260,7 @@
SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
+SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript)
MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags)
@@ -368,6 +374,9 @@
$(SUBDIRS_CLEAN):
@$(MAKE) --no-print-directory -C $(@:-clean=) clean
+$(SUBDIRS_DIST_CLEAN):
+ @$(MAKE) --no-print-directory -C $(@:-dist-clean=) dist-clean
+
clean: $(SUBDIRS_CLEAN)
rm -f defaults.h
rm -f include/asterisk/build.h
@@ -377,7 +386,7 @@
dist-clean: distclean
-distclean: clean
+distclean: $(SUBDIRS_DIST_CLEAN) clean
@$(MAKE) -C menuselect dist-clean
@$(MAKE) -C sounds dist-clean
rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
@@ -556,6 +565,8 @@
echo "astetcdir => $(ASTETCDIR)" ; \
echo "astmoddir => $(MODULES_DIR)" ; \
echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
+ echo "astdbdir => $(ASTDBDIR)" ; \
+ echo "astkeydir => $(ASTKEYDIR)" ; \
echo "astdatadir => $(ASTDATADIR)" ; \
echo "astagidir => $(AGI_DIR)" ; \
echo "astspooldir => $(ASTSPOOLDIR)" ; \
@@ -717,11 +728,11 @@
menuselect/gmenuselect: makeopts menuselect/menuselect.c menuselect/menuselect_gtk.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts
@CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect _gmenuselect CONFIGURE_SILENT="--silent"
-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
+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
@echo "Generating input for menuselect ..."
@build_tools/prep_moduledeps > $@
asterisk.pdf:
$(MAKE) -C doc/tex asterisk.pdf
-.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) menuselect.makeopts
+.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) menuselect.makeopts
Modified: team/russell/chan_console/Makefile.rules
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/Makefile.rules?view=diff&rev=84955&r1=84954&r2=84955
==============================================================================
--- team/russell/chan_console/Makefile.rules (original)
+++ team/russell/chan_console/Makefile.rules Sun Oct 7 22:19:39 2007
@@ -16,6 +16,8 @@
# behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command.
-include $(ASTTOPDIR)/makeopts
+
+.PHONY: dist-clean
ifeq ($(NOISY_BUILD),)
ECHO_PREFIX=@
@@ -107,3 +109,5 @@
%: %.o
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $^ $(PTHREAD_LIBS) $(LIBS)
+
+dist-clean::
Modified: team/russell/chan_console/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/UPGRADE.txt?view=diff&rev=84955&r1=84954&r2=84955
==============================================================================
--- team/russell/chan_console/UPGRADE.txt (original)
+++ team/russell/chan_console/UPGRADE.txt Sun Oct 7 22:19:39 2007
@@ -113,3 +113,8 @@
semicolon, in order to make the Local channel driver compatible with the comma
delimiter change in applications.
+Manager:
+
+* The IAXpeers command output has been changed to more closely resemble the
+ output of the SIPpeers command.
+
Modified: team/russell/chan_console/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_adsiprog.c?view=diff&rev=84955&r1=84954&r2=84955
==============================================================================
--- team/russell/chan_console/apps/app_adsiprog.c (original)
+++ team/russell/chan_console/apps/app_adsiprog.c Sun Oct 7 22:19:39 2007
@@ -228,9 +228,9 @@
static char *get_token(char **buf, char *script, int lineno)
{
- char *tmp = *buf;
- char *keyword;
+ char *tmp = *buf, *keyword;
int quoted = 0;
+
/* Advance past any white space */
while(*tmp && (*tmp < 33))
tmp++;
@@ -260,19 +260,21 @@
static int send_dtmf(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
{
- char dtmfstr[80];
- char *a;
- int bytes=0;
- a = get_token(&args, script, lineno);
- if (!a) {
+ char dtmfstr[80], *a;
+ int bytes = 0;
+
+ if (!(a = get_token(&args, script, lineno))) {
ast_log(LOG_WARNING, "Expecting something to send for SENDDTMF at line %d of %s\n", lineno, script);
return 0;
}
+
if (process_token(dtmfstr, a, sizeof(dtmfstr) - 1, ARG_STRING)) {
ast_log(LOG_WARNING, "Invalid token for SENDDTMF at line %d of %s\n", lineno, script);
return 0;
}
+
a = dtmfstr;
+
while(*a) {
if (strchr(validdtmf, *a)) {
*buf = *a;
@@ -282,21 +284,22 @@
ast_log(LOG_WARNING, "'%c' is not a valid DTMF tone at line %d of %s\n", *a, lineno, script);
a++;
}
+
return bytes;
}
static int goto_line(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
{
- char *page;
- char *gline;
+ char *page = get_token(&args, script, lineno);
+ char *gline = get_token(&args, script, lineno);
int line;
unsigned char cmd;
- page = get_token(&args, script, lineno);
- gline = get_token(&args, script, lineno);
+
if (!page || !gline) {
ast_log(LOG_WARNING, "Expecting page and line number for GOTOLINE at line %d of %s\n", lineno, script);
return 0;
}
+
if (!strcasecmp(page, "INFO")) {
cmd = 0;
} else if (!strcasecmp(page, "COMM")) {
@@ -305,28 +308,31 @@
ast_log(LOG_WARNING, "Expecting either 'INFO' or 'COMM' page, got got '%s' at line %d of %s\n", page, lineno, script);
return 0;
}
+
if (process_token(&line, gline, sizeof(line), ARG_NUMBER)) {
ast_log(LOG_WARNING, "Invalid line number '%s' at line %d of %s\n", gline, lineno, script);
return 0;
}
+
cmd |= line;
buf[0] = 0x8b;
buf[1] = cmd;
+
return 2;
}
static int goto_line_rel(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
{
- char *dir;
- char *gline;
+ char *dir = get_token(&args, script, lineno);
+ char *gline = get_token(&args, script, lineno);
int line;
unsigned char cmd;
- dir = get_token(&args, script, lineno);
- gline = get_token(&args, script, lineno);
+
if (!dir || !gline) {
ast_log(LOG_WARNING, "Expecting direction and number of lines for GOTOLINEREL at line %d of %s\n", lineno, script);
return 0;
}
+
if (!strcasecmp(dir, "UP")) {
cmd = 0;
} else if (!strcasecmp(dir, "DOWN")) {
@@ -335,267 +341,315 @@
ast_log(LOG_WARNING, "Expecting either 'UP' or 'DOWN' direction, got '%s' at line %d of %s\n", dir, lineno, script);
return 0;
}
+
if (process_token(&line, gline, sizeof(line), ARG_NUMBER)) {
ast_log(LOG_WARNING, "Invalid line number '%s' at line %d of %s\n", gline, lineno, script);
return 0;
}
+
cmd |= line;
buf[0] = 0x8c;
buf[1] = cmd;
+
return 2;
}
static int send_delay(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
{
- char *gtime;
+ char *gtime = get_token(&args, script, lineno);
int ms;
- gtime = get_token(&args, script, lineno);
+
if (!gtime) {
ast_log(LOG_WARNING, "Expecting number of milliseconds to wait at line %d of %s\n", lineno, script);
return 0;
}
+
if (process_token(&ms, gtime, sizeof(ms), ARG_NUMBER)) {
ast_log(LOG_WARNING, "Invalid delay milliseconds '%s' at line %d of %s\n", gtime, lineno, script);
return 0;
}
+
buf[0] = 0x90;
+
if (id == 11)
buf[1] = ms / 100;
else
buf[1] = ms / 10;
+
return 2;
}
static int set_state(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
{
- char *gstate;
+ char *gstate = get_token(&args, script, lineno);
int state;
- gstate = get_token(&args, script, lineno);
+
if (!gstate) {
ast_log(LOG_WARNING, "Expecting state number at line %d of %s\n", lineno, script);
return 0;
}
+
if (process_token(&state, gstate, sizeof(state), ARG_NUMBER)) {
ast_log(LOG_WARNING, "Invalid state number '%s' at line %d of %s\n", gstate, lineno, script);
return 0;
}
+
buf[0] = id;
buf[1] = state;
+
return 2;
}
static int cleartimer(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
{
- char *tok;
- tok = get_token(&args, script, lineno);
+ char *tok = get_token(&args, script, lineno);
+
if (tok)
ast_log(LOG_WARNING, "Clearing timer requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
buf[0] = id;
+
/* For some reason the clear code is different slightly */
if (id == 7)
buf[1] = 0x10;
else
buf[1] = 0x00;
+
return 2;
}
static struct adsi_flag *getflagbyname(struct adsi_script *state, char *name, char *script, int lineno, int create)
{
int x;
- for (x=0;x<state->numflags;x++)
+
+ for (x = 0; x < state->numflags; x++) {
if (!strcasecmp(state->flags[x].vname, name))
return &state->flags[x];
+ }
+
/* Return now if we're not allowed to create */
if (!create)
return NULL;
+
if (state->numflags > 6) {
ast_log(LOG_WARNING, "No more flag space at line %d of %s\n", lineno, script);
return NULL;
}
+
ast_copy_string(state->flags[state->numflags].vname, name, sizeof(state->flags[state->numflags].vname));
state->flags[state->numflags].id = state->numflags + 1;
state->numflags++;
+
return &state->flags[state->numflags-1];
}
static int setflag(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
{
- char *tok;
+ char *tok = get_token(&args, script, lineno);
char sname[80];
struct adsi_flag *flag;
- tok = get_token(&args, script, lineno);
+
if (!tok) {
ast_log(LOG_WARNING, "Setting flag requires a flag number at line %d of %s\n", lineno, script);
return 0;
}
+
if (process_token(sname, tok, sizeof(sname) - 1, ARG_STRING)) {
ast_log(LOG_WARNING, "Invalid flag '%s' at line %d of %s\n", tok, lineno, script);
return 0;
}
- flag = getflagbyname(state, sname, script, lineno, 0);
- if (!flag) {
+
+ if (!(flag = getflagbyname(state, sname, script, lineno, 0))) {
ast_log(LOG_WARNING, "Flag '%s' is undeclared at line %d of %s\n", sname, lineno, script);
return 0;
}
+
buf[0] = id;
buf[1] = ((flag->id & 0x7) << 4) | 1;
+
return 2;
}
static int clearflag(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
{
- char *tok;
+ char *tok = get_token(&args, script, lineno);
struct adsi_flag *flag;
char sname[80];
- tok = get_token(&args, script, lineno);
+
if (!tok) {
ast_log(LOG_WARNING, "Clearing flag requires a flag number at line %d of %s\n", lineno, script);
return 0;
}
+
if (process_token(sname, tok, sizeof(sname) - 1, ARG_STRING)) {
ast_log(LOG_WARNING, "Invalid flag '%s' at line %d of %s\n", tok, lineno, script);
return 0;
}
- flag = getflagbyname(state, sname, script, lineno, 0);
- if (!flag) {
+
+ if (!(flag = getflagbyname(state, sname, script, lineno, 0))) {
ast_log(LOG_WARNING, "Flag '%s' is undeclared at line %d of %s\n", sname, lineno, script);
return 0;
}
+
buf[0] = id;
buf[1] = ((flag->id & 0x7) << 4);
+
return 2;
}
static int starttimer(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
{
- char *tok;
+ char *tok = get_token(&args, script, lineno);
int secs;
- tok = get_token(&args, script, lineno);
+
if (!tok) {
ast_log(LOG_WARNING, "Missing number of seconds at line %d of %s\n", lineno, script);
return 0;
}
+
if (process_token(&secs, tok, sizeof(secs), ARG_NUMBER)) {
ast_log(LOG_WARNING, "Invalid number of seconds '%s' at line %d of %s\n", tok, lineno, script);
return 0;
}
+
buf[0] = id;
buf[1] = 0x1;
buf[2] = secs;
+
return 3;
}
static int geteventbyname(char *name)
{
int x;
- for (x=0;x<sizeof(events) / sizeof(events[0]); x++) {
+
+ for (x = 0; x < sizeof(events) / sizeof(events[0]); x++) {
if (!strcasecmp(events[x].name, name))
return events[x].id;
}
+
return 0;
}
static int getjustifybyname(char *name)
{
int x;
- for (x=0;x<sizeof(justify) / sizeof(justify[0]); x++) {
+
+ for (x = 0; x <sizeof(justify) / sizeof(justify[0]); x++) {
if (!strcasecmp(justify[x].name, name))
return justify[x].id;
}
+
return -1;
}
static struct adsi_soft_key *getkeybyname(struct adsi_script *state, char *name, char *script, int lineno)
{
int x;
- for (x=0;x<state->numkeys;x++)
+
+ for (x = 0; x < state->numkeys; x++) {
if (!strcasecmp(state->keys[x].vname, name))
return &state->keys[x];
+ }
+
if (state->numkeys > 61) {
ast_log(LOG_WARNING, "No more key space at line %d of %s\n", lineno, script);
return NULL;
}
+
ast_copy_string(state->keys[state->numkeys].vname, name, sizeof(state->keys[state->numkeys].vname));
state->keys[state->numkeys].id = state->numkeys + 2;
state->numkeys++;
+
return &state->keys[state->numkeys-1];
}
static struct adsi_subscript *getsubbyname(struct adsi_script *state, char *name, char *script, int lineno)
{
int x;
- for (x=0;x<state->numsubs;x++)
+
+ for (x = 0; x < state->numsubs; x++) {
if (!strcasecmp(state->subs[x].vname, name))
return &state->subs[x];
+ }
+
if (state->numsubs > 127) {
ast_log(LOG_WARNING, "No more subscript space at line %d of %s\n", lineno, script);
return NULL;
}
+
ast_copy_string(state->subs[state->numsubs].vname, name, sizeof(state->subs[state->numsubs].vname));
state->subs[state->numsubs].id = state->numsubs;
state->numsubs++;
+
return &state->subs[state->numsubs-1];
}
static struct adsi_state *getstatebyname(struct adsi_script *state, char *name, char *script, int lineno, int create)
{
int x;
- for (x=0;x<state->numstates;x++)
+
+ for (x = 0; x <state->numstates; x++) {
if (!strcasecmp(state->states[x].vname, name))
return &state->states[x];
+ }
+
/* Return now if we're not allowed to create */
if (!create)
return NULL;
+
if (state->numstates > 253) {
ast_log(LOG_WARNING, "No more state space at line %d of %s\n", lineno, script);
return NULL;
}
+
ast_copy_string(state->states[state->numstates].vname, name, sizeof(state->states[state->numstates].vname));
state->states[state->numstates].id = state->numstates + 1;
state->numstates++;
+
return &state->states[state->numstates-1];
}
static struct adsi_display *getdisplaybyname(struct adsi_script *state, char *name, char *script, int lineno, int create)
{
int x;
- for (x=0;x<state->numdisplays;x++)
+
+ for (x = 0; x < state->numdisplays; x++) {
if (!strcasecmp(state->displays[x].vname, name))
return &state->displays[x];
+ }
+
/* Return now if we're not allowed to create */
if (!create)
return NULL;
+
if (state->numdisplays > 61) {
ast_log(LOG_WARNING, "No more display space at line %d of %s\n", lineno, script);
return NULL;
}
+
ast_copy_string(state->displays[state->numdisplays].vname, name, sizeof(state->displays[state->numdisplays].vname));
state->displays[state->numdisplays].id = state->numdisplays + 1;
state->numdisplays++;
+
return &state->displays[state->numdisplays-1];
}
static int showkeys(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
{
- char *tok;
- char newkey[80];
- int bytes;
+ char *tok, newkey[80];
+ int bytes, x, flagid = 0;
unsigned char keyid[6];
- int x;
- int flagid=0;
struct adsi_soft_key *key;
struct adsi_flag *flag;
- for (x=0;x<7;x++) {
+ for (x = 0; x < 7; x++) {
/* Up to 6 key arguments */
- tok = get_token(&args, script, lineno);
- if (!tok)
+ if (!(tok = get_token(&args, script, lineno)))
break;
if (!strcasecmp(tok, "UNLESS")) {
/* Check for trailing UNLESS flag */
- tok = get_token(&args, script, lineno);
- if (!tok) {
+ if (!(tok = get_token(&args, script, lineno))) {
ast_log(LOG_WARNING, "Missing argument for UNLESS clause at line %d of %s\n", lineno, script);
} else if (process_token(newkey, tok, sizeof(newkey) - 1, ARG_STRING)) {
ast_log(LOG_WARNING, "Invalid flag name '%s' at line %d of %s\n", tok, lineno, script);
@@ -616,14 +670,13 @@
continue;
}
- key = getkeybyname(state, newkey, script, lineno);
- if (!key)
+ if (!(key = getkeybyname(state, newkey, script, lineno)))
break;
keyid[x] = key->id;
}
buf[0] = id;
buf[1] = (flagid & 0x7) << 3 | (x & 0x7);
- for (bytes=0;bytes<x;bytes++) {
+ for (bytes = 0; bytes < x; bytes++) {
buf[bytes + 2] = keyid[bytes];
}
return 2 + x;
@@ -631,45 +684,40 @@
static int showdisplay(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
{
- char *tok;
- char dispname[80];
- int line=0;
- int flag=0;
- int cmd = 3;
+ char *tok, dispname[80];
+ int line = 0, flag = 0, cmd = 3;
struct adsi_display *disp;
/* Get display */
- tok = get_token(&args, script, lineno);
- if (!tok || process_token(dispname, tok, sizeof(dispname) - 1, ARG_STRING)) {
+ if (!(tok = get_token(&args, script, lineno)) || process_token(dispname, tok, sizeof(dispname) - 1, ARG_STRING)) {
ast_log(LOG_WARNING, "Invalid display name: %s at line %d of %s\n", tok ? tok : "<nothing>", lineno, script);
return 0;
}
- disp = getdisplaybyname(state, dispname, script, lineno, 0);
- if (!disp) {
+
+ if (!(disp = getdisplaybyname(state, dispname, script, lineno, 0))) {
ast_log(LOG_WARNING, "Display '%s' is undefined at line %d of %s\n", dispname, lineno, script);
return 0;
}
- tok = get_token(&args, script, lineno);
- if (!tok || strcasecmp(tok, "AT")) {
+ if (!(tok = get_token(&args, script, lineno)) || strcasecmp(tok, "AT")) {
ast_log(LOG_WARNING, "Missing token 'AT' at line %d of %s\n", lineno, script);
return 0;
}
+
/* Get line number */
- tok = get_token(&args, script, lineno);
- if (!tok || process_token(&line, tok, sizeof(line), ARG_NUMBER)) {
+ if (!(tok = get_token(&args, script, lineno)) || process_token(&line, tok, sizeof(line), ARG_NUMBER)) {
ast_log(LOG_WARNING, "Invalid line: '%s' at line %d of %s\n", tok ? tok : "<nothing>", lineno, script);
return 0;
}
- tok = get_token(&args, script, lineno);
- if (tok && !strcasecmp(tok, "NOUPDATE")) {
+
+ if ((tok = get_token(&args, script, lineno)) && !strcasecmp(tok, "NOUPDATE")) {
cmd = 1;
tok = get_token(&args, script, lineno);
}
+
if (tok && !strcasecmp(tok, "UNLESS")) {
/* Check for trailing UNLESS flag */
- tok = get_token(&args, script, lineno);
- if (!tok) {
+ if (!(tok = get_token(&args, script, lineno))) {
ast_log(LOG_WARNING, "Missing argument for UNLESS clause at line %d of %s\n", lineno, script);
} else if (process_token(&flag, tok, sizeof(flag), ARG_NUMBER)) {
ast_log(LOG_WARNING, "Invalid flag number '%s' at line %d of %s\n", tok, lineno, script);
@@ -681,13 +729,14 @@
buf[0] = id;
buf[1] = (cmd << 6) | (disp->id & 0x3f);
buf[2] = ((line & 0x1f) << 3) | (flag & 0x7);
+
return 3;
}
static int cleardisplay(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
{
- char *tok;
- tok = get_token(&args, script, lineno);
+ char *tok = get_token(&args, script, lineno);
+
if (tok)
ast_log(LOG_WARNING, "Clearing display requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
@@ -698,8 +747,8 @@
static int digitdirect(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
{
- char *tok;
- tok = get_token(&args, script, lineno);
+ char *tok = get_token(&args, script, lineno);
+
if (tok)
ast_log(LOG_WARNING, "Digitdirect requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
@@ -710,8 +759,8 @@
static int clearcbone(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
{
- char *tok;
- tok = get_token(&args, script, lineno);
+ char *tok = get_token(&args, script, lineno);
+
if (tok)
ast_log(LOG_WARNING, "CLEARCB1 requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
@@ -722,8 +771,8 @@
static int digitcollect(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
{
- char *tok;
- tok = get_token(&args, script, lineno);
+ char *tok = get_token(&args, script, lineno);
+
if (tok)
ast_log(LOG_WARNING, "Digitcollect requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
@@ -734,47 +783,46 @@
static int subscript(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
{
- char *tok;
+ char *tok = get_token(&args, script, lineno);
char subscript[80];
struct adsi_subscript *sub;
- tok = get_token(&args, script, lineno);
+
if (!tok) {
ast_log(LOG_WARNING, "Missing subscript to call at line %d of %s\n", lineno, script);
return 0;
}
+
if (process_token(subscript, tok, sizeof(subscript) - 1, ARG_STRING)) {
ast_log(LOG_WARNING, "Invalid number of seconds '%s' at line %d of %s\n", tok, lineno, script);
return 0;
}
- sub = getsubbyname(state, subscript, script, lineno);
- if (!sub)
- return 0;
+
+ if (!(sub = getsubbyname(state, subscript, script, lineno)))
+ return 0;
+
buf[0] = 0x9d;
buf[1] = sub->id;
+
return 2;
}
static int onevent(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
{
- char *tok;
- char subscript[80];
- char sname[80];
- int sawin=0;
- int event;
- int snums[8];
- int scnt = 0;
- int x;
+ char *tok = get_token(&args, script, lineno);
+ char subscript[80], sname[80];
+ int sawin = 0, event, snums[8], scnt = 0, x;
struct adsi_subscript *sub;
- tok = get_token(&args, script, lineno);
+
if (!tok) {
ast_log(LOG_WARNING, "Missing event for 'ONEVENT' at line %d of %s\n", lineno, script);
return 0;
}
- event = geteventbyname(tok);
- if (event < 1) {
+
+ if ((event = geteventbyname(tok)) < 1) {
ast_log(LOG_WARNING, "'%s' is not a valid event name, at line %d of %s\n", args, lineno, script);
return 0;
}
+
tok = get_token(&args, script, lineno);
while ((!sawin && !strcasecmp(tok, "IN")) ||
(sawin && !strcasecmp(tok, "OR"))) {
@@ -794,8 +842,7 @@
return 0;
}
scnt++;
- tok = get_token(&args, script, lineno);
- if (!tok)
+ if (!(tok = get_token(&args, script, lineno)))
break;
}
if (!tok || strcasecmp(tok, "GOTO")) {
@@ -806,8 +853,7 @@
else
ast_log(LOG_WARNING, "Got '%s' while looking for 'GOTO' or 'IN' at line %d of %s\n", tok, lineno, script);
}
- tok = get_token(&args, script, lineno);
- if (!tok) {
+ if (!(tok = get_token(&args, script, lineno))) {
ast_log(LOG_WARNING, "Missing subscript to call at line %d of %s\n", lineno, script);
return 0;
}
@@ -815,13 +861,12 @@
ast_log(LOG_WARNING, "Invalid subscript '%s' at line %d of %s\n", tok, lineno, script);
return 0;
}
- sub = getsubbyname(state, subscript, script, lineno);
- if (!sub)
+ if (!(sub = getsubbyname(state, subscript, script, lineno)))
return 0;
buf[0] = 8;
buf[1] = event;
buf[2] = sub->id | 0x80;
- for (x=0;x<scnt;x++)
+ for (x = 0; x < scnt; x++)
buf[3 + x] = snums[x];
return 3 + scnt;
}
@@ -896,10 +941,10 @@
static int process_returncode(struct adsi_soft_key *key, char *code, char *args, struct adsi_script *state, char *script, int lineno)
{
[... 30707 lines stripped ...]
More information about the asterisk-commits
mailing list