[asterisk-commits] oej: branch oej/subscribemwi-1.2 r56620 - in /team/oej/subscribemwi-1.2: ./ a...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Feb 24 10:12:01 MST 2007


Author: oej
Date: Sat Feb 24 11:11:59 2007
New Revision: 56620

URL: http://svn.digium.com/view/asterisk?view=rev&rev=56620
Log:
Reset branch

Added:
    team/oej/subscribemwi-1.2/codecs/codec_zap.c
      - copied unchanged from r56504, branches/1.2/codecs/codec_zap.c
    team/oej/subscribemwi-1.2/doc/voicemail_odbc_postgresql.txt
      - copied unchanged from r56504, branches/1.2/doc/voicemail_odbc_postgresql.txt
    team/oej/subscribemwi-1.2/sounds/silence/
      - copied from r56504, branches/1.2/sounds/silence/
    team/oej/subscribemwi-1.2/sounds/silence/1.gsm
      - copied unchanged from r56504, branches/1.2/sounds/silence/1.gsm
    team/oej/subscribemwi-1.2/sounds/silence/10.gsm
      - copied unchanged from r56504, branches/1.2/sounds/silence/10.gsm
    team/oej/subscribemwi-1.2/sounds/silence/2.gsm
      - copied unchanged from r56504, branches/1.2/sounds/silence/2.gsm
    team/oej/subscribemwi-1.2/sounds/silence/3.gsm
      - copied unchanged from r56504, branches/1.2/sounds/silence/3.gsm
    team/oej/subscribemwi-1.2/sounds/silence/4.gsm
      - copied unchanged from r56504, branches/1.2/sounds/silence/4.gsm
    team/oej/subscribemwi-1.2/sounds/silence/5.gsm
      - copied unchanged from r56504, branches/1.2/sounds/silence/5.gsm
    team/oej/subscribemwi-1.2/sounds/silence/6.gsm
      - copied unchanged from r56504, branches/1.2/sounds/silence/6.gsm
    team/oej/subscribemwi-1.2/sounds/silence/7.gsm
      - copied unchanged from r56504, branches/1.2/sounds/silence/7.gsm
    team/oej/subscribemwi-1.2/sounds/silence/8.gsm
      - copied unchanged from r56504, branches/1.2/sounds/silence/8.gsm
    team/oej/subscribemwi-1.2/sounds/silence/9.gsm
      - copied unchanged from r56504, branches/1.2/sounds/silence/9.gsm
Modified:
    team/oej/subscribemwi-1.2/   (props changed)
    team/oej/subscribemwi-1.2/BUGS
    team/oej/subscribemwi-1.2/Makefile
    team/oej/subscribemwi-1.2/apps/app_chanspy.c
    team/oej/subscribemwi-1.2/apps/app_dial.c
    team/oej/subscribemwi-1.2/apps/app_dictate.c
    team/oej/subscribemwi-1.2/apps/app_externalivr.c
    team/oej/subscribemwi-1.2/apps/app_festival.c
    team/oej/subscribemwi-1.2/apps/app_groupcount.c
    team/oej/subscribemwi-1.2/apps/app_ices.c
    team/oej/subscribemwi-1.2/apps/app_macro.c
    team/oej/subscribemwi-1.2/apps/app_meetme.c
    team/oej/subscribemwi-1.2/apps/app_mixmonitor.c
    team/oej/subscribemwi-1.2/apps/app_mp3.c
    team/oej/subscribemwi-1.2/apps/app_nbscat.c
    team/oej/subscribemwi-1.2/apps/app_page.c
    team/oej/subscribemwi-1.2/apps/app_queue.c
    team/oej/subscribemwi-1.2/apps/app_record.c
    team/oej/subscribemwi-1.2/apps/app_rpt.c
    team/oej/subscribemwi-1.2/apps/app_voicemail.c
    team/oej/subscribemwi-1.2/apps/app_while.c
    team/oej/subscribemwi-1.2/apps/app_zapras.c
    team/oej/subscribemwi-1.2/asterisk.c
    team/oej/subscribemwi-1.2/build_tools/make_svn_branch_name
    team/oej/subscribemwi-1.2/cdr.c
    team/oej/subscribemwi-1.2/channel.c
    team/oej/subscribemwi-1.2/channels/chan_agent.c
    team/oej/subscribemwi-1.2/channels/chan_h323.c
    team/oej/subscribemwi-1.2/channels/chan_iax2.c
    team/oej/subscribemwi-1.2/channels/chan_mgcp.c
    team/oej/subscribemwi-1.2/channels/chan_misdn.c
    team/oej/subscribemwi-1.2/channels/chan_sip.c
    team/oej/subscribemwi-1.2/channels/chan_skinny.c
    team/oej/subscribemwi-1.2/channels/chan_zap.c
    team/oej/subscribemwi-1.2/channels/misdn/fac.c
    team/oej/subscribemwi-1.2/channels/misdn/ie.c
    team/oej/subscribemwi-1.2/channels/misdn/isdn_lib.c
    team/oej/subscribemwi-1.2/channels/misdn/isdn_lib.h
    team/oej/subscribemwi-1.2/channels/misdn/isdn_msg_parser.c
    team/oej/subscribemwi-1.2/channels/misdn_config.c
    team/oej/subscribemwi-1.2/codecs/Makefile
    team/oej/subscribemwi-1.2/config.c
    team/oej/subscribemwi-1.2/configs/dnsmgr.conf.sample
    team/oej/subscribemwi-1.2/configs/iax.conf.sample
    team/oej/subscribemwi-1.2/configs/meetme.conf.sample
    team/oej/subscribemwi-1.2/configs/misdn.conf.sample
    team/oej/subscribemwi-1.2/contrib/scripts/vmdb.sql
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_close.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_conv.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_debug.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_delete.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_get.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_open.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_overflow.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_page.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_put.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_search.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_seq.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_split.c
    team/oej/subscribemwi-1.2/db1-ast/btree/bt_utils.c
    team/oej/subscribemwi-1.2/db1-ast/db/db.c
    team/oej/subscribemwi-1.2/db1-ast/hash/hash.c
    team/oej/subscribemwi-1.2/db1-ast/hash/hash_bigkey.c
    team/oej/subscribemwi-1.2/db1-ast/hash/hash_buf.c
    team/oej/subscribemwi-1.2/db1-ast/hash/hash_func.c
    team/oej/subscribemwi-1.2/db1-ast/hash/hash_log2.c
    team/oej/subscribemwi-1.2/db1-ast/hash/hash_page.c
    team/oej/subscribemwi-1.2/db1-ast/hash/hsearch.c
    team/oej/subscribemwi-1.2/db1-ast/include/ndbm.h
    team/oej/subscribemwi-1.2/db1-ast/mpool/mpool.c
    team/oej/subscribemwi-1.2/db1-ast/recno/rec_close.c
    team/oej/subscribemwi-1.2/db1-ast/recno/rec_delete.c
    team/oej/subscribemwi-1.2/db1-ast/recno/rec_get.c
    team/oej/subscribemwi-1.2/db1-ast/recno/rec_open.c
    team/oej/subscribemwi-1.2/db1-ast/recno/rec_put.c
    team/oej/subscribemwi-1.2/db1-ast/recno/rec_search.c
    team/oej/subscribemwi-1.2/db1-ast/recno/rec_seq.c
    team/oej/subscribemwi-1.2/db1-ast/recno/rec_utils.c
    team/oej/subscribemwi-1.2/doc/README.misdn
    team/oej/subscribemwi-1.2/funcs/func_math.c
    team/oej/subscribemwi-1.2/funcs/func_strings.c
    team/oej/subscribemwi-1.2/include/asterisk/lock.h
    team/oej/subscribemwi-1.2/jitterbuf.c
    team/oej/subscribemwi-1.2/manager.c
    team/oej/subscribemwi-1.2/pbx.c
    team/oej/subscribemwi-1.2/pbx/pbx_dundi.c
    team/oej/subscribemwi-1.2/pbx/pbx_spool.c
    team/oej/subscribemwi-1.2/redhat/asterisk.spec
    team/oej/subscribemwi-1.2/res/res_agi.c
    team/oej/subscribemwi-1.2/res/res_features.c
    team/oej/subscribemwi-1.2/res/res_musiconhold.c
    team/oej/subscribemwi-1.2/rtp.c
    team/oej/subscribemwi-1.2/sounds.txt
    team/oej/subscribemwi-1.2/stdtime/localtime.c
    team/oej/subscribemwi-1.2/utils.c
    team/oej/subscribemwi-1.2/utils/Makefile
    team/oej/subscribemwi-1.2/utils/check_expr.c

Propchange: team/oej/subscribemwi-1.2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Feb 24 11:11:59 2007
@@ -1,1 +1,1 @@
-/branches/1.2:1-48264
+/branches/1.2:1-56616

Modified: team/oej/subscribemwi-1.2/BUGS
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/BUGS?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/BUGS (original)
+++ team/oej/subscribemwi-1.2/BUGS Sat Feb 24 11:11:59 2007
@@ -10,7 +10,7 @@
 learn how you can contribute by acting as a bug marshall
 please see:
 
-	http://www.digium.com/index.php?menu=bugguidelines
+	http://www.asterisk.org/developers/bug-guidelines
 
 If you would like to submit a feature request, please
 resist the temptation to post it to the bug tracker.

Modified: team/oej/subscribemwi-1.2/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/Makefile?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/Makefile (original)
+++ team/oej/subscribemwi-1.2/Makefile Sat Feb 24 11:11:59 2007
@@ -317,7 +317,7 @@
 
 ifneq ($(wildcard .version),)
   ASTERISKVERSION:=$(shell cat .version)
-  ASTERISKVERSIONNUM:=$(shell awk -F. '{printf "%02d%02d%02d", $$1, $$2, $$3}' .version)
+  ASTERISKVERSIONNUM:=$(shell awk -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
   RPMVERSION:=$(shell sed 's/[-\/:]/_/g' .version)
 else
   RPMVERSION=unknown
@@ -553,10 +553,19 @@
 datafiles: all
 	if [ x`$(ID) -un` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
 	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/silence
 	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
 	for x in sounds/digits/*.gsm; do \
 		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
 			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+		else \
+			echo "No description for $$x"; \
+			exit 1; \
+		fi; \
+	done
+	for x in sounds/silence/*.gsm; do \
+		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/silence ; \
 		else \
 			echo "No description for $$x"; \
 			exit 1; \

Modified: team/oej/subscribemwi-1.2/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/apps/app_chanspy.c?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/apps/app_chanspy.c (original)
+++ team/oej/subscribemwi-1.2/apps/app_chanspy.c Sat Feb 24 11:11:59 2007
@@ -53,7 +53,7 @@
 #define ALL_DONE(u, ret) LOCAL_USER_REMOVE(u); return ret;
 #define get_volfactor(x) x ? ((x > 0) ? (1 << x) : ((1 << abs(x)) * -1)) : 0
 
-static const char *synopsis = "Listen to the audio of an active channel\n";
+static const char *synopsis = "Listen to the audio of an active channel";
 static const char *app = "ChanSpy";
 static const char *desc = 
 "  ChanSpy([chanprefix][|options]): This application is used to listen to the\n"

Modified: team/oej/subscribemwi-1.2/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/apps/app_dial.c?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/apps/app_dial.c (original)
+++ team/oej/subscribemwi-1.2/apps/app_dial.c Sat Feb 24 11:11:59 2007
@@ -80,7 +80,7 @@
 "    ANSWEREDTIME - This is the amount of time for actual call.\n"
 "    DIALSTATUS   - This is the status of the call:\n"
 "                   CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER | CANCEL\n" 
-"                   DONTCALL | TORTURE\n"
+"                   DONTCALL | TORTURE | INVALIDARGS\n"
 "  For the Privacy and Screening Modes, the DIALSTATUS variable will be set to\n"
 "DONTCALL if the called party chooses to send the calling party to the 'Go Away'\n"
 "script. The DIALSTATUS variable will be set to TORTURE if the called party\n"
@@ -728,7 +728,7 @@
 	
 }
 
-static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags)
+static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags, int *continue_exec)
 {
 	int res=-1;
 	struct localuser *u;
@@ -759,7 +759,7 @@
 	char *start_sound=NULL;
 	char *dtmfcalled=NULL, *dtmfcalling=NULL;
 	char *var;
-	char status[256];
+	char status[256] = "INVALIDARGS";
 	int play_to_caller=0,play_to_callee=0;
 	int sentringing=0, moh=0;
 	char *outbound_group = NULL;
@@ -780,21 +780,19 @@
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
+		pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
 		return -1;
 	}
 
 	LOCAL_USER_ADD(u);
 
-	if (!(parse = ast_strdupa(data))) {
-		ast_log(LOG_WARNING, "Memory allocation failure\n");
-		LOCAL_USER_REMOVE(u);
-		return -1;
-	}
+	parse = ast_strdupa(data);
 	
 	AST_STANDARD_APP_ARGS(args, parse);
 
 	if (!ast_strlen_zero(args.options)) {
 		if (ast_app_parse_options(dial_exec_options, &opts, opt_args, args.options)) {
+			pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
 			LOCAL_USER_REMOVE(u);
 			return -1;
 		}
@@ -802,6 +800,7 @@
 
 	if (ast_strlen_zero(args.peers)) {
 		ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
+		pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
 		LOCAL_USER_REMOVE(u);
 		return -1;
 	}
@@ -989,6 +988,7 @@
 				   "At the tone, please say your name:"
 
 				*/
+				ast_answer(chan);
 				res = ast_play_and_record(chan, "priv-recordintro", privintro, 4, "gsm", &duration, 128, 2000, 0);  /* NOTE: I've reduced the total time to */
 															/* 4 sec don't think we'll need a lock removed, we 
 															   took care of conflicts by naming the privintro file */
@@ -1005,6 +1005,9 @@
 		}
 	}
 
+	if (continue_exec)
+		*continue_exec = 0;
+
 	/* If a channel group has been specified, get it for use when we create peer channels */
 	outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
 
@@ -1058,6 +1061,7 @@
 			cur = rest;
 			if (!cur)
 				chan->hangupcause = cause;
+			free(tmp);
 			continue;
 		}
 		pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
@@ -1096,6 +1100,7 @@
 			if (!tmp->chan) {
 				HANDLE_CAUSE(cause, chan);
 				cur = rest;
+				free(tmp);
 				continue;
 			}
 		}
@@ -1163,6 +1168,7 @@
 			ast_hangup(tmp->chan);
 			tmp->chan = NULL;
 			cur = rest;
+			free(tmp);
 			continue;
 		} else {
 			senddialevent(chan, tmp->chan);
@@ -1467,6 +1473,8 @@
 			ast_pbx_start(peer);
 			hanguptree(outgoing, NULL);
 			LOCAL_USER_REMOVE(u);
+			if (continue_exec)
+				*continue_exec = 1;
 			return 0;
 		}
 
@@ -1646,8 +1654,10 @@
 static int dial_exec(struct ast_channel *chan, void *data)
 {
 	struct ast_flags peerflags;
+
 	memset(&peerflags, 0, sizeof(peerflags));
-	return dial_exec_full(chan, data, &peerflags);
+
+	return dial_exec_full(chan, data, &peerflags, NULL);
 }
 
 static int retrydial_exec(struct ast_channel *chan, void *data)
@@ -1712,11 +1722,16 @@
 	context = pbx_builtin_getvar_helper(chan, "EXITCONTEXT");
 	
 	while (loops) {
+		int continue_exec;
+
 		chan->data = "Retrying";
 		if (ast_test_flag(chan, AST_FLAG_MOH))
 			ast_moh_stop(chan);
 
-		if ((res = dial_exec_full(chan, dialdata, &peerflags)) == 0) {
+		res = dial_exec_full(chan, dialdata, &peerflags, &continue_exec);
+		if (continue_exec)
+			break;
+		if (res == 0) {
 			if (ast_test_flag(&peerflags, OPT_DTMF_EXIT)) {
 				if (!(res = ast_streamfile(chan, announce, chan->language)))
 					res = ast_waitstream(chan, AST_DIGIT_ANY);
@@ -1753,7 +1768,6 @@
 
 	LOCAL_USER_REMOVE(u);
 	return loops ? res : 0;
-
 }
 
 int unload_module(void)

Modified: team/oej/subscribemwi-1.2/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/apps/app_dictate.c?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/apps/app_dictate.c (original)
+++ team/oej/subscribemwi-1.2/apps/app_dictate.c Sat Feb 24 11:11:59 2007
@@ -257,7 +257,8 @@
 						if (lastop != DFLAG_PLAY) {
 							lastop = DFLAG_PLAY;
 							ast_closestream(fs);
-							fs = ast_openstream(chan, path, chan->language);
+							if (!(fs = ast_openstream(chan, path, chan->language)))
+								break;
 							ast_seekstream(fs, samples, SEEK_SET);
 							chan->stream = NULL;
 						}

Modified: team/oej/subscribemwi-1.2/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/apps/app_externalivr.c?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/apps/app_externalivr.c (original)
+++ team/oej/subscribemwi-1.2/apps/app_externalivr.c Sat Feb 24 11:11:59 2007
@@ -31,6 +31,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
+#include <signal.h>
 
 #include "asterisk.h"
 
@@ -152,7 +153,7 @@
 		if (state->current) {
 			file_to_stream = state->current->filename;
 		} else {
-			file_to_stream = "silence-10";
+			file_to_stream = "silence/10";
 			u->playing_silence = 1;
 		}
 
@@ -258,9 +259,13 @@
 	FILE *child_commands = NULL;
 	FILE *child_errors = NULL;
 	FILE *child_events = NULL;
+	sigset_t fullset, oldset;
 
 	LOCAL_USER_ADD(u);
-	
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
+
 	AST_LIST_HEAD_INIT(&u->playlist);
 	AST_LIST_HEAD_INIT(&u->finishlist);
 	u->abort_current_sound = 0;
@@ -313,6 +318,9 @@
 	if (!pid) {
 		/* child process */
 		int i;
+
+		signal(SIGPIPE, SIG_DFL);
+		pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 
 		if (option_highpriority)
 			ast_set_priority(0);
@@ -336,6 +344,8 @@
 		int ready_fd;
 		int waitfds[2] = { child_errors_fd, child_commands_fd };
 		struct ast_channel *rchan;
+
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 
 		close(child_stdin[0]);
 		child_stdin[0] = 0;

Modified: team/oej/subscribemwi-1.2/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/apps/app_festival.c?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/apps/app_festival.c (original)
+++ team/oej/subscribemwi-1.2/apps/app_festival.c Sat Feb 24 11:11:59 2007
@@ -127,19 +127,26 @@
 #ifdef __PPC__ 
 	char c;
 #endif
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
 
         res = fork();
         if (res < 0)
                 ast_log(LOG_WARNING, "Fork failed\n");
-        if (res)
+        if (res) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
                 return res;
+	}
         for (x=0;x<256;x++) {
                 if (x != fd)
                         close(x);
         }
 	if (option_highpriority)
 		ast_set_priority(0);
-
+	signal(SIGPIPE, SIG_DFL);
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 /*IAS */
 #ifdef __PPC__  
 	for( x=0; x<length; x+=2)

Modified: team/oej/subscribemwi-1.2/apps/app_groupcount.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/apps/app_groupcount.c?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/apps/app_groupcount.c (original)
+++ team/oej/subscribemwi-1.2/apps/app_groupcount.c Sat Feb 24 11:11:59 2007
@@ -70,7 +70,8 @@
 
 	if (ast_strlen_zero(group)) {
 		grp = pbx_builtin_getvar_helper(chan, category);
-		strncpy(group, grp, sizeof(group) - 1);
+		if (!ast_strlen_zero(grp))
+			ast_copy_string(group, grp, sizeof(group));
 	}
 
 	count = ast_app_group_get_count(group, category);
@@ -152,6 +153,11 @@
 	if (!deprecation_warning) {
 	        ast_log(LOG_WARNING, "The CheckGroup application has been deprecated, please use a combination of the GotoIf application and the GROUP_COUNT() function.\n");
 		deprecation_warning = 1;
+	}
+
+	if (ast_strlen_zero(data)) {
+		ast_log(LOG_WARNING, "CheckGroup requires an argument(max[@category][|options])\n");
+		return 0;
 	}
 
 	if (!(parse = ast_strdupa(data))) {

Modified: team/oej/subscribemwi-1.2/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/apps/app_ices.c?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/apps/app_ices.c (original)
+++ team/oej/subscribemwi-1.2/apps/app_ices.c Sat Feb 24 11:11:59 2007
@@ -68,15 +68,27 @@
 {
 	int res;
 	int x;
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
+
 	res = fork();
 	if (res < 0) 
 		ast_log(LOG_WARNING, "Fork failed\n");
-	if (res)
+	if (res) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 		return res;
+	}
+
+	/* Stop ignoring PIPE */
+	signal(SIGPIPE, SIG_DFL);
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
+
 	if (option_highpriority)
 		ast_set_priority(0);
 	dup2(fd, STDIN_FILENO);
-	for (x=STDERR_FILENO + 1;x<256;x++) {
+	for (x=STDERR_FILENO + 1;x<1024;x++) {
 		if ((x != STDIN_FILENO) && (x != STDOUT_FILENO))
 			close(x);
 	}
@@ -87,7 +99,7 @@
 	/* As a last-ditch effort, try to use PATH */
 	execlp("ices", "ices", filename, (char *)NULL);
 	ast_log(LOG_WARNING, "Execute of ices failed\n");
-	return -1;
+	_exit(0);
 }
 
 static int ices_exec(struct ast_channel *chan, void *data)

Modified: team/oej/subscribemwi-1.2/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/apps/app_macro.c?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/apps/app_macro.c (original)
+++ team/oej/subscribemwi-1.2/apps/app_macro.c Sat Feb 24 11:11:59 2007
@@ -107,10 +107,10 @@
 	int oldpriority;
 	char pc[80], depthc[12];
 	char oldcontext[AST_MAX_CONTEXT] = "";
-	char *offsets, *s;
+	char *offsets, *s, *inhangupc;
 	int offset, depth = 0, maxdepth = 7;
 	int setmacrocontext=0;
-	int autoloopflag, dead = 0;
+	int autoloopflag, dead = 0, inhangup = 0;
   
 	char *save_macro_exten;
 	char *save_macro_context;
@@ -137,6 +137,13 @@
 	} else {
 		depth = 0;
 	}
+
+	/* Used for detecting whether to return when a Macro is called from another Macro after hangup */
+	if (strcmp(chan->exten, "h") == 0)
+		pbx_builtin_setvar_helper(chan, "MACRO_IN_HANGUP", "1");
+	inhangupc = pbx_builtin_getvar_helper(chan, "MACRO_IN_HANGUP");
+	if (!ast_strlen_zero(inhangupc))
+		sscanf(inhangupc, "%d", &inhangup);
 
 	if (depth >= maxdepth) {
 		ast_log(LOG_ERROR, "Macro():  possible infinite loop detected.  Returning early.\n");
@@ -252,7 +259,7 @@
 			break;
 		}
 		/* don't stop executing extensions when we're in "h" */
-		if (chan->_softhangup && strcasecmp(oldexten,"h") && strcasecmp(chan->macroexten,"h")) {
+		if (chan->_softhangup && !inhangup) {
 			ast_log(LOG_DEBUG, "Extension %s, macroexten %s, priority %d returned normally even though call was hung up\n",
 				chan->exten, chan->macroexten, chan->priority);
 			goto out;

Modified: team/oej/subscribemwi-1.2/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi-1.2/apps/app_meetme.c?view=diff&rev=56620&r1=56619&r2=56620
==============================================================================
--- team/oej/subscribemwi-1.2/apps/app_meetme.c (original)
+++ team/oej/subscribemwi-1.2/apps/app_meetme.c Sat Feb 24 11:11:59 2007
@@ -54,6 +54,7 @@
 #include "asterisk/cli.h"
 #include "asterisk/say.h"
 #include "asterisk/utils.h"
+#include "asterisk/linkedlists.h"
 
 static const char *tdesc = "MeetMe conference bridge";
 
@@ -129,16 +130,16 @@
 
 LOCAL_USER_DECL;
 
-static struct ast_conference {
+struct ast_conference {
 	char confno[AST_MAX_EXTENSION];		/* Conference */
 	struct ast_channel *chan;		/* Announcements channel */
 	int fd;					/* Announcements fd */
 	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 */
+	AST_LIST_HEAD_NOLOCK(, ast_conf_user) userlist;
 	time_t start;				/* Start time (s) */
+	int refcount;
 	int recording;				/* recording status */
 	int isdynamic;				/* Created on the fly? */
 	int locked;				/* Is the conference locked? */
@@ -148,8 +149,10 @@
 	char *recordingformat;			/* Format to record the Conference in */
 	char pin[AST_MAX_EXTENSION];		/* If protected by a PIN */
 	char pinadmin[AST_MAX_EXTENSION];	/* If protected by a admin PIN */
-	struct ast_conference *next;
-} *confs;
+	AST_LIST_ENTRY(ast_conference) list;
+};
+
+static AST_LIST_HEAD_STATIC(confs, ast_conference);
 
 struct volume {
 	int desired;				/* Desired volume adjustment */
@@ -158,8 +161,7 @@
 
 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 */
+	AST_LIST_ENTRY(ast_conf_user) list;
 	int userflags;				/* Flags as set in the conference */
 	int adminflags;				/* Flags set by the Admin */
 	struct ast_channel *chan;		/* Connected channel */
@@ -187,8 +189,6 @@
 	VOL_UP,
 	VOL_DOWN,
 };
-
-AST_MUTEX_DEFINE_STATIC(conflock);
 
 static int admin_exec(struct ast_channel *chan, void *data);
 
@@ -414,7 +414,7 @@
 	if (!chan->_softhangup)
 		res = ast_autoservice_start(chan);
 
-	ast_mutex_lock(&conflock);
+	AST_LIST_LOCK(&confs);
 
 	switch(sound) {
 	case ENTER:
@@ -432,20 +432,19 @@
 	if (data) 
 		careful_write(conf->fd, data, len, 1);
 
-	ast_mutex_unlock(&conflock);
+	AST_LIST_UNLOCK(&confs);
 
 	if (!res) 
 		ast_autoservice_stop(chan);
 }
 
-static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin, int make, int dynamic)
+static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin, int make, int dynamic, int refcount)
 {
 	struct ast_conference *cnf;
 	struct zt_confinfo ztc;
 
-	ast_mutex_lock(&conflock);
-
-	for (cnf = confs; cnf; cnf = cnf->next) {
+	AST_LIST_LOCK(&confs);
+	AST_LIST_TRAVERSE(&confs, cnf, list) {
 		if (!strcmp(confno, cnf->confno)) 
 			break;
 	}
@@ -490,18 +489,17 @@
 			cnf->start = time(NULL);
 			cnf->zapconf = ztc.confno;
 			cnf->isdynamic = dynamic;
-			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);
-			cnf->next = confs;
-			confs = cnf;
+			AST_LIST_INSERT_HEAD(&confs, cnf, list);
 		} else	
 			ast_log(LOG_WARNING, "Out of memory\n");
 	}
  cnfout:
-	ast_mutex_unlock(&conflock);
+ 	if (cnf)
+		ast_atomic_fetchadd_int(&cnf->refcount, refcount);
+	AST_LIST_UNLOCK(&confs);
 	return cnf;
 }
 
@@ -540,13 +538,14 @@
 	if (argc == 1) {
 		/* 'MeetMe': List all the conferences */	
 		now = time(NULL);
-		cnf = confs;
-		if (!cnf) {
+		AST_LIST_LOCK(&confs);
+		if (!AST_LIST_FIRST(&confs)) {
 			ast_cli(fd, "No active MeetMe conferences.\n");
+			AST_LIST_UNLOCK(&confs);
 			return RESULT_SUCCESS;
 		}
 		ast_cli(fd, header_format, "Conf Num", "Parties", "Marked", "Activity", "Creation");
-		while(cnf) {
+		AST_LIST_TRAVERSE(&confs, cnf, list) {
 			if (cnf->markedusers == 0)
 				strcpy(cmdline, "N/A ");
 			else 
@@ -558,9 +557,9 @@
 			ast_cli(fd, data_format, cnf->confno, cnf->users, cmdline, hr, min, sec, cnf->isdynamic ? "Dynamic" : "Static");
 
 			total += cnf->users; 	
-			cnf = cnf->next;
 		}
 		ast_cli(fd, "* Total number of MeetMe users: %d\n", total);
+		AST_LIST_UNLOCK(&confs);
 		return RESULT_SUCCESS;
 	}
 	if (argc < 3)
@@ -607,24 +606,22 @@
 		}	
 	} else if(strcmp(argv[1], "list") == 0) {
 		/* List all the users in a conference */
-		if (!confs) {
+		if (!AST_LIST_FIRST(&confs)) {
 			ast_cli(fd, "No active conferences.\n");
 			return RESULT_SUCCESS;	
 		}
-		cnf = confs;
-		/* Find the right conference */
-		while(cnf) {
+		AST_LIST_LOCK(&confs);
+		AST_LIST_TRAVERSE(&confs, cnf, list) {
 			if (strcmp(cnf->confno, argv[2]) == 0)
 				break;
-			if (cnf->next) {
-				cnf = cnf->next;	
-			} else {
-				ast_cli(fd, "No such conference: %s.\n",argv[2]);
-				return RESULT_SUCCESS;
-			}
+		}
+		if (!cnf) {
+			ast_cli(fd, "No such conference: %s.\n", argv[2]);
+			AST_LIST_UNLOCK(&confs);
+			return RESULT_SUCCESS;
 		}
 		/* Show all the users */
-		for (user = cnf->firstuser; user; user = user->nextuser)
+		AST_LIST_TRAVERSE(&cnf->userlist, user, list) {
 			ast_cli(fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s\n",
 				user->user_no,
 				user->chan->cid.cid_num ? user->chan->cid.cid_num : "<unknown>",
@@ -634,7 +631,9 @@
 				user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
 				user->adminflags & ADMINFLAG_MUTED ? "(Admin Muted)" : "",
 				istalking(user->talking));
+		}
 		ast_cli(fd,"%d users in that conference.\n",cnf->users);
+		AST_LIST_UNLOCK(&confs);
 
 		return RESULT_SUCCESS;
 	} else 
@@ -654,6 +653,7 @@
 	char usrno[50] = "";
 	char cmds[CONF_COMMANDS][20] = {"lock", "unlock", "mute", "unmute", "kick", "list"};
 	char *myline;
+	char *res = NULL;
 	
 	if (pos == 1) {
 		/* Command */
@@ -666,17 +666,16 @@
 		}
 	} else if (pos == 2) {
 		/* Conference Number */
-		ast_mutex_lock(&conflock);
-		cnf = confs;
-		while(cnf) {
+		AST_LIST_LOCK(&confs);
+		AST_LIST_TRAVERSE(&confs, cnf, list) {
 			if (!strncasecmp(word, cnf->confno, strlen(word))) {
 				if (++which > state)
 					break;
 			}
-			cnf = cnf->next;
-		}
-		ast_mutex_unlock(&conflock);
-		return cnf ? strdup(cnf->confno) : NULL;
+		}
+		res = cnf ? strdup(cnf->confno) : NULL;
+		AST_LIST_UNLOCK(&confs);
+		return res;
 	} else if (pos == 3) {
 		/* User Number || Conf Command option*/
 		if (strstr(line, "mute") || strstr(line, "kick")) {
@@ -684,7 +683,7 @@
 				return strdup("all");
 			}
 			which++;
-			ast_mutex_lock(&conflock);
+			AST_LIST_LOCK(&confs);
 
 			/* TODO: Find the conf number from the cmdline (ignore spaces) <- test this and make it fail-safe! */
 			myline = ast_strdupa(line);
@@ -692,15 +691,15 @@
 				while((confno = strsep(&myline, " ")) && (strcmp(confno, " ") == 0))
 					;
 			}
-			
-			for (cnf = confs; cnf; cnf = cnf->next) {
+
+			AST_LIST_TRAVERSE(&confs, cnf, list) {
 				if (!strcmp(confno, cnf->confno))
 				    break;
 			}
 
 			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, strlen(word))) {
 						if (++which > state)
@@ -708,7 +707,7 @@
 					}
 				}
 			}
-			ast_mutex_unlock(&conflock);
+			AST_LIST_UNLOCK(&confs);
 			return usr ? strdup(usrno) : NULL;
 		}
 	}
@@ -754,34 +753,31 @@
 }
 
 /* Remove the conference from the list and free it.
-   We assume that this was called while holding conflock. */
+   XXX We assume that this was called while holding the confs list lock. */
 static int conf_free(struct ast_conference *conf)
 {
-	struct ast_conference *prev = NULL, *cur = confs;
-
-	while (cur) {
+	struct ast_conference *cur;
+
+	AST_LIST_TRAVERSE_SAFE_BEGIN(&confs, cur, list) {
 		if (cur == conf) {
-			if (prev)
-				prev->next = conf->next;
-			else
-				confs = conf->next;
+			AST_LIST_REMOVE_CURRENT(&confs, list);
 			break;
 		}
-		prev = cur;
-		cur = cur->next;
-	}
+	}
+	AST_LIST_TRAVERSE_SAFE_END;
 
 	if (!cur)
 		ast_log(LOG_WARNING, "Conference not found\n");
 
 	if (conf->recording == MEETME_RECORD_ACTIVE) {
 		conf->recording = MEETME_RECORD_TERMINATE;
-		ast_mutex_unlock(&conflock);
+		AST_LIST_UNLOCK(&confs);
 		while (1) {
-			ast_mutex_lock(&conflock);
+			usleep(1);
+			AST_LIST_LOCK(&confs);
 			if (conf->recording == MEETME_RECORD_OFF)
 				break;
-			ast_mutex_unlock(&conflock);
+			AST_LIST_UNLOCK(&confs);
 		}
 	}
 
@@ -793,6 +789,21 @@
 	free(conf);
 
 	return 0;
+}
+
+/* Decrement reference counts, as incremented by find_conf() */
+static int dispose_conf(struct ast_conference *conf)
+{
+	int res = 0;
+
+	AST_LIST_LOCK(&confs);
+	if (ast_atomic_dec_and_test(&conf->refcount)) {
+		conf_free(conf);
+		res = 1;
+	}
+	AST_LIST_UNLOCK(&confs);
+
+	return res;
 }
 
 static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int confflags, char *optargs[])
@@ -846,6 +857,8 @@
 		timeout = time(NULL) + opt_waitmarked_timeout;
 	}
 
+	AST_LIST_LOCK(&confs);
+
 	if (confflags & CONFFLAG_RECORDCONF && conf->recording !=MEETME_RECORD_ACTIVE) {
 		conf->recordingfilename = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFILE");
 		if (!conf->recordingfilename) {
@@ -862,6 +875,7 @@
 		ast_verbose(VERBOSE_PREFIX_4 "Starting recording of MeetMe Conference %s into file %s.%s.\n",
 			    conf->confno, conf->recordingfilename, conf->recordingformat);
 		ast_pthread_create(&conf->recordthread, &conf->attr, recordthread, conf);
+		pthread_attr_destroy(&conf->attr);
 	}
 
 	time(&user->jointime);
@@ -870,38 +884,28 @@
 		/* Sorry, but this confernce is locked! */	
 		if (!ast_streamfile(chan, "conf-locked", chan->language))
 			ast_waitstream(chan, "");
+		AST_LIST_UNLOCK(&confs);
 		goto outrun;
 	}
 
 	if (confflags & CONFFLAG_MARKEDUSER)
 		conf->markedusers++;
-      
-   	ast_mutex_lock(&conflock);
-	if (!conf->firstuser) {
-		/* Fill the first new User struct */
+
+	if (AST_LIST_LAST(&conf->userlist))
+		user->user_no = AST_LIST_LAST(&conf->userlist)->user_no + 1;
+	else
 		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(&conflock);
-			goto outrun;
-		} else {
-			conf->lastuser->nextuser = user;
-			conf->lastuser = user;
-		}
-	}
 
 	user->chan = chan;
 	user->userflags = confflags;
 	user->adminflags = 0;
 	user->talking = -1;
 	conf->users++;
-	ast_mutex_unlock(&conflock);
+
+	AST_LIST_INSERT_TAIL(&conf->userlist, user, list);
+
+	/* Since we control a user in the userlist, our conference should never go away now. */
+	AST_LIST_UNLOCK(&confs);
 
 	if (confflags & CONFFLAG_EXIT_CONTEXT) {
 		if ((agifile = pbx_builtin_getvar_helper(chan, "MEETME_EXIT_CONTEXT"))) 
@@ -1050,7 +1054,7 @@
 	ztc.chan = 0;	
 	ztc.confno = conf->zapconf;
 
-	ast_mutex_lock(&conflock);
+	AST_LIST_LOCK(&confs);
 
 	if (!(confflags & CONFFLAG_QUIET) && (confflags & CONFFLAG_INTROUSER) && conf->users > 1) {
 		if (conf->chan && ast_fileexists(user->namerecloc, NULL, NULL)) {
@@ -1071,7 +1075,7 @@
 	if (ioctl(fd, ZT_SETCONF, &ztc)) {
 		ast_log(LOG_WARNING, "Error setting conference\n");
 		close(fd);
-		ast_mutex_unlock(&conflock);
+		AST_LIST_UNLOCK(&confs);
 		goto outrun;
 	}
 	ast_log(LOG_DEBUG, "Placed channel %s in ZAP conf %d\n", chan->name, conf->zapconf);
@@ -1090,7 +1094,7 @@
 				conf_play(chan, conf, ENTER);
 	}
 
-	ast_mutex_unlock(&conflock);
+	AST_LIST_UNLOCK(&confs);
 
 	conf_flush(fd, chan);
 
@@ -1424,7 +1428,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, "");
@@ -1543,7 +1547,7 @@
 					if (user->listen.actual)
 						ast_frame_adjust_volume(&fr, user->listen.actual);
 					if (ast_write(chan, &fr) < 0) {
-						ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
+						ast_log(LOG_WARNING, "Unable to write frame to channel %s\n", chan->name);
 					}
 				} else 
 					ast_log(LOG_WARNING, "Failed to read frame: %s\n", strerror(errno));
@@ -1569,7 +1573,7 @@
 
 	reset_volumes(user);
 
-	ast_mutex_lock(&conflock);
+	AST_LIST_LOCK(&confs);
 	if (!(confflags & CONFFLAG_QUIET) && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN))
 		conf_play(chan, conf, LEAVE);
 
@@ -1584,14 +1588,14 @@
 			ast_filedelete(user->namerecloc, NULL);
 		}
 	}
-	ast_mutex_unlock(&conflock);
+	AST_LIST_UNLOCK(&confs);
 
  outrun:
-	ast_mutex_lock(&conflock);
+	AST_LIST_LOCK(&confs);
 
 	if (confflags & CONFFLAG_MONITORTALKER && dsp)
 		ast_dsp_free(dsp);
-	
+
 	if (user->user_no) { /* Only cleanup users who really joined! */
 		manager_event(EVENT_FLAG_CALL, "MeetmeLeave", 
 			      "Channel: %s\r\n"
@@ -1602,62 +1606,33 @@
 		conf->users--;
 		if (confflags & CONFFLAG_MARKEDUSER) 
 			conf->markedusers--;
-		if (!conf->users) {
-			/* No more users -- close this one out */
-			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));
 		pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
 	}
 	free(user);
-	ast_mutex_unlock(&conflock);
+	AST_LIST_UNLOCK(&confs);
 
 	return ret;
 }
 
 static struct ast_conference *find_conf(struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin,
-					struct ast_flags *confflags)
+	int refcount, struct ast_flags *confflags)
 {
 	struct ast_config *cfg;
 	struct ast_variable *var;
 	struct ast_conference *cnf;
 
 	/* Check first in the conference list */
-	ast_mutex_lock(&conflock);
-	for (cnf = confs; cnf; cnf = cnf->next) {
+	AST_LIST_LOCK(&confs);
+	AST_LIST_TRAVERSE(&confs, cnf, list) {
 		if (!strcmp(confno, cnf->confno)) 
 			break;
 	}
-	ast_mutex_unlock(&conflock);
+	if (cnf)
+		ast_atomic_fetchadd_int(&cnf->refcount, refcount);
+	AST_LIST_UNLOCK(&confs);
 
 	if (!cnf) {
 		if (dynamic) {
@@ -1669,9 +1644,9 @@
 					if (ast_app_getdata(chan, "conf-getpin", dynamic_pin, AST_MAX_EXTENSION - 1, 0) < 0)
 						return NULL;
 				}
-				cnf = build_conf(confno, dynamic_pin, "", make, dynamic);
+				cnf = build_conf(confno, dynamic_pin, "", make, dynamic, refcount);
 			} else {
-				cnf = build_conf(confno, "", "", make, dynamic);
+				cnf = build_conf(confno, "", "", make, dynamic, refcount);
 			}
 		} else {
 			/* Check the config */
@@ -1693,14 +1668,14 @@
 							/* Bingo it's a valid conference */
 							if (pin)
 								if (pinadmin)
-									cnf = build_conf(confno, pin, pinadmin, make, dynamic);
+									cnf = build_conf(confno, pin, pinadmin, make, dynamic, refcount);
 								else
-									cnf = build_conf(confno, pin, "", make, dynamic);
+									cnf = build_conf(confno, pin, "", make, dynamic, refcount);
 							else
 								if (pinadmin)
-									cnf = build_conf(confno, "", pinadmin, make, dynamic);
+									cnf = build_conf(confno, "", pinadmin, make, dynamic, refcount);
 								else
-									cnf = build_conf(confno, "", "", make, dynamic);
+									cnf = build_conf(confno, "", "", make, dynamic, refcount);
 							break;
 						}
 					}
@@ -1763,10 +1738,12 @@
 	}
 	
 	confnum = strsep(&localdata,"|");       
-	conf = find_conf(chan, confnum, 0, 0, NULL, NULL);
-	if (conf)
+	conf = find_conf(chan, confnum, 0, 0, NULL, 1, NULL);
+	if (conf) {
 		count = conf->users;
-	else
+		dispose_conf(conf);
+		conf = NULL;
+	} else
 		count = 0;
 
 	if (!ast_strlen_zero(localdata)){
@@ -1791,7 +1768,7 @@
 	char confno[AST_MAX_EXTENSION] = "";
 	int allowretry = 0;
 	int retrycnt = 0;
-	struct ast_conference *cnf;
+	struct ast_conference *cnf = NULL;
 	struct ast_flags confflags = {0};
 	int dynamic = 0;
 	int empty = 0, empty_no_pin = 0;
@@ -1847,15 +1824,15 @@
 			struct ast_variable *var;
 			int confno_int;
 
-			ast_mutex_lock(&conflock);
-			for (cnf = confs; cnf; cnf = cnf->next) {
+			AST_LIST_LOCK(&confs);
+			AST_LIST_TRAVERSE(&confs, cnf, list) {
 				if (sscanf(cnf->confno, "%d", &confno_int) == 1) {
 					/* Disqualify in use conference */
 					if (confno_int >= 0 && confno_int < 1024)
 						map[confno_int]++;
 				}
 			}
-			ast_mutex_unlock(&conflock);

[... 6539 lines stripped ...]


More information about the asterisk-commits mailing list