[asterisk-commits] oej: branch oej/sipregister r44755 - in /team/oej/sipregister: ./ apps/ cdr/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Oct 9 04:27:22 MST 2006


Author: oej
Date: Mon Oct  9 06:27:21 2006
New Revision: 44755

URL: http://svn.digium.com/view/asterisk?rev=44755&view=rev
Log:
Update

Added:
    team/oej/sipregister/configs/gtalk.conf.sample
      - copied unchanged from r44717, trunk/configs/gtalk.conf.sample
    team/oej/sipregister/configs/h323.conf.sample
      - copied unchanged from r44717, trunk/configs/h323.conf.sample
    team/oej/sipregister/configs/users.conf.sample
      - copied unchanged from r44717, trunk/configs/users.conf.sample
    team/oej/sipregister/res/res_limit.c
      - copied unchanged from r44717, trunk/res/res_limit.c
    team/oej/sipregister/res/res_realtime.c
      - copied unchanged from r44717, trunk/res/res_realtime.c
Removed:
    team/oej/sipregister/main/jitterbuf.h
Modified:
    team/oej/sipregister/   (props changed)
    team/oej/sipregister/.cleancount
    team/oej/sipregister/CHANGES
    team/oej/sipregister/Makefile.moddir_rules
    team/oej/sipregister/Makefile.rules
    team/oej/sipregister/README
    team/oej/sipregister/acinclude.m4
    team/oej/sipregister/apps/app_rpt.c
    team/oej/sipregister/cdr/cdr_csv.c
    team/oej/sipregister/cdr/cdr_custom.c
    team/oej/sipregister/cdr/cdr_manager.c
    team/oej/sipregister/cdr/cdr_odbc.c
    team/oej/sipregister/cdr/cdr_pgsql.c
    team/oej/sipregister/cdr/cdr_radius.c
    team/oej/sipregister/cdr/cdr_tds.c
    team/oej/sipregister/channels/chan_h323.c
    team/oej/sipregister/channels/chan_sip.c
    team/oej/sipregister/channels/h323/ast_h323.cxx
    team/oej/sipregister/channels/h323/ast_h323.h
    team/oej/sipregister/channels/h323/chan_h323.h
    team/oej/sipregister/codecs/Makefile
    team/oej/sipregister/codecs/codec_gsm.c
    team/oej/sipregister/codecs/codec_ilbc.c
    team/oej/sipregister/codecs/codec_lpc10.c
    team/oej/sipregister/codecs/codec_speex.c
    team/oej/sipregister/codecs/gsm/Makefile
    team/oej/sipregister/codecs/ilbc/Makefile
    team/oej/sipregister/codecs/lpc10/Makefile
    team/oej/sipregister/configs/alsa.conf.sample
    team/oej/sipregister/configs/cdr.conf.sample
    team/oej/sipregister/configs/dundi.conf.sample
    team/oej/sipregister/configs/enum.conf.sample
    team/oej/sipregister/configs/extensions.ael.sample
    team/oej/sipregister/configs/extensions.conf.sample
    team/oej/sipregister/configs/features.conf.sample
    team/oej/sipregister/configs/func_odbc.conf.sample
    team/oej/sipregister/configs/iax.conf.sample
    team/oej/sipregister/configs/indications.conf.sample
    team/oej/sipregister/configs/logger.conf.sample
    team/oej/sipregister/configs/manager.conf.sample
    team/oej/sipregister/configs/mgcp.conf.sample
    team/oej/sipregister/configs/misdn.conf.sample
    team/oej/sipregister/configs/muted.conf.sample
    team/oej/sipregister/configs/osp.conf.sample
    team/oej/sipregister/configs/oss.conf.sample
    team/oej/sipregister/configs/phone.conf.sample
    team/oej/sipregister/configs/queues.conf.sample
    team/oej/sipregister/configs/res_odbc.conf.sample
    team/oej/sipregister/configs/sip.conf.sample
    team/oej/sipregister/configs/skinny.conf.sample
    team/oej/sipregister/configs/smdi.conf.sample
    team/oej/sipregister/configs/voicemail.conf.sample
    team/oej/sipregister/configs/vpb.conf.sample
    team/oej/sipregister/configs/zapata.conf.sample
    team/oej/sipregister/contrib/init.d/rc.redhat.asterisk
    team/oej/sipregister/formats/format_g723.c
    team/oej/sipregister/formats/format_ogg_vorbis.c
    team/oej/sipregister/formats/format_pcm.c
    team/oej/sipregister/funcs/func_callerid.c
    team/oej/sipregister/include/asterisk.h
    team/oej/sipregister/include/asterisk/adsi.h
    team/oej/sipregister/include/asterisk/agi.h
    team/oej/sipregister/include/asterisk/autoconfig.h.in
    team/oej/sipregister/include/asterisk/callerid.h
    team/oej/sipregister/include/asterisk/cli.h
    team/oej/sipregister/include/asterisk/compiler.h
    team/oej/sipregister/include/asterisk/frame.h
    team/oej/sipregister/include/asterisk/jabber.h
    team/oej/sipregister/include/asterisk/linkedlists.h
    team/oej/sipregister/include/asterisk/lock.h
    team/oej/sipregister/include/asterisk/logger.h
    team/oej/sipregister/include/asterisk/pbx.h
    team/oej/sipregister/include/asterisk/strings.h
    team/oej/sipregister/include/asterisk/threadstorage.h
    team/oej/sipregister/main/Makefile
    team/oej/sipregister/main/acl.c
    team/oej/sipregister/main/app.c
    team/oej/sipregister/main/asterisk.c
    team/oej/sipregister/main/astmm.c
    team/oej/sipregister/main/autoservice.c
    team/oej/sipregister/main/callerid.c
    team/oej/sipregister/main/cdr.c
    team/oej/sipregister/main/channel.c
    team/oej/sipregister/main/cli.c
    team/oej/sipregister/main/config.c
    team/oej/sipregister/main/db.c
    team/oej/sipregister/main/db1-ast/Makefile
    team/oej/sipregister/main/devicestate.c
    team/oej/sipregister/main/dns.c
    team/oej/sipregister/main/dnsmgr.c
    team/oej/sipregister/main/dsp.c
    team/oej/sipregister/main/enum.c
    team/oej/sipregister/main/file.c
    team/oej/sipregister/main/frame.c
    team/oej/sipregister/main/http.c
    team/oej/sipregister/main/image.c
    team/oej/sipregister/main/io.c
    team/oej/sipregister/main/loader.c
    team/oej/sipregister/main/logger.c
    team/oej/sipregister/main/manager.c
    team/oej/sipregister/main/pbx.c
    team/oej/sipregister/main/rtp.c
    team/oej/sipregister/main/say.c
    team/oej/sipregister/main/sched.c
    team/oej/sipregister/main/slinfactory.c
    team/oej/sipregister/main/strcompat.c
    team/oej/sipregister/main/term.c
    team/oej/sipregister/main/translate.c
    team/oej/sipregister/main/udptl.c
    team/oej/sipregister/main/utils.c
    team/oej/sipregister/makeopts.in
    team/oej/sipregister/res/Makefile
    team/oej/sipregister/res/res_adsi.c
    team/oej/sipregister/res/res_agi.c
    team/oej/sipregister/res/res_clioriginate.c
    team/oej/sipregister/res/res_config_odbc.c
    team/oej/sipregister/res/res_config_pgsql.c
    team/oej/sipregister/res/res_convert.c
    team/oej/sipregister/res/res_crypto.c
    team/oej/sipregister/res/res_features.c
    team/oej/sipregister/res/res_indications.c
    team/oej/sipregister/res/res_jabber.c
    team/oej/sipregister/res/res_monitor.c
    team/oej/sipregister/res/res_musiconhold.c
    team/oej/sipregister/res/res_odbc.c
    team/oej/sipregister/res/res_smdi.c
    team/oej/sipregister/res/res_snmp.c
    team/oej/sipregister/utils/   (props changed)
    team/oej/sipregister/utils/muted.c

Propchange: team/oej/sipregister/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/sipregister/
            ('branch-1.2-blocked' removed)

Propchange: team/oej/sipregister/
            ('branch-1.2-merged' removed)

Propchange: team/oej/sipregister/
------------------------------------------------------------------------------
    branch-1.4-blocked = /branches/1.4:43484,43510,43582,43626,43703,43756,44023

Propchange: team/oej/sipregister/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/oej/sipregister/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Oct  9 06:27:21 2006
@@ -1,1 +1,1 @@
-/trunk:1-41490
+/trunk:1-44726

Modified: team/oej/sipregister/.cleancount
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/.cleancount?rev=44755&r1=44754&r2=44755&view=diff
==============================================================================
--- team/oej/sipregister/.cleancount (original)
+++ team/oej/sipregister/.cleancount Mon Oct  9 06:27:21 2006
@@ -1,1 +1,1 @@
-22
+25

Modified: team/oej/sipregister/CHANGES
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/CHANGES?rev=44755&r1=44754&r2=44755&view=diff
==============================================================================
--- team/oej/sipregister/CHANGES (original)
+++ team/oej/sipregister/CHANGES Mon Oct  9 06:27:21 2006
@@ -37,3 +37,6 @@
      Read() - timeout now can be floating pt.
      WaitForRing() now takes floating pt timeout arg.
      SpeechBackground() -- clarified in the docstrings that the timeout is an integer seconds.
+  * Extend CALLERID() function with "pres" and "ton" parameters to
+     fetch string representation of calling number presentation indicator
+     and numeric representation of type of calling number value.

Modified: team/oej/sipregister/Makefile.moddir_rules
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/Makefile.moddir_rules?rev=44755&r1=44754&r2=44755&view=diff
==============================================================================
--- team/oej/sipregister/Makefile.moddir_rules (original)
+++ team/oej/sipregister/Makefile.moddir_rules Mon Oct  9 06:27:21 2006
@@ -12,11 +12,11 @@
 #
 
 ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
-  CFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
+  ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
 endif
 
 ifeq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
-  CFLAGS+=${GC_CFLAGS}
+  ASTCFLAGS+=${GC_CFLAGS}
 endif
 
 ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),)
@@ -27,35 +27,18 @@
 
 comma:=,
 
-define module_o_template
-$(2): $(3)
-$(2): CFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
-endef
+$(addsuffix .o,$(C_MODS)): ASTCFLAGS+=-DAST_MODULE=\"$*\" $(MENUSELECT_OPTS_$*:%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_INCLUDE))
+$(addsuffix .oo,$(CC_MODS)): ASTCFLAGS+=-DAST_MODULE=\"$*\" $(MENUSELECT_OPTS_$*:%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_INCLUDE))
 
-define module_so_template
-$(1)=$(1).so
-$(1).so: CFLAGS+=-fPIC
-$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
-$(1).so: $(2)
-endef
+$(LOADABLE_MODS:%=%.so): ASTCFLAGS+=-fPIC
+$(LOADABLE_MODS:%=%.so): LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_LIB))
+$(LOADABLE_MODS:%=%.so): ASTLDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_LDFLAGS))
 
-define module_a_template
-$(1)=modules.link
-modules.link: $(2)
-endef
+$(addsuffix .so,$(filter $(LOADABLE_MODS),$(C_MODS))): %.so: %.o
+$(addsuffix .so,$(filter $(LOADABLE_MODS),$(CC_MODS))): %.so: %.oo
 
-$(foreach mod,$(C_MODS),$(eval $(call module_o_template,$(mod),$(mod).o,$(mod).c)))
-
-$(foreach mod,$(CC_MODS),$(eval $(call module_o_template,$(mod),$(mod).oo,$(mod).cc)))
-
-$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_so_template,$(mod),$(mod).o)))
-
-$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_so_template,$(mod),$(mod).oo)))
-
-$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_a_template,$(mod),$(mod).o)))
-
-$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_a_template,$(mod),$(mod).oo)))
+modules.link: $(addsuffix .o,$(filter $(EMBEDDED_MODS),$(C_MODS)))
+modules.link: $(addsuffix .oo,$(filter $(EMBEDDED_MODS),$(CC_MODS)))
 
 .PHONY: clean clean-depend depend uninstall _all
 
@@ -81,7 +64,8 @@
 
 modules.link:
 	@rm -f $@
-	@for file in $(patsubst $(ASTTOPDIR)/%,%,$(realpath $^)); do echo "INPUT (../$${file})" >> $@; done
+	@for file in $(patsubst %,$(SUBDIR)/%,$(filter %.o,$^)); do echo "INPUT (../$${file})" >> $@; done
+	@for file in $(patsubst %,$(SUBDIR)/%,$(filter-out %.o,$^)); do echo "INPUT (../$${file})" >> $@; done
 
 clean-depend::
 	rm -f .depend
@@ -95,9 +79,11 @@
 
 uninstall::
 
--include .depend
+ifneq ($(wildcard .depend),)
+  include .depend
+endif
 
 depend: .depend
 
 .depend:
-	../build_tools/mkdep $(CFLAGS) `ls *.c *.cc 2> /dev/null`
+	../build_tools/mkdep $(ASTCFLAGS) `ls *.c *.cc 2> /dev/null`

Modified: team/oej/sipregister/Makefile.rules
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/Makefile.rules?rev=44755&r1=44754&r2=44755&view=diff
==============================================================================
--- team/oej/sipregister/Makefile.rules (original)
+++ team/oej/sipregister/Makefile.rules Mon Oct  9 06:27:21 2006
@@ -15,7 +15,7 @@
 # Prefixing one or the other with @\# or @ or nothing makes the desired
 # behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command.
 
-include $(ASTTOPDIR)/makeopts
+-include $(ASTTOPDIR)/makeopts
 
 ifeq ($(NOISY_BUILD),)
    ECHO_PREFIX=@
@@ -33,68 +33,33 @@
 #K6OPT=-DK6OPT
 
 OPTIMIZE?=-O6
-CFLAGS+=$(OPTIMIZE)
+ASTCFLAGS+=$(OPTIMIZE)
 endif
 
-define ast_make_o_c
-$(1): $(2)
-	$(ECHO_PREFIX) echo "   [CC] $$< -> $$@"
-	$(CMD_PREFIX) $$(CC) -o $$@ -c $$< $$(CFLAGS)
-endef
+%.o: %.c
+	$(ECHO_PREFIX) echo "   [CC] $< -> $@"
+	$(CMD_PREFIX) $(CC) -o $@ -c $< $(ASTCFLAGS)
 
-define ast_make_oo_cc
-$(1): $(2)
-	$(ECHO_PREFIX) echo "   [CXX] $$< -> $$@"
-	$(CMD_PREFIX) $$(CXX) -o $$@ -c $$< $$(CFLAGS)
-endef
+%.oo: %.cc
+	$(ECHO_PREFIX) echo "   [CXX] $< -> $@"
+	$(CMD_PREFIX) $(CXX) -o $@ -c $< $(ASTCFLAGS)
 
-define ast_make_c_y
-$(1): $(2)
-	$(ECHO_PREFIX) echo "   [BISON] $$< -> $$@"
-	$(CMD_PREFIX) bison -o $$@ -d --name-prefix=ast_yy $$<
-endef
+%.c: %.y
+	$(ECHO_PREFIX) echo "   [BISON] $< -> $@"
+	$(CMD_PREFIX) bison -o $@ -d --name-prefix=ast_yy $<
 
-define ast_make_c_fl
-$(1): $(2)
-	$(ECHO_PREFIX) echo "   [FLEX] $$< -> $$@"
-	$(CMD_PREFIX) flex -o $$@ --full $$<
-endef
+%.c: %.fl
+	$(ECHO_PREFIX) echo "   [FLEX] $< -> $@"
+	$(CMD_PREFIX) flex -o $@ --full $<
 
-define ast_make_so_o
-$(1): $(2)
-	$(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
-	$(CMD_PREFIX) $$(CC) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
-endef
+%.so: %.o
+	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
+	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLDFLAGS) $(SOLINK) $^ $(LIBS)
 
-define ast_make_so_oo
-$(1): $(2)
-	$(ECHO_PREFIX) echo "   [LDXX] $$^ -> $$@"
-	$(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
-endef
+%.soo: %.oo
+	$(ECHO_PREFIX) echo "   [LDXX] $^ -> $@"
+	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLDFLAGS) $(SOLINK) $^ $(LIBS)
 
-define ast_make_a_o
-$(1): $(2)
-	$(ECHO_PREFIX) echo "   [AR] $$^ -> $$@"
-	$(CMD_PREFIX) $$(AR) cr $$@ $$^
-	$(CMD_PREFIX) $$(RANLIB) $$@
-endef
-
-define ast_make_final
-$(1): $(2)
-	$(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
-	$(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
-endef
-
-define ast_make_final_host
-$(1): $(2)
-	$(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
-	$(CMD_PREFIX) $$(HOST_CC) $$(STATIC_BUILD) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
-endef
-
-$(eval $(call ast_make_o_c,%.o,%.c))
-
-$(eval $(call ast_make_oo_cc,%.oo,%.cc))
-
-$(eval $(call ast_make_so_o,%.so,%.o))
-
-$(eval $(call ast_make_final,%,%.o))
+%: %.o
+	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
+	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLDFLAGS) $^ $(LIBS)

Modified: team/oej/sipregister/README
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/README?rev=44755&r1=44754&r2=44755&view=diff
==============================================================================
--- team/oej/sipregister/README (original)
+++ team/oej/sipregister/README Mon Oct  9 06:27:21 2006
@@ -1,4 +1,4 @@
-The Asterisk Open Source PBX
+The Asterisk(R) Open Source PBX
 by Mark Spencer <markster at digium.com>
 and the Asterisk.org developer community
 
@@ -247,3 +247,6 @@
   Welcome to the growing worldwide community of Asterisk users!
 
 Mark Spencer
+
+----
+Asterisk is a trademark belonging to Digium, inc

Modified: team/oej/sipregister/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/acinclude.m4?rev=44755&r1=44754&r2=44755&view=diff
==============================================================================
--- team/oej/sipregister/acinclude.m4 (original)
+++ team/oej/sipregister/acinclude.m4 Mon Oct  9 06:27:21 2006
@@ -2,7 +2,7 @@
 
 AC_DEFUN([AST_GCC_ATTRIBUTE],
 [
-AC_MSG_CHECKING(checking for compiler 'attribute $1' support)
+AC_MSG_CHECKING(for compiler 'attribute $1' support)
 AC_COMPILE_IFELSE(
 	AC_LANG_PROGRAM([static int __attribute__(($1)) test(void) {}],
 			[]),
@@ -23,11 +23,11 @@
      USE_$1=no
      ;;
      y|ye|yes)
-     $1_MANDATORY="yes"
+     ac_mandatory_list="${ac_mandatory_list} $1"
      ;;
      *)
      $1_DIR="${withval}"
-     $1_MANDATORY="yes"
+     ac_mandatory_list="${ac_mandatory_list} $1"
      ;;
 esac
 ])
@@ -37,11 +37,71 @@
 AC_SUBST([PBX_$1])
 ])
 
-# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data])
-
+# Check whether any of the mandatory modules are not present, and
+# print error messages in case.
+
+AC_DEFUN([AST_CHECK_MANDATORY],
+[
+	AC_MSG_CHECKING([for mandatory modules: ${ac_mandatory_list}])
+	err=0;
+	for i in ${ac_mandatory_list}; do
+		eval "a=\${PBX_$i}"
+		if test "x${a}" = "x1" ; then continue; fi
+		if test ${err} = "0" ; then AC_MSG_RESULT(fail) ; fi
+		AC_MSG_RESULT()
+		eval "a=\${${i}_OPTION}"
+		AC_MSG_NOTICE(***)
+		AC_MSG_NOTICE(*** The $i installation appears to be missing or broken.)
+		AC_MSG_NOTICE(*** Either correct the installation, or run configure)
+		AC_MSG_NOTICE(*** including --without-${a}.)
+		err=1
+	done
+	if test $err = 1 ; then exit 1; fi
+	AC_MSG_RESULT(ok)
+])
+
+#-- The following two tests are only performed if PBX_$1 != 1,
+#   so you can use multiple tests and stop at the first matching one.
+#   On success, set PBX_$1 = 1, and also #define HAVE_$1 1
+#   and #define HAVE_$1_VERSION ${last_argument} so you can tell which
+#   test succeeded.
+#   They should be called after AST_EXT_LIB_SETUP($1, ...)
+
+# Check if a given macro is defined in a certain header.
+
+# AST_C_DEFINE_CHECK([package symbol name], [macro name], [header file], [version])
+AC_DEFUN([AST_C_DEFINE_CHECK],
+[
+    if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
+	AC_MSG_CHECKING([for $2 in $3])
+	saved_cppflags="${CPPFLAGS}"
+	if test "x${$1_DIR}" != "x"; then
+	    $1_INCLUDE= "-I${$1_DIR}/include"
+	fi
+	CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+
+	AC_COMPILE_IFELSE(
+	    [ AC_LANG_PROGRAM( [#include <$3>], [int foo = $2;]) ],
+	    [   AC_MSG_RESULT(yes)
+		PBX_$1=1
+		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) ] 
+	)
+	CPPFLAGS="${saved_cppflags}"
+    fi
+])
+
+
+# Check for existence of a given package ($1), either looking up a function
+# in a library, or, if no function is supplied, only check for the
+# existence of the header files.
+
+# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data], [version])
 AC_DEFUN([AST_EXT_LIB_CHECK],
 [
-if test "${USE_$1}" != "no"; then
+if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
    pbxlibdir=""
    if test "x${$1_DIR}" != "x"; then
       if test -d ${$1_DIR}/lib; then
@@ -50,7 +110,12 @@
       	 pbxlibdir="-L${$1_DIR}"
       fi
    fi
-   AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
+   pbxfuncname="$3"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_$1_FOUND=yes
+   else
+      AC_CHECK_LIB([$2], [${pbxfuncname}], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
+   fi
 
    if test "${AST_$1_FOUND}" = "yes"; then
       $1_LIB="-l$2 $5"
@@ -67,28 +132,17 @@
 	 fi
       fi
       if test "x${$1_HEADER_FOUND}" = "x0" ; then
-         if test ! -z "${$1_MANDATORY}" ;
-         then
-            AC_MSG_NOTICE( ***)
-            AC_MSG_NOTICE( *** It appears that you do not have the $2 development package installed.)
-            AC_MSG_NOTICE( *** Please install it to include ${$1_DESCRIP} support, or re-run configure)
-            AC_MSG_NOTICE( *** without explicitly specifying --with-${$1_OPTION})
-            exit 1
-         fi
          $1_LIB=""
          $1_INCLUDE=""
-         PBX_$1=0
       else
+         if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
+	    $1_LIB=""
+	 fi
          PBX_$1=1
-         AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define to indicate the ${$1_DESCRIP} library])
+         # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
+         AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define this to indicate the ${$1_DESCRIP} library])
+	 AC_DEFINE_UNQUOTED([HAVE_$1_VERSION], [$6], [Define to indicate the ${$1_DESCRIP} library version])
       fi
-   elif test ! -z "${$1_MANDATORY}";
-   then
-      AC_MSG_NOTICE(***)
-      AC_MSG_NOTICE(*** The ${$1_DESCRIP} installation on this system appears to be broken.)
-      AC_MSG_NOTICE(*** Either correct the installation, or run configure)
-      AC_MSG_NOTICE(*** without explicitly specifying --with-${$1_OPTION})
-      exit 1
    fi
 fi
 ])
@@ -116,6 +170,344 @@
 AC_SUBST([GNU_MAKE])
 ])
 
+
+AC_DEFUN(
+[AST_CHECK_PWLIB], [
+PWLIB_INCDIR=
+PWLIB_LIBDIR=
+if test "${PWLIBDIR:-unset}" != "unset" ; then
+  AC_CHECK_FILE(${PWLIBDIR}/version.h, HAS_PWLIB=1, )
+fi
+if test "${HAS_PWLIB:-unset}" = "unset" ; then
+  if test "${OPENH323DIR:-unset}" != "unset"; then
+    AC_CHECK_FILE(${OPENH323DIR}/../pwlib/version.h, HAS_PWLIB=1, )
+  fi
+  if test "${HAS_PWLIB:-unset}" != "unset" ; then
+    PWLIBDIR="${OPENH323DIR}/../pwlib"
+  else
+    AC_CHECK_FILE(${HOME}/pwlib/include/ptlib.h, HAS_PWLIB=1, )
+    if test "${HAS_PWLIB:-unset}" != "unset" ; then
+      PWLIBDIR="${HOME}/pwlib"
+    else
+      AC_CHECK_FILE(/usr/local/include/ptlib.h, HAS_PWLIB=1, )
+      if test "${HAS_PWLIB:-unset}" != "unset" ; then
+        AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin)
+        if test "${PTLIB_CONFIG:-unset}" = "unset" ; then
+          AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/share/pwlib/make)
+        fi
+        PWLIB_INCDIR="/usr/local/include"
+        if test "x$LIB64" != "x"; then
+          PWLIB_LIBDIR="/usr/local/lib64"
+        else
+          PWLIB_LIBDIR="/usr/local/lib"
+        fi
+      else
+        AC_CHECK_FILE(/usr/include/ptlib.h, HAS_PWLIB=1, )
+        if test "${HAS_PWLIB:-unset}" != "unset" ; then
+          AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/pwlib/make)
+          PWLIB_INCDIR="/usr/include"
+          if test "x$LIB64" != "x"; then
+          	PWLIB_LIBDIR="/usr/lib64"
+          else
+	        PWLIB_LIBDIR="/usr/lib"
+	      fi
+        fi
+      fi
+    fi
+  fi
+fi
+
+#if test "${HAS_PWLIB:-unset}" = "unset" ; then
+#  echo "Cannot find pwlib - please install or set PWLIBDIR and try again"
+#  exit
+#fi
+
+if test "${HAS_PWLIB:-unset}" != "unset" ; then
+  if test "${PWLIBDIR:-unset}" = "unset" ; then
+    if test "${PTLIB_CONFIG:-unset}" != "unset" ; then
+      PWLIBDIR=`$PTLIB_CONFIG --prefix`
+    else
+      echo "Cannot find ptlib-config - please install and try again"
+      exit
+    fi
+  fi
+
+  if test "x$PWLIBDIR" = "x/usr" -o "x$PWLIBDIR" = "x/usr/"; then
+    PWLIBDIR="/usr/share/pwlib"
+    PWLIB_INCDIR="/usr/include"
+    if test "x$LIB64" != "x"; then
+      PWLIB_LIBDIR="/usr/lib64"
+    else
+      PWLIB_LIBDIR="/usr/lib"
+    fi
+  fi
+  if test "x$PWLIBDIR" = "x/usr/local" -o "x$PWLIBDIR" = "x/usr/"; then
+    PWLIBDIR="/usr/local/share/pwlib"
+    PWLIB_INCDIR="/usr/local/include"
+    if test "x$LIB64" != "x"; then
+      PWLIB_LIBDIR="/usr/local/lib64"
+    else
+      PWLIB_LIBDIR="/usr/local/lib"
+    fi
+  fi
+
+  if test "${PWLIB_INCDIR:-unset}" = "unset"; then
+    PWLIB_INCDIR="${PWLIBDIR}/include"
+  fi
+  if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
+    PWLIB_LIBDIR="${PWLIBDIR}/lib"
+  fi
+
+  AC_SUBST([PWLIBDIR])
+  AC_SUBST([PWLIB_INCDIR])
+  AC_SUBST([PWLIB_LIBDIR])
+fi
+])
+
+
+AC_DEFUN(
+[AST_CHECK_OPENH323_PLATFORM], [
+PWLIB_OSTYPE=
+case "$host_os" in
+  linux*)          PWLIB_OSTYPE=linux ;
+  		;;
+  freebsd* )       PWLIB_OSTYPE=FreeBSD ;
+  		;;
+  openbsd* )       PWLIB_OSTYPE=OpenBSD ;
+				   ENDLDLIBS="-lossaudio" ;
+		;;
+  netbsd* )        PWLIB_OSTYPE=NetBSD ;
+				   ENDLDLIBS="-lossaudio" ;
+		;;
+  solaris* | sunos* ) PWLIB_OSTYPE=solaris ;
+		;;
+  darwin* )	       PWLIB_OSTYPE=Darwin ;
+		;;
+  beos*)           PWLIB_OSTYPE=beos ;
+                   STDCCFLAGS="$STDCCFLAGS -D__BEOS__"
+		;;
+  cygwin*)         PWLIB_OSTYPE=cygwin ;
+		;;
+  mingw*)	       PWLIB_OSTYPE=mingw ;
+		           STDCCFLAGS="$STDCCFLAGS -mms-bitfields" ;
+		           ENDLDLIBS="-lwinmm -lwsock32 -lsnmpapi -lmpr -lcomdlg32 -lgdi32 -lavicap32" ;
+		;;
+  * )		       PWLIB_OSTYPE="$host_os" ;
+		           AC_MSG_WARN("OS $PWLIB_OSTYPE not recognized - proceed with caution!") ;
+		;;
+esac
+
+PWLIB_MACHTYPE=
+case "$host_cpu" in
+   x86 | i686 | i586 | i486 | i386 ) PWLIB_MACHTYPE=x86
+                   ;;
+
+   x86_64)	   PWLIB_MACHTYPE=x86_64 ;
+		   P_64BIT=1 ;
+                   LIB64=1 ;
+		   ;;
+
+   alpha | alphaev56 | alphaev6 | alphaev67 | alphaev7) PWLIB_MACHTYPE=alpha ;
+		   P_64BIT=1 ;
+		   ;;
+
+   sparc )         PWLIB_MACHTYPE=sparc ;
+		   ;;
+
+   powerpc )       PWLIB_MACHTYPE=ppc ;
+		   ;;
+
+   ppc )           PWLIB_MACHTYPE=ppc ;
+		   ;;
+
+   powerpc64 )     PWLIB_MACHTYPE=ppc64 ;
+		   P_64BIT=1 ;
+                   LIB64=1 ;
+		   ;;
+
+   ppc64 )         PWLIB_MACHTYPE=ppc64 ;
+		   P_64BIT=1 ;
+                   LIB64=1 ;
+		   ;;
+
+   ia64)	   PWLIB_MACHTYPE=ia64 ;
+		   P_64BIT=1 ;
+	  	   ;;
+
+   s390x)	   PWLIB_MACHTYPE=s390x ;
+		   P_64BIT=1 ;
+                   LIB64=1 ;
+		   ;;
+
+   s390)	   PWLIB_MACHTYPE=s390 ;
+		   ;;
+
+   * )		   PWLIB_MACHTYPE="$host_cpu";
+		   AC_MSG_WARN("CPU $PWLIB_MACHTYPE not recognized - proceed with caution!") ;;
+esac
+
+PWLIB_PLATFORM="${PWLIB_OSTYPE}_${PWLIB_MACHTYPE}"
+
+AC_SUBST([PWLIB_PLATFORM])
+])
+
+
+AC_DEFUN(
+[AST_CHECK_OPENH323], [
+OPENH323_INCDIR=
+OPENH323_LIBDIR=
+if test "${OPENH323DIR:-unset}" != "unset" ; then
+  AC_CHECK_FILE(${OPENH323DIR}/version.h, HAS_OPENH323=1, )
+fi
+if test "${HAS_OPENH323:-unset}" = "unset" ; then
+  AC_CHECK_FILE(${PWLIBDIR}/../openh323/version.h, OPENH323DIR="${PWLIBDIR}/../openh323"; HAS_OPENH323=1, )
+  if test "${HAS_OPENH323:-unset}" != "unset" ; then
+    OPENH323DIR="${PWLIBDIR}/../openh323"
+    AC_CHECK_FILE(${OPENH323DIR}/include/h323.h, , OPENH323_INCDIR="${PWLIB_INCDIR}/openh323"; OPENH323_LIBDIR="${PWLIB_LIBDIR}")
+  else
+    AC_CHECK_FILE(${HOME}/openh323/include/h323.h, HAS_OPENH323=1, )
+    if test "${HAS_OPENH323:-unset}" != "unset" ; then
+      OPENH323DIR="${HOME}/openh323"
+    else
+      AC_CHECK_FILE(/usr/local/include/openh323/h323.h, HAS_OPENH323=1, )
+      if test "${HAS_OPENH323:-unset}" != "unset" ; then
+        OPENH323DIR="/usr/local/share/openh323"
+        OPENH323_INCDIR="/usr/local/include/openh323"
+        if test "x$LIB64" != "x"; then
+          OPENH323_LIBDIR="/usr/local/lib64"
+        else
+          OPENH323_LIBDIR="/usr/local/lib"
+        fi
+      else
+        AC_CHECK_FILE(/usr/include/openh323/h323.h, HAS_OPENH323=1, )
+        if test "${HAS_OPENH323:-unset}" != "unset" ; then
+          OPENH323DIR="/usr/share/openh323"
+          OPENH323_INCDIR="/usr/include/openh323"
+          if test "x$LIB64" != "x"; then
+            OPENH323_LIBDIR="/usr/lib64"
+          else
+            OPENH323_LIBDIR="/usr/lib"
+          fi
+        fi
+      fi
+    fi
+  fi
+fi
+
+if test "${HAS_OPENH323:-unset}" != "unset" ; then
+  if test "${OPENH323_INCDIR:-unset}" = "unset"; then
+    OPENH323_INCDIR="${OPENH323DIR}/include"
+  fi
+  if test "${OPENH323_LIBDIR:-unset}" = "unset"; then
+    OPENH323_LIBDIR="${OPENH323DIR}/lib"
+  fi
+
+  AC_SUBST([OPENH323DIR])
+  AC_SUBST([OPENH323_INCDIR])
+  AC_SUBST([OPENH323_LIBDIR])
+fi
+])
+
+
+AC_DEFUN(
+[AST_CHECK_PWLIB_VERSION], [
+	if test "${HAS_$2:-unset}" != "unset"; then
+		$2_VERSION=`grep "$2_VERSION" ${$2_INCDIR}/$3 | cut -f2 -d ' ' | sed -e 's/"//g'`
+		$2_MAJOR_VERSION=`echo ${$2_VERSION} | cut -f1 -d.`
+		$2_MINOR_VERSION=`echo ${$2_VERSION} | cut -f2 -d.`
+		$2_BUILD_NUMBER=`echo ${$2_VERSION} | cut -f3 -d.`
+		let $2_VER=${$2_MAJOR_VERSION}*10000+${$2_MINOR_VERSION}*100+${$2_BUILD_NUMBER}
+		let $2_REQ=$4*10000+$5*100+$6
+
+		AC_MSG_CHECKING(if $1 version ${$2_VERSION} is compatible with chan_h323)
+		if test ${$2_VER} -lt ${$2_REQ}; then
+			AC_MSG_RESULT(no)
+			unset HAS_$2
+		else
+			AC_MSG_RESULT(yes)
+		fi
+	fi
+])
+
+
+AC_DEFUN(
+[AST_CHECK_PWLIB_BUILD], [
+	if test "${HAS_$2:-unset}" != "unset"; then
+	   AC_MSG_CHECKING($1 installation validity)
+
+	   saved_cppflags="${CPPFLAGS}"
+	   saved_libs="${LIBS}"
+	   LIBS="${LIBS} -L${$2_LIBDIR} -l${PLATFORM_$2} $7"
+	   CPPFLAGS="${CPPFLAGS} -I${$2_INCDIR} $6"
+
+	   AC_LANG_PUSH([C++])
+
+	   AC_LINK_IFELSE(
+		[AC_LANG_PROGRAM([$4],[$5])],
+		[	AC_MSG_RESULT(yes) 
+			ac_cv_lib_$2="yes" 
+		],
+		[	AC_MSG_RESULT(no) 
+			ac_cv_lib_$2="no" 
+		]
+		)
+
+	   AC_LANG_POP([C++])
+
+	   LIBS="${saved_libs}"
+	   CPPFLAGS="${saved_cppflags}"
+
+	   if test "${ac_cv_lib_$2}" = "yes"; then
+	      if test "${$2_LIBDIR}" != "" -a "${$2_LIBDIR}" != "/usr/lib"; then
+	         $2_LIB="-L${$2_LIBDIR} -l${PLATFORM_$2}"
+	      else
+	         $2_LIB="-l${PLATFORM_$2}"
+	      fi
+	      if test "${$2_INCDIR}" != "" -a "${$2_INCDIR}" != "/usr/include"; then
+	         $2_INCLUDE="-I${$2_INCDIR}"
+	      fi
+	   	  PBX_$2=1
+	   	  AC_DEFINE([HAVE_$2], 1, [$3])
+	   fi
+	fi
+])
+
+AC_DEFUN(
+[AST_CHECK_OPENH323_BUILD], [
+	if test "${HAS_OPENH323:-unset}" != "unset"; then
+		AC_MSG_CHECKING(OpenH323 build option)
+		OPENH323_SUFFIX=
+		files=`ls -l ${OPENH323_LIBDIR}/libh323_${PWLIB_PLATFORM}_*.so*`
+		libfile=
+		if test -n "$files"; then
+			for f in $files; do
+				if test -f $f -a ! -L $f; then
+					libfile=`basename $f`
+					break;
+				fi
+			done
+		fi
+		if test "${libfile:-unset}" != "unset"; then
+			OPENH323_SUFFIX=`eval "echo ${libfile} | sed -e 's/libh323_${PWLIB_PLATFORM}_\(@<:@^.@:>@*\)\..*/\1/'"`
+		fi
+		case "${OPENH323_SUFFIX}" in
+			n)
+				OPENH323_BUILD="notrace";;
+			r)
+				OPENH323_BUILD="opt";;
+			d)
+				OPENH323_BUILD="debug";;
+			*)
+				OPENH323_BUILD="notrace";;
+		esac
+		AC_MSG_RESULT(${OPENH323_BUILD})
+
+		AC_SUBST([OPENH323_SUFFIX])
+		AC_SUBST([OPENH323_BUILD])
+	fi
+])
+
+
 # AST_FUNC_FORK
 # -------------
 AN_FUNCTION([fork],  [AST_FUNC_FORK])

Modified: team/oej/sipregister/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_rpt.c?rev=44755&r1=44754&r2=44755&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_rpt.c (original)
+++ team/oej/sipregister/apps/app_rpt.c Mon Oct  9 06:27:21 2006
@@ -178,16 +178,16 @@
 #define REM_SCANTIME 100
 
 
-enum {REM_OFF,REM_MONITOR,REM_TX};
-
-enum{ID,PROC,TERM,COMPLETE,UNKEY,REMDISC,REMALREADY,REMNOTFOUND,REMGO,
-	CONNECTED,CONNFAIL,STATUS,TIMEOUT,ID1, STATS_TIME,
+enum {REM_OFF, REM_MONITOR, REM_TX};
+
+enum {ID, PROC, TERM, COMPLETE, UNKEY, REMDISC, REMALREADY, REMNOTFOUND, REMGO,
+	CONNECTED, CONNFAIL, STATUS, TIMEOUT, ID1, STATS_TIME,
 	STATS_VERSION, IDTALKOVER, ARB_ALPHA, TEST_TONE, REV_PATCH,
 	TAILMSG, MACRO_NOTFOUND, MACRO_BUSY, LASTNODEKEY};
 
-enum {REM_SIMPLEX,REM_MINUS,REM_PLUS};
-
-enum {REM_LOWPWR,REM_MEDPWR,REM_HIPWR};
+enum {REM_SIMPLEX, REM_MINUS, REM_PLUS};
+
+enum {REM_LOWPWR, REM_MEDPWR, REM_HIPWR};
 
 enum {DC_INDETERMINATE, DC_REQ_FLUSH, DC_ERROR, DC_COMPLETE, DC_DOKEY};
 
@@ -195,10 +195,10 @@
 
 enum {DLY_TELEM, DLY_ID, DLY_UNKEY, DLY_CALLTERM};
 
-enum {REM_MODE_FM,REM_MODE_USB,REM_MODE_LSB,REM_MODE_AM};
-
-enum {HF_SCAN_OFF,HF_SCAN_DOWN_SLOW,HF_SCAN_DOWN_QUICK,
-      HF_SCAN_DOWN_FAST,HF_SCAN_UP_SLOW,HF_SCAN_UP_QUICK,HF_SCAN_UP_FAST};
+enum {REM_MODE_FM, REM_MODE_USB, REM_MODE_LSB, REM_MODE_AM};
+
+enum {HF_SCAN_OFF, HF_SCAN_DOWN_SLOW, HF_SCAN_DOWN_QUICK,
+      HF_SCAN_DOWN_FAST, HF_SCAN_UP_SLOW, HF_SCAN_UP_QUICK, HF_SCAN_UP_FAST};
 
 #include "asterisk.h"
 
@@ -241,6 +241,7 @@
 #include "asterisk/config.h"
 #include "asterisk/say.h"
 #include "asterisk/localtime.h"
+#include "asterisk/app.h"
 
 static char *app = "Rpt";
 
@@ -288,8 +289,8 @@
 static int nrpts = 0;
 
 char *discstr = "!!DISCONNECT!!";
-static char *remote_rig_ft897="ft897";
-static char *remote_rig_rbi="rbi";
+static char *remote_rig_ft897 = "ft897";
+static char *remote_rig_rbi = "rbi";
 
 #ifdef	OLD_ASTERISK
 STANDARD_LOCAL_USER;
@@ -393,18 +394,17 @@
 	char *remote;
 
 	struct {
-
-		const char *ourcontext;
-		const char *ourcallerid;
-		const char *acctcode;
-		const char *ident;
-		char *tonezone;
+		char ourcontext[80];
+		char ourcallerid[80];
+		char acctcode[21];
+		char ident[80];
+		char tonezone[80];
 		char simple;
-		const char *functions;
-		const char *link_functions;
-		const char *phone_functions;
-		const char *dphone_functions;
-		const char *nodes;
+		char functions[80];
+		char link_functions[80];
+		char phone_functions[80];
+		char dphone_functions[80];
+		char nodes[80];
 		int hangtime;
 		int totime;
 		int idtime;
@@ -412,15 +412,17 @@
 		int tailsquashedtime;
 		int duplex;
 		int politeid;
-		char *tailmessages[500];
-		int tailmessagemax;
-		const char	*memory;
-		const char	*macro;
-		const char	*startupmacro;
+		char *tailmsgbuf;
+		AST_DECLARE_APP_ARGS(tailmsg,
+			AST_APP_ARG(msgs)[100];
+		);
+		char memory[80];
+		char macro[80];
+		char startupmacro[80];
 		int iobase;
 		char funcchar;
 		char endchar;
-		char	nobusyout;
+		char nobusyout;
 	} p;
 	struct rpt_link links;
 	int unkeytocttimer;
@@ -438,24 +440,24 @@
 	char rem_dtmfbuf[MAXDTMF];
 	char lastdtmfcommand[MAXDTMF];
 	char cmdnode[50];
-	struct ast_channel *rxchannel,*txchannel;
-	struct ast_channel *pchannel,*txpchannel, *remchannel;
+	struct ast_channel *rxchannel, *txchannel;
+	struct ast_channel *pchannel, *txpchannel, *remchannel;
 	struct rpt_tele tele;
-	struct timeval lasttv,curtv;
-	pthread_t rpt_call_thread,rpt_thread;
-	time_t dtmf_time,rem_dtmf_time,dtmf_time_rem;
-	int tailtimer,totimer,idtimer,txconf,conf,callmode,cidx,scantimer,tmsgtimer,skedtimer;
-	int mustid,tailid;
+	struct timeval lasttv, curtv;
+	pthread_t rpt_call_thread, rpt_thread;
+	time_t dtmf_time, rem_dtmf_time, dtmf_time_rem;
+	int tailtimer, totimer, idtimer, txconf, conf, callmode, cidx, scantimer, tmsgtimer, skedtimer;
+	int mustid, tailid;
 	int tailevent;
 	int telemrefcount;
-	int dtmfidx,rem_dtmfidx;
-	int dailytxtime,dailykerchunks,totalkerchunks,dailykeyups,totalkeyups,timeouts;
+	int dtmfidx, rem_dtmfidx;
+	int dailytxtime, dailykerchunks, totalkerchunks, dailykeyups, totalkeyups, timeouts;
 	int totalexecdcommands, dailyexecdcommands;
-	long	retxtimer;
+	long retxtimer;
 	long long totaltxtime;
 	char mydtmf;
 	char exten[AST_MAX_EXTENSION];
-	char freq[MAXREMSTR],rxpl[MAXREMSTR],txpl[MAXREMSTR];
+	char freq[MAXREMSTR], rxpl[MAXREMSTR], txpl[MAXREMSTR];
 	char offset;
 	char powerlevel;
 	char txplon;
@@ -481,22 +483,22 @@
 	int tailmessagen;
 	time_t disgorgetime;
 	time_t lastthreadrestarttime;
-	long	macrotimer;
-	char	lastnodewhichkeyedusup[MAXNODESTR];
+	long macrotimer;
+	char lastnodewhichkeyedusup[MAXNODESTR];
 #ifdef	__RPT_NOTCH
 	struct rptfilter
 	{
-		char	desc[100];
-		float	x0;
-		float	x1;
-		float	x2;
-		float	y0;
-		float	y1;
-		float	y2;
-		float	gain;
-		float	const0;
-		float	const1;
-		float	const2;
+		char desc[100];
+		float x0;
+		float x1;
+		float x2;
+		float y0;
+		float y1;
+		float y2;
+		float gain;
+		float const0;
+		float const1;
+		float const2;
 	} filters[MAXFILTERS];
 #endif
 #ifdef	_MDC_DECODE_H_
@@ -512,8 +514,8 @@
 
 #define	MAXLOCKTHREAD 100
 
-#define rpt_mutex_lock(x) _rpt_mutex_lock(x,myrpt,__LINE__)
-#define rpt_mutex_unlock(x) _rpt_mutex_unlock(x,myrpt,__LINE__)
+#define	rpt_mutex_lock(x)	_rpt_mutex_lock(x, myrpt, __LINE__)
+#define	rpt_mutex_unlock(x)	_rpt_mutex_unlock(x, myrpt, __LINE__)
 
 struct lockthread
 {
@@ -539,36 +541,33 @@
 
 static struct lockthread *get_lockthread(pthread_t id)
 {
-int	i;
-
-	for(i = 0; i < MAXLOCKTHREAD; i++)
-	{
-		if (lockthreads[i].id == id) return(&lockthreads[i]);
-	}
-	return(NULL);
-}
-
-static struct lockthread *put_lockthread(pthread_t id)
-{
-int	i;
-
-	for(i = 0; i < MAXLOCKTHREAD; i++)
-	{
+	int	i;
+
+	for (i = 0; i < MAXLOCKTHREAD; i++) {
 		if (lockthreads[i].id == id)
 			return(&lockthreads[i]);
 	}
-	for(i = 0; i < MAXLOCKTHREAD; i++)
-	{
-		if (!lockthreads[i].id)
-		{
+	return NULL;
+}
+
+static struct lockthread *put_lockthread(pthread_t id)
+{
+	int	i;
+
+	for (i = 0; i < MAXLOCKTHREAD; i++) {
+		if (lockthreads[i].id == id)
+			return(&lockthreads[i]);
+	}
+	for (i = 0; i < MAXLOCKTHREAD; i++) {
+		if (!lockthreads[i].id) {
 			lockthreads[i].lockcount = 0;
 			lockthreads[i].lastlock = 0;
 			lockthreads[i].lastunlock = 0;
 			lockthreads[i].id = id;
-			return(&lockthreads[i]);
-		}
-	}
-	return(NULL);
+			return &lockthreads[i];
+		}
+	}
+	return NULL;
 }
 
 
@@ -576,9 +575,9 @@
 {
 	struct by_lightning lock_ring_copy[32];
 	int lock_ring_index_copy;
-	int i,j;
+	int i, j;
 	long long diff;
-	char a[100];
+	char a[100] = "";
 	struct timeval lasttv;
 
 	ast_mutex_lock(&locklock);
@@ -587,30 +586,27 @@
 	ast_mutex_unlock(&locklock);
 
 	lasttv.tv_sec = lasttv.tv_usec = 0;
-	for(i = 0 ; i < 32 ; i++)
-	{
+	for (i = 0; i < 32; i++) {
 		j = (i + lock_ring_index_copy) % 32;
-		strftime(a,sizeof(a) - 1,"%m/%d/%Y %H:%M:%S",
+		strftime(a, sizeof(a) - 1, "%m/%d/%Y %H:%M:%S",
 			localtime(&lock_ring_copy[j].tv.tv_sec));
 		diff = 0;
-		if(lasttv.tv_sec)
-		{
-			diff = (lock_ring_copy[j].tv.tv_sec - lasttv.tv_sec)
-				* 1000000;
+		if (lasttv.tv_sec) {
+			diff = (lock_ring_copy[j].tv.tv_sec - lasttv.tv_sec) * 1000000;
 			diff += (lock_ring_copy[j].tv.tv_usec - lasttv.tv_usec);
 		}
 		lasttv.tv_sec = lock_ring_copy[j].tv.tv_sec;
 		lasttv.tv_usec = lock_ring_copy[j].tv.tv_usec;
-		if (!lock_ring_copy[j].tv.tv_sec) continue;
-		if (lock_ring_copy[j].line < 0)
-		{
-			ast_log(LOG_NOTICE,"LOCKDEBUG [#%d] UNLOCK app_rpt.c:%d node %s pid %x diff %lld us at %s.%06d\n",
-				i - 31,-lock_ring_copy[j].line,lock_ring_copy[j].rpt->name,(int) lock_ring_copy[j].lockthread.id,diff,a,(int)lock_ring_copy[j].tv.tv_usec);
-		}
-		else
-		{
-			ast_log(LOG_NOTICE,"LOCKDEBUG [#%d] LOCK app_rpt.c:%d node %s pid %x diff %lld us at %s.%06d\n",
-				i - 31,lock_ring_copy[j].line,lock_ring_copy[j].rpt->name,(int) lock_ring_copy[j].lockthread.id,diff,a,(int)lock_ring_copy[j].tv.tv_usec);
+		if (!lock_ring_copy[j].tv.tv_sec)
+			continue;
+		if (lock_ring_copy[j].line < 0) {
+			ast_log(LOG_NOTICE, "LOCKDEBUG [#%d] UNLOCK app_rpt.c:%d node %s pid %x diff %lld us at %s.%06d\n",
+				i - 31, -lock_ring_copy[j].line, lock_ring_copy[j].rpt->name,
+				(int) lock_ring_copy[j].lockthread.id, diff, a, (int)lock_ring_copy[j].tv.tv_usec);
+		} else {
+			ast_log(LOG_NOTICE, "LOCKDEBUG [#%d] LOCK app_rpt.c:%d node %s pid %x diff %lld us at %s.%06d\n",
+				i - 31, lock_ring_copy[j].line, lock_ring_copy[j].rpt->name,
+				(int) lock_ring_copy[j].lockthread.id, diff, a, (int)lock_ring_copy[j].tv.tv_usec);
 		}
 	}
 }
@@ -618,22 +614,21 @@
 
 static void _rpt_mutex_lock(ast_mutex_t *lockp, struct rpt *myrpt, int line)
 {
-struct lockthread *t;
-pthread_t id;
+	struct lockthread *t;
+	pthread_t id;
 
 	id = pthread_self();
 	ast_mutex_lock(&locklock);
 	t = put_lockthread(id);
-	if (!t)
-	{
+	if (!t) {
 		ast_mutex_unlock(&locklock);
 		return;
 	}
-	if (t->lockcount)
-	{
+	if (t->lockcount) {
 		int lastline = t->lastlock;
 		ast_mutex_unlock(&locklock);
-		ast_log(LOG_NOTICE,"rpt_mutex_lock: Double lock request line %d node %s pid %x, last lock was line %d\n",line,myrpt->name,(int) t->id,lastline);

[... 27466 lines stripped ...]


More information about the asterisk-commits mailing list