[asterisk-commits] branch oej/sipregister r27345 - in /team/oej/sipregister: ./ apps/ build_tool...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue May 16 07:07:17 MST 2006


Author: oej
Date: Tue May 16 09:07:16 2006
New Revision: 27345

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

Added:
    team/oej/sipregister/build_tools/make_buildopts_h
      - copied unchanged from r27306, trunk/build_tools/make_buildopts_h
Modified:
    team/oej/sipregister/   (props changed)
    team/oej/sipregister/.cleancount
    team/oej/sipregister/Makefile
    team/oej/sipregister/apps/Makefile
    team/oej/sipregister/apps/app_externalivr.c
    team/oej/sipregister/apps/app_meetme.c
    team/oej/sipregister/apps/app_speech_utils.c
    team/oej/sipregister/apps/app_voicemail.c
    team/oej/sipregister/asterisk.c
    team/oej/sipregister/build_tools/Makefile
    team/oej/sipregister/build_tools/cflags.xml
    team/oej/sipregister/channel.c
    team/oej/sipregister/channels/Makefile
    team/oej/sipregister/channels/chan_agent.c
    team/oej/sipregister/channels/chan_sip.c
    team/oej/sipregister/configs/manager.conf.sample
    team/oej/sipregister/configs/sip.conf.sample
    team/oej/sipregister/configure.ac
    team/oej/sipregister/dnsmgr.c
    team/oej/sipregister/doc/cliprompt.txt
    team/oej/sipregister/enum.c
    team/oej/sipregister/funcs/func_cdr.c
    team/oej/sipregister/funcs/func_logic.c
    team/oej/sipregister/image.c
    team/oej/sipregister/include/asterisk/   (props changed)
    team/oej/sipregister/include/asterisk/linkedlists.h
    team/oej/sipregister/include/asterisk/lock.h
    team/oej/sipregister/include/asterisk/rtp.h
    team/oej/sipregister/loader.c
    team/oej/sipregister/manager.c
    team/oej/sipregister/pbx.c
    team/oej/sipregister/res/res_features.c
    team/oej/sipregister/rtp.c

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

Propchange: team/oej/sipregister/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

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

Propchange: team/oej/sipregister/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue May 16 09:07:16 2006
@@ -1,1 +1,1 @@
-/trunk:1-26708
+/trunk:1-27339

Modified: team/oej/sipregister/.cleancount
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/.cleancount?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/.cleancount (original)
+++ team/oej/sipregister/.cleancount Tue May 16 09:07:16 2006
@@ -1,1 +1,1 @@
-15
+16

Modified: team/oej/sipregister/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/Makefile?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/Makefile (original)
+++ team/oej/sipregister/Makefile Tue May 16 09:07:16 2006
@@ -24,18 +24,6 @@
 #CROSS_PROC=arm
 #SUB_PROC=xscale # or maverick
 
-# Pentium Pro Optimize
-#PROC=i686
-
-# Pentium & VIA processors optimize
-#PROC=i586
-
-#PROC=k6
-#PROC=ppc
-
-CC=$(CROSS_COMPILE)gcc
-HOST_CC=gcc
-
 ifeq ($(CROSS_COMPILE),)
   OSARCH=$(shell uname -s)
   PROC?=$(shell uname -m)
@@ -69,37 +57,7 @@
 OVERWRITE=y
 
 # Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3 #-pg
-
-# Set NOCRYPTO to yes if you do not want to have crypto support or dependencies
-#NOCRYPTO=yes
-
-# If you are running a radio application, define RADIO_RELAX so that the DTMF
-# will be received more reliably
-#OPTIONS += -DRADIO_RELAX
-
-# If you don't have a lot of memory (e.g. embedded Asterisk), define LOW_MEMORY
-# to reduce the size of certain static buffers
-#ifneq ($(CROSS_COMPILE),)
-#OPTIONS += -DLOW_MEMORY
-#endif
-
-# Asterisk SMDI integration
-WITH_SMDI = 1
-
-# Optional debugging parameters
-DEBUG_THREADS = #-DDUMP_SCHEDULER #-DDEBUG_SCHEDULER #-DDEBUG_THREADS #-DDO_CRASH #-DDETECT_DEADLOCKS
-
-# If you want to debug channel locking, try this (depends on code using
-# ast_channel_lock and companions to work)
-DEBUG_THREADS += #-DDEBUG_CHANNEL_LOCKS
-
-# Uncomment next one to enable ast_frame tracing (for debugging)
-TRACE_FRAMES = #-DTRACE_FRAMES
-
-# Where to install asterisk after compiling
-# Default -> leave empty
-INSTALL_PREFIX?=
+DEBUG=-g3
 
 # Staging directory
 # Files are copied here temporarily during the install process
@@ -110,16 +68,16 @@
 #DESTDIR?=/tmp/asterisk
 
 # Original busydetect routine
-BUSYDETECT = #-DBUSYDETECT
+#BUSYDETECT = -DBUSYDETECT
 
 # Improved busydetect routine, comment the previous one if you use this one
-BUSYDETECT+= #-DBUSYDETECT_MARTIN 
+#BUSYDETECT+= -DBUSYDETECT_MARTIN 
 # Detect the busy signal looking only at tone lengths
 # For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence
-BUSYDETECT+= #-DBUSYDETECT_TONEONLY
+#BUSYDETECT+= -DBUSYDETECT_TONEONLY
 # Enforce the detection of busy signal (get rid of false hangups)
 # Don't use together with -DBUSYDETECT_TONEONLY
-BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
+#BUSYDETECT+= -DBUSYDETECT_COMPARE_TONE_AND_SILENCE
 
 # Define standard directories for various platforms
 # These apply if they are not redefined in asterisk.conf 
@@ -195,14 +153,13 @@
   include makeopts
 endif
 
-ASTCFLAGS+=$(MENUSELECT_CFLAGS)
 TOPDIR_CFLAGS=-include include/autoconfig.h -Iinclude
 MOD_SUBDIR_CFLAGS=-include ../include/autoconfig.h -I../include -I..
 OTHER_SUBDIR_CFLAGS=-include ../include/autoconfig.h -I../include -I..
 
 #   *CLI> show memory allocations [filename]
 #   *CLI> show memory summary [filename]
-ifneq ($(findstring -DMALLOC_DEBUG,$(ASTCFLAGS)),)
+ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
   TOPDIR_CFLAGS+=-include include/asterisk/astmm.h
   MOD_SUBDIR_CFLAGS+=-include ../include/asterisk/astmm.h
 endif
@@ -252,7 +209,7 @@
   ID=/usr/xpg4/bin/id
 endif
 
-ASTCFLAGS+=-pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) #-DMAKE_VALGRIND_HAPPY
+ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
 ASTCFLAGS+=$(OPTIMIZE)
 
 ifeq ($(AST_DEVMODE),yes)
@@ -260,7 +217,7 @@
 endif
 
 ifeq ($(shell gcc -v 2>&1 | grep 'gcc version' | cut -f3 -d' ' | cut -f1 -d.),4)
-ASTCFLAGS+= -Wno-pointer-sign
+ASTCFLAGS+=-Wno-pointer-sign
 endif
 ASTOBJ=-o asterisk
 
@@ -287,8 +244,7 @@
 endif # FreeBSD
 
 ifeq ($(OSARCH),NetBSD)
-  ASTCFLAGS+=-pthread
-  INCLUDE+=-I$(CROSS_COMPILE_TARGET)/usr/pkg/include
+  AST_CFLAGS+=-pthread -I$(CROSS_COMPILE_TARGET)/usr/pkg/include
   MPG123TARG=netbsd
 endif
 
@@ -297,8 +253,7 @@
 endif
 
 ifeq ($(OSARCH),SunOS)
-  ASTCFLAGS+=-Wcast-align -DSOLARIS
-  INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
+  ASTCFLAGS+=-Wcast-align -DSOLARIS -Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
 endif
 
 LIBEDIT=editline/libedit.a
@@ -323,13 +278,9 @@
   endif
 endif
 
-ASTCFLAGS+= $(DEBUG_THREADS)
-ASTCFLAGS+= $(TRACE_FRAMES)
-ASTCFLAGS+= $(MALLOC_DEBUG)
-ASTCFLAGS+= $(BUSYDETECT)
-ASTCFLAGS+= $(OPTIONS)
+ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS)
 ifeq ($(findstring dont-optimize,$(MAKECMDGOALS)),)
-ASTCFLAGS+= -fomit-frame-pointer 
+ASTCFLAGS+=-fomit-frame-pointer
 endif
 
 MOD_SUBDIRS=res channels pbx apps codecs formats cdr funcs
@@ -348,11 +299,11 @@
 # we need to link in the objects statically, not as a library, because
 # otherwise modules will not have them available if none of the static
 # objects use it.
-OBJS+= stdtime/localtime.o
+OBJS+=stdtime/localtime.o
 
 # At the moment say.o is an optional component which can be overridden
 # by a module.
-OBJS+= say.o
+OBJS+=say.o
 
 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
   OBJS+= poll.o
@@ -411,7 +362,7 @@
 endif
 
 ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
-  CFLAGS+=$(TOPDIR_CFLAGS) $(ASTCFLAGS)
+  CFLAGS+=$(TOPDIR_CFLAGS)$(ASTCFLAGS)
 endif
 
 # This is used when generating the doxygen documentation
@@ -432,7 +383,7 @@
 	@echo " +               make install                +"  
 	@echo " +-------------------------------------------+"  
 
-all: config.status menuselect.makeopts cleantest depend asterisk subdirs
+all: cleantest config.status menuselect.makeopts depend asterisk subdirs
 
 config.status: configure
 	@CFLAGS="" ./configure
@@ -525,10 +476,17 @@
 	fi
 	@rm -f $@.tmp
 
+include/asterisk/buildopts.h: menuselect.makeopts
+	@build_tools/make_buildopts_h > $@.tmp
+	@if cmp -s $@.tmp $@ ; then echo; else \
+		mv $@.tmp $@ ; \
+	fi
+	@rm -f $@.tmp
+
 stdtime/libtime.a:
-	CFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) -C stdtime libtime.a
-
-asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
+	CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C stdtime libtime.a
+
+asterisk: include/asterisk/buildopts.h editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
 	build_tools/make_build_h > include/asterisk/build.h.tmp
 	if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
 		mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
@@ -541,9 +499,9 @@
 	$(CC) $(AUDIO_LIBS) -o muted muted.o
 
 subdirs: 
-	@for x in $(MOD_SUBDIRS); do CFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) -C $$x || exit 1 ; done
-	@CFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) -C utils
-	@CFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) -C agi
+	@for x in $(MOD_SUBDIRS); do CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $$x || exit 1 ; done
+	@CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C utils
+	@CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C agi
 
 clean-depend:
 	@for x in $(SUBDIRS); do $(MAKE) -C $$x clean-depend || exit 1 ; done
@@ -567,6 +525,7 @@
 	rm -f menuselect.makeopts makeopts makeopts.xml
 	rm -f config.log config.status
 	rm -f include/autoconfig.h
+	rm -f include/asterisk/buildopts.h
 	$(MAKE) -C mxml clean
 	$(MAKE) -C build_tools dist-clean
 
@@ -675,7 +634,7 @@
 	if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
 	ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
 	$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/	
+	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
 	if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
 		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
 		chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
@@ -862,7 +821,7 @@
 
 rpm: __rpm
 
-__rpm: include/asterisk/version.h spec
+__rpm: include/asterisk/version.h include/asterisk/buildopts.h spec
 	rm -rf /tmp/asterisk ; \
 	mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
 	$(MAKE) DESTDIR=/tmp/asterisk install ; \
@@ -911,10 +870,10 @@
 
 valgrind: dont-optimize
 
-depend: include/asterisk/version.h .depend defaults.h 
+depend: include/asterisk/version.h include/asterisk/buildopts.h .depend defaults.h 
 	@for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
 
-.depend: include/asterisk/version.h defaults.h
+.depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h
 	build_tools/mkdep $(CFLAGS) $(wildcard *.c)
 
 .tags-depend:
@@ -997,7 +956,7 @@
 menuselect: build_tools/menuselect makeopts.xml
 	- at build_tools/menuselect ${GLOBAL_MAKEOPTS} ${USER_MAKEOPTS} menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
 
-build_tools/menuselect: build_tools/menuselect.c build_tools/menuselect_curses.c build_tools/menuselect.h include/autoconfig.h mxml/libmxml.a $(MENUSELECT_OBJS)
+build_tools/menuselect: build_tools/menuselect.c build_tools/menuselect_curses.c build_tools/menuselect.h config.status mxml/libmxml.a $(MENUSELECT_OBJS)
 	$(MAKE) -C build_tools menuselect
 
 mxml/libmxml.a:

Modified: team/oej/sipregister/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/Makefile?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/apps/Makefile (original)
+++ team/oej/sipregister/apps/Makefile Tue May 16 09:07:16 2006
@@ -12,10 +12,6 @@
 #
 
 MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%.so,$(wildcard app_*.c)))
-
-ifneq ($(WITH_SMDI),)
-  CFLAGS+=-DWITH_SMDI
-endif
 
 # If you have UnixODBC you can use ODBC voicemail
 # storage

Modified: team/oej/sipregister/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_externalivr.c?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_externalivr.c (original)
+++ team/oej/sipregister/apps/app_externalivr.c Tue May 16 09:07:16 2006
@@ -258,14 +258,14 @@
 	FILE *child_commands = NULL;
 	FILE *child_errors = NULL;
 	FILE *child_events = NULL;
-	struct ivr_localuser foo, *u = &foo;
-
-	bzero(u, sizeof(*u));
+	struct ivr_localuser foo = {
+		.playlist = AST_LIST_HEAD_INIT_VALUE,
+		.finishlist = AST_LIST_HEAD_INIT_VALUE,
+	};
+	struct ivr_localuser *u = &foo;
 
 	LOCAL_USER_ADD(lu);
 	
-	AST_LIST_HEAD_INIT(&u->playlist);
-	AST_LIST_HEAD_INIT(&u->finishlist);
 	u->abort_current_sound = 0;
 	u->chan = chan;
 	

Modified: team/oej/sipregister/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_meetme.c?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_meetme.c (original)
+++ team/oej/sipregister/apps/app_meetme.c Tue May 16 09:07:16 2006
@@ -152,8 +152,6 @@
 	int zapconf;				/* Zaptel Conf # */
 	int users;				/* Number of active users */
 	int markedusers;			/* Number of marked users */
-	struct ast_conf_user *firstuser;	/* Pointer to the first user struct */
-	struct ast_conf_user *lastuser;		/* Pointer to the last user struct */
 	time_t start;				/* Start time (s) */
 	int refcount;				/* reference count of usage */
 	unsigned int recording:2;				/* recording status */
@@ -168,6 +166,7 @@
 	struct ast_frame *transframe[32];
 	struct ast_frame *origframe;
 	struct ast_trans_pvt *transpath[32];
+	AST_LIST_HEAD_NOLOCK(, ast_conf_user) userlist;
 	AST_LIST_ENTRY(ast_conference) list;
 };
 
@@ -180,8 +179,6 @@
 
 struct ast_conf_user {
 	int user_no;				/* User Number */
-	struct ast_conf_user *prevuser;		/* Pointer to the previous user */
-	struct ast_conf_user *nextuser;		/* Pointer to the next user */
 	int userflags;				/* Flags as set in the conference */
 	int adminflags;				/* Flags set by the Admin */
 	struct ast_channel *chan;		/* Connected channel */
@@ -192,6 +189,7 @@
 	time_t jointime;			/* Time the user joined the conference */
 	struct volume talk;
 	struct volume listen;
+	AST_LIST_ENTRY(ast_conf_user) list;
 };
 
 static int audio_buffers;			/* The number of audio buffers to be allocated on pseudo channels
@@ -532,9 +530,6 @@
 			cnf->start = time(NULL);
 			cnf->zapconf = ztc.confno;
 			cnf->isdynamic = dynamic ? 1 : 0;
-			cnf->firstuser = NULL;
-			cnf->lastuser = NULL;
-			cnf->locked = 0;
 			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
 			AST_LIST_INSERT_HEAD(&confs, cnf, list);
@@ -665,7 +660,7 @@
 			return RESULT_SUCCESS;
 		}
 		/* Show all the users */
-		for (user = cnf->firstuser; user; user = user->nextuser){
+		AST_LIST_TRAVERSE(&cnf->userlist, user, list) {
 			now = time(NULL);
 			hr = (now - user->jointime) / 3600;
 			min = ((now - user->jointime) % 3600) / 60;
@@ -751,7 +746,7 @@
 
 			if (cnf) {
 				/* Search for the user */
-				for (usr = cnf->firstuser; usr; usr = usr->nextuser) {
+				AST_LIST_TRAVERSE(&cnf->userlist, usr, list) {
 					snprintf(usrno, sizeof(usrno), "%d", usr->user_no);
 					if (!strncasecmp(word, usrno, len) && ++which > state)
 						break;
@@ -928,24 +923,13 @@
 		conf->markedusers++;
       
    	ast_mutex_lock(&conf->playlock);
-	if (!conf->firstuser) {
-		/* Fill the first new User struct */
+
+	if (AST_LIST_EMPTY(&conf->userlist))
 		user->user_no = 1;
-		conf->firstuser = user;
-		conf->lastuser = user;
-	} else {
-		/* Fill the new user struct */	
-		user->user_no = conf->lastuser->user_no + 1; 
-		user->prevuser = conf->lastuser;
-		if (conf->lastuser->nextuser) {
-			ast_log(LOG_WARNING, "Error in User Management!\n");
-			ast_mutex_unlock(&conf->playlock);
-			goto outrun;
-		} else {
-			conf->lastuser->nextuser = user;
-			conf->lastuser = user;
-		}
-	}
+	else
+		user->user_no = AST_LIST_LAST(&conf->userlist)->user_no + 1;
+
+	AST_LIST_INSERT_TAIL(&conf->userlist, user, list);
 
 	user->chan = chan;
 	user->userflags = confflags;
@@ -1480,7 +1464,7 @@
 								break;
 							case '3': /* Eject last user */
 								menu_active = 0;
-								usr = conf->lastuser;
+								usr = AST_LIST_LAST(&conf->userlist);
 								if ((usr->chan->name == chan->name)||(usr->userflags & CONFFLAG_ADMIN)) {
 									if(!ast_streamfile(chan, "conf-errormenu", chan->language))
 										ast_waitstream(chan, "");
@@ -1711,39 +1695,12 @@
 		ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
 		if (confflags & CONFFLAG_MARKEDUSER) 
 			conf->markedusers--;
-		if (!conf->users) {
+		if (AST_LIST_EMPTY(&conf->userlist)) {
 			/* close this one when no more users and no references*/
-			if (!conf->refcount){
+			if (!conf->refcount)
 				conf_free(conf);
-			}
 		} else {
-			/* Remove the user struct */ 
-			if (user == conf->firstuser) {
-				if (user->nextuser) {
-					/* There is another entry */
-					user->nextuser->prevuser = NULL;
-				} else {
-					/* We are the only entry */
-					conf->lastuser = NULL;
-				}
-				/* In either case */
-				conf->firstuser = user->nextuser;
-			} else if (user == conf->lastuser){
-				if (user->prevuser)
-					user->prevuser->nextuser = NULL;
-				else
-					ast_log(LOG_ERROR, "Bad bad bad!  We're the last, not the first, but nobody before us??\n");
-				conf->lastuser = user->prevuser;
-			} else {
-				if (user->nextuser)
-					user->nextuser->prevuser = user->prevuser;
-				else
-					ast_log(LOG_ERROR, "Bad! Bad! Bad! user->nextuser is NULL but we're not the end!\n");
-				if (user->prevuser)
-					user->prevuser->nextuser = user->nextuser;
-				else
-					ast_log(LOG_ERROR, "Bad! Bad! Bad! user->prevuser is NULL but we're not the beginning!\n");
-			}
+			AST_LIST_REMOVE(&conf->userlist, user, list);
 		}
 		/* Return the number of seconds the user was in the conf */
 		snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime));
@@ -2221,18 +2178,16 @@
 	return res;
 }
 
-static struct ast_conf_user* find_user(struct ast_conference *conf, char *callerident) 
+static struct ast_conf_user *find_user(struct ast_conference *conf, char *callerident) 
 {
 	struct ast_conf_user *user = NULL;
 	int cid;
 	
 	sscanf(callerident, "%i", &cid);
 	if (conf && callerident) {
-		user = conf->firstuser;
-		while (user) {
+		AST_LIST_TRAVERSE(&conf->userlist, user, list) {
 			if (cid == user->user_no)
 				return user;
-			user = user->nextuser;
 		}
 	}
 	return NULL;
@@ -2282,23 +2237,15 @@
 			case 108: /* l: Unlock */ 
 				cnf->locked = 0;
 				break;
-			case 75: /* K: kick all users*/
-				user = cnf->firstuser;
-				while(user) {
+			case 75: /* K: kick all users */
+				AST_LIST_TRAVERSE(&cnf->userlist, user, list)
 					user->adminflags |= ADMINFLAG_KICKME;
-					if (user->nextuser) {
-						user = user->nextuser;
-					} else {
-						break;
-					}
-				}
 				break;
 			case 101: /* e: Eject last user*/
-				user = cnf->lastuser;
-				if (!(user->userflags & CONFFLAG_ADMIN)) {
+				user = AST_LIST_LAST(&cnf->userlist);
+				if (!(user->userflags & CONFFLAG_ADMIN))
 					user->adminflags |= ADMINFLAG_KICKME;
-					break;
-				} else
+				else
 					ast_log(LOG_NOTICE, "Not kicking last user, is an Admin!\n");
 				break;
 			case 77: /* M: Mute */ 
@@ -2314,15 +2261,9 @@
 				}
 				break;
 			case 78: /* N: Mute all users */
-				user = cnf->firstuser;
-				while(user) {
-					if (user && !(user->userflags & CONFFLAG_ADMIN))
+				AST_LIST_TRAVERSE(&cnf->userlist, user, list) {
+					if (!(user->userflags & CONFFLAG_ADMIN))
 						user->adminflags |= ADMINFLAG_MUTED;
-					if (user->nextuser) {
-						user = user->nextuser;
-					} else {
-						break;
-					}
 				}
 				break;					
 			case 109: /* m: Unmute */ 
@@ -2337,25 +2278,15 @@
 					ast_log(LOG_NOTICE, "Specified User not found or he muted himself!\n");
 				}
 				break;
-			case  110: /* n: Unmute all users */
-				user = cnf->firstuser;
-				while(user) {
-					if (user && (user-> adminflags & ADMINFLAG_MUTED)) {
-						user->adminflags ^= ADMINFLAG_MUTED;
-					}
-					if (user->nextuser) {
-						user = user->nextuser;
-					} else {
-						break;
-					}
-				}
+			case 110: /* n: Unmute all users */
+				AST_LIST_TRAVERSE(&cnf->userlist, user, list)
+					user->adminflags &= ~ADMINFLAG_MUTED;
 				break;
 			case 107: /* k: Kick user */ 
-				if (user) {
+				if (user)
 					user->adminflags |= ADMINFLAG_KICKME;
-				} else {
+				else
 					ast_log(LOG_NOTICE, "Specified User not found!");
-				}
 				break;
 			}
 		} else {

Modified: team/oej/sipregister/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_speech_utils.c?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_speech_utils.c (original)
+++ team/oej/sipregister/apps/app_speech_utils.c Tue May 16 09:07:16 2006
@@ -511,6 +511,12 @@
                 LOCAL_USER_REMOVE(u);
                 return -1;
         }
+
+	/* If channel is not already answered, then answer it */
+	if (chan->_state != AST_STATE_UP && ast_answer(chan)) {
+		LOCAL_USER_REMOVE(u);
+		return -1;
+	}
 
         /* Record old read format */
         oldreadformat = chan->readformat;

Modified: team/oej/sipregister/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_voicemail.c?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_voicemail.c (original)
+++ team/oej/sipregister/apps/app_voicemail.c Tue May 16 09:07:16 2006
@@ -919,7 +919,7 @@
 			odbc_release_obj(obj);
 			goto yuck;
 		}
-		fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC);
+		fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC, 0770);
 		if (fd < 0) {
 			ast_log(LOG_WARNING, "Failed to write '%s': %s\n", full_fn, strerror(errno));
 			SQLFreeHandle (SQL_HANDLE_STMT, stmt);
@@ -949,13 +949,13 @@
 			if (!strcasecmp(coltitle, "recording")) {
 				res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize);
 				fdlen = colsize;
-				fd = open(full_fn, O_RDWR | O_TRUNC | O_CREAT, 0770);
 				if (fd > -1) {
 					char tmp[1]="";
 					lseek(fd, fdlen - 1, SEEK_SET);
 					if (write(fd, tmp, 1) != 1) {
 						close(fd);
 						fd = -1;
+						continue;
 					}
 					if (fd > -1)
 						fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);

Modified: team/oej/sipregister/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/asterisk.c?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/asterisk.c (original)
+++ team/oej/sipregister/asterisk.c Tue May 16 09:07:16 2006
@@ -1644,6 +1644,9 @@
 					}
 					break;
 #endif
+				case 's': /* Asterisk system name (from asterisk.conf) */
+					strncat(p, ast_config_AST_SYSTEM_NAME, sizeof(prompt) - strlen(prompt) - 1);
+					break;
 				case 't': /* time */
 					memset(&tm, 0, sizeof(tm));
 					time(&ts);

Modified: team/oej/sipregister/build_tools/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/build_tools/Makefile?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/build_tools/Makefile (original)
+++ team/oej/sipregister/build_tools/Makefile Tue May 16 09:07:16 2006
@@ -1,5 +1,5 @@
 MENUSELECT_OBJS=menuselect.o menuselect_curses.o
-MENUSELECT_CFLAGS=-g -c -D_GNU_SOURCE -I../ -I../include/
+MENUSELECT_CFLAGS=-g -c -D_GNU_SOURCE -DMENUSELECT -I../ -I../include/
 MENUSELECT_LIBS=../mxml/libmxml.a
 
 ifeq ($(OSARCH),SunOS)

Modified: team/oej/sipregister/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/build_tools/cflags.xml?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/build_tools/cflags.xml (original)
+++ team/oej/sipregister/build_tools/cflags.xml Tue May 16 09:07:16 2006
@@ -1,20 +1,23 @@
 	<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" force_clean_on_change="yes">
-		<member name="-DDEBUG_SCHEDULER">
+		<member name="DEBUG_SCHEDULER" displayname="Enable Scheduler Debugging Output">
 		</member>
-		<member name="-DDEBUG_THREADS">
+		<member name="DEBUG_THREADS" displayname="Enable Thread Debugging">
 		</member>
-		<member name="-DDETECT_DEADLOCKS">
+		<member name="DETECT_DEADLOCKS" displayname="Detect Deadlocks">
 		</member>
-		<member name="-DDUMP_SCHEDULER">
+		<member name="DUMP_SCHEDULER" displayname="Dump Scheduler Contents for Debugging">
 		</member>
-		<member name="-DLOW_MEMORY">
+		<member name="LOW_MEMORY" displayname="Optimize for Low Memory Usage">
 		</member>
-		<member name="-DMALLOC_DEBUG">
+		<member name="MALLOC_DEBUG" displayname="Keep Track of Memory Allocations">
 		</member>
-		<member name="-DRADIO_RELAX">
+		<member name="MTX_PROFILE" displayname="Enable Code Profiling Using TSC Counters">
 		</member>
-		<member name="-DTRACE_FRAMES">
+		<member name="RADIO_RELAX" displayname="Relax DTMF for Radio Applications">
 		</member>
-		<member name="-DMTX_PROFILE">
+		<member name="TRACE_FRAMES" displayname="Trace Frame Allocations">
+		</member>
+		<member name="WITH_SMDI" displayname="Include SMDI Support">
+			<defaultenabled>yes</defaultenabled>
 		</member>
 	</category>

Modified: team/oej/sipregister/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/channel.c?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/channel.c (original)
+++ team/oej/sipregister/channel.c Tue May 16 09:07:16 2006
@@ -3328,7 +3328,6 @@
 		if (!f) {
 			*fo = NULL;
 			*rc = who;
-			res = AST_BRIDGE_COMPLETE;
 			ast_log(LOG_DEBUG, "Didn't get a frame from channel: %s\n",who->name);
 			break;
 		}
@@ -3336,6 +3335,8 @@
 		other = (who == c0) ? c1 : c0; /* the 'other' channel */
 
 		if ((f->frametype == AST_FRAME_CONTROL) && !(config->flags & AST_BRIDGE_IGNORE_SIGS)) {
+			int bridge_exit = 0;
+
 			switch (f->subclass) {
 			case AST_CONTROL_HOLD:
 			case AST_CONTROL_UNHOLD:
@@ -3345,11 +3346,11 @@
 			default:
 				*fo = f;
 				*rc = who;
-				res =  AST_BRIDGE_COMPLETE;
+				bridge_exit = 1;
 				ast_log(LOG_DEBUG, "Got a FRAME_CONTROL (%d) frame on channel %s\n", f->subclass, who->name);
 				break;
 			}
-			if (res == AST_BRIDGE_COMPLETE)
+			if (bridge_exit)
 				break;
 		}
 		if ((f->frametype == AST_FRAME_VOICE) ||
@@ -3365,7 +3366,6 @@
 			if (f->frametype == AST_FRAME_DTMF && monitored_source) {
 				*fo = f;
 				*rc = who;
-				res = AST_BRIDGE_COMPLETE;
 				ast_log(LOG_DEBUG, "Got DTMF on channel (%s)\n", who->name);
 				break;
 			}

Modified: team/oej/sipregister/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/channels/Makefile?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/channels/Makefile (original)
+++ team/oej/sipregister/channels/Makefile Tue May 16 09:07:16 2006
@@ -42,10 +42,6 @@
 
 ifeq ($(OSARCH),SunOS)
   SOLINK+=-lrt
-endif
-
-ifeq ($(WITH_SMDI),1)
-  CFLAGS+=-DWITH_SMDI
 endif
 
 ifeq ($(wildcard h323/libchanh323.a),)

Modified: team/oej/sipregister/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/channels/chan_agent.c?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/channels/chan_agent.c (original)
+++ team/oej/sipregister/channels/chan_agent.c Tue May 16 09:07:16 2006
@@ -2597,19 +2597,16 @@
 	ast_manager_unregister("AgentLogoff");
 	ast_manager_unregister("AgentCallbackLogin");
 	/* Unregister channel */
-	ast_channel_unregister(&agent_tech);
-	if (!AST_LIST_LOCK(&agents)) {
-		/* Hangup all interfaces if they have an owner */
-		AST_LIST_TRAVERSE(&agents, p, list) {
-			if (p->owner)
-				ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
-		}
-		AST_LIST_UNLOCK(&agents);
-		AST_LIST_HEAD_INIT(&agents);
-	} else {
-		ast_log(LOG_WARNING, "Unable to lock the monitor\n");
-		return -1;
-	}		
+	AST_LIST_LOCK(&agents);
+	/* Hangup all interfaces if they have an owner */
+	while ((p = AST_LIST_REMOVE_HEAD(&agents, list))) {
+		if (p->owner)
+			ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
+		free(p);
+	}
+	AST_LIST_UNLOCK(&agents);
+	AST_LIST_HEAD_DESTROY(&agents);
+
 	return 0;
 }
 

Modified: team/oej/sipregister/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/channels/chan_sip.c?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- team/oej/sipregister/channels/chan_sip.c (original)
+++ team/oej/sipregister/channels/chan_sip.c Tue May 16 09:07:16 2006
@@ -1031,34 +1031,13 @@
 static int ourport;
 static struct sockaddr_in debugaddr;
 
-struct ast_config *notify_types;		/*!< The list of manual NOTIFY types we know how to send */
-
-
+static struct ast_config *notify_types;		/*!< The list of manual NOTIFY types we know how to send */
 
 /*---------------------------- Forward declarations of functions in chan_sip.c */
-static int transmit_response(struct sip_pvt *p, char *msg, struct sip_request *req);
-static int transmit_response_with_sdp(struct sip_pvt *p, char *msg, struct sip_request *req, enum xmittype reliable);
-static int transmit_response_with_unsupported(struct sip_pvt *p, const char *msg, struct sip_request *req, const char *unsupported);
-static int transmit_response_with_auth(struct sip_pvt *p, const char *msg, struct sip_request *req, const char *rand, enum xmittype reliable, const char *header, int stale);
-static int transmit_request(struct sip_pvt *p, int sipmethod, int inc, enum xmittype reliable, int newbranch);
-static int transmit_request_with_auth(struct sip_pvt *p, int sipmethod, int inc, enum xmittype reliable, int newbranch);
-static int transmit_invite(struct sip_pvt *p, int sipmethod, int sendsdp, int init);
-static int transmit_reinvite_with_sdp(struct sip_pvt *p);
-static int transmit_info_with_digit(struct sip_pvt *p, char digit);
-static int transmit_info_with_vidupdate(struct sip_pvt *p);
-static int transmit_message_with_text(struct sip_pvt *p, const char *text);
-static int transmit_refer(struct sip_pvt *p, const char *dest);
-static int sip_sipredirect(struct sip_pvt *p, const char *dest);
-static struct sip_peer *temp_peer(const char *name);
-static int do_proxy_auth(struct sip_pvt *p, struct sip_request *req, char *header, char *respheader, int sipmethod, int init);
-static void free_old_route(struct sip_route *route);
-static int reply_digest(struct sip_pvt *p, struct sip_request *req, char *header, int sipmethod, char *digest, int digest_len);
-static int build_reply_digest(struct sip_pvt *p, int method, char *digest, int digest_len);
-static int update_call_counter(struct sip_pvt *fup, int event);
-static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int realtime);
-static struct sip_user *build_user(const char *name, struct ast_variable *v, int realtime);
-static int sip_do_reload(enum channelreloadreason reason);
-static int expire_register(void *data);
+/*! \note Sorted up from start to build_rpid.... Will continue categorization in order to
+	split up chan_sip.c into several files  */
+
+/*--- PBX interface functions */
 static struct ast_channel *sip_request_call(const char *type, int format, void *data, int *cause);
 static int sip_devicestate(void *data);
 static int sip_sendtext(struct ast_channel *ast, const char *text);
@@ -1071,38 +1050,174 @@
 static int sip_transfer(struct ast_channel *ast, const char *dest);
 static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
 static int sip_senddigit(struct ast_channel *ast, char digit);
+
+/*--- Transmitting responses and requests */
+static int __sip_xmit(struct sip_pvt *p, char *data, int len);
+static int __sip_reliable_xmit(struct sip_pvt *p, int seqno, int resp, char *data, int len, int fatal, int sipmethod);
+static int __transmit_response(struct sip_pvt *p, const char *msg, struct sip_request *req, enum xmittype reliable);
+static int transmit_response(struct sip_pvt *p, char *msg, struct sip_request *req);
+static int transmit_response_reliable(struct sip_pvt *p, const char *msg, struct sip_request *req);
+static int transmit_response_with_date(struct sip_pvt *p, char *msg, struct sip_request *req);
+static int transmit_response_with_sdp(struct sip_pvt *p, char *msg, struct sip_request *req, enum xmittype reliable);
+static int transmit_response_with_unsupported(struct sip_pvt *p, const char *msg, struct sip_request *req, const char *unsupported);
+static int transmit_response_with_auth(struct sip_pvt *p, const char *msg, struct sip_request *req, const char *rand, enum xmittype reliable, const char *header, int stale);
+static int transmit_response_with_allow(struct sip_pvt *p, char *msg, struct sip_request *req, enum xmittype reliable);
+static int transmit_request(struct sip_pvt *p, int sipmethod, int inc, enum xmittype reliable, int newbranch);
+static int transmit_request_with_auth(struct sip_pvt *p, int sipmethod, int inc, enum xmittype reliable, int newbranch);
+static int transmit_invite(struct sip_pvt *p, int sipmethod, int sendsdp, int init);
+static int transmit_reinvite_with_sdp(struct sip_pvt *p);
+static int transmit_info_with_digit(struct sip_pvt *p, char digit);
+static int transmit_info_with_vidupdate(struct sip_pvt *p);
+static int transmit_message_with_text(struct sip_pvt *p, const char *text);
+static int transmit_refer(struct sip_pvt *p, const char *dest);
+static int transmit_state_notify(struct sip_pvt *p, int state, int full);
+static int transmit_register(struct sip_registry *r, int sipmethod, char *auth, char *authheader);
+static int retrans_pkt(void *data);
+static int send_response(struct sip_pvt *p, struct sip_request *req, enum xmittype reliable, int seqno);
+static int send_request(struct sip_pvt *p, struct sip_request *req, enum xmittype reliable, int seqno);
+static void copy_request(struct sip_request *dst, struct sip_request *src);
+
+/*--- Dialog management */
+static struct sip_pvt *sip_alloc(ast_string_field callid, struct sockaddr_in *sin,
+				 int useglobal_nat, const int intended_method);
+static int __sip_autodestruct(void *data);
+static int sip_scheddestroy(struct sip_pvt *p, int ms);
+static int sip_cancel_destroy(struct sip_pvt *p);
+static void sip_destroy(struct sip_pvt *p);
+static void __sip_destroy(struct sip_pvt *p, int lockowner);
+static int __sip_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod, int reset);
+static int __sip_pretend_ack(struct sip_pvt *p);
+static int __sip_semi_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod);
+static int auto_congest(void *nothing);
+static int update_call_counter(struct sip_pvt *fup, int event);
+static int hangup_sip2cause(int cause);
+static const char *hangup_cause2sip(int cause);
+static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
+static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *sin, const int intended_method);
+
+/*--- Codec handling / SDP */
+static void try_suggested_sip_codec(struct sip_pvt *p);
+static const char *get_sdp_by_line(const char* line, const char *name, int nameLen);
+static const char* get_sdp_iterate(int* start, struct sip_request *req, const char *name);
+static const char *get_sdp(struct sip_request *req, const char *name);
+static int process_sdp(struct sip_pvt *p, struct sip_request *req);
+static void add_codec_to_sdp(const struct sip_pvt *p, int codec, int sample_rate,
+			     char **m_buf, size_t *m_size, char **a_buf, size_t *a_size,
+			     int debug);
+static void add_noncodec_to_sdp(const struct sip_pvt *p, int format, int sample_rate,
+				char **m_buf, size_t *m_size, char **a_buf, size_t *a_size,
+				int debug);
+static int add_sdp(struct sip_request *resp, struct sip_pvt *p);
+
+/*--- Authentication stuff */
+static int do_proxy_auth(struct sip_pvt *p, struct sip_request *req, char *header, char *respheader, int sipmethod, int init);
+static int reply_digest(struct sip_pvt *p, struct sip_request *req, char *header, int sipmethod, char *digest, int digest_len);
+static int build_reply_digest(struct sip_pvt *p, int method, char *digest, int digest_len);
 static int clear_realm_authentication(struct sip_auth *authlist);	/* Clear realm authentication list (at reload) */
 static struct sip_auth *add_realm_authentication(struct sip_auth *authlist, char *configuration, int lineno);	/* Add realm authentication in list */
 static struct sip_auth *find_realm_authentication(struct sip_auth *authlist, const char *realm);	/* Find authentication for a specific realm */
 static int check_auth(struct sip_pvt *p, struct sip_request *req, const char *username,
 		const char *secret, const char *md5secret, int sipmethod,
 		char *uri, enum xmittype reliable, int ignore);
+
+/*--- Domain handling */
 static int check_sip_domain(const char *domain, char *context, size_t len); /* Check if domain is one of our local domains */
+
+static void free_old_route(struct sip_route *route);
+
+/*--- Misc functions */
+static int sip_do_reload(enum channelreloadreason reason);
+static int expire_register(void *data);
+static int sip_sipredirect(struct sip_pvt *p, const char *dest);
+static int restart_monitor(void);
+static int sip_send_mwi_to_peer(struct sip_peer *peer);
+static void sip_destroy(struct sip_pvt *p);
+static int sip_scheddestroy(struct sip_pvt *p, int ms);
+static int sip_addrcmp(char *name, struct sockaddr_in *sin);	/* Support for peer matching */
+
+/*--- CLI and manager command helpers */
+static const char *sip_nat_mode(const struct sip_pvt *p);
+
+/*--- Debugging */
+static void sip_dump_history(struct sip_pvt *dialog);	/* Dump history to LOG_DEBUG at end of dialog, before destroying data */
+static inline int sip_debug_test_addr(const struct sockaddr_in *addr);
+static inline int sip_debug_test_pvt(struct sip_pvt *p);
+static int append_history_full(struct sip_pvt *p, const char *fmt, ...);
+
+/*--- Device object handling */
+static struct sip_peer *temp_peer(const char *name);
+static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int realtime);
+static struct sip_user *build_user(const char *name, struct ast_variable *v, int realtime);
+static int update_call_counter(struct sip_pvt *fup, int event);
+static void sip_destroy_peer(struct sip_peer *peer);
+static void sip_destroy_user(struct sip_user *user);
+static int sip_poke_peer(struct sip_peer *peer);

[... 1576 lines stripped ...]


More information about the asterisk-commits mailing list