[asterisk-commits] branch oej/stopshrinkinguris r15324 - in /team/oej/stopshrinkinguris: ./ agi/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Mar 27 14:42:41 MST 2006


Author: oej
Date: Mon Mar 27 15:42:29 2006
New Revision: 15324

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

Added:
    team/oej/stopshrinkinguris/apps/app_channelredirect.c
      - copied unchanged from r15319, trunk/apps/app_channelredirect.c
    team/oej/stopshrinkinguris/configs/http.conf.sample
      - copied unchanged from r15319, trunk/configs/http.conf.sample
    team/oej/stopshrinkinguris/http.c
      - copied unchanged from r15319, trunk/http.c
    team/oej/stopshrinkinguris/include/asterisk/http.h
      - copied unchanged from r15319, trunk/include/asterisk/http.h
Modified:
    team/oej/stopshrinkinguris/   (props changed)
    team/oej/stopshrinkinguris/Makefile
    team/oej/stopshrinkinguris/agi/Makefile
    team/oej/stopshrinkinguris/app.c
    team/oej/stopshrinkinguris/apps/app_amd.c
    team/oej/stopshrinkinguris/apps/app_dial.c
    team/oej/stopshrinkinguris/apps/app_directory.c
    team/oej/stopshrinkinguris/apps/app_dumpchan.c
    team/oej/stopshrinkinguris/apps/app_meetme.c
    team/oej/stopshrinkinguris/apps/app_queue.c
    team/oej/stopshrinkinguris/apps/app_readfile.c
    team/oej/stopshrinkinguris/apps/app_stack.c
    team/oej/stopshrinkinguris/apps/app_voicemail.c
    team/oej/stopshrinkinguris/asterisk.c
    team/oej/stopshrinkinguris/cdr.c
    team/oej/stopshrinkinguris/cdr/Makefile
    team/oej/stopshrinkinguris/channels/chan_agent.c
    team/oej/stopshrinkinguris/channels/chan_iax2.c
    team/oej/stopshrinkinguris/channels/chan_misdn.c
    team/oej/stopshrinkinguris/channels/chan_sip.c
    team/oej/stopshrinkinguris/channels/chan_skinny.c
    team/oej/stopshrinkinguris/channels/chan_vpb.c
    team/oej/stopshrinkinguris/channels/chan_zap.c
    team/oej/stopshrinkinguris/channels/misdn/isdn_lib.c
    team/oej/stopshrinkinguris/cli.c
    team/oej/stopshrinkinguris/configs/sip.conf.sample
    team/oej/stopshrinkinguris/configs/zapata.conf.sample
    team/oej/stopshrinkinguris/contrib/init.d/rc.redhat.asterisk
    team/oej/stopshrinkinguris/db.c
    team/oej/stopshrinkinguris/funcs/func_channel.c
    team/oej/stopshrinkinguris/funcs/func_enum.c
    team/oej/stopshrinkinguris/image.c
    team/oej/stopshrinkinguris/include/asterisk/cdr.h
    team/oej/stopshrinkinguris/include/asterisk/compat.h
    team/oej/stopshrinkinguris/include/asterisk/lock.h
    team/oej/stopshrinkinguris/include/asterisk/manager.h
    team/oej/stopshrinkinguris/include/asterisk/say.h
    team/oej/stopshrinkinguris/include/asterisk/sched.h
    team/oej/stopshrinkinguris/include/asterisk/strings.h
    team/oej/stopshrinkinguris/loader.c
    team/oej/stopshrinkinguris/manager.c
    team/oej/stopshrinkinguris/pbx.c
    team/oej/stopshrinkinguris/res/res_features.c
    team/oej/stopshrinkinguris/res/res_musiconhold.c
    team/oej/stopshrinkinguris/res/res_snmp.c
    team/oej/stopshrinkinguris/say.c
    team/oej/stopshrinkinguris/stdtime/localtime.c
    team/oej/stopshrinkinguris/utils.c

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

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

Propchange: team/oej/stopshrinkinguris/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Mar 27 15:42:29 2006
@@ -1,1 +1,1 @@
-/trunk:1-14182
+/trunk:1-15322

Modified: team/oej/stopshrinkinguris/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/Makefile?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/Makefile (original)
+++ team/oej/stopshrinkinguris/Makefile Mon Mar 27 15:42:29 2006
@@ -357,14 +357,23 @@
 SUBDIRS=res channels pbx apps codecs formats agi cdr funcs utils stdtime
 
 OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
-	translate.o file.o say.o pbx.o cli.o md5.o term.o \
+	translate.o file.o pbx.o cli.o md5.o term.o \
 	ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
 	cdr.o tdd.o acl.o rtp.o udptl.o manager.o asterisk.o \
 	dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
 	astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
 	utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
 	netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
-	cryptostub.o sha1.o
+	cryptostub.o sha1.o http.o
+
+# 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
+
+# At the moment say.o is an optional component which can be overridden
+# by a module.
+OBJS+= say.o
 
 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
   OBJS+= poll.o

Modified: team/oej/stopshrinkinguris/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/agi/Makefile?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/agi/Makefile (original)
+++ team/oej/stopshrinkinguris/agi/Makefile Mon Mar 27 15:42:29 2006
@@ -18,10 +18,6 @@
 LIBS=
 ifeq ($(OSARCH),SunOS)
   LIBS=-lsocket -lnsl ../strcompat.o
-endif
-
-ifeq ($(findstring BSD,${OSARCH}),BSD)
-  CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
 endif
 
 all: depend $(AGIS)

Modified: team/oej/stopshrinkinguris/app.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/app.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/app.c (original)
+++ team/oej/stopshrinkinguris/app.c Mon Mar 27 15:42:29 2006
@@ -1059,7 +1059,7 @@
 	if (ast_strlen_zero(group))
 		return 0;
 
- 	s = (!ast_strlen_zero(category)) ? category : GROUP_CATEGORY_PREFIX;
+ 	s = S_OR(category, GROUP_CATEGORY_PREFIX);
 	ast_copy_string(cat, s, sizeof(cat));
 
 	chan = NULL;
@@ -1089,7 +1089,7 @@
 	if (regcomp(&regexbuf, groupmatch, REG_EXTENDED | REG_NOSUB))
 		return 0;
 
-	s = (!ast_strlen_zero(category)) ? category : GROUP_CATEGORY_PREFIX;
+	s = S_OR(category, GROUP_CATEGORY_PREFIX);
 	ast_copy_string(cat, s, sizeof(cat));
 
 	chan = NULL;

Modified: team/oej/stopshrinkinguris/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/apps/app_amd.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/apps/app_amd.c (original)
+++ team/oej/stopshrinkinguris/apps/app_amd.c Mon Mar 27 15:42:29 2006
@@ -20,6 +20,10 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+
+#include "asterisk.h"
+ 
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include "asterisk/module.h"
 #include "asterisk/lock.h"

Modified: team/oej/stopshrinkinguris/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/apps/app_dial.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/apps/app_dial.c (original)
+++ team/oej/stopshrinkinguris/apps/app_dial.c Mon Mar 27 15:42:29 2006
@@ -541,7 +541,7 @@
 							senddialevent(in, o->chan);
 							/* After calling, set callerid to extension */
 							if (!ast_test_flag(peerflags, OPT_ORIGINAL_CLID))
-								ast_set_callerid(o->chan, ast_strlen_zero(in->macroexten) ? in->exten : in->macroexten, get_cid_name(cidname, sizeof(cidname), in), NULL);
+								ast_set_callerid(o->chan, S_OR(in->macroexten, in->exten), get_cid_name(cidname, sizeof(cidname), in), NULL);
 						}
 					}
 					/* Hangup the original channel now, in case we needed it */
@@ -1135,7 +1135,7 @@
 			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
 			if (!ast_test_flag(peerflags, OPT_ORIGINAL_CLID))
-				ast_set_callerid(tmp->chan, ast_strlen_zero(chan->macroexten) ? chan->exten : chan->macroexten, get_cid_name(cidname, sizeof(cidname), chan), NULL);
+				ast_set_callerid(tmp->chan, S_OR(chan->macroexten, chan->exten), get_cid_name(cidname, sizeof(cidname), chan), NULL);
 		}
 		/* Put them in the list of outgoing thingies...  We're ready now. 
 		   XXX If we're forcibly removed, these outgoing calls won't get

Modified: team/oej/stopshrinkinguris/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/apps/app_directory.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/apps/app_directory.c (original)
+++ team/oej/stopshrinkinguris/apps/app_directory.c Mon Mar 27 15:42:29 2006
@@ -179,7 +179,7 @@
 		}
 		ast_stopstream(chan);
 	} else {
-		res = ast_say_character_str(chan, !ast_strlen_zero(name) ? name : ext,
+		res = ast_say_character_str(chan, S_OR(name, ext),
 					AST_DIGIT_ANY, chan->language);
 	}
 

Modified: team/oej/stopshrinkinguris/apps/app_dumpchan.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/apps/app_dumpchan.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/apps/app_dumpchan.c (original)
+++ team/oej/stopshrinkinguris/apps/app_dumpchan.c Mon Mar 27 15:42:29 2006
@@ -126,7 +126,7 @@
 			 ast_print_group(cgrp, sizeof(cgrp), c->callgroup),
 			 ast_print_group(pgrp, sizeof(pgrp), c->pickupgroup),
 			 ( c->appl ? c->appl : "(N/A)" ),
-			 ( c-> data ? (!ast_strlen_zero(c->data) ? c->data : "(Empty)") : "(None)"),
+			 ( c-> data ? S_OR(c->data, "(Empty)") : "(None)"),
 			 (ast_test_flag(c, AST_FLAG_BLOCKING) ? c->blockproc : "(Not Blocking)"));
 
 	return 0;

Modified: team/oej/stopshrinkinguris/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/apps/app_meetme.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/apps/app_meetme.c (original)
+++ team/oej/stopshrinkinguris/apps/app_meetme.c Mon Mar 27 15:42:29 2006
@@ -779,6 +779,8 @@
 			f = ast_read(chan);
 			if (f)
 				ast_frfree(f);
+			else /* channel was hung up or something else happened */
+				break;
 		}
 	}
 
@@ -1843,8 +1845,8 @@
 				if (!strcasecmp(args.confno, confno)) {
 					/* Bingo it's a valid conference */
 					cnf = build_conf(args.confno,
-							ast_strlen_zero(args.pin) ? "" : args.pin,
-							ast_strlen_zero(args.pinadmin) ? "" : args.pinadmin,
+							S_OR(args.pin, ""),
+							S_OR(args.pinadmin, ""),
 							make, dynamic, refcount);
 					break;
 				}

Modified: team/oej/stopshrinkinguris/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/apps/app_queue.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/apps/app_queue.c (original)
+++ team/oej/stopshrinkinguris/apps/app_queue.c Mon Mar 27 15:42:29 2006
@@ -3357,7 +3357,7 @@
 	AST_LIST_UNLOCK(&queues);
 }
 
-static int __queues_show(int manager, int fd, int argc, char **argv, int queue_show)
+static int __queues_show(struct mansession *s, int manager, int fd, int argc, char **argv, int queue_show)
 {
 	struct ast_call_queue *q;
 	struct queue_ent *qe;
@@ -3381,10 +3381,17 @@
 	AST_LIST_LOCK(&queues);
 	if (AST_LIST_EMPTY(&queues)) {
 		AST_LIST_UNLOCK(&queues);
-		if (queue_show)
-			ast_cli(fd, "No such queue: %s.%s",argv[2], term);
-		else
-			ast_cli(fd, "No queues.%s", term);
+		if (queue_show) {
+			if (s)
+				astman_append(s, "No such queue: %s.%s",argv[2], term);
+			else
+				ast_cli(fd, "No such queue: %s.%s",argv[2], term);
+		} else {
+			if (s)
+				astman_append(s, "No queues.%s", term);
+			else
+				ast_cli(fd, "No queues.%s", term);
+		}
 		return RESULT_SUCCESS;
 	}
 	AST_LIST_TRAVERSE(&queues, q, list) {
@@ -3409,10 +3416,17 @@
 		sl = 0;
 		if(q->callscompleted > 0)
 			sl = 100*((float)q->callscompletedinsl/(float)q->callscompleted);
-		ast_cli(fd, "%-12.12s has %d calls (max %s) in '%s' strategy (%ds holdtime), W:%d, C:%d, A:%d, SL:%2.1f%% within %ds%s",
-			q->name, q->count, max_buf, int2strat(q->strategy), q->holdtime, q->weight, q->callscompleted, q->callsabandoned,sl,q->servicelevel, term);
+		if (s)
+			astman_append(s, "%-12.12s has %d calls (max %s) in '%s' strategy (%ds holdtime), W:%d, C:%d, A:%d, SL:%2.1f%% within %ds%s",
+				q->name, q->count, max_buf, int2strat(q->strategy), q->holdtime, q->weight, q->callscompleted, q->callsabandoned,sl,q->servicelevel, term);
+		else
+			ast_cli(fd, "%-12.12s has %d calls (max %s) in '%s' strategy (%ds holdtime), W:%d, C:%d, A:%d, SL:%2.1f%% within %ds%s",
+				q->name, q->count, max_buf, int2strat(q->strategy), q->holdtime, q->weight, q->callscompleted, q->callsabandoned,sl,q->servicelevel, term);
 		if (q->members) {
-			ast_cli(fd, "   Members: %s", term);
+			if (s)
+				astman_append(s, "   Members: %s", term);
+			else
+				ast_cli(fd, "   Members: %s", term);
 			for (mem = q->members; mem; mem = mem->next) {
 				max_buf[0] = '\0';
 				max = max_buf;
@@ -3429,19 +3443,37 @@
 							 mem->calls, (long)(time(NULL) - mem->lastcall));
 				} else
 					ast_build_string(&max, &max_left, " has taken no calls yet");
-				ast_cli(fd, "      %s%s%s", mem->interface, max_buf, term);
-			}
-		} else
+				if (s)
+					astman_append(s, "      %s%s%s", mem->interface, max_buf, term);
+				else
+					ast_cli(fd, "      %s%s%s", mem->interface, max_buf, term);
+			}
+		} else if (s)
+			astman_append(s, "   No Members%s", term);
+		else	
 			ast_cli(fd, "   No Members%s", term);
 		if (q->head) {
 			pos = 1;
-			ast_cli(fd, "   Callers: %s", term);
-			for (qe = q->head; qe; qe = qe->next) 
-				ast_cli(fd, "      %d. %s (wait: %ld:%2.2ld, prio: %d)%s", pos++, qe->chan->name,
-					(long)(now - qe->start) / 60, (long)(now - qe->start) % 60, qe->prio, term);
-		} else
+			if (s)
+				astman_append(s, "   Callers: %s", term);
+			else
+				ast_cli(fd, "   Callers: %s", term);
+			for (qe = q->head; qe; qe = qe->next) {
+				if (s)
+					astman_append(s, "      %d. %s (wait: %ld:%2.2ld, prio: %d)%s", pos++, qe->chan->name,
+						(long)(now - qe->start) / 60, (long)(now - qe->start) % 60, qe->prio, term);
+				else
+					ast_cli(fd, "      %d. %s (wait: %ld:%2.2ld, prio: %d)%s", pos++, qe->chan->name,
+						(long)(now - qe->start) / 60, (long)(now - qe->start) % 60, qe->prio, term);
+			}
+		} else if (s)
+			astman_append(s, "   No Callers%s", term);
+		else
 			ast_cli(fd, "   No Callers%s", term);
-		ast_cli(fd, "%s", term);
+		if (s)
+			astman_append(s, "%s", term);
+		else
+			ast_cli(fd, "%s", term);
 		ast_mutex_unlock(&q->lock);
 		if (queue_show)
 			break;
@@ -3452,12 +3484,12 @@
 
 static int queues_show(int fd, int argc, char **argv)
 {
-	return __queues_show(0, fd, argc, argv, 0);
+	return __queues_show(NULL, 0, fd, argc, argv, 0);
 }
 
 static int queue_show(int fd, int argc, char **argv)
 {
-	return __queues_show(0, fd, argc, argv, 1);
+	return __queues_show(NULL, 0, fd, argc, argv, 1);
 }
 
 static char *complete_queue(const char *line, const char *word, int pos, int state)
@@ -3485,8 +3517,8 @@
 static int manager_queues_show( struct mansession *s, struct message *m )
 {
 	char *a[] = { "show", "queues" };
-	__queues_show(1, s->fd, 2, a, 0);
-	ast_cli(s->fd, "\r\n\r\n");	/* Properly terminate Manager output */
+	__queues_show(s, 1, -1, 2, a, 0);
+	astman_append(s, "\r\n\r\n");	/* Properly terminate Manager output */
 
 	return RESULT_SUCCESS;
 } 
@@ -3518,7 +3550,7 @@
 		if (ast_strlen_zero(queuefilter) || !strcmp(q->name, queuefilter)) {
 			if(q->callscompleted > 0)
 				sl = 100*((float)q->callscompletedinsl/(float)q->callscompleted);
-			ast_cli(s->fd, "Event: QueueParams\r\n"
+			astman_append(s, "Event: QueueParams\r\n"
 						"Queue: %s\r\n"
 						"Max: %d\r\n"
 						"Calls: %d\r\n"
@@ -3535,7 +3567,7 @@
 			/* List Queue Members */
 			for (mem = q->members; mem; mem = mem->next) {
 				if (ast_strlen_zero(memberfilter) || !strcmp(mem->interface, memberfilter)) {
-					ast_cli(s->fd, "Event: QueueMember\r\n"
+					astman_append(s, "Event: QueueMember\r\n"
 						"Queue: %s\r\n"
 						"Location: %s\r\n"
 						"Membership: %s\r\n"
@@ -3553,7 +3585,7 @@
 			/* List Queue Entries */
 			pos = 1;
 			for (qe = q->head; qe; qe = qe->next) {
-				ast_cli(s->fd, "Event: QueueEntry\r\n"
+				astman_append(s, "Event: QueueEntry\r\n"
 					"Queue: %s\r\n"
 					"Position: %d\r\n"
 					"Channel: %s\r\n"
@@ -3572,7 +3604,7 @@
 	}
 	AST_LIST_UNLOCK(&queues);
 
-	ast_cli(s->fd,
+	astman_append(s,
 		"Event: QueueStatusComplete\r\n"
 		"%s"
 		"\r\n",idText);

Modified: team/oej/stopshrinkinguris/apps/app_readfile.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/apps/app_readfile.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/apps/app_readfile.c (original)
+++ team/oej/stopshrinkinguris/apps/app_readfile.c Mon Mar 27 15:42:29 2006
@@ -92,15 +92,16 @@
 		}
 	}
 
-	returnvar = ast_read_textfile(file);
-	if(len > 0){
-		if(len < strlen(returnvar))
-			returnvar[len]='\0';
-		else
-			ast_log(LOG_WARNING,"%s is longer than %d, and %d \n", file, len, (int)strlen(returnvar));
+	if ((returnvar = ast_read_textfile(file))) {
+		if (len > 0) {
+			if (len < strlen(returnvar))
+				returnvar[len]='\0';
+			else
+				ast_log(LOG_WARNING, "%s is longer than %d, and %d \n", file, len, (int)strlen(returnvar));
+		}
+		pbx_builtin_setvar_helper(chan, varname, returnvar);
+		free(returnvar);
 	}
-	pbx_builtin_setvar_helper(chan, varname, returnvar);
-	free(returnvar);
 	LOCAL_USER_REMOVE(u);
 	return res;
 }

Modified: team/oej/stopshrinkinguris/apps/app_stack.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/apps/app_stack.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/apps/app_stack.c (original)
+++ team/oej/stopshrinkinguris/apps/app_stack.c Mon Mar 27 15:42:29 2006
@@ -29,6 +29,10 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+
+#include "asterisk.h"
+ 
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include "asterisk/options.h"
 #include "asterisk/logger.h"

Modified: team/oej/stopshrinkinguris/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/apps/app_voicemail.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/apps/app_voicemail.c (original)
+++ team/oej/stopshrinkinguris/apps/app_voicemail.c Mon Mar 27 15:42:29 2006
@@ -328,7 +328,7 @@
 "           message. The units are whole-number decibels (dB).\n"
 "    s    - Skip the playback of instructions for leaving a message to the\n"
 "           calling party.\n"
-"    u    - Play the 'unavailble greeting.\n"
+"    u    - Play the 'unavailable greeting.\n"
 "    j    - Jump to priority n+101 if the mailbox is not found or some other\n"
 "           error occurs.\n";
 
@@ -3473,11 +3473,13 @@
 		return res;
 	if (flag==1) {
 		struct leave_vm_options leave_options;
+		char mailbox[AST_MAX_EXTENSION * 2 + 2];
+		snprintf(mailbox, sizeof(mailbox), "%s@%s", username, context);
 
 		/* Send VoiceMail */
 		memset(&leave_options, 0, sizeof(leave_options));
 		leave_options.record_gain = record_gain;
-		cmd = leave_voicemail(chan, username, &leave_options);
+		cmd = leave_voicemail(chan, mailbox, &leave_options);
 	} else {
 
 		/* Forward VoiceMail */
@@ -3697,13 +3699,15 @@
 				if (!ast_strlen_zero(prefile)) {
 				/* See if we can find a recorded name for this person instead of their extension number */
 					if (ast_fileexists(prefile, NULL, NULL) > 0) {
-						ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
+						if (option_verbose > 2)
+							ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
 						if (!callback)
 							res = wait_file2(chan, vms, "vm-from");
 						res = ast_streamfile(chan, prefile, chan->language) > -1;
 						res = ast_waitstream(chan, "");
 					} else {
-						ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid);
+						if (option_verbose > 2)
+							ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid);
 						/* BB: Say "from extension" as one saying to sound smoother */
 						if (!callback)
 							res = wait_file2(chan, vms, "vm-from-extension");
@@ -3878,7 +3882,7 @@
 		return ERROR_LOCK_PATH;
 	
 	vms->curmsg = -1; 
-	for (x=0;x < vmu->maxmsg;x++) { 
+	for (x = 0; x < vmu->maxmsg; x++) { 
 		if (!vms->deleted[x] && (strcasecmp(vms->curbox, "INBOX") || !vms->heard[x])) { 
 			/* Save this message.  It's not in INBOX or hasn't been heard */ 
 			make_file(vms->fn, sizeof(vms->fn), vms->curdir, x); 
@@ -3912,9 +3916,9 @@
 
 done:
 	if (vms->deleted)
-		memset(vms->deleted, 0, sizeof(vms->deleted)); 
+		memset(vms->deleted, 0, vmu->maxmsg * sizeof(int)); 
 	if (vms->heard)
-		memset(vms->heard, 0, sizeof(vms->heard)); 
+		memset(vms->heard, 0, vmu->maxmsg * sizeof(int)); 
 
 	return 0;
 }
@@ -5356,7 +5360,8 @@
 					cmd = 't';
 					break;
 				case '2': /* Callback */
-					ast_verbose( VERBOSE_PREFIX_3 "Callback Requested\n");
+					if (option_verbose > 2)
+						ast_verbose( VERBOSE_PREFIX_3 "Callback Requested\n");
 					if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1) {
 						cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 2, record_gain);
 						if (cmd == 9) {
@@ -6443,7 +6448,8 @@
 	int retries = 0;
 
 	if (!num) {
-		ast_verbose( VERBOSE_PREFIX_3 "Destination number will be entered manually\n");
+		if (option_verbose > 2)
+			ast_verbose( VERBOSE_PREFIX_3 "Destination number will be entered manually\n");
 		while (retries < 3 && cmd != 't') {
 			destination[1] = '\0';
 			destination[0] = cmd = ast_play_and_wait(chan,"vm-enter-num-to-call");
@@ -6463,7 +6469,8 @@
 				if (cmd < 0)
 					return 0;
 				if (cmd == '*') {
-					ast_verbose( VERBOSE_PREFIX_3 "User hit '*' to cancel outgoing call\n");
+					if (option_verbose > 2)
+						ast_verbose( VERBOSE_PREFIX_3 "User hit '*' to cancel outgoing call\n");
 					return 0;
 				}
 				if ((cmd = ast_readstring(chan,destination + strlen(destination),sizeof(destination)-1,6000,10000,"#")) < 0) 
@@ -6477,14 +6484,16 @@
 		}
 		
 	} else {
-		ast_verbose( VERBOSE_PREFIX_3 "Destination number is CID number '%s'\n", num);
+		if (option_verbose > 2)
+			ast_verbose( VERBOSE_PREFIX_3 "Destination number is CID number '%s'\n", num);
 		ast_copy_string(destination, num, sizeof(destination));
 	}
 
 	if (!ast_strlen_zero(destination)) {
 		if (destination[strlen(destination) -1 ] == '*')
 			return 0; 
-		ast_verbose( VERBOSE_PREFIX_3 "Placing outgoing call to extension '%s' in context '%s' from context '%s'\n", destination, outgoing_context, chan->context);
+		if (option_verbose > 2)
+			ast_verbose( VERBOSE_PREFIX_3 "Placing outgoing call to extension '%s' in context '%s' from context '%s'\n", destination, outgoing_context, chan->context);
 		ast_copy_string(chan->exten, destination, sizeof(chan->exten));
 		ast_copy_string(chan->context, outgoing_context, sizeof(chan->context));
 		chan->priority = 0;
@@ -6555,7 +6564,8 @@
 							if (res)
 								return 9;
 						} else {
-							ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n");
+							if (option_verbose > 2)
+								ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n");
 							res = ast_play_and_wait(chan, "vm-sorry");
 						}
 						return res;
@@ -6576,7 +6586,8 @@
 						break;
 					default:
 						if (num) {
-							ast_verbose( VERBOSE_PREFIX_3 "Confirm CID number '%s' is number to use for callback\n", num);
+							if (option_verbose > 2)
+								ast_verbose( VERBOSE_PREFIX_3 "Confirm CID number '%s' is number to use for callback\n", num);
 							res = ast_play_and_wait(chan, "vm-num-i-have");
 							if (!res)
 								res = play_message_callerid(chan, vms, num, vmu->context, 1);
@@ -6618,25 +6629,30 @@
 		if (!ast_strlen_zero(cid)) {
 			ast_callerid_parse(cid, &name, &num);
 			if (!num) {
-				ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n");
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n");
 				if (!res)
 					res = ast_play_and_wait(chan, "vm-nonumber");
 				return res;
 			} else {
 				if (find_user(NULL, vmu->context, num)) {
 					struct leave_vm_options leave_options;
-
-					ast_verbose(VERBOSE_PREFIX_3 "Leaving voicemail for '%s' in context '%s'\n", num, vmu->context);
+					char mailbox[AST_MAX_EXTENSION * 2 + 2];
+					snprintf(mailbox, sizeof(mailbox), "%s@%s", num, vmu->context);
+
+					if (option_verbose > 2)
+						ast_verbose(VERBOSE_PREFIX_3 "Leaving voicemail for '%s' in context '%s'\n", num, vmu->context);
 					
 					memset(&leave_options, 0, sizeof(leave_options));
 					leave_options.record_gain = record_gain;
-					res = leave_voicemail(chan, num, &leave_options);
+					res = leave_voicemail(chan, mailbox, &leave_options);
 					if (!res)
 						res = 't';
 					return res;
 				} else {
 					/* Sender has no mailbox, can't reply */
-					ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
+					if (option_verbose > 2)
+						ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
 					ast_play_and_wait(chan, "vm-nobox");
 					res = 't';
 					return res;
@@ -6687,7 +6703,8 @@
  				break;
  			} else {
  				/* Otherwise 1 is to save the existing message */
- 				ast_verbose(VERBOSE_PREFIX_3 "Saving message as is\n");
+ 				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Saving message as is\n");
  				ast_streamfile(chan, "vm-msgsaved", chan->language);
  				ast_waitstream(chan, "");
 				STORE(recordfile, vmu->mailbox, vmu->context, -1);
@@ -6697,17 +6714,21 @@
  			}
  		case '2':
  			/* Review */
- 			ast_verbose(VERBOSE_PREFIX_3 "Reviewing the message\n");
+ 			if (option_verbose > 2)
+				ast_verbose(VERBOSE_PREFIX_3 "Reviewing the message\n");
  			ast_streamfile(chan, recordfile, chan->language);
  			cmd = ast_waitstream(chan, AST_DIGIT_ANY);
  			break;
  		case '3':
  			message_exists = 0;
  			/* Record */
- 			if (recorded == 1)
-				ast_verbose(VERBOSE_PREFIX_3 "Re-recording the message\n");
- 			else	
-				ast_verbose(VERBOSE_PREFIX_3 "Recording the message\n");
+ 			if (recorded == 1) {
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Re-recording the message\n");
+ 			} else {	
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Recording the message\n");
+			}
 			if (recorded && outsidecaller) {
  				cmd = ast_play_and_wait(chan, INTRO);
  				cmd = ast_play_and_wait(chan, "beep");
@@ -6731,14 +6752,16 @@
 #if 0			
  			else if (vmu->review && (*duration < 5)) {
  				/* Message is too short */
- 				ast_verbose(VERBOSE_PREFIX_3 "Message too short\n");
+ 				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Message too short\n");
 				cmd = ast_play_and_wait(chan, "vm-tooshort");
  				cmd = vm_delete(recordfile);
  				break;
  			}
  			else if (vmu->review && (cmd == 2 && *duration < (maxsilence + 3))) {
  				/* Message is all silence */
- 				ast_verbose(VERBOSE_PREFIX_3 "Nothing recorded\n");
+ 				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Nothing recorded\n");
  				cmd = vm_delete(recordfile);
 				cmd = ast_play_and_wait(chan, "vm-nothingrecorded");
 				if (!cmd)

Modified: team/oej/stopshrinkinguris/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/asterisk.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/asterisk.c (original)
+++ team/oej/stopshrinkinguris/asterisk.c Mon Mar 27 15:42:29 2006
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -107,6 +107,7 @@
 #include "asterisk/pbx.h"
 #include "asterisk/enum.h"
 #include "asterisk/rtp.h"
+#include "asterisk/http.h"
 #if defined(T38_SUPPORT)
 #include "asterisk/udptl.h"
 #endif
@@ -882,11 +883,11 @@
 	if (ast_socket > -1) {
 		close(ast_socket);
 		ast_socket = -1;
+		unlink(ast_config_AST_SOCKET);
+		pthread_cancel(lthread);
 	}
 	if (ast_consock > -1)
 		close(ast_consock);
-	if (ast_socket > -1)
-		unlink(ast_config_AST_SOCKET);
 	if (!ast_opt_remote)
 		unlink(ast_config_AST_PID);
 	printf(term_quit());
@@ -1847,7 +1848,8 @@
 	return 0;
 }
 
-static void ast_readconfig(void) {
+static void ast_readconfig(void) 
+{
 	struct ast_config *cfg;
 	struct ast_variable *v;
 	char *config = AST_CONFIG_FILE;
@@ -2321,6 +2323,7 @@
 		printf(term_quit());
 		exit(1);
 	}
+	ast_http_init();
 	ast_channels_init();
 	if (init_manager()) {
 		printf(term_quit());

Modified: team/oej/stopshrinkinguris/cdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/cdr.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/cdr.c (original)
+++ team/oej/stopshrinkinguris/cdr.c Mon Mar 27 15:42:29 2006
@@ -439,7 +439,7 @@
 
 	while (cdr) {
 		next = cdr->next;
-		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+		chan = S_OR(cdr->channel, "<unknown>");
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_POSTED) && !ast_test_flag(cdr, AST_CDR_FLAG_POST_DISABLED))
 			ast_log(LOG_WARNING, "CDR on channel '%s' not posted\n", chan);
 		if (ast_tvzero(cdr->end))
@@ -464,7 +464,7 @@
 
 	while (cdr) {
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
-			chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+			chan = S_OR(cdr->channel, "<unknown>");
 			if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
 				ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
 			if (!ast_tvzero(cdr->start))
@@ -480,7 +480,7 @@
 	char *chan; 
 
 	while (cdr) {
-		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+		chan = S_OR(cdr->channel, "<unknown>");
 		if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
 			ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
 		if (cdr->disposition < AST_CDR_ANSWERED)
@@ -497,7 +497,7 @@
 
 	while (cdr) {
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
-			chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+			chan = S_OR(cdr->channel, "<unknown>");
 			if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
 				ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
 			if (cdr->disposition < AST_CDR_BUSY)
@@ -512,11 +512,13 @@
 	char *chan; 
 
 	while (cdr) {
-		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+		chan = S_OR(cdr->channel, "<unknown>");
 		if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
 			ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
-		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED))
-			cdr->disposition = AST_CDR_FAILED;
+		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
+			if (cdr->disposition < AST_CDR_FAILED)
+				cdr->disposition = AST_CDR_FAILED;
+		}
 		cdr = cdr->next;
 	}
 }
@@ -552,7 +554,7 @@
 	char *chan; 
 
 	while (cdr) {
-		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+		chan = S_OR(cdr->channel, "<unknown>");
 		if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
 			ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED))
@@ -567,7 +569,7 @@
 
 	while (cdr) {
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
-			chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+			chan = S_OR(cdr->channel, "<unknown>");
 			if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
 				ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
 			if (!app)
@@ -615,7 +617,7 @@
 
 	while (cdr) {
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
-			chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+			chan = S_OR(cdr->channel, "<unknown>");
 			if (!ast_strlen_zero(cdr->channel)) 
 				ast_log(LOG_WARNING, "CDR already initialized on '%s'\n", chan); 
 			ast_copy_string(cdr->channel, c->name, sizeof(cdr->channel));
@@ -650,7 +652,7 @@
 	char *chan;
 
 	while (cdr) {
-		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+		chan = S_OR(cdr->channel, "<unknown>");
 		if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
 			ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
 		if (ast_tvzero(cdr->end))
@@ -776,8 +778,8 @@
 			/* Copy account code et-al */	
 			ast_copy_string(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode));
 			/* Destination information */
-			ast_copy_string(cdr->dst, (ast_strlen_zero(c->macroexten)) ? c->exten : c->macroexten, sizeof(cdr->dst));
-			ast_copy_string(cdr->dcontext, (ast_strlen_zero(c->macrocontext)) ? c->context : c->macrocontext, sizeof(cdr->dcontext));
+			ast_copy_string(cdr->dst, S_OR(c->macroexten, c->exten), sizeof(cdr->dst));
+			ast_copy_string(cdr->dcontext, S_OR(c->macrocontext, c->context), sizeof(cdr->dcontext));
 		}
 		cdr = cdr->next;
 	}
@@ -804,7 +806,7 @@
 	struct ast_cdr_beitem *i;
 
 	while (cdr) {
-		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+		chan = S_OR(cdr->channel, "<unknown>");
 		if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
 			ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
 		if (ast_tvzero(cdr->end))

Modified: team/oej/stopshrinkinguris/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/cdr/Makefile?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/cdr/Makefile (original)
+++ team/oej/stopshrinkinguris/cdr/Makefile Mon Mar 27 15:42:29 2006
@@ -35,11 +35,6 @@
   CYGSOLIB=-L.. -L. -lasterisk.dll
 else
   CFLAGS+=-fPIC
-endif
-
-ifeq ($(findstring BSD,${OSARCH}),BSD)
-  CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
-  SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
 endif
 
 #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.

Modified: team/oej/stopshrinkinguris/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/channels/chan_agent.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/channels/chan_agent.c (original)
+++ team/oej/stopshrinkinguris/channels/chan_agent.c Mon Mar 27 15:42:29 2006
@@ -1230,7 +1230,7 @@
 	if(!chan) 
 		return 0;
 
-	snprintf(loginchan, sizeof(loginchan), "%s@%s", chan, !ast_strlen_zero(context) ? context : "default");
+	snprintf(loginchan, sizeof(loginchan), "%s@%s", chan, S_OR(context,"default"));
 	
 	AST_LIST_TRAVERSE(&agents, p, list) {
 		if(!strcasecmp(chan, p->loginchan))
@@ -1411,7 +1411,7 @@
 			status = "AGENT_LOGGEDOFF";
 		}
 
-		ast_cli(s->fd, "Event: Agents\r\n"
+		astman_append(s, "Event: Agents\r\n"
 			"Agent: %s\r\n"
 			"Name: %s\r\n"
 			"Status: %s\r\n"
@@ -1424,7 +1424,7 @@
 		ast_mutex_unlock(&p->lock);
 	}
 	AST_LIST_UNLOCK(&agents);
-	ast_cli(s->fd, "Event: AgentsComplete\r\n"
+	astman_append(s, "Event: AgentsComplete\r\n"
 		"%s"
 		"\r\n",idText);
 	return 0;
@@ -1825,7 +1825,7 @@
 								res = ast_app_getdata(chan, "agent-newlocation", tmpchan+pos, sizeof(tmpchan) - 2, 0);
 							if (ast_strlen_zero(tmpchan) )
 								break;
-							if(ast_exists_extension(chan, !ast_strlen_zero(context) ? context : "default", tmpchan,1, NULL) ) {
+							if(ast_exists_extension(chan, S_OR(context,"default"), tmpchan,1, NULL) ) {
 								if(!allow_multiple_login(tmpchan,context) ) {
 									args.extension = NULL;
 									pos = 0;
@@ -1837,7 +1837,7 @@
 								args.extension = NULL;
 								pos = 0;
 							} else {
-								ast_log(LOG_WARNING, "Extension '%s@%s' is not valid for automatic login of agent '%s'\n", tmpchan, !ast_strlen_zero(context) ? context : "default", p->agent);
+								ast_log(LOG_WARNING, "Extension '%s@%s' is not valid for automatic login of agent '%s'\n", tmpchan, S_OR(context, "default"), p->agent);
 								res = ast_streamfile(chan, "invalid", chan->language);
 								if (!res)
 									res = ast_waitstream(chan, AST_DIGIT_ANY);

Modified: team/oej/stopshrinkinguris/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/stopshrinkinguris/channels/chan_iax2.c?rev=15324&r1=15323&r2=15324&view=diff
==============================================================================
--- team/oej/stopshrinkinguris/channels/chan_iax2.c (original)
+++ team/oej/stopshrinkinguris/channels/chan_iax2.c Mon Mar 27 15:42:29 2006
@@ -240,6 +240,9 @@
 
 static pthread_t netthreadid = AST_PTHREADT_NULL;
 static pthread_t schedthreadid = AST_PTHREADT_NULL;
+AST_MUTEX_DEFINE_STATIC(sched_lock);
+static int sched_halt = 0;
+static ast_cond_t sched_cond;
 
 enum {
 	IAX_STATE_STARTED = 		(1 << 0),
@@ -670,7 +673,7 @@
 static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in *sin);
 
 static void destroy_peer(struct iax2_peer *peer);
-static int ast_cli_netstats(int fd, int limit_fmt);
+static int ast_cli_netstats(struct mansession *s, int fd, int limit_fmt);
 
 #define IAX_IOSTATE_IDLE		0
 #define IAX_IOSTATE_READY		1
@@ -696,6 +699,8 @@
 	int iores;
 	int iofd;
 	time_t checktime;
+	ast_mutex_t lock;
+	ast_cond_t cond;
 };
 
 struct iax2_thread_list {
@@ -703,6 +708,13 @@
 };
 
 static struct iax2_thread_list idlelist, activelist;
+
+static void signal_condition(ast_mutex_t *lock, ast_cond_t *cond)
+{
+	ast_mutex_lock(lock);
+	ast_cond_signal(cond);
+	ast_mutex_unlock(lock);
+}
 
 static void iax_debug_output(const char *data)
 {
@@ -836,7 +848,7 @@
 #ifdef DEBUG_SCHED_MULTITHREAD
 		ast_copy_string(thread->curfunc, funcname, sizeof(thread->curfunc));
 #endif
-		pthread_kill(thread->threadid, SIGURG);
+		signal_condition(&thread->lock, &thread->cond);
 		return 0;
 	}
 	time(&t);
@@ -2283,7 +2295,9 @@
     }
 
     pvt->jbid = ast_sched_add(sched, when, get_from_jb, (void *)pvt);
-	pthread_kill(schedthreadid, SIGURG);
+
+    /* Signal scheduler thread */
+    signal_condition(&sched_lock, &sched_cond);
 }
 
 static void __get_from_jb(void *p) 
@@ -2617,7 +2631,7 @@
 		if (option_debug && iaxdebug)
 			ast_log(LOG_DEBUG, "schedule_delivery: Scheduling delivery in %d ms\n", delay);
 		fr->retrans = ast_sched_add(sched, delay, do_deliver, fr);
-		pthread_kill(schedthreadid, SIGURG);
+		signal_condition(&sched_lock, &sched_cond);
 	}
 #endif
 	if (tsout)
@@ -2653,7 +2667,7 @@
 	ast_mutex_unlock(&iaxq.lock);
 	/* Wake up the network and scheduler thread */
 	pthread_kill(netthreadid, SIGURG);
-	pthread_kill(schedthreadid, SIGURG);
+	signal_condition(&sched_lock, &sched_cond);
 	return 0;
 }
 
@@ -4310,7 +4324,7 @@
 #undef FORMAT2
 }
 
-static int __iax2_show_peers(int manager, int fd, int argc, char *argv[])
+static int __iax2_show_peers(int manager, int fd, struct mansession *s, int argc, char *argv[])
 {
 	regex_t regexbuf;
 	int havepattern = 0;

[... 5811 lines stripped ...]


More information about the asterisk-commits mailing list