[asterisk-commits] branch rizzo/base r9527 - in /team/rizzo/base: ./ apps/ cdr/ channels/ channe...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Feb 11 08:02:10 MST 2006


Author: rizzo
Date: Sat Feb 11 09:01:26 2006
New Revision: 9527

URL: http://svn.digium.com/view/asterisk?rev=9527&view=rev
Log:
Merged revisions 9138-9139,9150,9157,9163,9166,9186,9194,9215,9223,9225,9238-9239,9247-9248,9259-9261,9263,9292,9294,9309-9310,9324,9327,9349,9364,9378,9391,9405,9423,9436,9449-9452,9468-9469,9471-9472,9490,9506-9508 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r9138 | tilghman | 2006-02-03 23:37:29 +0100 (Fri, 03 Feb 2006) | 2 lines

Bug 6322 - Implementation of SHA1 in Asterisk (plus dialplan function to use it)

................
r9139 | bweschke | 2006-02-03 23:38:38 +0100 (Fri, 03 Feb 2006) | 3 lines

 Don't set a global variable if the channel you're trying to set CHANLOCALSTATUS on has gone away already.


................
r9150 | russell | 2006-02-04 17:32:27 +0100 (Sat, 04 Feb 2006) | 2 lines

remove windows-style line endings

................
r9157 | tilghman | 2006-02-05 18:20:29 +0100 (Sun, 05 Feb 2006) | 10 lines

Merged revisions 9156 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r9156 | tilghman | 2006-02-05 11:10:19 -0600 (Sun, 05 Feb 2006) | 2 lines

Bug 6176 - Fix race condition

........

................
r9163 | kpfleming | 2006-02-06 21:18:17 +0100 (Mon, 06 Feb 2006) | 2 lines

rename properties for forward-porting fixes so they don't conflict with developer branches

................
r9166 | kpfleming | 2006-02-06 21:30:49 +0100 (Mon, 06 Feb 2006) | 2 lines

minor cleanup

................
r9186 | crichter | 2006-02-07 14:34:59 +0100 (Tue, 07 Feb 2006) | 1 line

default values of jitterbuffer and jitterbuffer_upper_threshold should be > 0, this fixes the tv_fix warnings, because we use ast_read to transmit frames to asterisk in jitterbuffer mode, instead of queueing the audio data with ast_queue_frame.
................
r9194 | mattf | 2006-02-07 19:00:42 +0100 (Tue, 07 Feb 2006) | 2 lines

Make sure we output the APDU debug on pri debug commands

................
r9215 | crichter | 2006-02-08 17:10:21 +0100 (Wed, 08 Feb 2006) | 8 lines

* dozens of white-space removements
* some // comment removements
* debugging optimization, use port where possible
* fixed  pickup problem (pickup didn't work anymore after mqueue)
* removed some mIDSN_JOLLY defines which are not needed anymore in mqueue
* adapted the new cli.h constifications


................
r9223 | crichter | 2006-02-08 20:39:37 +0100 (Wed, 08 Feb 2006) | 1 line

L2 Signalling in PTP-TE Mode fixed
................
r9225 | crichter | 2006-02-08 20:51:53 +0100 (Wed, 08 Feb 2006) | 1 line

fix for the L2 Signalling
................
r9238 | tilghman | 2006-02-09 00:10:39 +0100 (Thu, 09 Feb 2006) | 10 lines

Merged revisions 9233 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r9233 | tilghman | 2006-02-08 16:34:38 -0600 (Wed, 08 Feb 2006) | 2 lines

Leave it to RH/CentOS to put the freetds headers in a completely nonstandard location.

........

................
r9239 | mogorman | 2006-02-09 00:14:17 +0100 (Thu, 09 Feb 2006) | 12 lines

Merged revisions 9232 via svnmerge from 
https://svn.digium.com/svn/asterisk/branches/1.2

........
r9232 | mogorman | 2006-02-08 16:12:34 -0600 (Wed, 08 Feb 2006) | 4 lines

Make logger report error,warning,notice if logger.conf
not found, also updated chan_oss to give correct
error message if its config file is not found.

........

................
r9247 | russell | 2006-02-09 02:33:50 +0100 (Thu, 09 Feb 2006) | 10 lines

Merged revisions 9246 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r9246 | russell | 2006-02-08 20:24:55 -0500 (Wed, 08 Feb 2006) | 2 lines

reload peercontext on iax2 reload (issue #6442)

........

................
r9248 | russell | 2006-02-09 02:52:09 +0100 (Thu, 09 Feb 2006) | 2 lines

clarify return value (issue #6434)

................
r9259 | russell | 2006-02-09 03:08:04 +0100 (Thu, 09 Feb 2006) | 4 lines

various code cleanup changes including changing #define'd constants to enums,
comments to doxygen style, memory allocation to use ast_ wrappers, use calloc
instead of malloc+memset, and removing duplicated error messages (issue #6435)

................
r9260 | russell | 2006-02-09 03:21:57 +0100 (Thu, 09 Feb 2006) | 3 lines

remove unnecessary format check in zt_request so that we will actually accept
a requested format of ALAW (issue #6421, different patch)

................
r9261 | russell | 2006-02-09 03:27:30 +0100 (Thu, 09 Feb 2006) | 2 lines

remove some Makefile targets for things that don't exist in the tree

................
r9263 | russell | 2006-02-09 03:35:34 +0100 (Thu, 09 Feb 2006) | 1 line


................
r9292 | oej | 2006-02-09 16:25:34 +0100 (Thu, 09 Feb 2006) | 7 lines

- Adding example on using european time zones in voicemail.conf 
- Moving the timezone section to below the documentation section

Example written and contributed by Henrik Olsen, Astricon Training student.
Thanks!


................
r9294 | oej | 2006-02-09 16:40:53 +0100 (Thu, 09 Feb 2006) | 2 lines

- Change "rfc2833" to "rtp" in sip.conf. Keeping backwards compatibility.

................
r9309 | crichter | 2006-02-09 17:58:13 +0100 (Thu, 09 Feb 2006) | 1 line

still some L1 related fixes
................
r9310 | russell | 2006-02-09 17:59:50 +0100 (Thu, 09 Feb 2006) | 3 lines

conversions to memory allocation wrappers, remove duplicated error messages,
remove unnecessary casts, malloc+memset to calloc (issue #6395)

................
r9324 | tilghman | 2006-02-09 22:08:29 +0100 (Thu, 09 Feb 2006) | 9 lines

Blocked revisions 9323 via svnmerge

........
r9323 | tilghman | 2006-02-09 15:02:05 -0600 (Thu, 09 Feb 2006) | 2 lines

Backport 5929 to 1.2

........

................
r9327 | tilghman | 2006-02-09 22:11:13 +0100 (Thu, 09 Feb 2006) | 9 lines

Blocked revisions 9326 via svnmerge

........
r9326 | tilghman | 2006-02-09 15:10:10 -0600 (Thu, 09 Feb 2006) | 2 lines

Revert behavior change from previous commit (fixes only)

........

................
r9349 | tilghman | 2006-02-10 01:20:43 +0100 (Fri, 10 Feb 2006) | 2 lines

Bug 6387 - janitor cleanup for linked lists

................
r9364 | crichter | 2006-02-10 11:10:58 +0100 (Fri, 10 Feb 2006) | 1 line

added Proceeding state, to be more ETSI conform with outgoing setups on the Network side (no release_complete but disconnect or release in proceeding state)
................
r9378 | crichter | 2006-02-10 15:17:28 +0100 (Fri, 10 Feb 2006) | 4 lines

* jb can be configed by misdn_set_opt
* reload does misdn_reload as well


................
r9391 | kpfleming | 2006-02-10 17:33:47 +0100 (Fri, 10 Feb 2006) | 2 lines

restore 'rfc2833' naming for DTMF mode in chan_sip

................
r9405 | kpfleming | 2006-02-10 21:40:00 +0100 (Fri, 10 Feb 2006) | 10 lines

Merged revisions 9404 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r9404 | kpfleming | 2006-02-10 14:38:59 -0600 (Fri, 10 Feb 2006) | 2 lines

don't create monitor threads in detached mode, when we need to be able to pthread_join() them later if the module is unloaded (solve crash-on-unload problem for these channel modules)

........

................
r9423 | mattf | 2006-02-10 22:50:56 +0100 (Fri, 10 Feb 2006) | 2 lines

Add smdi support for asterisk (see doc/smdi.txt for config info) (#5945)

................
r9436 | mattf | 2006-02-10 23:45:03 +0100 (Fri, 10 Feb 2006) | 2 lines

Minor bugfix for #6386

................
r9449 | mattf | 2006-02-11 00:19:05 +0100 (Sat, 11 Feb 2006) | 2 lines

Add boost gain option to microphone, also minor bug fixes (#6388)

................
r9450 | mattf | 2006-02-11 00:37:27 +0100 (Sat, 11 Feb 2006) | 2 lines

Lots of little fixes for doing MSVC compiling codecs in windows (#6022)

................
r9451 | kpfleming | 2006-02-11 00:55:47 +0100 (Sat, 11 Feb 2006) | 9 lines

clean up SMDI support commit:
copyright header format and dates
code formatting and guidelines conformance
use of timeval wrapper functions
use of memory allocation wrappers
propery unref created interface objects during config load
document new variable set by chan_zap in doc/channelvariables.txt
remove useless 'extern' on function prototypes and definitions

................
r9452 | kpfleming | 2006-02-11 00:58:11 +0100 (Sat, 11 Feb 2006) | 2 lines

one more copyright/file header and version string support

................
r9468 | kpfleming | 2006-02-11 04:13:25 +0100 (Sat, 11 Feb 2006) | 2 lines

fix compiler warnings

................
r9469 | kpfleming | 2006-02-11 04:14:05 +0100 (Sat, 11 Feb 2006) | 2 lines

build function modules independently (no more pbx_functions.so)

................
r9471 | kpfleming | 2006-02-11 04:21:09 +0100 (Sat, 11 Feb 2006) | 2 lines

remove last vestiges of pbx_functions

................
r9472 | kpfleming | 2006-02-11 04:28:59 +0100 (Sat, 11 Feb 2006) | 2 lines

doh!

................
r9490 | kpfleming | 2006-02-11 05:02:50 +0100 (Sat, 11 Feb 2006) | 2 lines

ignore archives in this directory

................
r9506 | markster | 2006-02-11 08:05:49 +0100 (Sat, 11 Feb 2006) | 2 lines

Fix SMDI to not blow up asterisk when there's no config file.

................
r9507 | markster | 2006-02-11 08:06:23 +0100 (Sat, 11 Feb 2006) | 2 lines

Make IAX2 not try to authenticate when registration info is not changing

................
r9508 | markster | 2006-02-11 08:06:47 +0100 (Sat, 11 Feb 2006) | 2 lines

Add capability to retrieve list of channel types

................

Added:
    team/rizzo/base/codecs/gsm/libgsm.vcproj
      - copied unchanged from r9508, trunk/codecs/gsm/libgsm.vcproj
    team/rizzo/base/codecs/ilbc/libilbc.vcproj
      - copied unchanged from r9508, trunk/codecs/ilbc/libilbc.vcproj
    team/rizzo/base/codecs/lpc10/liblpc10.vcproj
      - copied unchanged from r9508, trunk/codecs/lpc10/liblpc10.vcproj
    team/rizzo/base/configs/smdi.conf.sample
      - copied unchanged from r9508, trunk/configs/smdi.conf.sample
    team/rizzo/base/doc/smdi.txt
      - copied unchanged from r9508, trunk/doc/smdi.txt
    team/rizzo/base/funcs/func_sha1.c
      - copied unchanged from r9508, trunk/funcs/func_sha1.c
    team/rizzo/base/include/asterisk/sha1.h
      - copied, changed from r9508, trunk/include/asterisk/sha1.h
    team/rizzo/base/include/asterisk/smdi.h
      - copied unchanged from r9508, trunk/include/asterisk/smdi.h
    team/rizzo/base/res/res_smdi.c
      - copied unchanged from r9508, trunk/res/res_smdi.c
    team/rizzo/base/sha1.c
      - copied unchanged from r9508, trunk/sha1.c
Removed:
    team/rizzo/base/funcs/pbx_functions.c
Modified:
    team/rizzo/base/   (props changed)
    team/rizzo/base/Makefile
    team/rizzo/base/UPGRADE.txt
    team/rizzo/base/apps/Makefile
    team/rizzo/base/apps/app_macro.c
    team/rizzo/base/apps/app_osplookup.c
    team/rizzo/base/apps/app_voicemail.c
    team/rizzo/base/cdr.c
    team/rizzo/base/cdr/Makefile
    team/rizzo/base/channel.c
    team/rizzo/base/channels/Makefile
    team/rizzo/base/channels/chan_iax2.c
    team/rizzo/base/channels/chan_local.c
    team/rizzo/base/channels/chan_mgcp.c
    team/rizzo/base/channels/chan_misdn.c
    team/rizzo/base/channels/chan_misdn_config.c
    team/rizzo/base/channels/chan_oss.c
    team/rizzo/base/channels/chan_sip.c
    team/rizzo/base/channels/chan_zap.c
    team/rizzo/base/channels/misdn/   (props changed)
    team/rizzo/base/channels/misdn/Makefile
    team/rizzo/base/channels/misdn/isdn_lib.c
    team/rizzo/base/channels/misdn/isdn_lib_intern.h
    team/rizzo/base/channels/misdn/isdn_msg_parser.c
    team/rizzo/base/cli.c
    team/rizzo/base/codecs/gsm/src/add.c
    team/rizzo/base/codecs/gsm/src/code.c
    team/rizzo/base/codecs/gsm/src/decode.c
    team/rizzo/base/codecs/gsm/src/long_term.c
    team/rizzo/base/codecs/gsm/src/lpc.c
    team/rizzo/base/codecs/gsm/src/preprocess.c
    team/rizzo/base/codecs/gsm/src/rpe.c
    team/rizzo/base/codecs/gsm/src/short_term.c
    team/rizzo/base/codecs/lpc10/bsynz.c
    team/rizzo/base/codecs/lpc10/decode.c
    team/rizzo/base/codecs/lpc10/encode.c
    team/rizzo/base/codecs/lpc10/energy.c
    team/rizzo/base/codecs/lpc10/f2clib.c
    team/rizzo/base/codecs/lpc10/irc2pc.c
    team/rizzo/base/codecs/lpc10/lpc10.h
    team/rizzo/base/codecs/lpc10/onset.c
    team/rizzo/base/codecs/lpc10/pitsyn.c
    team/rizzo/base/codecs/lpc10/tbdm.c
    team/rizzo/base/codecs/lpc10/voicin.c
    team/rizzo/base/codecs/lpc10/vparms.c
    team/rizzo/base/config.c
    team/rizzo/base/configs/misdn.conf.sample
    team/rizzo/base/configs/voicemail.conf.sample
    team/rizzo/base/configs/zapata.conf.sample
    team/rizzo/base/db.c
    team/rizzo/base/devicestate.c
    team/rizzo/base/dnsmgr.c
    team/rizzo/base/doc/channelvariables.txt
    team/rizzo/base/dsp.c
    team/rizzo/base/enum.c
    team/rizzo/base/file.c
    team/rizzo/base/funcs/Makefile
    team/rizzo/base/funcs/func_base64.c   (contents, props changed)
    team/rizzo/base/funcs/func_callerid.c
    team/rizzo/base/funcs/func_cdr.c
    team/rizzo/base/funcs/func_cut.c
    team/rizzo/base/funcs/func_db.c
    team/rizzo/base/funcs/func_enum.c
    team/rizzo/base/funcs/func_env.c
    team/rizzo/base/funcs/func_groupcount.c
    team/rizzo/base/funcs/func_language.c
    team/rizzo/base/funcs/func_logic.c
    team/rizzo/base/funcs/func_math.c
    team/rizzo/base/funcs/func_md5.c
    team/rizzo/base/funcs/func_moh.c
    team/rizzo/base/funcs/func_odbc.c
    team/rizzo/base/funcs/func_rand.c
    team/rizzo/base/funcs/func_strings.c
    team/rizzo/base/funcs/func_timeout.c
    team/rizzo/base/funcs/func_uri.c
    team/rizzo/base/include/asterisk/callerid.h
    team/rizzo/base/include/asterisk/channel.h
    team/rizzo/base/include/asterisk/utils.h
    team/rizzo/base/logger.c
    team/rizzo/base/res/Makefile
    team/rizzo/base/utils.c

Propchange: team/rizzo/base/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/rizzo/base/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/rizzo/base/
            ('svnmerge-blocked' removed)

Propchange: team/rizzo/base/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Feb 11 09:01:26 2006
@@ -1,1 +1,1 @@
-/trunk:1-9133
+/trunk:1-9526

Modified: team/rizzo/base/Makefile
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/Makefile?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/Makefile (original)
+++ team/rizzo/base/Makefile Sat Feb 11 09:01:26 2006
@@ -3,7 +3,7 @@
 # 
 # Top level Makefile
 #
-# Copyright (C) 1999-2005, Mark Spencer
+# Copyright (C) 1999-2006, Digium, Inc.
 #
 # Mark Spencer <markster at digium.com>
 #
@@ -88,6 +88,11 @@
 #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
@@ -369,7 +374,7 @@
 	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
+	cryptostub.o sha1.o
 
 SAY_SRCS=	say2.c	\
 		say/say_cz.c	say/say_da.c	say/say_de.c	\
@@ -981,4 +986,4 @@
 	rm -rf $(DESTDIR)$(ASTSPOOLDIR)
 	rm -rf $(DESTDIR)$(ASTETCDIR)
 	rm -rf $(DESTDIR)$(ASTLOGDIR)
-	
+

Modified: team/rizzo/base/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/UPGRADE.txt?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/UPGRADE.txt (original)
+++ team/rizzo/base/UPGRADE.txt Sat Feb 11 09:01:26 2006
@@ -35,6 +35,11 @@
 * The function ${CHECK_MD5()} has been deprecated in favor of using an
   expression: $[${MD5(<string>)} = ${saved_md5}].
 
+* The 'builtin' functions that used to be combined in pbx_functions.so are
+  now built as separate modules. If you are not using 'autoload=yes' in your
+  modules.conf file then you will need to explicitly load the modules that
+  contain the functions you want to use.
+
 The SIP channel:
 
 * The "incominglimit" setting is replaced by the "call-limit" setting in sip.conf.

Modified: team/rizzo/base/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/apps/Makefile?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/apps/Makefile (original)
+++ team/rizzo/base/apps/Makefile Sat Feb 11 09:01:26 2006
@@ -59,7 +59,12 @@
 APPS+=app_sms.so
 endif
 
+# Asterisk SMDI integration
 #
+ifeq (${WITH_SMDI},1)
+CFLAGS+=-DWITH_SMDI
+endif
+
 # If you have UnixODBC you can use ODBC voicemail
 # storage
 #
@@ -91,15 +96,6 @@
 app_curl.so: app_curl.o
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
 
-app_sql_postgres.o: app_sql_postgres.c
-	$(CC) -pipe -I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include -I$(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
-
-app_sql_postgres.so: app_sql_postgres.o
-	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
-
-app_sql_odbc.so: app_sql_odbc.o
-	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
-
 look:	look.c
 	$(CC) -pipe -O6 -g look.c -o look -lncurses
 

Modified: team/rizzo/base/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/apps/app_macro.c?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/apps/app_macro.c (original)
+++ team/rizzo/base/apps/app_macro.c Sat Feb 11 09:01:26 2006
@@ -107,7 +107,7 @@
 	char oldcontext[AST_MAX_CONTEXT] = "";
 	int offset, depth = 0;
 	int setmacrocontext=0;
-	int autoloopflag;
+	int autoloopflag, dead = 0;
   
 	char *save_macro_exten;
 	char *save_macro_context;
@@ -208,8 +208,8 @@
 				break;
 			}
 			switch(res) {
-	        	case MACRO_EXIT_RESULT:
-                        	res = 0;
+			case MACRO_EXIT_RESULT:
+				res = 0;
 				goto out;
 			case AST_PBX_KEEPALIVE:
 				if (option_debug)
@@ -223,6 +223,7 @@
 					ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
 				else if (option_verbose > 1)
 					ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
+				dead = 1;
 				goto out;
 			}
 		}
@@ -242,37 +243,44 @@
 	out:
 	/* Reset the depth back to what it was when the routine was entered (like if we called Macro recursively) */
 	snprintf(depthc, sizeof(depthc), "%d", depth);
-	pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
-
-	ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
-  	for (x=1; x<argc; x++) {
+	if (!dead) {
+		pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
+
+		ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
+	}
+
+  	for (x = 1; x < argc; x++) {
   		/* Restore old arguments and delete ours */
 		snprintf(varname, sizeof(varname), "ARG%d", x);
   		if (oldargs[x]) {
-			pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
+			if (!dead)
+				pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
 			free(oldargs[x]);
-		} else {
+		} else if (!dead) {
 			pbx_builtin_setvar_helper(chan, varname, NULL);
 		}
   	}
 
 	/* Restore macro variables */
-	pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
+	if (!dead) {
+		pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
+		pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
+		pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
+	}
 	if (save_macro_exten)
 		free(save_macro_exten);
-	pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
 	if (save_macro_context)
 		free(save_macro_context);
-	pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
 	if (save_macro_priority)
 		free(save_macro_priority);
-	if (setmacrocontext) {
+
+	if (!dead && setmacrocontext) {
 		chan->macrocontext[0] = '\0';
 		chan->macroexten[0] = '\0';
 		chan->macropriority = 0;
 	}
 
-	if (!strcasecmp(chan->context, fullmacro)) {
+	if (!dead && !strcasecmp(chan->context, fullmacro)) {
   		/* If we're leaving the macro normally, restore original information */
 		chan->priority = oldpriority;
 		ast_copy_string(chan->context, oldcontext, sizeof(chan->context));
@@ -292,7 +300,8 @@
 		}
 	}
 
-	pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
+	if (!dead)
+		pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
 	if (save_macro_offset)
 		free(save_macro_offset);
 	LOCAL_USER_REMOVE(u);

Modified: team/rizzo/base/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/apps/app_osplookup.c?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/apps/app_osplookup.c (original)
+++ team/rizzo/base/apps/app_osplookup.c Sat Feb 11 09:01:26 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>
  *
@@ -184,6 +184,7 @@
 	int res=0;
 	struct localuser *u;
 	char *temp;
+	const char *val;
 	int cause;
 	struct ast_osp_result result;
 	int priority_jump = 0;
@@ -212,11 +213,11 @@
 	}
 
 	cause = str2cause(args.cause);
-	temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
+	val = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
 	result.handle = -1;
-	if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
-		temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
-		if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
+	if (!ast_strlen_zero(val) && (sscanf(val, "%d", &result.handle) == 1) && (result.handle > -1)) {
+		val = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
+		if (ast_strlen_zero(val) || (sscanf(val, "%d", &result.numresults) != 1)) {
 			result.numresults = 0;
 		}
 		if ((res = ast_osp_next(&result, cause)) > 0) {
@@ -255,6 +256,7 @@
 	int res=0;
 	struct localuser *u;
 	char *temp;
+	const char *val;
 	int cause;
 	time_t start=0, duration=0;
 	struct ast_osp_result result;
@@ -293,9 +295,9 @@
 		ast_log(LOG_WARNING, "OSPFinish called on channel '%s' with no CDR!\n", chan->name);
 	
 	cause = str2cause(args.status);
-	temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
+	val = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
 	result.handle = -1;
-	if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
+	if (!ast_strlen_zero(val) && (sscanf(val, "%d", &result.handle) == 1) && (result.handle > -1)) {
 		if (!ast_osp_terminate(result.handle, cause, start, duration)) {
 			pbx_builtin_setvar_helper(chan, "_OSPHANDLE", "");
 			pbx_builtin_setvar_helper(chan, "OSPFINISHSTATUS", "SUCCESS");

Modified: team/rizzo/base/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/apps/app_voicemail.c?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/apps/app_voicemail.c (original)
+++ team/rizzo/base/apps/app_voicemail.c Sat Feb 11 09:01:26 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>
  *
@@ -73,6 +73,10 @@
 #include "asterisk/cli.h"
 #include "asterisk/utils.h"
 #include "asterisk/stringfields.h"
+#ifdef WITH_SMDI
+#include "asterisk/smdi.h"
+#define SMDI_MWI_WAIT_TIMEOUT 1000 /* 1 second */
+#endif
 #ifdef USE_ODBC_STORAGE
 #include "asterisk/res_odbc.h"
 #endif
@@ -393,7 +397,9 @@
 static char serveremail[80];
 static char mailcmd[160];	/* Configurable mail cmd */
 static char externnotify[160]; 
-
+#ifdef WITH_SMDI
+static struct ast_smdi_interface *smdi_iface = NULL;
+#endif
 static char vmfmts[80];
 static int vmminmessage;
 static int vmmaxmessage;
@@ -2318,13 +2324,37 @@
 	char arguments[255];
 	char ext_context[256] = "";
 	int newvoicemails = 0, oldvoicemails = 0;
+#ifdef WITH_SMDI
+	struct ast_smdi_mwi_message *mwi_msg;
+#endif
 
 	if (!ast_strlen_zero(context))
 		snprintf(ext_context, sizeof(ext_context), "%s@%s", extension, context);
 	else
 		ast_copy_string(ext_context, extension, sizeof(ext_context));
 
+#ifdef WITH_SMDI
+	if (!strcasecmp(externnotify, "smdi")) {
+		if (ast_app_has_voicemail(ext_context, NULL)) 
+			ast_smdi_mwi_set(smdi_iface, extension);
+		else
+			ast_smdi_mwi_unset(smdi_iface, extension);
+
+		if ((mwi_msg = ast_smdi_mwi_message_wait(smdi_iface, SMDI_MWI_WAIT_TIMEOUT))) {
+			ast_log(LOG_ERROR, "Error executing SMDI MWI change for %s on %s\n", extension, smdi_iface->name);
+			if (!strncmp(mwi_msg->cause, "INV", 3))
+				ast_log(LOG_ERROR, "Invalid MWI extension: %s\n", mwi_msg->fwd_st);
+			else if (!strncmp(mwi_msg->cause, "BLK", 3))
+				ast_log(LOG_WARNING, "MWI light was already on or off for %s\n", mwi_msg->fwd_st);
+			ast_log(LOG_WARNING, "The switch reported '%s'\n", mwi_msg->cause);
+			ASTOBJ_UNREF(mwi_msg, ast_smdi_mwi_message_destroy);
+		} else {
+			ast_log(LOG_DEBUG, "Successfully executed SMDI MWI change for %s on %s\n", extension, smdi_iface->name);
+		}
+	} else if (!ast_strlen_zero(externnotify)) {
+#else
 	if (!ast_strlen_zero(externnotify)) {
+#endif
 		if (messagecount(ext_context, &newvoicemails, &oldvoicemails)) {
 			ast_log(LOG_ERROR, "Problem in calculating number of voicemail messages available for extension %s\n", extension);
 		} else {
@@ -5832,6 +5862,9 @@
 	char *cat;
 	struct ast_variable *var;
 	char *notifystr = NULL;
+#ifdef WITH_SMDI
+	char *smdistr = NULL;
+#endif
 	char *astattach;
 	char *astsearch;
 	char *astsaycid;
@@ -5941,6 +5974,24 @@
 		if ((notifystr = ast_variable_retrieve(cfg, "general", "externnotify"))) {
 			ast_copy_string(externnotify, notifystr, sizeof(externnotify));
 			ast_log(LOG_DEBUG, "found externnotify: %s\n", externnotify);
+#ifdef WITH_SMDI
+			if (!strcasecmp(externnotify, "smdi")) {
+				ast_log(LOG_DEBUG, "Using SMDI for external voicemail notification\n");
+				if ((smdistr = ast_variable_retrieve(cfg, "general", "smdiport"))) {
+					smdi_iface = ast_smdi_interface_find(smdistr);
+				} else {
+					ast_log(LOG_DEBUG, "No SMDI interface set, trying default (/dev/ttyS0)\n");
+					smdi_iface = ast_smdi_interface_find("/dev/ttyS0");
+				}
+
+				if (!smdi_iface) {
+					ast_log(LOG_ERROR, "No valid SMDI interface specfied, disabling external voicemail notification\n");
+					externnotify[0] = '\0';
+				} else {
+					ast_log(LOG_DEBUG, "Using SMDI port %s\n", smdi_iface->name);
+				}
+			}
+#endif
 		} else {
 			externnotify[0] = '\0';
 		}

Modified: team/rizzo/base/cdr.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/cdr.c?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/cdr.c (original)
+++ team/rizzo/base/cdr.c Sat Feb 11 09:01:26 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>
  *
@@ -1173,8 +1173,6 @@
 	   if it does not exist */
 	if (enabled && batchmode && (!was_enabled || !was_batchmode) && (cdr_thread == AST_PTHREADT_NULL)) {
 		ast_cond_init(&cdr_pending_cond, NULL);
-		pthread_attr_init(&attr);
-		pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 		if (ast_pthread_create(&cdr_thread, &attr, do_cdr, NULL) < 0) {
 			ast_log(LOG_ERROR, "Unable to start CDR thread.\n");
 			ast_sched_del(sched, cdr_sched);

Modified: team/rizzo/base/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/cdr/Makefile?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/cdr/Makefile (original)
+++ team/rizzo/base/cdr/Makefile Sat Feb 11 09:01:26 2006
@@ -40,11 +40,11 @@
 #
 # FreeTDS stuff...
 #
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h),)
-  ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.63),1)
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/freetds/tds.h),)
+  ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.63),1)
     CFLAGS += -DFREETDS_0_63
   else
-	ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.62),1)
+	ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.62),1)
       CFLAGS += -DFREETDS_0_62
     else
       CFLAGS += -DFREETDS_PRE_0_62

Modified: team/rizzo/base/channel.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/channel.c?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/channel.c (original)
+++ team/rizzo/base/channel.c Sat Feb 11 09:01:26 2006
@@ -72,6 +72,7 @@
 #include "asterisk/app.h"
 #include "asterisk/transcap.h"
 #include "asterisk/devicestate.h"
+#include "asterisk/sha1.h"
 
 struct channel_spy_trans {
 	int last_format;
@@ -191,6 +192,22 @@
 	{ AST_CAUSE_INTERWORKING, "Interworking, unspecified" },
 };
 
+
+struct ast_variable *ast_channeltype_list(void)
+{
+	struct chanlist *cl;
+	struct ast_variable *var=NULL, *prev = NULL;
+	AST_LIST_TRAVERSE(&backends, cl, list) {
+		if (prev)  {
+			if ((prev->next = ast_variable_new(cl->tech->type, cl->tech->description)))
+				prev = prev->next;
+		} else {
+			var = ast_variable_new(cl->tech->type, cl->tech->description);
+			prev = var;
+		}
+	}
+	return var;
+}
 
 static int show_channeltypes(int fd, int argc, char *argv[])
 {

Modified: team/rizzo/base/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/channels/Makefile?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/channels/Makefile (original)
+++ team/rizzo/base/channels/Makefile Sat Feb 11 09:01:26 2006
@@ -63,6 +63,13 @@
 
 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
   CHANNEL_LIBS+=chan_phone.so
+endif
+
+#
+# Asterisk SMDI integration
+#
+ifeq (${WITH_SMDI},1)
+CFLAGS+=-DWITH_SMDI
 endif
 
 ifneq ($(wildcard h323/libchanh323.a),)

Modified: team/rizzo/base/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/channels/chan_iax2.c?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/channels/chan_iax2.c (original)
+++ team/rizzo/base/channels/chan_iax2.c Sat Feb 11 09:01:26 2006
@@ -234,7 +234,8 @@
 enum {
 	IAX_STATE_STARTED = 		(1 << 0),
 	IAX_STATE_AUTHENTICATED = 	(1 << 1),
-	IAX_STATE_TBD = 		(1 << 2)
+	IAX_STATE_TBD = 		(1 << 2),
+	IAX_STATE_UNCHANGED = 		(1 << 3),
 } iax2_state;
 
 struct iax2_context {
@@ -4986,7 +4987,7 @@
 	int x;
 	int expire = 0;
 
-	ast_clear_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED);
+	ast_clear_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED | IAX_STATE_UNCHANGED);
 	iaxs[callno]->peer[0] = '\0';
 	if (ies->username)
 		ast_copy_string(peer, ies->username, sizeof(peer));
@@ -5031,6 +5032,8 @@
 			destroy_peer(p);
 		return -1;
 	}
+	if (!inaddrcmp(&p->addr, sin))
+		ast_set_flag(&iaxs[callno]->state, IAX_STATE_UNCHANGED);
 	ast_copy_string(iaxs[callno]->secret, p->secret, sizeof(iaxs[callno]->secret));
 	ast_copy_string(iaxs[callno]->inkeys, p->inkeys, sizeof(iaxs[callno]->inkeys));
 	/* Check secret against what we have on file */
@@ -7337,7 +7340,8 @@
 					auth_fail(fr.callno, IAX_COMMAND_REGREJ);
 					break;
 				}
-				if ((ast_strlen_zero(iaxs[fr.callno]->secret) && ast_strlen_zero(iaxs[fr.callno]->inkeys)) || ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_AUTHENTICATED)) {
+				if ((ast_strlen_zero(iaxs[fr.callno]->secret) && ast_strlen_zero(iaxs[fr.callno]->inkeys)) || 
+						ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_AUTHENTICATED | IAX_STATE_UNCHANGED)) {
 					if (f.subclass == IAX_COMMAND_REGREL)
 						memset(&sin, 0, sizeof(sin));
 					if (update_registry(iaxs[fr.callno]->peer, &sin, fr.callno, ies.devicetype, fd, ies.refresh))
@@ -8106,6 +8110,7 @@
 		peer->pokefreqok = DEFAULT_FREQ_OK;
 		peer->pokefreqnotok = DEFAULT_FREQ_NOTOK;
 		peer->context[0] = '\0';
+		peer->peercontext[0] = '\0';
 		while(v) {
 			if (!strcasecmp(v->name, "secret")) {
 				if (!ast_strlen_zero(peer->secret)) {

Modified: team/rizzo/base/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/channels/chan_local.c?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/channels/chan_local.c (original)
+++ team/rizzo/base/channels/chan_local.c Sat Feb 11 09:01:26 2006
@@ -69,9 +69,6 @@
 
 #define IS_OUTBOUND(a,b) (a == b->chan ? 1 : 0)
 
-/* Protect the interface list (of sip_pvt's) */
-AST_MUTEX_DEFINE_STATIC(locallock);
-
 static struct ast_channel *local_request(const char *type, int format, void *data, int *cause);
 static int local_digit(struct ast_channel *ast, char digit);
 static int local_call(struct ast_channel *ast, char *dest, int timeout);
@@ -101,7 +98,7 @@
 	.send_html = local_sendhtml,
 };
 
-static struct local_pvt {
+struct local_pvt {
 	ast_mutex_t lock;			/* Channel private lock */
 	char context[AST_MAX_CONTEXT];		/* Context to call */
 	char exten[AST_MAX_EXTENSION];		/* Extension to call */
@@ -113,8 +110,10 @@
 	int nooptimization;			/* Don't leave masq state */
 	struct ast_channel *owner;		/* Master Channel */
 	struct ast_channel *chan;		/* Outbound channel */
-	struct local_pvt *next;			/* Next entity */
-} *locals = NULL;
+	AST_LIST_ENTRY(local_pvt) list;		/* Next entity */
+};
+
+static AST_LIST_HEAD_STATIC(locals, local_pvt);
 
 static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_frame *f, struct ast_channel *us)
 {
@@ -357,23 +356,19 @@
 #if 0
 static void local_destroy(struct local_pvt *p)
 {
-	struct local_pvt *cur, *prev = NULL;
-	ast_mutex_lock(&locallock);
-	cur = locals;
-	while(cur) {
+	struct local_pvt *cur;
+
+	AST_LIST_LOCK(&locals);
+	AST_LIST_TRAVERSE_SAFE_BEGIN(&locals, cur, list) {
 		if (cur == p) {
-			if (prev)
-				prev->next = cur->next;
-			else
-				locals = cur->next;
-			ast_mutex_destroy(cur);
+			AST_LIST_REMOVE_CURRENT(&locals, list);
+			ast_mutex_destroy(&cur->lock);
 			free(cur);
 			break;
 		}
-		prev = cur;
-		cur = cur->next;
-	}
-	ast_mutex_unlock(&locallock);
+	}
+	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_UNLOCK(&locals);
 	if (!cur)
 		ast_log(LOG_WARNING, "Unable ot find local '%s@%s' in local list\n", p->exten, p->context);
 }
@@ -385,7 +380,6 @@
 	struct local_pvt *p = ast->tech_pvt;
 	int isoutbound;
 	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
-	struct local_pvt *cur, *prev=NULL;
 	struct ast_channel *ochan = NULL;
 	int glaredetect;
 
@@ -393,7 +387,7 @@
 	isoutbound = IS_OUTBOUND(ast, p);
 	if (isoutbound) {
 		const char *status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS");
-		if (status)
+		if ((status) && (p->owner))
 			pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status);
 		p->chan = NULL;
 		p->launchedpbx = 0;
@@ -414,20 +408,9 @@
 			p->cancelqueue = 1;
 		ast_mutex_unlock(&p->lock);
 		/* Remove from list */
-		ast_mutex_lock(&locallock);
-		cur = locals;
-		while(cur) {
-			if (cur == p) {
-				if (prev)
-					prev->next = cur->next;
-				else
-					locals = cur->next;
-				break;
-			}
-			prev = cur;
-			cur = cur->next;
-		}
-		ast_mutex_unlock(&locallock);
+		AST_LIST_LOCK(&locals);
+		AST_LIST_REMOVE(&locals, p, list);
+		AST_LIST_UNLOCK(&locals);
 		/* Grab / release lock just in case */
 		ast_mutex_lock(&p->lock);
 		ast_mutex_unlock(&p->lock);
@@ -483,10 +466,9 @@
 		tmp = NULL;
 	} else {
 		/* Add to list */
-		ast_mutex_lock(&locallock);
-		tmp->next = locals;
-		locals = tmp;
-		ast_mutex_unlock(&locallock);
+		AST_LIST_LOCK(&locals);
+		AST_LIST_INSERT_HEAD(&locals, tmp, list);
+		AST_LIST_UNLOCK(&locals);
 	}
 	
 	return tmp;
@@ -562,17 +544,15 @@
 
 	if (argc != 3)
 		return RESULT_SHOWUSAGE;
-	ast_mutex_lock(&locallock);
-	p = locals;
-	while(p) {
+	if (AST_LIST_EMPTY(&locals))
+		ast_cli(fd, "No local channels in use\n");
+	AST_LIST_LOCK(&locals);
+	AST_LIST_TRAVERSE(&locals, p, list) {
 		ast_mutex_lock(&p->lock);
 		ast_cli(fd, "%s -- %s@%s\n", p->owner ? p->owner->name : "<unowned>", p->exten, p->context);
 		ast_mutex_unlock(&p->lock);
-		p = p->next;
-	}
-	if (!locals)
-		ast_cli(fd, "No local channels in use\n");
-	ast_mutex_unlock(&locallock);
+	}
+	AST_LIST_UNLOCK(&locals);
 	return RESULT_SUCCESS;
 }
 
@@ -610,16 +590,14 @@
 	/* First, take us out of the channel loop */
 	ast_cli_unregister(&cli_show_locals);
 	ast_channel_unregister(&local_tech);
-	if (!ast_mutex_lock(&locallock)) {
+	if (!AST_LIST_LOCK(&locals)) {
 		/* Hangup all interfaces if they have an owner */
-		p = locals;
-		while(p) {
+		AST_LIST_TRAVERSE(&locals, p, list) {
 			if (p->owner)
 				ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
-			p = p->next;
 		}
-		locals = NULL;
-		ast_mutex_unlock(&locallock);
+		AST_LIST_UNLOCK(&locals);
+		AST_LIST_HEAD_DESTROY(&locals);
 	} else {
 		ast_log(LOG_WARNING, "Unable to lock the monitor\n");
 		return -1;

Modified: team/rizzo/base/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/channels/chan_mgcp.c?rev=9527&r1=9526&r2=9527&view=diff
==============================================================================
--- team/rizzo/base/channels/chan_mgcp.c (original)
+++ team/rizzo/base/channels/chan_mgcp.c Sat Feb 11 09:01:26 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>
  *
@@ -3528,10 +3528,6 @@
 
 static int restart_monitor(void)
 {
-	pthread_attr_t attr;
-	pthread_attr_init(&attr);
-        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);	
-
 	/* If we're supposed to be stopped -- stay stopped */
 	if (monitor_thread == AST_PTHREADT_STOP)
 		return 0;
@@ -3549,7 +3545,7 @@
 		pthread_kill(monitor_thread, SIGURG);
 	} else {
 		/* Start a new monitor */
-		if (ast_pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) {
+		if (ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
 			ast_mutex_unlock(&monlock);
 			ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
 			return -1;

Modified: team/rizzo/base/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/base/channels/chan_misdn.c?rev=9527&r1=9526&r2=9527&view=diff

[... 4820 lines stripped ...]


More information about the asterisk-commits mailing list