[asterisk-commits] branch group/new_loader_completion r37681 - in /team/group/new_loader_complet...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Jul 15 14:50:05 MST 2006


Author: kpfleming
Date: Sat Jul 15 16:50:04 2006
New Revision: 37681

URL: http://svn.digium.com/view/asterisk?rev=37681&view=rev
Log:
update to trunk

Modified:
    team/group/new_loader_completion/   (props changed)
    team/group/new_loader_completion/Makefile
    team/group/new_loader_completion/Makefile.moddir_rules
    team/group/new_loader_completion/agi/Makefile
    team/group/new_loader_completion/apps/Makefile
    team/group/new_loader_completion/apps/app_queue.c
    team/group/new_loader_completion/apps/app_sms.c
    team/group/new_loader_completion/apps/app_voicemail.c
    team/group/new_loader_completion/cdr/Makefile
    team/group/new_loader_completion/channels/Makefile
    team/group/new_loader_completion/channels/chan_iax2.c
    team/group/new_loader_completion/channels/chan_skinny.c
    team/group/new_loader_completion/channels/chan_zap.c
    team/group/new_loader_completion/codecs/Makefile
    team/group/new_loader_completion/configs/iax.conf.sample
    team/group/new_loader_completion/configure
    team/group/new_loader_completion/configure.ac
    team/group/new_loader_completion/formats/Makefile
    team/group/new_loader_completion/funcs/Makefile
    team/group/new_loader_completion/manager.c
    team/group/new_loader_completion/pbx/Makefile
    team/group/new_loader_completion/res/Makefile
    team/group/new_loader_completion/utils/Makefile

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
    automerge = yeah baby

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Jul 15 16:50:04 2006
@@ -1,1 +1,1 @@
-/trunk:1-37595
+/trunk:1-37680

Modified: team/group/new_loader_completion/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/Makefile?rev=37681&r1=37680&r2=37681&view=diff
==============================================================================
--- team/group/new_loader_completion/Makefile (original)
+++ team/group/new_loader_completion/Makefile Sat Jul 15 16:50:04 2006
@@ -9,6 +9,15 @@
 #
 # This program is free software, distributed under the terms of
 # the GNU General Public License
+#
+
+# All Makefiles use the following variables:
+#
+# LDFLAGS - linker flags (not libraries), used for all links
+# LIBS - additional libraries, at top-level for all links,
+#      on a single object just for that object
+# SOLINK - linker flags used only for creating shared objects (.so files),
+#      used for all .so links
 #
 
 .EXPORT_ALL_VARIABLES:
@@ -238,7 +247,7 @@
 ifeq ($(OSARCH),FreeBSD)
   BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
   ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
-  LIBS+=$(shell if test  $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
+  AST_LIBS+=$(shell if test  $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
 endif # FreeBSD
 
 ifeq ($(OSARCH),NetBSD)
@@ -311,13 +320,13 @@
 endif
 
 ifeq ($(OSARCH),Linux)
-  LIBS+=-ldl -lpthread $(EDITLINE_LIB) -lm -lresolv  #-lnjamd
+  AST_LIBS+=-ldl -lpthread $(EDITLINE_LIB) -lm -lresolv  #-lnjamd
 else
-  LIBS+=$(EDITLINE_LIB) -lm
+  AST_LIBS+=$(EDITLINE_LIB) -lm
 endif
 
 ifeq ($(OSARCH),Darwin)
-  LIBS+=-lresolv
+  AST_LIBS+=-lresolv
   ASTCFLAGS+=-D__Darwin__
   AUDIO_LIBS=-framework CoreAudio
   ASTLINK=-Wl,-dynamic
@@ -332,24 +341,24 @@
   ASTLINK=-Wl,-E 
   SOLINK=-shared -Xlinker -x
   ifeq ($(findstring BSD,$(OSARCH)),BSD)
-    SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
+    LDFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
   endif
 endif
 
 ifeq ($(OSARCH),FreeBSD)
-  LIBS+=-lcrypto
+  AST_LIBS+=-lcrypto
 endif
 
 ifeq ($(OSARCH),NetBSD)
-  LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib $(EDITLINE_LIB)
+  AST_LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib $(EDITLINE_LIB)
 endif
 
 ifeq ($(OSARCH),OpenBSD)
-  LIBS+=-lcrypto -lpthread -lm $(EDITLINE_LIB)
+  AST_LIBS+=-lcrypto -lpthread -lm $(EDITLINE_LIB)
 endif
 
 ifeq ($(OSARCH),SunOS)
-  LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/opt/ssl/lib -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
+  AST_LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/opt/ssl/lib -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
   OBJS+=strcompat.o
   ASTLINK=
   SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
@@ -377,7 +386,7 @@
 	@echo " +               make install                +"  
 	@echo " +-------------------------------------------+"  
 
-all: cleantest config.status menuselect.makeopts depend asterisk $(SUBDIRS)
+all: cleantest config.status menuselect.makeopts depend $(SUBDIRS) asterisk
 
 $(MOD_SUBDIRS):
 	@CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@
@@ -413,10 +422,10 @@
 endif
 
 editline/config.h:
-	cd editline && unset CFLAGS LIBS && CFLAGS="$(OPTIMIZE)" ./configure ; \
+	cd editline && unset CFLAGS AST_LIBS && CFLAGS="$(OPTIMIZE)" ./configure ; \
 
 editline/libedit.a:
-	cd editline && unset CFLAGS LIBS && test -f config.h || CFLAGS="$(OPTIMIZE)" ./configure
+	cd editline && unset CFLAGS AST_LIBS && test -f config.h || CFLAGS="$(OPTIMIZE)" ./configure
 	$(MAKE) -C editline libedit.a
 
 db1-ast/libdb1.a:
@@ -492,11 +501,11 @@
 	fi
 	@rm -f include/asterisk/build.h.tmp
 	@$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
-	@echo "   [LD] $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.1 $(LIBS) -> $@"
-	@$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(LIBS)
+	@echo "   [LD] $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.1 $(AST_LIBS) -> $@"
+	@$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(AST_LIBS)
 
 muted: muted.o
-muted: LDFLAGS+=$(AUDIO_LIBS)
+muted: LIBS+=$(AUDIO_LIBS)
 
 $(SUBDIRS_CLEAN_DEPEND):
 	@$(MAKE) -C $(@:-clean-depend=) clean-depend
@@ -892,7 +901,7 @@
 	@CFLAGS="-include $(ASTTOPDIR)/include/asterisk/autoconfig.h -I$(ASTTOPDIR)/include" PARENTSRC="$(ASTTOPDIR)" $(MAKE) -C menuselect menuselect
 
 mxml/libmxml.a:
-	@cd mxml && unset CFLAGS LIBS && test -f config.h || ./configure
+	@cd mxml && unset CFLAGS AST_LIBS && test -f config.h || ./configure
 	$(MAKE) -C mxml libmxml.a
 
 makeopts.xml: $(foreach dir,$(MOD_SUBDIRS),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml

Modified: team/group/new_loader_completion/Makefile.moddir_rules
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/Makefile.moddir_rules?rev=37681&r1=37680&r2=37681&view=diff
==============================================================================
--- team/group/new_loader_completion/Makefile.moddir_rules (original)
+++ team/group/new_loader_completion/Makefile.moddir_rules Sat Jul 15 16:50:04 2006
@@ -25,21 +25,23 @@
 
 define module_so_o_template
 $(1).so: $(1).o
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
 endef
 
 define module_so_oo_template
 $(1).so: $(1).oo
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
 endef
 
-$(foreach mod,$(filter-out $(CC_MODS),$(SELECTED_MODS)),$(eval $(call module_o_c_template,$(mod))))
+$(foreach mod,$(C_MODS),$(eval $(call module_o_c_template,$(mod))))
 
-$(foreach mod,$(filter-out $(CC_MODS),$(SELECTED_MODS)),$(eval $(call module_so_o_template,$(mod))))
+$(foreach mod,$(C_MODS),$(eval $(call module_so_o_template,$(mod))))
 
-$(foreach mod,$(filter $(CC_MODS),$(SELECTED_MODS)),$(eval $(call module_oo_cc_template,$(mod))))
+$(foreach mod,$(CC_MODS),$(eval $(call module_oo_cc_template,$(mod))))
 
-$(foreach mod,$(filter $(CC_MODS),$(SELECTED_MODS)),$(eval $(call module_so_oo_template,$(mod))))
+$(foreach mod,$(CC_MODS),$(eval $(call module_so_oo_template,$(mod))))
 
 .PHONY: clean clean-depend depend uninstall _all
 

Modified: team/group/new_loader_completion/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/agi/Makefile?rev=37681&r1=37680&r2=37681&view=diff
==============================================================================
--- team/group/new_loader_completion/agi/Makefile (original)
+++ team/group/new_loader_completion/agi/Makefile Sat Jul 15 16:50:04 2006
@@ -16,7 +16,7 @@
 AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
 
 ifeq ($(OSARCH),SunOS)
-  LDFLAGS+=-lsocket -lnsl ../strcompat.o
+  LIBS+=-lsocket -lnsl ../strcompat.o
 endif
 
 include $(ASTTOPDIR)/Makefile.rules

Modified: team/group/new_loader_completion/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/Makefile?rev=37681&r1=37680&r2=37681&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/Makefile (original)
+++ team/group/new_loader_completion/apps/Makefile Sat Jul 15 16:50:04 2006
@@ -14,7 +14,10 @@
   include ../menuselect.makedeps
 endif
 
-SELECTED_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
+C_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
+CC_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.cc,%,$(wildcard app_*.cc)))
+
+SELECTED_MODS:=$(C_MODS) $(CC_MODS)
 
 ifneq ($(findstring ODBC_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
 MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_ODBC_STORAGE)
@@ -31,6 +34,5 @@
 include $(ASTTOPDIR)/Makefile.moddir_rules
 
 ifeq (SunOS,$(shell uname))
-app_chanspy.so: app_chanspy.o
-	$(CC) $(SOLINK) -o $@ $^ -lrt
+app_chanspy.so: LIBS+=-lrt
 endif

Modified: team/group/new_loader_completion/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/app_queue.c?rev=37681&r1=37680&r2=37681&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/app_queue.c (original)
+++ team/group/new_loader_completion/apps/app_queue.c Sat Jul 15 16:50:04 2006
@@ -23,18 +23,18 @@
  * \author Mark Spencer <markster at digium.com>
  *
  * \arg Config in \ref Config_qu queues.conf
- * 
+ *
  * \par Development notes
  * \note 2004-11-25: Persistent Dynamic Members added by:
  *             NetNation Communications (www.netnation.com)
  *             Kevin Lindsay <kevinl at netnation.com>
- * 
+ *
  *             Each dynamic agent in each queue is now stored in the astdb.
  *             When asterisk is restarted, each agent will be automatically
  *             readded into their recorded queues. This feature can be
  *             configured with the 'persistent_members=<1|0>' setting in the
  *             '[general]' category in queues.conf. The default is on.
- * 
+ *
  * \note 2004-06-04: Priorities in queues added by inAccess Networks (work funded by Hellas On Line (HOL) www.hol.gr).
  *
  * \note These features added by David C. Troy <dave at toad.net>:
@@ -138,7 +138,7 @@
 "      'h' -- allow callee to hang up by hitting *.\n"
 "      'H' -- allow caller to hang up by hitting *.\n"
 "      'n' -- no retries on the timeout; will exit this application and \n"
-"	      go to the next step.\n"
+"             go to the next step.\n"
 "      'r' -- ring instead of playing MOH\n"
 "      't' -- allow the called user transfer the calling user\n"
 "      'T' -- to allow the calling user to transfer the call.\n"
@@ -252,7 +252,7 @@
 	QUEUE_FULL = 6,
 };
 
-const struct { 
+const struct {
 	enum queue_result id;
 	char *text;
 } queue_results[] = {
@@ -282,37 +282,37 @@
 
 
 struct queue_ent {
-	struct call_queue *parent;	/*!< What queue is our parent */
-	char moh[80];			/*!< Name of musiconhold to be used */
-	char announce[80];		/*!< Announcement to play for member when call is answered */
-	char context[AST_MAX_CONTEXT];	/*!< Context when user exits queue */
-	char digits[AST_MAX_EXTENSION];	/*!< Digits entered while in queue */
-	int pos;			/*!< Where we are in the queue */
-	int prio;			/*!< Our priority */
-	int last_pos_said;              /*!< Last position we told the user */
-	time_t last_periodic_announce_time;	/*!< The last time we played a periodic announcement */
-	int last_periodic_announce_sound;	/* The last periodic announcement we made */
-	time_t last_pos;                /*!< Last time we told the user their position */
-	int opos;			/*!< Where we started in the queue */
-	int handled;			/*!< Whether our call was handled */
-	int max_penalty;		/*!< Limit the members that can take this call to this penalty or lower */
-	time_t start;			/*!< When we started holding */
-	time_t expire;			/*!< When this entry should expire (time out of queue) */
-	struct ast_channel *chan;	/*!< Our channel */
-	struct queue_ent *next;		/*!< The next queue entry */
+	struct call_queue *parent;          /*!< What queue is our parent */
+	char moh[80];                       /*!< Name of musiconhold to be used */
+	char announce[80];                  /*!< Announcement to play for member when call is answered */
+	char context[AST_MAX_CONTEXT];      /*!< Context when user exits queue */
+	char digits[AST_MAX_EXTENSION];     /*!< Digits entered while in queue */
+	int pos;                            /*!< Where we are in the queue */
+	int prio;                           /*!< Our priority */
+	int last_pos_said;                  /*!< Last position we told the user */
+	time_t last_periodic_announce_time; /*!< The last time we played a periodic announcement */
+	int last_periodic_announce_sound;   /*!< The last periodic announcement we made */
+	time_t last_pos;                    /*!< Last time we told the user their position */
+	int opos;                           /*!< Where we started in the queue */
+	int handled;                        /*!< Whether our call was handled */
+	int max_penalty;                    /*!< Limit the members that can take this call to this penalty or lower */
+	time_t start;                       /*!< When we started holding */
+	time_t expire;                      /*!< When this entry should expire (time out of queue) */
+	struct ast_channel *chan;           /*!< Our channel */
+	struct queue_ent *next;             /*!< The next queue entry */
 };
 
 struct member {
-	char interface[80];		/*!< Technology/Location */
-	int penalty;			/*!< Are we a last resort? */
-	int calls;			/*!< Number of calls serviced by this member */
-	int dynamic;			/*!< Are we dynamically added? */
-	int status;			/*!< Status of queue member */
-	int paused;			/*!< Are we paused (not accepting calls)? */
-	time_t lastcall;		/*!< When last successful call was hungup */
-	unsigned int dead:1;			/*!< Used to detect members deleted in realtime */
-	unsigned int delme:1;		/*!< Flag to delete entry on reload */
-	struct member *next;		/*!< Next member */
+	char interface[80];                 /*!< Technology/Location */
+	int penalty;                        /*!< Are we a last resort? */
+	int calls;                          /*!< Number of calls serviced by this member */
+	int dynamic;                        /*!< Are we dynamically added? */
+	int status;                         /*!< Status of queue member */
+	int paused;                         /*!< Are we paused (not accepting calls)? */
+	time_t lastcall;                    /*!< When last successful call was hungup */
+	unsigned int dead:1;                /*!< Used to detect members deleted in realtime */
+	unsigned int delme:1;               /*!< Flag to delete entry on reload */
+	struct member *next;                /*!< Next member */
 };
 
 struct member_interface {
@@ -331,10 +331,10 @@
 
 struct call_queue {
 	ast_mutex_t lock;	
-	char name[80];			/*!< Name */
-	char moh[80];			/*!< Music On Hold class to be used */
-	char announce[80];		/*!< Announcement to play when call is answered */
-	char context[AST_MAX_CONTEXT];	/*!< Exit context */
+	char name[80];                      /*!< Name */
+	char moh[80];                       /*!< Music On Hold class to be used */
+	char announce[80];                  /*!< Announcement to play when call is answered */
+	char context[AST_MAX_CONTEXT];      /*!< Exit context */
 	unsigned int monjoin:1;
 	unsigned int dead:1;
 	unsigned int joinempty:2;
@@ -349,44 +349,44 @@
 	unsigned int strategy:3;
 	unsigned int maskmemberstatus:1;
 	unsigned int realtime:1;
-	int announcefrequency;          /*!< How often to announce their position */
-	int periodicannouncefrequency;	/*!< How often to play periodic announcement */
-	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 */
-	int callsabandoned;             /*!< Number of queue calls abandoned */
-	int servicelevel;               /*!< seconds setting for servicelevel*/
-	int callscompletedinsl;         /*!< Number of calls answered with servicelevel*/
-	char monfmt[8];                 /*!< Format to use when recording calls */
-	int montype;			/*!< Monitor type  Monitor vs. MixMonitor */
-	char sound_next[80];            /*!< Sound file: "Your call is now first in line" (def. queue-youarenext) */
-	char sound_thereare[80];        /*!< Sound file: "There are currently" (def. queue-thereare) */
-	char sound_calls[80];           /*!< Sound file: "calls waiting to speak to a representative." (def. queue-callswaiting)*/
-	char sound_holdtime[80];        /*!< Sound file: "The current estimated total holdtime is" (def. queue-holdtime) */
-	char sound_minutes[80];         /*!< Sound file: "minutes." (def. queue-minutes) */
-	char sound_lessthan[80];        /*!< Sound file: "less-than" (def. queue-lessthan) */
-	char sound_seconds[80];         /*!< Sound file: "seconds." (def. queue-seconds) */
-	char sound_thanks[80];          /*!< Sound file: "Thank you for your patience." (def. queue-thankyou) */
-	char sound_reporthold[80];	/*!< Sound file: "Hold time" (def. queue-reporthold) */
-	char sound_periodicannounce[MAX_PERIODIC_ANNOUNCEMENTS][80];/* Sound files: Custom announce, no default */
-
-	int count;			/*!< How many entries */
-	int maxlen;			/*!< Max number of entries */
-	int wrapuptime;			/*!< Wrapup Time */
-
-	int retry;			/*!< Retry calling everyone after this amount of time */
-	int timeout;			/*!< How long to wait for an answer */
-	int weight;                     /*!< Respective weight */
-	int autopause;			/*!< Auto pause queue members if they fail to answer */
+	int announcefrequency;              /*!< How often to announce their position */
+	int periodicannouncefrequency;      /*!< How often to play periodic announcement */
+	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 */
+	int callsabandoned;                 /*!< Number of queue calls abandoned */
+	int servicelevel;                   /*!< seconds setting for servicelevel*/
+	int callscompletedinsl;             /*!< Number of calls answered with servicelevel*/
+	char monfmt[8];                     /*!< Format to use when recording calls */
+	int montype;                        /*!< Monitor type  Monitor vs. MixMonitor */
+	char sound_next[80];                /*!< Sound file: "Your call is now first in line" (def. queue-youarenext) */
+	char sound_thereare[80];            /*!< Sound file: "There are currently" (def. queue-thereare) */
+	char sound_calls[80];               /*!< Sound file: "calls waiting to speak to a representative." (def. queue-callswaiting)*/
+	char sound_holdtime[80];            /*!< Sound file: "The current estimated total holdtime is" (def. queue-holdtime) */
+	char sound_minutes[80];             /*!< Sound file: "minutes." (def. queue-minutes) */
+	char sound_lessthan[80];            /*!< Sound file: "less-than" (def. queue-lessthan) */
+	char sound_seconds[80];             /*!< Sound file: "seconds." (def. queue-seconds) */
+	char sound_thanks[80];              /*!< Sound file: "Thank you for your patience." (def. queue-thankyou) */
+	char sound_reporthold[80];          /*!< Sound file: "Hold time" (def. queue-reporthold) */
+	char sound_periodicannounce[MAX_PERIODIC_ANNOUNCEMENTS][80];/*!< Sound files: Custom announce, no default */
+
+	int count;                          /*!< How many entries */
+	int maxlen;                         /*!< Max number of entries */
+	int wrapuptime;                     /*!< Wrapup Time */
+
+	int retry;                          /*!< Retry calling everyone after this amount of time */
+	int timeout;                        /*!< How long to wait for an answer */
+	int weight;                         /*!< Respective weight */
+	int autopause;                      /*!< Auto pause queue members if they fail to answer */
 
 	/* Queue strategy things */
-	int rrpos;			/*!< Round Robin - position */
-	int memberdelay;		/*!< Seconds to delay connecting member to caller */
-	int autofill;			/*!< Ignore the head call status and ring an available agent */
+	int rrpos;                          /*!< Round Robin - position */
+	int memberdelay;                    /*!< Seconds to delay connecting member to caller */
+	int autofill;                       /*!< Ignore the head call status and ring an available agent */
 	
-	struct member *members;		/*!< Head of the list of members */
-	struct queue_ent *head;		/*!< Head of the list of callers */
-	AST_LIST_ENTRY(call_queue) list;	/*!< Next call queue */
+	struct member *members;             /*!< Head of the list of members */
+	struct queue_ent *head;             /*!< Head of the list of callers */
+	AST_LIST_ENTRY(call_queue) list;    /*!< Next call queue */
 };
 
 static AST_LIST_HEAD_STATIC(queues, call_queue);
@@ -517,7 +517,7 @@
 	AST_LIST_LOCK(&interfaces);
 	AST_LIST_TRAVERSE(&interfaces, curint, list) {
 		if (!strcasecmp(curint->interface, sc->dev))
-			break; 
+			break;
 	}
 	AST_LIST_UNLOCK(&interfaces);
 
@@ -526,7 +526,7 @@
 			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));
 		free(sc);
 		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));
@@ -543,16 +543,16 @@
 					continue;
 
 				manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
-					      "Queue: %s\r\n"
-					      "Location: %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->dynamic ? "dynamic" : "static",
-					      cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
+					"Queue: %s\r\n"
+					"Location: %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->dynamic ? "dynamic" : "static",
+					cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
 			}
 		}
 		ast_mutex_unlock(&q->lock);
@@ -657,14 +657,14 @@
 	q->wrapuptime = 0;
 }
 
-static int add_to_interfaces(char *interface) 
+static int add_to_interfaces(char *interface)
 {
 	struct member_interface *curint;
 
 	AST_LIST_LOCK(&interfaces);
 	AST_LIST_TRAVERSE(&interfaces, curint, list) {
 		if (!strcasecmp(curint->interface, interface))
-			break; 
+			break;
 	}
 
 	if (curint) {
@@ -725,7 +725,7 @@
 	AST_LIST_TRAVERSE_SAFE_END;
 	AST_LIST_UNLOCK(&interfaces);
 
- 	return 0;
+	return 0;
 }
 
 static void clear_and_free_interfaces(void)
@@ -889,7 +889,7 @@
 		   we will not see any effect on use_weight until next reload. */
 	} else if (!strcasecmp(param, "timeoutrestart")) {
 		q->timeoutrestart = ast_true(val);
-	} else if(failunknown) {
+	} else if (failunknown) {
 		if (linenum >= 0) {
 			ast_log(LOG_WARNING, "Unknown keyword in queue '%s': %s at line %d of queues.conf\n",
 				q->name, param, linenum);
@@ -912,8 +912,8 @@
 
 	/* Find the member, or the place to put a new one. */
 	for (m = q->members, prev_m = NULL;
-	     m && strcmp(m->interface, interface);
-	     prev_m = m, m = m->next);
+		m && strcmp(m->interface, interface);
+		prev_m = m, m = m->next);
 
 	/* Create a new one if not found, else update penalty */
 	if (!m) {
@@ -946,7 +946,7 @@
 				q->members = next;
 			remove_from_interfaces(curm->interface);
 			free(curm);
-		} else 
+		} else
 			prev = curm;
 	}
 }
@@ -1147,7 +1147,7 @@
 		*reason = QUEUE_FULL;
 	else {
 		/* There's space for us, put us at the right position inside
-		 * the queue. 
+		 * the queue.
 		 * Take into account the priority of the calling user */
 		inserted = 0;
 		prev = NULL;
@@ -1172,12 +1172,12 @@
 		ast_copy_string(qe->context, q->context, sizeof(qe->context));
 		q->count++;
 		res = 0;
-		manager_event(EVENT_FLAG_CALL, "Join", 
-			      "Channel: %s\r\nCallerID: %s\r\nCallerIDName: %s\r\nQueue: %s\r\nPosition: %d\r\nCount: %d\r\nUniqueid: %s\r\n",
-			      qe->chan->name, 
-			      S_OR(qe->chan->cid.cid_num, "unknown"), /* XXX somewhere else it is <unknown> */
-			      S_OR(qe->chan->cid.cid_name, "unknown"),
-			      q->name, qe->pos, q->count, qe->chan->uniqueid );
+		manager_event(EVENT_FLAG_CALL, "Join",
+			"Channel: %s\r\nCallerID: %s\r\nCallerIDName: %s\r\nQueue: %s\r\nPosition: %d\r\nCount: %d\r\nUniqueid: %s\r\n",
+			qe->chan->name,
+			S_OR(qe->chan->cid.cid_num, "unknown"), /* XXX somewhere else it is <unknown> */
+			S_OR(qe->chan->cid.cid_name, "unknown"),
+			q->name, qe->pos, q->count, qe->chan->uniqueid );
 		if (option_debug)
 			ast_log(LOG_DEBUG, "Queue '%s' Join, Channel '%s', Position '%d'\n", q->name, qe->chan->name, qe->pos );
 	}
@@ -1213,7 +1213,7 @@
 		return 0;
 	}
 
- 	/* If there's no context to goto, short-circuit */
+	/* If there's no context to goto, short-circuit */
 	if (ast_strlen_zero(qe->context))
 		return 0;
 
@@ -1282,7 +1282,7 @@
 	/* If the hold time is >1 min, if it's enabled, and if it's not
 	   supposed to be only once and we have already said it, say it */
 	if ((avgholdmins+avgholdsecs) > 0 && (qe->parent->announceholdtime) &&
-	    (!(qe->parent->announceholdtime == ANNOUNCEHOLDTIME_ONCE) && qe->last_pos)) {
+		(!(qe->parent->announceholdtime == ANNOUNCEHOLDTIME_ONCE) && qe->last_pos)) {
 		res = play_file(qe->chan, qe->parent->sound_holdtime);
 		if (res && valid_exit(qe, res))
 			goto playout;
@@ -1318,17 +1318,17 @@
 
 	}
 
- posout:
+posout:
 	if (option_verbose > 2)
 		ast_verbose(VERBOSE_PREFIX_3 "Told %s in %s their queue position (which was %d)\n",
-			    qe->chan->name, qe->parent->name, qe->pos);
+			qe->chan->name, qe->parent->name, qe->pos);
 	res = play_file(qe->chan, qe->parent->sound_thanks);
 	if (res && !valid_exit(qe, res))
 		res = 0;
 
- playout:
+playout:
 	/* Set our last_pos indicators */
- 	qe->last_pos = now;
+	qe->last_pos = now;
 	qe->last_pos_said = qe->pos;
 
 	/* Don't restart music on hold if we're about to exit the caller from the queue */
@@ -1429,16 +1429,16 @@
 		cur->status = status;
 		if (!q->maskmemberstatus) {
 			manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
-				      "Queue: %s\r\n"
-				      "Location: %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->dynamic ? "dynamic" : "static",
-				      cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
+				"Queue: %s\r\n"
+				"Location: %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->dynamic ? "dynamic" : "static",
+				cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
 		}
 	}
 	ast_mutex_unlock(&q->lock);
@@ -1470,7 +1470,7 @@
 	 * to solve deadlock */
 	AST_LIST_TRAVERSE(&queues, q, list) {
 		if (q == rq) /* don't check myself, could deadlock */
-			continue; 
+			continue;
 		ast_mutex_lock(&q->lock);
 		if (q->count && q->members) {
 			for (mem = q->members; mem; mem = mem->next) {
@@ -1486,7 +1486,7 @@
 			}
 		}
 		ast_mutex_unlock(&q->lock);
-		if (found) 
+		if (found)
 			break;
 	}
 	return found;
@@ -1594,7 +1594,7 @@
 		update_dial_status(qe->parent, tmp->member, status);
 		(*busies)++;
 		return 0;
-	} else if (status != tmp->oldstatus) 
+	} else if (status != tmp->oldstatus)
 		update_dial_status(qe->parent, tmp->member, status);
 	
 	tmp->chan->appl = "AppQueue";
@@ -1657,8 +1657,8 @@
 
 	for (cur = outgoing; cur; cur = cur->q_next) {
 		if (cur->stillgoing &&					/* Not already done */
-		    !cur->chan &&					/* Isn't already going */
-		    (!best || cur->metric < best->metric)) {		/* We haven't found one yet, or it's better */
+			!cur->chan &&					/* Isn't already going */
+			(!best || cur->metric < best->metric)) {		/* We haven't found one yet, or it's better */
 			best = cur;
 		}
 	}
@@ -1787,12 +1787,12 @@
 {
 	ast_mutex_lock(&qe->parent->lock);
 	manager_event(EVENT_FLAG_AGENT, "QueueCallerAbandon",
-	              "Queue: %s\r\n"
-	              "Uniqueid: %s\r\n"
-	              "Position: %d\r\n"
-	              "OriginalPosition: %d\r\n"
-	              "HoldTime: %d\r\n",
-	              qe->parent->name, qe->chan->uniqueid, qe->pos, qe->opos, (int)(time(NULL) - qe->start));
+		"Queue: %s\r\n"
+		"Uniqueid: %s\r\n"
+		"Position: %d\r\n"
+		"OriginalPosition: %d\r\n"
+		"HoldTime: %d\r\n",
+		qe->parent->name, qe->chan->uniqueid, qe->pos, qe->opos, (int)(time(NULL) - qe->start));
 
 	qe->parent->callsabandoned++;
 	ast_mutex_unlock(&qe->parent->lock);
@@ -1813,8 +1813,8 @@
 				ast_verbose( VERBOSE_PREFIX_3 "Failed to pause Queue Member %s in queue %s!\n", membername, qe->parent->name);
 		}
 	}
- return;
-} 
+	return;
+}
 
 #define AST_MAX_WATCHERS 256
 
@@ -1838,7 +1838,7 @@
 
 	starttime = (long) time(NULL);
 	
-	while(*to && !peer) {
+	while (*to && !peer) {
 		int numlines, retry, pos = 1;
 		struct ast_channel *watchers[AST_MAX_WATCHERS];
 		watchers[0] = in;
@@ -1854,7 +1854,7 @@
 				numlines++;
 			}
 			if (pos > 1 /* found */ || !stillgoing /* nobody listening */ ||
-					 (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) /* ring would not be delivered */)
+				(qe->parent->strategy != QUEUE_STRATEGY_RINGALL) /* ring would not be delivered */)
 				break;
 			/* On "ringall" strategy we only move to the next penalty level
 			   when *all* ringing phones are done in the current penalty level */
@@ -1899,7 +1899,7 @@
 						ast_verbose(VERBOSE_PREFIX_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) 
+					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);
@@ -1922,7 +1922,7 @@
 								free(o->chan->cid.cid_ani);
 							o->chan->cid.cid_ani = ast_strdup(in->cid.cid_ani);
 						}
-						if (o->chan->cid.cid_rdnis) 
+						if (o->chan->cid.cid_rdnis)
 							free(o->chan->cid.cid_rdnis);
 						o->chan->cid.cid_rdnis = ast_strdup(S_OR(in->macroexten, in->exten));
 						if (ast_call(o->chan, tmpchan, 0)) {
@@ -1938,7 +1938,7 @@
 				f = ast_read(winner);
 				if (f) {
 					if (f->frametype == AST_FRAME_CONTROL) {
-						switch(f->subclass) {
+						switch (f->subclass) {
 						case AST_CONTROL_ANSWER:
 							/* This is our guy if someone answered. */
 							if (!peer) {
@@ -2035,7 +2035,7 @@
 			}
 			ast_frfree(f);
 		}
-		if (!*to) 
+		if (!*to)
 			rna(orig, qe, on);
 	}
 
@@ -2148,12 +2148,12 @@
 
 		/* Make a position announcement, if enabled */
 		if (qe->parent->announcefrequency && !ringing &&
-		    (res = say_position(qe)))
+			(res = say_position(qe)))
 			break;
 
 		/* Make a periodic announcement, if enabled */
 		if (qe->parent->periodicannouncefrequency && !ringing &&
-		    (res = say_periodic_announcement(qe)))
+			(res = say_periodic_announcement(qe)))
 			break;
 
 		/* Wait a second before checking again */
@@ -2172,7 +2172,7 @@
 		be sure it's still valid */
 	ast_mutex_lock(&q->lock);
 	cur = q->members;
-	while(cur) {
+	while (cur) {
 		if (member == cur) {
 			time(&cur->lastcall);
 			cur->calls++;
@@ -2307,11 +2307,11 @@
 		}
 
 	/* Hold the lock while we setup the outgoing calls */
-	if (use_weight) 
+	if (use_weight)
 		AST_LIST_LOCK(&queues);
 	ast_mutex_lock(&qe->parent->lock);
 	if (option_debug)
-		ast_log(LOG_DEBUG, "%s is trying to call a queue member.\n", 
+		ast_log(LOG_DEBUG, "%s is trying to call a queue member.\n",
 							qe->chan->name);
 	ast_copy_string(queuename, qe->parent->name, sizeof(queuename));
 	cur = qe->parent->members;
@@ -2325,7 +2325,7 @@
 
 		if (!tmp) {
 			ast_mutex_unlock(&qe->parent->lock);
-			if (use_weight) 
+			if (use_weight)
 				AST_LIST_UNLOCK(&queues);
 			goto out;
 		}
@@ -2337,7 +2337,7 @@
 		/* Special case: If we ring everyone, go ahead and ring them, otherwise
 		   just calculate their metric for the appropriate strategy */
 		if (!calc_metric(qe->parent, cur, x++, qe, tmp)) {
-			/* Put them in the list of outgoing thingies...  We're ready now. 
+			/* Put them in the list of outgoing thingies...  We're ready now.
 			   XXX If we're forcibly removed, these outgoing calls won't get
 			   hung up XXX */
 			tmp->q_next = outgoing;
@@ -2355,7 +2355,7 @@
 		to = (qe->parent->timeout) ? qe->parent->timeout * 1000 : -1;
 	ring_one(qe, outgoing, &numbusies);
 	ast_mutex_unlock(&qe->parent->lock);
-	if (use_weight) 
+	if (use_weight)
 		AST_LIST_UNLOCK(&queues);
 	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT));
 	ast_mutex_lock(&qe->parent->lock);
@@ -2375,7 +2375,7 @@
 			ast_log(LOG_DEBUG, "%s: Nobody answered.\n", qe->chan->name);
 	} else { /* peer is valid */
 		/* Ah ha!  Someone answered within the desired timeframe.  Of course after this
-		   we will always return with -1 so that it is hung up properly after the 
+		   we will always return with -1 so that it is hung up properly after the
 		   conversation.  */
 		qe->handled++;
 		if (!strcmp(qe->chan->tech->type, "Zap"))
@@ -2409,7 +2409,7 @@
 						if (holdtime < 2) {
 							play_file(peer, qe->parent->sound_lessthan);
 							ast_say_number(peer, 2, AST_DIGIT_ANY, peer->language, NULL);
-						} else 
+						} else
 							ast_say_number(peer, holdtime, AST_DIGIT_ANY, peer->language, NULL);
 						play_file(peer, qe->parent->sound_minutes);
 					}
@@ -2467,7 +2467,7 @@
 					which = peer;
 				if (monitorfilename)
 					ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1 );
-				else if (qe->chan->cdr) 
+				else if (qe->chan->cdr)
 					ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1 );
 				else {
 					/* Last ditch effort -- no CDR, make up something */
@@ -2483,7 +2483,7 @@
 				if (!monitorfilename) {
 					if (qe->chan->cdr)
 						ast_copy_string(tmpid, qe->chan->cdr->uniqueid, sizeof(tmpid)-1);
-					else 
+					else
 						snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
 				} else {
 					ast_copy_string(tmpid2, monitorfilename, sizeof(tmpid2)-1);
@@ -2510,7 +2510,7 @@
 
 					memset(meid, 0, sizeof(meid));
 					pbx_substitute_variables_helper(qe->chan, meid2, meid, sizeof(meid) - 1);
-				} 
+				}
 	
 				snprintf(tmpid2, sizeof(tmpid2)-1, "%s.%s", tmpid, qe->parent->monfmt);
 
@@ -2530,9 +2530,9 @@
 				}
 
 				if (mixmonapp) {
-					if (!ast_strlen_zero(monitor_exec) && !ast_strlen_zero(monitor_options)) 
+					if (!ast_strlen_zero(monitor_exec) && !ast_strlen_zero(monitor_options))
 						snprintf(mixmonargs, sizeof(mixmonargs)-1, "%s|b%s|%s", tmpid2, monitor_options, monitor_exec);
-					else 
+					else
 						snprintf(mixmonargs, sizeof(mixmonargs)-1, "%s|b%s", tmpid2, monitor_options);
 						
 					if (option_debug)
@@ -2547,11 +2547,11 @@
 		}
 		/* Drop out of the queue at this point, to prepare for next caller */
 		leave_queue(qe);			
- 		if (!ast_strlen_zero(url) && ast_channel_supports_html(peer)) {
+		if (!ast_strlen_zero(url) && ast_channel_supports_html(peer)) {
 			if (option_debug)
-	 			ast_log(LOG_DEBUG, "app_queue: sendurl=%s.\n", url);
- 			ast_channel_sendurl(peer, url);
- 		}
+				ast_log(LOG_DEBUG, "app_queue: sendurl=%s.\n", url);
+			ast_channel_sendurl(peer, url);
+		}
 		if (qe->parent->setinterfacevar)
 				pbx_builtin_setvar_helper(qe->chan, "MEMBERINTERFACE", member->interface);
 		if (!ast_strlen_zero(agi)) {
@@ -2561,7 +2561,7 @@
 			if (app) {
 				agiexec = ast_strdupa(agi);
 				ret = pbx_exec(qe->chan, app, agiexec);
-			} else 
+			} else
 				ast_log(LOG_WARNING, "Asked to execute an AGI on this channel, but could not find application (agi)!\n");
 		}
 		ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "CONNECT", "%ld|%s", (long)time(NULL) - qe->start, peer->uniqueid);
@@ -2584,12 +2584,12 @@
 		bridge = ast_bridge_call(qe->chan,peer, &bridge_config);
 
 		if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
-			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "TRANSFER", "%s|%s|%ld|%ld", 
-				      qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
-				      (long) (time(NULL) - callstart));
+			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "TRANSFER", "%s|%s|%ld|%ld",
+				qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
+				(long) (time(NULL) - callstart));
 		} else if (qe->chan->_softhangup) {
 			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETECALLER", "%ld|%ld",
-				      (long) (callstart - qe->start), (long) (time(NULL) - callstart));
+				(long) (callstart - qe->start), (long) (time(NULL) - callstart));
 			if (qe->parent->eventwhencalled)
 				manager_event(EVENT_FLAG_AGENT, "AgentComplete",
 						"Queue: %s\r\n"
@@ -2605,7 +2605,7 @@
 						qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 		} else {
 			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETEAGENT", "%ld|%ld",
-				      (long) (callstart - qe->start), (long) (time(NULL) - callstart));
+				(long) (callstart - qe->start), (long) (time(NULL) - callstart));
 			if (qe->parent->eventwhencalled)
 				manager_event(EVENT_FLAG_AGENT, "AgentComplete",
 						"Queue: %s\r\n"
@@ -2677,8 +2677,8 @@
 			continue;
 
 		res = snprintf(value + value_len, sizeof(value) - value_len, "%s;%d;%d%s",
-			       cur_member->interface, cur_member->penalty, cur_member->paused,
-			       cur_member->next ? "|" : "");
+			cur_member->interface, cur_member->penalty, cur_member->paused,
+			cur_member->next ? "|" : "");
 		if (res != strlen(value + value_len)) {

[... 3902 lines stripped ...]


More information about the asterisk-commits mailing list